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
e4fed9fa
Commit
e4fed9fa
authored
Aug 24, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
importimport
parent
c511ba38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1724 additions
and
1549 deletions
+1724
-1549
dataGrid.vue
components/page/dataGrid.vue
+596
-617
add.vue
pages/import/add.vue
+108
-97
api.js
pages/import/api.js
+4
-1
detail.vue
pages/import/detail.vue
+91
-67
index.vue
pages/import/index.vue
+244
-220
process.vue
pages/import/process.vue
+681
-547
No files found.
components/page/dataGrid.vue
View file @
e4fed9fa
This diff is collapsed.
Click to expand it.
pages/import/add.vue
View file @
e4fed9fa
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
></Input>
<Input
v-model=
"entity.name"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('file')"
prop=
"file"
>
<InputExcel
v-model=
"imgName"
:parms=
"parms"
:showButton=
"false"
/>
<InputExcel
v-model=
"imgName"
:parms=
"parms"
:showButton=
"false"
/>
</FormItem>
</Col>
<Col
:span=
"24"
>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"5"
></Input>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem>
</Col>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</Form>
</
template
>
<
script
>
<
script
>
import
Api
from
"./api"
;
import
InputExcel
from
"@/components/page/inputExcel.vue"
;
export
default
{
name
:
"Add"
,
components
:
{
InputExcel
},
data
()
{
return
{
disabled
:
false
,
parms
:
"app=import&eid="
+
this
.
$u
.
guid
()
+
"&name=excel"
,
imgName
:
""
,
entity
:
{
name
:
""
,
file
:
""
,
filePath
:
""
,
remark
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
file
:[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}]
},
};
},
props
:
{
v
:
Object
,
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
name
:
"Add"
,
components
:
{
InputExcel
},
getEid
()
{
this
.
parms
.
eid
=
this
.
$u
.
guid
()
this
.
parms
.
app
=
'import'
this
.
$refs
.
refFile
.
intFiles
()
data
()
{
return
{
disabled
:
false
,
parms
:
"app=import&eid="
+
this
.
$u
.
guid
()
+
"&name=excel"
,
imgName
:
""
,
entity
:
{
name
:
""
,
file
:
""
,
path
:
""
,
remark
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
file
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}]
},
};
},
l
(
key
)
{
key
=
"import_center"
+
"."
+
key
;
return
this
.
$t
(
key
);
props
:
{
v
:
Object
,
eid
:
Number
,
},
},
watch
:
{
imgName
(
newName
,
oldName
)
{
const
imgPathsArr
=
JSON
.
parse
(
newName
);
this
.
entity
.
file
=
imgPathsArr
[
0
].
fileName
this
.
entity
.
filePath
=
imgPathsArr
[
0
].
filePath
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
},
getEid
()
{
this
.
parms
.
eid
=
this
.
$u
.
guid
()
this
.
parms
.
app
=
'import'
this
.
$refs
.
refFile
.
intFiles
()
},
l
(
key
)
{
key
=
"import_center"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
watch
:
{
imgName
(
newName
,
oldName
)
{
const
imgPathsArr
=
JSON
.
parse
(
newName
);
this
.
entity
.
file
=
imgPathsArr
[
0
].
fileName
this
.
entity
.
path
=
imgPathsArr
[
0
].
filePath
},
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
},
};
</
script
>
pages/import/api.js
View file @
e4fed9fa
...
...
@@ -24,5 +24,8 @@ export default {
deletes
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/batchdelete`
,
params
);
},
openExcel
(
params
)
{
//处理时打开以前上传的excel返回数据
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/open`
,
params
);
},
}
pages/import/detail.vue
View file @
e4fed9fa
<
template
>
<div
class=
"detail"
>
<div
class=
"detail"
>
<Row>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('file')"
><a
@
click=
"downFile(entity.filePath)"
>
{{
entity
.
file
}}
</a></Filed>
<Filed
:span=
"12"
:name=
"l('status')"
>
{{
entity
.
status
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('remark')"
>
{{
entity
.
remark
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('creationTime')"
>
{{
entity
.
creationTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('creatorUserId')"
>
{{
entity
.
creatorUserId
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('lastModificationTime')"
>
{{
entity
.
lastModificationTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('lastModifierUserId')"
>
{{
entity
.
lastModifierUserId
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('isDeleted')"
>
{{
entity
.
isDeleted
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('deletionTime')"
>
{{
entity
.
deletionTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('deleterUserId')"
>
{{
entity
.
deleterUserId
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('creator')"
>
{{
entity
.
creator
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('lastModifier')"
>
{{
entity
.
lastModifier
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('file')"
>
<a
@
click=
"downFile(entity.path)"
>
{{
entity
.
file
}}
</a>
</Filed>
<Filed
:span=
"12"
:name=
"l('status')"
>
<state
code=
"improt.im.status"
:value=
"entity.status"
type=
"text"
></state>
</Filed>
<Filed
:span=
"24"
:name=
"l('remark')"
>
{{
entity
.
remark
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('creationTime')"
>
{{
entity
.
creationTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('creatorUserId')"
>
<User
:value=
"entity.creatorUserId"
></User>
</Filed>
<!--
<Filed
:span=
"12"
:name=
"l('lastModificationTime')"
>
{{
entity
.
lastModificationTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('lastModifierUserId')"
>
{{
entity
.
lastModifierUserId
}}
<User
:value=
"entity.lastModifierUserId"
></User>
</Filed>
<Filed
:span=
"12"
:name=
"l('isDeleted')"
>
{{
entity
.
isDeleted
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('deletionTime')"
>
{{
entity
.
deletionTime
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('deleterUserId')"
>
{{
entity
.
deleterUserId
}}
<User
:value=
"entity.deleterUserId"
></User>
</Filed>
<Filed
:span=
"12"
:name=
"l('creator')"
>
{{
entity
.
creator
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('lastModifier')"
>
{{
entity
.
lastModifier
}}
</Filed>
-->
</Row>
</div>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
downUrl
:
fileUrlDown
,
fileUrlPath
:
""
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
{
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
downUrl
:
fileUrlDown
,
fileUrlPath
:
""
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
,
},
],
},
};
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
props
:
{
eid
:
Number
,
},
downFile
(
path
)
{
alert
(
path
)
let
truePath
=
path
.
trim
();
if
(
truePath
.
length
>
2
)
{
if
(
truePath
.
substring
(
0
,
7
).
toLowerCase
()
==
"http://"
||
truePath
.
substring
(
0
,
8
).
toLowerCase
()
==
"https://"
)
{
window
.
open
(
truePath
,
"_blank"
);
}
else
{
this
.
fileUrlPath
=
this
.
downUrl
+
path
;
window
.
open
(
this
.
fileUrlPath
,
"_blank"
);
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
}
},
l
(
key
)
{
key
=
"import_center"
+
"."
+
key
;
return
this
.
$t
(
key
);
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
,
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
$emit
(
"on-load"
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
downFile
(
path
)
{
//alert(path)
let
truePath
=
path
;
if
(
truePath
.
length
>
2
)
{
if
(
truePath
.
substring
(
0
,
7
).
toLowerCase
()
==
"http://"
||
truePath
.
substring
(
0
,
8
).
toLowerCase
()
==
"https://"
)
{
window
.
open
(
truePath
,
"_blank"
);
}
else
{
this
.
fileUrlPath
=
this
.
downUrl
+
path
;
window
.
open
(
this
.
fileUrlPath
,
"_blank"
);
}
}
},
l
(
key
)
{
key
=
"import_center"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
},
};
</
script
>
pages/import/index.vue
View file @
e4fed9fa
This diff is collapsed.
Click to expand it.
pages/import/process.vue
View file @
e4fed9fa
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