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
Hide 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 @@
...
@@ -21,10 +21,7 @@
</div>
</div>
<div
class=
"btns"
>
<div
class=
"btns"
>
<slot
name=
"buttons"
></slot>
<slot
name=
"buttons"
></slot>
<Button
@
click=
"openImportModal"
>
<Button
@
click=
"export2Excel"
v-if=
"exportTitle.length>0"
>
导入
</Button>
<Button
@
click=
"export2Excel"
>
导出
导出
</Button>
</Button>
<Button
v-if=
"set&&type=='table'"
@
click=
"config=!config"
>
<Button
v-if=
"set&&type=='table'"
@
click=
"config=!config"
>
...
@@ -70,9 +67,7 @@
...
@@ -70,9 +67,7 @@
</li>
</li>
</ul>
</ul>
</Drawer>
</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"
>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar"
>
<div
class=
"tip"
>
已选
{{
selectItems
.
length
}}
项
</div>
<div
class=
"tip"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
<slot
name=
"batch"
></slot>
...
@@ -105,7 +100,6 @@ export default {
...
@@ -105,7 +100,6 @@ export default {
userConfig
:
null
,
//用户页面配置信息。,
userConfig
:
null
,
//用户页面配置信息。,
// userId: 1
// userId: 1
userId
:
this
.
$store
.
state
.
userInfo
.
userId
,
userId
:
this
.
$store
.
state
.
userInfo
.
userId
,
ImportModal
:
false
,
};
};
},
},
props
:
{
props
:
{
...
@@ -222,9 +216,9 @@ export default {
...
@@ -222,9 +216,9 @@ export default {
type
:
Number
,
type
:
Number
,
default
:
40
,
default
:
40
,
},
},
t
itle
:
{
exportT
itle
:
{
type
:
String
,
type
:
String
,
default
:
"
导出数据
"
,
default
:
""
,
}
}
},
},
created
()
{
created
()
{
...
@@ -476,17 +470,7 @@ export default {
...
@@ -476,17 +470,7 @@ export default {
this
.
footerToolbar
=
false
;
this
.
footerToolbar
=
false
;
this
.
$refs
.
table
.
selectAll
(
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
//导出excel
export2Excel
()
{
export2Excel
()
{
//当前显示数据
//当前显示数据
...
@@ -531,7 +515,7 @@ export default {
...
@@ -531,7 +515,7 @@ export default {
var
tempCol
=
[];
var
tempCol
=
[];
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columnsNow
);
//导出列标题信息griddata this.$refs.grid.columnsCur
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columnsNow
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
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
)
{
if
(
el
.
code
)
{
tempCol
.
push
({
tempCol
.
push
({
key
:
el
.
key
,
key
:
el
.
key
,
...
@@ -553,7 +537,7 @@ export default {
...
@@ -553,7 +537,7 @@ export default {
});
});
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
//获取导出数据结束
this
.
$u
.
outExcel
(
this
.
t
itle
+
this
.
$u
.
outExcel
(
this
.
exportT
itle
+
"("
+
nowDate
+
")"
,
"("
+
nowDate
+
")"
,
tHeader
,
tHeader
,
filterVal
,
filterVal
,
...
@@ -561,7 +545,6 @@ export default {
...
@@ -561,7 +545,6 @@ export default {
);
);
});
});
},
},
//导入excel
},
},
computed
:
{
computed
:
{
columnsNow
()
{
columnsNow
()
{
...
...
components/page/import/process.vue
View file @
f5568ee9
<
template
>
<
template
>
<div
class=
"table-content"
>
<Modal
v-model=
"ImportModal"
title=
"导入"
fullscreen
footer-hide
@
on-cancel=
"cancelModal"
>
<div
class=
"table-tools"
>
<div
class=
"table-content"
>
<div
class=
"table-search"
>
<Form
inline
>
<FormItem>
<div
style=
"height:34px;overflow: hidden;padding:0"
>
<Upload
action
:before-upload=
"beforeUpload"
ref=
"uploadfile"
:format=
"formatList"
>
<Button
icon=
"ios-cloud-upload-outline"
>
上传文件
</Button>
</Upload>
</div>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"openInfoModal"
:disabled=
"btnIm"
>
导入
</Button>
</FormItem>
</Form>
<div
class=
"table-tools"
>
<div
class=
"table-search"
>
<Form
inline
>
<FormItem>
<div
style=
"height:34px;overflow: hidden;padding:0"
>
<Upload
action
:before-upload=
"beforeUpload"
ref=
"uploadfile"
:format=
"formatList"
>
<Button
icon=
"ios-cloud-upload-outline"
>
上传文件
</Button>
</Upload>
</div>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"openInfoModal"
:disabled=
"btnIm"
>
导入
</Button>
</FormItem>
</Form>
</div>
<div
class=
"btns"
>
<Form
inline
>
<FormItem>
<RadioGroup
v-model=
"excelType"
type=
"button"
@
on-change=
"changeExcel"
size=
"small"
>
<Tooltip
content=
"文件数据"
>
<Radio
label=
"0"
>
<Icon
type=
"ios-list-box-outline"
/>
</Radio>
</Tooltip>
<Tooltip
content=
"粘贴Excel数据"
>
<Radio
label=
"1"
>
<Icon
type=
"ios-copy"
/>
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
</div>
</div>
<div
class=
"btns"
>
<div
class=
"table-main"
ref=
"main"
>
<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"
/>
</div>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
<Form
inline
>
<Form
inline
>
<FormItem>
<FormItem>
<RadioGroup
v-model=
"excelType"
type=
"button"
@
on-change=
"changeExcel"
size=
"small"
>
<Tabs
:animated=
"false"
:value=
"0"
@
on-click=
"sheetClick"
>
<Tooltip
content=
"文件数据"
>
<TabPane
:label=
"item"
v-for=
"(item,index) in sheetNames"
:key=
"index"
></TabPane>
<Radio
label=
"0"
>
</Tabs>
<Icon
type=
"ios-list-box-outline"
/>
</Radio>
</Tooltip>
<Tooltip
content=
"粘贴Excel数据"
>
<Radio
label=
"1"
>
<Icon
type=
"ios-copy"
/>
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</FormItem>
</Form>
</Form>
</div>
</FooterToolbar>
<Modal
v-model=
"infoModal"
:title=
"titleInfo"
fullscreen
>
<DataGrid
:tool=
"false"
:page=
"false"
:columns=
"colsIm"
:data=
"dataIm"
:height=
"tdHeightExcel+30"
ref=
"dataImport"
></DataGrid>
<div
slot=
"footer"
>
<Button
@
click=
"infoModal=false"
>
关闭
</Button>
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
</div>
</Modal>
</div>
</div>
<div
class=
"table-main"
ref=
"main"
>
</Modal>
<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"
/>
</div>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
<Form
inline
>
<FormItem>
<Tabs
:animated=
"false"
:value=
"0"
@
on-click=
"sheetClick"
>
<TabPane
:label=
"item"
v-for=
"(item,index) in sheetNames"
:key=
"index"
></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal
v-model=
"infoModal"
:title=
"titleInfo"
fullscreen
>
<DataGrid
:tool=
"false"
:page=
"false"
:columns=
"colsIm"
:data=
"dataIm"
:height=
"tdHeightExcel+30"
ref=
"dataImport"
></DataGrid>
<div
slot=
"footer"
>
<Button
@
click=
"infoModal=false"
>
关闭
</Button>
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
</div>
</Modal>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -93,6 +96,8 @@ export default {
...
@@ -93,6 +96,8 @@ export default {
titleInfo
:
''
,
titleInfo
:
''
,
noDataText
:
'暂无数据'
,
noDataText
:
'暂无数据'
,
imBtn
:
true
,
imBtn
:
true
,
columnsIm
:
this
.
columns
,
ImportModal
:
this
.
open
};
};
},
},
props
:
{
props
:
{
...
@@ -109,6 +114,10 @@ export default {
...
@@ -109,6 +114,10 @@ export default {
type
:
Array
,
type
:
Array
,
default
:
[],
default
:
[],
},
},
open
:
{
type
:
Boolean
,
default
:
false
}
},
},
created
()
{
created
()
{
this
.
tdHeightExcel
=
window
.
innerHeight
-
180
;
this
.
tdHeightExcel
=
window
.
innerHeight
-
180
;
...
@@ -143,7 +152,7 @@ export default {
...
@@ -143,7 +152,7 @@ export default {
title
:
'序号'
title
:
'序号'
})
})
tempCol
.
forEach
((
ele
,
index
)
=>
{
tempCol
.
forEach
((
ele
,
index
)
=>
{
if
(
ele
.
key
==
"action"
||
ele
.
type
==
"selection"
)
{
if
(
ele
.
key
==
"action"
||
ele
.
type
==
"selection"
||
ele
.
key
==
"ico"
)
{
ele
.
hide
=
true
;
ele
.
hide
=
true
;
}
}
});
});
...
@@ -298,7 +307,7 @@ export default {
...
@@ -298,7 +307,7 @@ export default {
openInfoModal
()
{
openInfoModal
()
{
if
((
this
.
excelType
==
'0'
&&
this
.
excelData
.
length
>
0
)
||
(
this
.
excelType
==
'1'
&&
this
.
$refs
.
comExcel
.
excelData
.
length
>
0
))
{
if
((
this
.
excelType
==
'0'
&&
this
.
excelData
.
length
>
0
)
||
(
this
.
excelType
==
'1'
&&
this
.
$refs
.
comExcel
.
excelData
.
length
>
0
))
{
this
.
imBtn
=
true
;
this
.
imBtn
=
true
;
this
.
loadColum
(
this
.
columns
);
this
.
loadColum
(
this
.
columns
Im
);
this
.
titleInfo
=
"批量导入"
;
this
.
titleInfo
=
"批量导入"
;
this
.
infoModal
=
true
this
.
infoModal
=
true
}
else
{
}
else
{
...
@@ -339,6 +348,9 @@ export default {
...
@@ -339,6 +348,9 @@ export default {
this
.
btnIm
=
false
this
.
btnIm
=
false
}
}
},
},
cancelModal
()
{
this
.
$emit
(
'on-cancel'
)
},
l
(
key
)
{
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
return
this
.
$t
(
key
);
...
@@ -352,7 +364,11 @@ export default {
...
@@ -352,7 +364,11 @@ export default {
}
}
});
});
this
.
colsIm
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
colsIm
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
columnsIm
=
this
.
$u
.
clone
(
this
.
columns
)
},
},
open
(
v
)
{
this
.
ImportModal
=
v
}
},
},
};
};
</
script
>
</
script
>
...
...
pages/import/index.vue
View file @
f5568ee9
<
template
>
<
template
>
<div
class=
"h100"
>
<div
class=
"h100"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
t
itle=
"导入中心"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
exportT
itle=
"导入中心"
>
<template
slot=
"easySearch"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<FormItem
prop=
"keys"
>
...
...
pages/mesPlan/index.vue
View file @
f5568ee9
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</div>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<!--:data="dataT"-->
<!--: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"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<FormItem
prop=
"keys"
>
...
@@ -1045,10 +1045,7 @@ export default {
...
@@ -1045,10 +1045,7 @@ export default {
this
.
dataT
=
this
.
$u
.
clone
(
this
.
dataT
);
this
.
dataT
=
this
.
$u
.
clone
(
this
.
dataT
);
},
},
//批量导入start
//批量导入start
onImportData
(
val
)
{
alert
(
JSON
.
stringify
(
val
))
this
.
$refs
.
grid
.
closeImport
()
},
//批量导入end
//批量导入end
}
}
};
};
...
...
pages/resource/resource/api.js
View file @
f5568ee9
...
@@ -44,5 +44,9 @@ export default {
...
@@ -44,5 +44,9 @@ export default {
getmaterialdefinitionproperty
(
params
){
getmaterialdefinitionproperty
(
params
){
return
Api
.
get
(
`
${
material
}
/custompropertydefinition/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