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
ae2643b6
Commit
ae2643b6
authored
Aug 27, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PROCESS
parent
bc31834f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
164 deletions
+163
-164
inputExcel.vue
components/page/inputExcel.vue
+148
-160
npm-shrinkwrap.json
npm-shrinkwrap.json
+0
-0
process.vue
pages/import/process.vue
+15
-4
No files found.
components/page/inputExcel.vue
View file @
ae2643b6
<
template
>
<
template
>
<div>
<div>
<Input
v-model=
"newName"
placeholder=
"请选择上传文件"
disabled
>
<Input
v-model=
"newName"
placeholder=
"请选择上传文件"
disabled
>
<Button
v-if=
"view"
icon=
"md-download"
slot=
"prepend"
@
click=
"downFile(newName)"
>
</Button>
<Button
v-if=
"view"
icon=
"md-download"
slot=
"prepend"
@
click=
"downFile(newName)"
>
</Button>
<Button
type=
"primary"
icon=
"ios-cloud-upload-outline"
slot=
"append"
@
click=
"handler"
>
上传
</Button>
<Button
type=
"primary"
icon=
"ios-cloud-upload-outline"
slot=
"append"
@
click=
"handler"
>
上传
</Button>
</Input>
</Input>
<Upload
<Upload
v-model=
"name"
:action=
"postUrl"
:on-success=
"uploadSuccess"
:on-error=
"uploadError"
:on-remove=
"removeFile"
:format=
"formatList"
:max-size=
"maxSize"
:on-exceeded-size=
"onExceededSize"
:on-format-error=
"onFormatError"
:show-upload-list=
"false"
:files=
"files"
:on-progress=
"onProgress"
>
v-model=
"name"
:action=
"postUrl"
:on-success=
"uploadSuccess"
:on-error=
"uploadError"
:on-remove=
"removeFile"
:format=
"formatList"
:max-size=
"maxSize"
:on-exceeded-size=
"onExceededSize"
:on-format-error=
"onFormatError"
:show-upload-list=
"false"
:files=
"files"
:on-progress=
"onProgress"
>
<Button
v-show=
"1==2"
type=
"primary"
ref=
"upload"
>
上传
</Button>
<Button
v-show=
"1==2"
type=
"primary"
ref=
"upload"
>
上传
</Button>
</Upload>
</Upload>
<Progress
:percent=
"per"
:stroke-width=
"5"
v-show=
"vshowPro"
/>
<Progress
:percent=
"per"
:stroke-width=
"5"
v-show=
"vshowPro"
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
util
from
"@/libs/util"
;
import
util
from
"@/libs/util"
;
export
default
{
export
default
{
...
@@ -38,13 +26,12 @@ export default {
...
@@ -38,13 +26,12 @@ export default {
downUrl
:
fileUrlDown
,
downUrl
:
fileUrlDown
,
fileUrlPath
:
""
,
fileUrlPath
:
""
,
nameList
:
[],
nameList
:
[],
postUrl
:
postUrl
:
fileUrl
+
fileUrl
+
"/upload/?token=Bearer "
+
"/upload/?token=Bearer "
+
util
.
cookies
.
get
(
"token"
)
+
util
.
cookies
.
get
(
"token"
)
+
"&"
+
"&"
+
this
.
parms
,
this
.
parms
,
formatList
:
[
"xlsx"
,
"xls
"
],
formatList
:
[
"xlsx"
,
"xls"
,
"jpg"
,
"gif"
,
"png"
,
"pdf"
,
"docx"
,
"doc"
,
"txt"
,
"rar"
,
"zip
"
],
newName
:
""
,
newName
:
""
,
newPath
:
""
,
newPath
:
""
,
per
:
0
,
per
:
0
,
...
@@ -165,7 +152,7 @@ export default {
...
@@ -165,7 +152,7 @@ export default {
nativeInputValue
()
{
nativeInputValue
()
{
return
this
.
value
===
null
||
this
.
value
===
undefined
?
""
:
this
.
value
;
return
this
.
value
===
null
||
this
.
value
===
undefined
?
""
:
this
.
value
;
},
},
view
()
{
view
()
{
return
true
return
true
}
}
},
},
...
@@ -176,5 +163,6 @@ export default {
...
@@ -176,5 +163,6 @@ export default {
}
}
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
</
style
>
</
style
>
package-lock
.json
→
npm-shrinkwrap
.json
View file @
ae2643b6
File moved
pages/import/process.vue
View file @
ae2643b6
...
@@ -9,9 +9,11 @@
...
@@ -9,9 +9,11 @@
<FormItem>
<FormItem>
<dictionary
code=
"import.im.page"
style=
"width:160px"
@
on-change=
"pageChange"
v-model=
"pageType"
></dictionary>
<dictionary
code=
"import.im.page"
style=
"width:160px"
@
on-change=
"pageChange"
v-model=
"pageType"
></dictionary>
</FormItem>
</FormItem>
<!--
<FormItem>
<FormItem>
<div
class=
"tip mr20"
>
共
{{
listLength
}}
条数据
</div>
<div
class=
"tip mr20"
>
共
{{
listLength
}}
条数据
</div>
</FormItem>
</FormItem>
-->
<FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"openInfoModal"
:disabled=
"btnIm"
>
导入
</Button>
<Button
type=
"primary"
@
click=
"openInfoModal"
:disabled=
"btnIm"
>
导入
</Button>
</FormItem>
</FormItem>
...
@@ -37,12 +39,12 @@
...
@@ -37,12 +39,12 @@
</a>
</a>
</FormItem>
</FormItem>
<FormItem>
<FormItem>
<RadioGroup
v-model=
"excelType"
type=
"button"
@
on-change=
"changeExcel"
>
<RadioGroup
v-model=
"excelType"
type=
"button"
@
on-change=
"changeExcel"
size=
"small"
>
<Radio
label=
"0"
>
<Radio
label=
"0"
>
<Icon
type=
"
md-list"
/>
列表
<Icon
type=
"
ios-list-box-outline"
/>
</Radio>
</Radio>
<Radio
label=
"1"
>
<Radio
label=
"1"
>
<Icon
type=
"
md-clipboard"
/>
Excel
<Icon
type=
"
ios-copy"
/>
</Radio>
</Radio>
</RadioGroup>
</RadioGroup>
</FormItem>
</FormItem>
...
@@ -400,6 +402,11 @@ export default {
...
@@ -400,6 +402,11 @@ export default {
var
tempCos
=
Object
.
keys
(
this
.
openDatas
[
val
].
dataTable
[
0
]);
//获取列表标题
var
tempCos
=
Object
.
keys
(
this
.
openDatas
[
val
].
dataTable
[
0
]);
//获取列表标题
this
.
columnsImport
=
[];
this
.
columnsImport
=
[];
var
headersNow
=
[];
var
headersNow
=
[];
headersNow
.
push
({
type
:
'index'
,
width
:
60
,
align
:
'center'
})
tempCos
.
forEach
((
el
)
=>
{
tempCos
.
forEach
((
el
)
=>
{
let
headObj
=
{};
let
headObj
=
{};
headObj
.
title
=
el
;
headObj
.
title
=
el
;
...
@@ -532,6 +539,11 @@ export default {
...
@@ -532,6 +539,11 @@ export default {
var
lines
=
csv
.
split
(
"
\n
"
);
//第一行标题
var
lines
=
csv
.
split
(
"
\n
"
);
//第一行标题
var
headers
=
lines
[
0
].
split
(
","
);
var
headers
=
lines
[
0
].
split
(
","
);
var
headersNow
=
[];
var
headersNow
=
[];
headersNow
.
push
({
type
:
'index'
,
width
:
60
,
align
:
'center'
})
headers
.
forEach
((
elHead
)
=>
{
headers
.
forEach
((
elHead
)
=>
{
let
headObj
=
{};
let
headObj
=
{};
headObj
.
title
=
elHead
;
headObj
.
title
=
elHead
;
...
@@ -539,7 +551,6 @@ export default {
...
@@ -539,7 +551,6 @@ export default {
headersNow
.
push
(
headObj
);
headersNow
.
push
(
headObj
);
});
});
this
.
columnsImport
=
headersNow
;
this
.
columnsImport
=
headersNow
;
var
result
=
[];
var
result
=
[];
for
(
var
i
=
1
;
i
<
lines
.
length
-
1
;
i
++
)
{
for
(
var
i
=
1
;
i
<
lines
.
length
-
1
;
i
++
)
{
var
obj
=
{};
var
obj
=
{};
...
...
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