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
f5568ee9
Commit
f5568ee9
authored
Aug 28, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import
parent
367ceb3d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
623 additions
and
560 deletions
+623
-560
dataGrid.vue
components/page/dataGrid.vue
+7
-24
process.vue
components/page/import/process.vue
+68
-52
index.vue
pages/import/index.vue
+1
-1
index.vue
pages/mesPlan/index.vue
+2
-5
api.js
pages/resource/resource/api.js
+4
-0
index.vue
pages/resource/resource/index.vue
+541
-478
No files found.
components/page/dataGrid.vue
View file @
f5568ee9
...
...
@@ -21,10 +21,7 @@
</div>
<div
class=
"btns"
>
<slot
name=
"buttons"
></slot>
<Button
@
click=
"openImportModal"
>
导入
</Button>
<Button
@
click=
"export2Excel"
>
<Button
@
click=
"export2Excel"
v-if=
"exportTitle.length>0"
>
导出
</Button>
<Button
v-if=
"set&&type=='table'"
@
click=
"config=!config"
>
...
...
@@ -70,9 +67,7 @@
</li>
</ul>
</Drawer>
<Modal
v-model=
"ImportModal"
title=
"导入"
fullscreen
footer-hide
>
<ImportExcel
v-if=
"ImportModal"
@
on-get-data=
"getData"
:columns=
"columnsNow"
/>
</Modal>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar"
>
<div
class=
"tip"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
...
...
@@ -105,7 +100,6 @@ export default {
userConfig
:
null
,
//用户页面配置信息。,
// userId: 1
userId
:
this
.
$store
.
state
.
userInfo
.
userId
,
ImportModal
:
false
,
};
},
props
:
{
...
...
@@ -222,9 +216,9 @@ export default {
type
:
Number
,
default
:
40
,
},
t
itle
:
{
exportT
itle
:
{
type
:
String
,
default
:
"
导出数据
"
,
default
:
""
,
}
},
created
()
{
...
...
@@ -476,17 +470,7 @@ export default {
this
.
footerToolbar
=
false
;
this
.
$refs
.
table
.
selectAll
(
false
);
},
//导入功能
openImportModal
()
{
this
.
ImportModal
=
true
},
getData
(
val
)
{
// alert(JSON.stringify(val))
this
.
$emit
(
"on-import-data"
,
val
)
},
closeImport
()
{
this
.
ImportModal
=
false
},
//导出excel
export2Excel
()
{
//当前显示数据
...
...
@@ -531,7 +515,7 @@ export default {
var
tempCol
=
[];
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columnsNow
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
if
((
el
.
hide
&&
!
el
.
import
)
||
(
!
el
.
hide
&&
el
.
key
!=
"action"
&&
el
.
type
!=
"selection"
))
{
if
((
el
.
hide
&&
!
el
.
import
)
||
(
!
el
.
hide
&&
el
.
key
!=
"action"
&&
el
.
type
!=
"selection"
&&
el
.
key
!=
"ico"
))
{
if
(
el
.
code
)
{
tempCol
.
push
({
key
:
el
.
key
,
...
...
@@ -553,7 +537,7 @@ export default {
});
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this
.
$u
.
outExcel
(
this
.
t
itle
+
this
.
$u
.
outExcel
(
this
.
exportT
itle
+
"("
+
nowDate
+
")"
,
tHeader
,
filterVal
,
...
...
@@ -561,7 +545,6 @@ export default {
);
});
},
//导入excel
},
computed
:
{
columnsNow
()
{
...
...
components/page/import/process.vue
View file @
f5568ee9
<
template
>
<div
class=
"table-content"
>
<Modal
v-model=
"ImportModal"
title=
"导入"
fullscreen
footer-hide
@
on-cancel=
"cancelModal"
>
<div
class=
"table-content"
>
<div
class=
"table-tools"
>
<div
class=
"table-search"
>
<Form
inline
>
...
...
@@ -55,7 +57,8 @@
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
</div>
</Modal>
</div>
</div>
</Modal>
</
template
>
<
script
>
...
...
@@ -93,6 +96,8 @@ export default {
titleInfo
:
''
,
noDataText
:
'暂无数据'
,
imBtn
:
true
,
columnsIm
:
this
.
columns
,
ImportModal
:
this
.
open
};
},
props
:
{
...
...
@@ -109,6 +114,10 @@ export default {
type
:
Array
,
default
:
[],
},
open
:
{
type
:
Boolean
,
default
:
false
}
},
created
()
{
this
.
tdHeightExcel
=
window
.
innerHeight
-
180
;
...
...
@@ -143,7 +152,7 @@ export default {
title
:
'序号'
})
tempCol
.
forEach
((
ele
,
index
)
=>
{
if
(
ele
.
key
==
"action"
||
ele
.
type
==
"selection"
)
{
if
(
ele
.
key
==
"action"
||
ele
.
type
==
"selection"
||
ele
.
key
==
"ico"
)
{
ele
.
hide
=
true
;
}
});
...
...
@@ -298,7 +307,7 @@ export default {
openInfoModal
()
{
if
((
this
.
excelType
==
'0'
&&
this
.
excelData
.
length
>
0
)
||
(
this
.
excelType
==
'1'
&&
this
.
$refs
.
comExcel
.
excelData
.
length
>
0
))
{
this
.
imBtn
=
true
;
this
.
loadColum
(
this
.
columns
);
this
.
loadColum
(
this
.
columns
Im
);
this
.
titleInfo
=
"批量导入"
;
this
.
infoModal
=
true
}
else
{
...
...
@@ -339,6 +348,9 @@ export default {
this
.
btnIm
=
false
}
},
cancelModal
()
{
this
.
$emit
(
'on-cancel'
)
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
...
...
@@ -352,7 +364,11 @@ export default {
}
});
this
.
colsIm
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
columnsIm
=
this
.
$u
.
clone
(
this
.
columns
)
},
open
(
v
)
{
this
.
ImportModal
=
v
}
},
};
</
script
>
...
...
pages/import/index.vue
View file @
f5568ee9
<
template
>
<div
class=
"h100"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
t
itle=
"导入中心"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
exportT
itle=
"导入中心"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
...
...
pages/mesPlan/index.vue
View file @
f5568ee9
...
...
@@ -24,7 +24,7 @@
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<!--:data="dataT"-->
<DataGrid
:action=
"action"
:columns=
"columns"
:conditions=
"easySearch"
ref=
"grid"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"false"
rowKey=
"id"
t
itle=
"订单管理"
@
on-import-data=
"onImportData"
>
<DataGrid
:action=
"action"
:columns=
"columns"
:conditions=
"easySearch"
ref=
"grid"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"false"
rowKey=
"id"
exportT
itle=
"订单管理"
@
on-import-data=
"onImportData"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
...
...
@@ -1045,10 +1045,7 @@ export default {
this
.
dataT
=
this
.
$u
.
clone
(
this
.
dataT
);
},
//批量导入start
onImportData
(
val
)
{
alert
(
JSON
.
stringify
(
val
))
this
.
$refs
.
grid
.
closeImport
()
},
//批量导入end
}
};
...
...
pages/resource/resource/api.js
View file @
f5568ee9
...
...
@@ -44,5 +44,9 @@ export default {
getmaterialdefinitionproperty
(
params
){
return
Api
.
get
(
`
${
material
}
/custompropertydefinition/getmaterialdefinitionproperty`
,
params
);
},
//批量导入
import
(
params
)
{
return
Api
.
post
(
`
${
resourceUrl
}
/resourceimportservice/import`
,
params
);
},
}
\ No newline at end of file
pages/resource/resource/index.vue
View file @
f5568ee9
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