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
590fddf4
Commit
590fddf4
authored
Sep 26, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of
http://git.mes123.com/zhouyx/mes-ui
into product
parents
596e79e2
146db3e9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
2484 additions
and
2299 deletions
+2484
-2299
dataGrid.vue
components/page/dataGrid.vue
+858
-824
process.vue
components/page/import/process.vue
+473
-471
zh-CN.js
i18n/locale/zh-CN.js
+7
-1
henq.js
libs/henq.js
+36
-0
npm-shrinkwrap.json
npm-shrinkwrap.json
+5
-5
baseColums.js
pages/import/baseColums.js
+36
-10
process.vue
pages/import/process.vue
+1069
-988
No files found.
components/page/dataGrid.vue
View file @
590fddf4
This diff is collapsed.
Click to expand it.
components/page/import/process.vue
View file @
590fddf4
<
template
>
<
template
>
<Modal
v-model=
"ImportModal"
:title=
"modalTitles"
fullscreen
footer-hide
@
on-cancel=
"cancelModal"
>
<Modal
v-model=
"ImportModal"
:title=
"modalTitles"
fullscreen
footer-hide
@
on-cancel=
"cancelModal"
>
<div
class=
"table-content"
>
<div
class=
"table-content"
>
<div
class=
"table-tools"
>
<div
class=
"table-tools"
>
<div
class=
"table-search"
>
<div
class=
"table-search"
>
...
@@ -36,16 +36,7 @@
...
@@ -36,16 +36,7 @@
</div>
</div>
</div>
</div>
<div
class=
"table-main"
ref=
"main"
>
<div
class=
"table-main"
ref=
"main"
>
<Table
<Table
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tdHeightExcel"
:no-data-text=
"noDataText"
ref=
"table"
class=
"tableCommon"
v-if=
"tableImport"
></Table>
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tdHeightExcel"
:no-data-text=
"noDataText"
ref=
"table"
class=
"tableCommon"
v-if=
"tableImport"
></Table>
<component
:is=
"detailExcel"
ref=
"comExcel"
@
on-datalength=
"datalength"
/>
<component
:is=
"detailExcel"
ref=
"comExcel"
@
on-datalength=
"datalength"
/>
</div>
</div>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
...
@@ -58,26 +49,21 @@
...
@@ -58,26 +49,21 @@
</Form>
</Form>
</FooterToolbar>
</FooterToolbar>
<Modal
v-model=
"infoModal"
:title=
"modalTitles"
fullscreen
>
<Modal
v-model=
"infoModal"
:title=
"modalTitles"
fullscreen
>
<DataGrid
<DataGrid
:tool=
"false"
:page=
"false"
:columns=
"colsIm"
:data=
"dataIm"
:height=
"tdHeightExcel+30"
ref=
"dataImport"
></DataGrid>
:tool=
"false"
:page=
"false"
:columns=
"colsIm"
:data=
"dataIm"
:height=
"tdHeightExcel+30"
ref=
"dataImport"
></DataGrid>
<div
slot=
"footer"
>
<div
slot=
"footer"
>
<Button
@
click=
"infoModal=false"
>
关闭
</Button>
<Button
@
click=
"infoModal=false"
>
关闭
</Button>
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
</div>
</div>
</Modal>
</Modal>
</div>
</div>
</Modal>
</Modal>
</
template
>
</
template
>
<
script
>
<
script
>
import
XLSX
from
"xlsx"
;
import
XLSX
from
"xlsx"
;
import
{
Switch
}
from
"view-design"
;
import
{
Switch
}
from
"view-design"
;
export
default
{
export
default
{
name
:
"Edit"
,
name
:
"Edit"
,
data
()
{
data
()
{
...
@@ -173,22 +159,19 @@ export default {
...
@@ -173,22 +159,19 @@ export default {
}
}
});
});
this
.
colsIm
=
tempCol
;
this
.
colsIm
=
tempCol
;
this
.
colsIm
.
unshift
(
this
.
colsIm
.
unshift
({
{
type
:
"index"
,
type
:
"index"
,
width
:
80
,
width
:
80
,
align
:
"right"
,
align
:
"right"
,
title
:
"序号"
,
title
:
"序号"
,
},
},
{
{
key
:
"ico"
,
key
:
"ico"
,
title
:
" "
,
title
:
" "
,
align
:
"center"
,
align
:
"center"
,
width
:
60
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
render
:
(
h
,
params
)
=>
{
return
h
(
return
h
(
"div"
,
"div"
,
{
{
class
:
""
,
class
:
""
,
},
},
[
[
...
@@ -203,8 +186,7 @@ export default {
...
@@ -203,8 +186,7 @@ export default {
]
]
);
);
},
},
}
});
);
//处理原始数据和表头进行对应
//处理原始数据和表头进行对应
let
temCol
=
this
.
$u
.
clone
(
this
.
colsIm
);
//原始数据表头
let
temCol
=
this
.
$u
.
clone
(
this
.
colsIm
);
//原始数据表头
let
temColPage
=
this
.
$u
.
clone
(
columns
);
//需要显示的页面的表头
let
temColPage
=
this
.
$u
.
clone
(
columns
);
//需要显示的页面的表头
...
@@ -273,10 +255,28 @@ export default {
...
@@ -273,10 +255,28 @@ export default {
eles
[
elem
.
key
]
!=
null
eles
[
elem
.
key
]
!=
null
)
{
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
let
codeArr
=
[]
let
keyValue
=
eles
[
elem
.
key
]
if
(
keyValue
.
length
>
0
&&
(
keyValue
.
indexOf
(
','
)
>
-
1
||
keyValue
.
indexOf
(
','
)
>
-
1
))
{
//如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if
(
keyValue
.
indexOf
(
','
)
>
-
1
)
{
codeArr
=
keyValue
.
split
(
','
)
}
if
(
keyValue
.
indexOf
>
-
1
)
{
codeArr
=
keyValue
.
split
(
','
)
}
}
if
(
codeArr
.
length
<=
1
)
{
//对应的数据包含一个数据字典项
eles
[
elem
.
key
]
=
this
.
$u
.
dirCode
(
eles
[
elem
.
key
]
=
this
.
$u
.
dirCode
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
eles
[
elem
.
key
]
eles
[
elem
.
key
]
);
);
}
else
{
//对应的数据包含多个数据字典项
let
codeInfo
=
''
codeArr
.
forEach
(
el
=>
{
codeInfo
=
codeInfo
+
this
.
$u
.
dirCode
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
el
)
+
","
;
})
eles
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
)
}
}
}
});
});
});
});
...
@@ -463,6 +463,7 @@ export default {
...
@@ -463,6 +463,7 @@ export default {
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@import "../../../assets/css/custom.less";
@import "../../../assets/css/custom.less";
.table-content {
.table-content {
position: relative;
position: relative;
height: 100%;
height: 100%;
...
@@ -501,6 +502,7 @@ export default {
...
@@ -501,6 +502,7 @@ export default {
display: flex;
display: flex;
line-height: 50px;
line-height: 50px;
background: @right-header-bg;
background: @right-header-bg;
.table-search {
.table-search {
flex-grow: 1;
flex-grow: 1;
}
}
...
...
i18n/locale/zh-CN.js
View file @
590fddf4
...
@@ -428,12 +428,18 @@ export default {
...
@@ -428,12 +428,18 @@ export default {
DipartLocation
:
{
DipartLocation
:
{
name
:
"部门"
,
name
:
"部门"
,
organizationType
:
"组织类型"
,
organizationType
:
"组织类型"
,
status
:
'是否生产班组'
,
// status: '是否生产班组',
status
:
'属性'
,
departcode
:
'部门编号'
,
departcode
:
'部门编号'
,
department
:
'部门名称'
,
department
:
'部门名称'
,
cityName
:
'省市县'
,
cityName
:
'省市县'
,
creationTime
:
'创建时间'
,
creationTime
:
'创建时间'
,
upMent
:
'上级部门'
,
upMent
:
'上级部门'
,
code
:
'部门编号'
,
location
:
'省市县'
,
parent_Id
:
'上级部门'
,
property
:
'属性'
,
parentTitle
:
'上级部门'
},
},
instance
:
{
instance
:
{
id
:
'主键'
,
id
:
'主键'
,
...
...
libs/henq.js
View file @
590fddf4
...
@@ -166,6 +166,42 @@ henq.findRoots = (arr1, id) => {
...
@@ -166,6 +166,42 @@ henq.findRoots = (arr1, id) => {
forFn
(
arr1
,
id
)
forFn
(
arr1
,
id
)
return
temp
return
temp
}
}
//省市县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
//导出pdf
henq
.
outPdf
=
(
ele
,
fileName
)
=>
{
henq
.
outPdf
=
(
ele
,
fileName
)
=>
{
// document.head.innerHTML =
// document.head.innerHTML =
...
...
npm-shrinkwrap.json
View file @
590fddf4
...
@@ -1744,7 +1744,7 @@
...
@@ -1744,7 +1744,7 @@
"dependencies"
:
{
"dependencies"
:
{
"ajv"
:
{
"ajv"
:
{
"version"
:
"5.5.2"
,
"version"
:
"5.5.2"
,
"resolved"
:
"https://registry.npm
js.org/ajv/-/
ajv-5.5.2.tgz"
,
"resolved"
:
"https://registry.npm
.taobao.org/ajv/download/ajv-5.5.2.tgz?cache=0&sync_timestamp=1597480760804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2F
ajv-5.5.2.tgz"
,
"integrity"
:
"sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU="
,
"integrity"
:
"sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU="
,
"dev"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"optional"
:
true
,
...
@@ -1776,7 +1776,7 @@
...
@@ -1776,7 +1776,7 @@
},
},
"cross-spawn"
:
{
"cross-spawn"
:
{
"version"
:
"5.1.0"
,
"version"
:
"5.1.0"
,
"resolved"
:
"https://registry.npm
js.org/cross-spawn/-/
cross-spawn-5.1.0.tgz"
,
"resolved"
:
"https://registry.npm
.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz?cache=0&sync_timestamp=1590421014780&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2F
cross-spawn-5.1.0.tgz"
,
"integrity"
:
"sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk="
,
"integrity"
:
"sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk="
,
"dev"
:
true
,
"dev"
:
true
,
"optional"
:
true
,
"optional"
:
true
,
...
@@ -1856,7 +1856,7 @@
...
@@ -1856,7 +1856,7 @@
},
},
"fast-deep-equal"
:
{
"fast-deep-equal"
:
{
"version"
:
"1.1.0"
,
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npm
js.org/fast-deep-equal/-
/fast-deep-equal-1.1.0.tgz"
,
"resolved"
:
"https://registry.npm
.taobao.org/fast-deep-equal/download
/fast-deep-equal-1.1.0.tgz"
,
"integrity"
:
"sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
,
"integrity"
:
"sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
,
"dev"
:
true
,
"dev"
:
true
,
"optional"
:
true
"optional"
:
true
...
@@ -1894,7 +1894,7 @@
...
@@ -1894,7 +1894,7 @@
},
},
"json-schema-traverse"
:
{
"json-schema-traverse"
:
{
"version"
:
"0.3.1"
,
"version"
:
"0.3.1"
,
"resolved"
:
"https://registry.npm
js.org/json-schema-traverse/-
/json-schema-traverse-0.3.1.tgz"
,
"resolved"
:
"https://registry.npm
.taobao.org/json-schema-traverse/download
/json-schema-traverse-0.3.1.tgz"
,
"integrity"
:
"sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
,
"integrity"
:
"sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
,
"dev"
:
true
,
"dev"
:
true
,
"optional"
:
true
"optional"
:
true
...
@@ -1964,7 +1964,7 @@
...
@@ -1964,7 +1964,7 @@
},
},
"yallist"
:
{
"yallist"
:
{
"version"
:
"2.1.2"
,
"version"
:
"2.1.2"
,
"resolved"
:
"https://registry.npm
js.org/yallist/-
/yallist-2.1.2.tgz"
,
"resolved"
:
"https://registry.npm
.taobao.org/yallist/download
/yallist-2.1.2.tgz"
,
"integrity"
:
"sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
,
"integrity"
:
"sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
,
"dev"
:
true
,
"dev"
:
true
,
"optional"
:
true
"optional"
:
true
...
...
pages/import/baseColums.js
View file @
590fddf4
...
@@ -135,16 +135,39 @@ export default {
...
@@ -135,16 +135,39 @@ export default {
},
},
columns1
()
{
columns1
()
{
let
col1
=
[{
let
col1
=
[{
key
:
"
userN
ame"
,
key
:
"
n
ame"
,
title
:
this
.
l
(
"userN
ame"
),
title
:
this
.
l
1
(
"n
ame"
),
align
:
"left"
,
align
:
"left"
,
},
},
{
{
key
:
"status"
,
key
:
"parent_Id"
,
title
:
this
.
l
(
"status"
),
title
:
this
.
l1
(
"parent_Id"
),
align
:
"center"
,
align
:
"left"
,
code
:
"User.base.status"
,
parentDepart
:
true
,
import
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l1
(
"code"
),
align
:
"left"
,
},
{
key
:
"location"
,
title
:
this
.
l1
(
"location"
),
align
:
"left"
,
location
:
true
,
import
:
true
,
},
{
key
:
"property"
,
title
:
this
.
l1
(
"property"
),
align
:
"left"
,
code
:
"department.property"
,
},
{
key
:
"creationTime"
,
title
:
this
.
l1
(
"creationTime"
),
align
:
"left"
,
},
},
]
]
return
col1
return
col1
...
@@ -629,6 +652,10 @@ export default {
...
@@ -629,6 +652,10 @@ export default {
key
=
"user"
+
"."
+
key
;
key
=
"user"
+
"."
+
key
;
return
i18n
.
t
(
key
);
return
i18n
.
t
(
key
);
},
},
l1
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
return
i18n
.
t
(
key
);
},
l2
(
key
)
{
l2
(
key
)
{
key
=
"resource"
+
"."
+
key
;
key
=
"resource"
+
"."
+
key
;
return
i18n
.
t
(
key
);
return
i18n
.
t
(
key
);
...
@@ -645,8 +672,7 @@ export default {
...
@@ -645,8 +672,7 @@ export default {
key
=
"product_info"
+
"."
+
key
;
key
=
"product_info"
+
"."
+
key
;
return
i18n
.
t
(
key
);
return
i18n
.
t
(
key
);
},
},
test
()
test
()
{
{
ViewUI
.
Message
.
error
(
"terterer"
)
ViewUI
.
Message
.
error
(
"terterer"
)
}
}
}
}
\ No newline at end of file
pages/import/process.vue
View file @
590fddf4
This diff is collapsed.
Click to expand it.
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