Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
6df392a6
Commit
6df392a6
authored
Sep 17, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门管理 export,treegrid,org,getalldepartment ......
parent
06d2afa4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1135 additions
and
963 deletions
+1135
-963
index.vue
components/page/treeGrid/index.vue
+582
-610
zh-CN.js
i18n/locale/zh-CN.js
+4
-0
henq.js
libs/henq.js
+36
-0
package-lock.json
package-lock.json
+10
-10
index.vue
pages/basicData/department/index.vue
+336
-194
org.vue
pages/basicData/department/org.vue
+167
-149
No files found.
components/page/treeGrid/index.vue
View file @
6df392a6
This diff is collapsed.
Click to expand it.
i18n/locale/zh-CN.js
View file @
6df392a6
...
...
@@ -428,6 +428,10 @@ export default {
cityName
:
'省市县'
,
creationTime
:
'创建时间'
,
upMent
:
'上级部门'
,
code
:
'部门编号'
,
location
:
'省市县'
,
parent_Id
:
'上级部门'
,
property
:
'属性'
,
},
instance
:
{
id
:
'主键'
,
...
...
libs/henq.js
View file @
6df392a6
...
...
@@ -139,6 +139,42 @@ henq.treeToList = (tree) => {
treeToList
(
tree
,
null
)
return
list
;
}
//省市县pacc转为list
henq
.
treeToList1
=
(
tree
)
=>
{
let
list
=
[];
function
treeToList1
(
data
)
{
data
.
map
(
u
=>
{
if
(
u
.
children
&&
u
.
level
!=
1
)
{
treeToList1
(
u
.
children
,
u
)
}
else
if
(
u
.
children
&&
u
.
level
==
1
)
{
list
=
list
.
concat
(
u
.
children
);
}
})
}
treeToList1
(
tree
,
null
)
return
list
;
}
//根据departId返出上级所有name
henq
.
getDepartAllName
=
(
list
,
id
)
=>
{
let
names
=
''
;
function
getDepartAllName
(
list
,
id
)
{
list
.
map
(
u
=>
{
if
(
id
==
u
.
id
)
{
names
=
u
.
name
+
"-"
+
names
if
(
u
.
parent_Id
>
0
)
{
getDepartAllName
(
list
,
u
.
parent_Id
)
}
}
})
}
getDepartAllName
(
list
,
id
)
return
names
.
slice
(
0
,
names
.
length
-
1
);
}
//导出pdf
henq
.
outPdf
=
(
ele
,
fileName
)
=>
{
// document.head.innerHTML =
...
...
package-lock.json
View file @
6df392a6
...
...
@@ -4783,7 +4783,7 @@
"dependencies"
:
{
"commander"
:
{
"version"
:
"2.14.1"
,
"resolved"
:
"http
://r.cnpmjs.org/commander/download/
commander-2.14.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2F
commander-2.14.1.tgz"
,
"integrity"
:
"sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
}
}
...
...
@@ -5340,7 +5340,7 @@
},
"crc-32"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"http
://r.cnpmjs
.org/crc-32/download/crc-32-1.2.0.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/crc-32/download/crc-32-1.2.0.tgz"
,
"integrity"
:
"sha1-yy224puIUI4y2d0OwWk+e0Ghggg="
,
"requires"
:
{
"exit-on-epipe"
:
"~1.0.1"
,
...
...
@@ -7127,7 +7127,7 @@
},
"exit-on-epipe"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"http
://r.cnpmjs
.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz"
,
"integrity"
:
"sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
},
"expand-brackets"
:
{
...
...
@@ -7814,7 +7814,7 @@
},
"frac"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/frac/download/frac-1.1.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/frac/download/frac-1.1.2.tgz"
,
"integrity"
:
"sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
},
"fragment-cache"
:
{
...
...
@@ -14419,7 +14419,7 @@
},
"printj"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/printj/download/printj-1.1.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/printj/download/printj-1.1.2.tgz"
,
"integrity"
:
"sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
},
"private"
:
{
...
...
@@ -15893,7 +15893,7 @@
},
"script-loader"
:
{
"version"
:
"0.7.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/script-loader/download/script-loader-0.7.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/script-loader/download/script-loader-0.7.2.tgz"
,
"integrity"
:
"sha1-IBbbb4byX1z1baOJFdgzeLsWa6c="
,
"dev"
:
true
,
"requires"
:
{
...
...
@@ -16473,7 +16473,7 @@
},
"ssf"
:
{
"version"
:
"0.10.3"
,
"resolved"
:
"http
://r.cnpmjs
.org/ssf/download/ssf-0.10.3.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/ssf/download/ssf-0.10.3.tgz"
,
"integrity"
:
"sha1-jq4fwpyQpVLnkhII+BiS1vd6yys="
,
"requires"
:
{
"frac"
:
"~1.1.2"
...
...
@@ -20196,7 +20196,7 @@
},
"wmf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"http
://r.cnpmjs
.org/wmf/download/wmf-1.0.2.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/wmf/download/wmf-1.0.2.tgz"
,
"integrity"
:
"sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
},
"word-wrap"
:
{
...
...
@@ -20315,7 +20315,7 @@
},
"xlsx"
:
{
"version"
:
"0.15.6"
,
"resolved"
:
"http
://r.cnpmjs.org/xlsx/download/
xlsx-0.15.6.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2F
xlsx-0.15.6.tgz"
,
"integrity"
:
"sha1-Rh+EHW2eoag3XizSRr8jrs4IodU="
,
"requires"
:
{
"adler-32"
:
"~1.2.0"
,
...
...
@@ -20330,7 +20330,7 @@
"dependencies"
:
{
"commander"
:
{
"version"
:
"2.17.1"
,
"resolved"
:
"http
://r.cnpmjs.org/commander/download/
commander-2.17.1.tgz"
,
"resolved"
:
"http
s://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2F
commander-2.17.1.tgz"
,
"integrity"
:
"sha1-vXerfebelCBc6sxy8XFtKfIKd78="
}
}
...
...
pages/basicData/department/index.vue
View file @
6df392a6
This diff is collapsed.
Click to expand it.
pages/basicData/department/org.vue
View file @
6df392a6
<
template
>
<Card
shadow
style=
"height:100%;width:100%;overflow:hidden; position: relative;"
>
<Card
shadow
style=
"height:100%;width:100%;overflow:hidden; position: relative;"
>
<div
class=
"department-outer"
>
<div
class=
"zoom-box"
>
<zoom-controller
v-model=
"zoom"
:min=
"20"
:max=
"200"
></zoom-controller>
</div>
<div
class=
"view-box"
>
<org-view
:data=
"rootData"
:zoom-handled=
"zoomHandled"
@
on-menu-click=
"handleMenuClick"
></org-view>
</div>
<div
class=
"zoom-box"
>
<zoom-controller
v-model=
"zoom"
:min=
"20"
:max=
"200"
></zoom-controller>
</div>
<div
class=
"view-box"
>
<org-view
:data=
"rootData"
:zoom-handled=
"zoomHandled"
@
on-menu-click=
"handleMenuClick"
></org-view>
</div>
</div>
</Card>
</Card>
</
template
>
<
script
>
import
OrgView
from
"@/components/department/org-view.vue"
;
import
ZoomController
from
"@/components/department/zoom-controller.vue"
;
const
menuDic
=
{
edit
:
"编辑部门"
,
detail
:
"查看部门"
,
new
:
"新增子部门"
,
delete
:
"删除部门"
edit
:
"编辑部门"
,
detail
:
"查看部门"
,
new
:
"新增子部门"
,
delete
:
"删除部门"
};
export
default
{
name
:
"org_tree_page"
,
components
:
{
OrgView
,
ZoomController
},
props
:
{
data
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
}
}
},
data
()
{
return
{
modal
:
false
,
modal1
:
false
,
modalTitle
:
"新增部门"
,
information
:
{},
//部门信息
model
:
{
deptId
:
0
,
name
:
""
,
parentId
:
0
,
parentName
:
""
,
orderNum
:
1
},
root
:
{
deptId
:
0
,
name
:
"顶层"
,
label
:
"顶层"
,
parentId
:
0
,
parentName
:
""
,
orderNum
:
1
},
data
:
null
,
zoom
:
100
};
},
computed
:
{
zoomHandled
()
{
return
this
.
zoom
/
100
;
name
:
"org_tree_page"
,
components
:
{
OrgView
,
ZoomController
},
rootData
()
{
console
.
warn
(
this
.
data
);
var
root
=
{
id
:
0
,
label
:
"根节点"
,
children
:
this
.
data
};
return
root
;
}
},
methods
:
{
setDepartmentData
(
data
)
{
data
.
isRoot
=
true
;
return
data
;
props
:
{
datas
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
}
}
},
handleMenuClick
({
data
,
key
})
{
this
.
$emit
(
"nodeChange"
,
key
,
data
)
data
()
{
return
{
modal
:
false
,
modal1
:
false
,
modalTitle
:
"新增部门"
,
information
:
{},
//部门信息
model
:
{
deptId
:
0
,
name
:
""
,
parentId
:
0
,
parentName
:
""
,
orderNum
:
1
},
root
:
{
deptId
:
0
,
name
:
"顶层"
,
label
:
"顶层"
,
parentId
:
0
,
parentName
:
""
,
orderNum
:
1
},
data
:
null
,
zoom
:
100
};
},
computed
:
{
zoomHandled
()
{
return
this
.
zoom
/
100
;
},
rootData
()
{
console
.
warn
(
this
.
datas
);
var
root
=
{
id
:
0
,
label
:
"根节点"
,
children
:
this
.
datas
};
return
root
;
}
},
methods
:
{
setDepartmentData
(
data
)
{
data
.
isRoot
=
true
;
return
data
;
},
handleMenuClick
({
data
,
key
})
{
this
.
$emit
(
"nodeChange"
,
key
,
data
)
},
},
mounted
()
{
console
.
warn
(
this
.
data
);
}
},
mounted
()
{
console
.
warn
(
this
.
datas
);
}
};
</
script
>
<
style
lang=
"less"
>
.tools {
position: absolute;
z-index: 66;
right: 10px;
position: absolute;
z-index: 66;
right: 10px;
}
.percent-100 {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.department-outer {
.percent-100;
overflow: hidden;
.tip-box {
position: absolute;
left: 20px;
top: 20px;
z-index: 12;
}
.zoom-box {
position: absolute;
right: 30px;
bottom: 30px;
z-index: 2;
}
.view-box {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
cursor: move;
.org-tree-drag-wrapper {
width: 100%;
height: 100%;
.percent-100;
overflow: hidden;
.tip-box {
position: absolute;
left: 20px;
top: 20px;
z-index: 12;
}
.org-tree-wrapper {
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
transition: transform 0.2s ease-out;
.org-tree-node-label {
box-shadow: 0px 2px 12px 0px rgba(5, 123, 241, 0.4);
border-radius: 4px;
.org-tree-node-label-inner {
padding: 0;
.custom-org-node {
padding: 14px 41px;
background: #0672dd;
user-select: none;
word-wrap: none;
white-space: nowrap;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
font-weight: 500;
line-height: 20px;
transition: background 0.1s ease-in;
cursor: default;
&:hover {
background: #4194e7;
transition: background 0.1s ease-in;
}
&.has-children-label {
cursor: pointer;
}
.context-menu {
position: absolute;
right: -10px;
bottom: 20px;
z-index: 10;
.zoom-box {
position: absolute;
right: 30px;
bottom: 30px;
z-index: 2;
}
.view-box {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
cursor: move;
.org-tree-drag-wrapper {
width: 100%;
height: 100%;
}
.org-tree-wrapper {
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
transition: transform 0.2s ease-out;
.org-tree-node-label {
box-shadow: 0px 2px 12px 0px rgba(5, 123, 241, 0.4);
border-radius: 4px;
.org-tree-node-label-inner {
padding: 0;
.custom-org-node {
padding: 14px 41px;
background: #0672dd;
user-select: none;
word-wrap: none;
white-space: nowrap;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
font-weight: 500;
line-height: 20px;
transition: background 0.1s ease-in;
cursor: default;
&:hover {
background: #4194e7;
transition: background 0.1s ease-in;
}
&.has-children-label {
cursor: pointer;
}
.context-menu {
position: absolute;
right: -10px;
bottom: 20px;
z-index: 10;
}
}
}
}
}
}
}
}
}
}
.info-p {
height: 40px;
line-height: 40px;
margin-left: 20px;
span {
font-size: 13px;
}
height: 40px;
line-height: 40px;
margin-left: 20px;
span {
font-size: 13px;
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment