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
4c0814bb
Commit
4c0814bb
authored
Sep 21, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类优化
parent
e81703d7
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
403 additions
and
258 deletions
+403
-258
zh-CN.js
i18n/locale/zh-CN.js
+13
-0
add.vue
pages/word/classification/add.vue
+9
-11
edit.vue
pages/word/classification/edit.vue
+14
-3
index.vue
pages/word/classification/index.vue
+2
-1
api.js
pages/word/document/api.js
+7
-7
index.vue
pages/word/document/index.vue
+205
-118
add.vue
pages/word/template/add.vue
+146
-111
api.js
pages/word/template/api.js
+7
-7
No files found.
i18n/locale/zh-CN.js
View file @
4c0814bb
...
...
@@ -1745,5 +1745,18 @@ export default {
creator
:
'创建人'
,
remark
:
''
,
url
:
'模板路径'
,
},
document_ref
:{
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
lastModifierUserId
:
'更新人'
,
isDeleted
:
'删除人'
,
deletionTime
:
'删除时间'
,
deleterUserId
:
'删除人'
,
documentId
:
'文档id'
,
refName
:
'引用的文档名称'
,
refId
:
'引用的文档id'
,
name
:
'文档名称'
,
}
}
pages/word/classification/add.vue
View file @
4c0814bb
...
...
@@ -34,9 +34,9 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
v-if=
"row.id"
>
<!--
<Checkbox
v-model=
"entity.inheritCategoryId"
></Checkbox>
-->
<RadioGroup
v-model=
"
entity.inheritCategoryId
"
>
<RadioGroup
v-model=
"
inherit
"
>
<Radio
label=
"1"
>
是
</Radio>
<Radio
label=
"0"
>
否
</Radio>
</RadioGroup>
...
...
@@ -136,28 +136,21 @@ export default {
return
{
disabled
:
false
,
entity
:
{
// creationTime: null,
creatorUserId
:
this
.
$store
.
state
.
userInfo
.
userId
,
//creator: this.$store.state.userInfo.userName,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
name
:
""
,
upId
:
0
,
level
:
1
,
//层级,顶级1,
totalDocument
:
0
,
// tenantId: null,
type
:
0
,
englishFullName
:
""
,
englishName
:
""
,
status
:
0
,
description
:
""
,
inheritCategoryId
:
"0"
,
//0否,
1是
inheritCategoryId
:
"0"
,
//0否,
是,row的id值
template
:
""
,
templateId
:
""
,
},
inherit
:
"0"
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
...
...
@@ -284,6 +277,7 @@ export default {
// if (this.eid > 0) {
// this.load(this.eid);
// }
console
.
log
(
this
.
row
);
this
.
parms
.
eid
=
this
.
$u
.
guid
();
this
.
$refs
.
refFile
.
intFiles
();
},
...
...
@@ -334,13 +328,17 @@ export default {
// this.entity.filePath = "";
this
.
entity
.
templateId
=
""
;
}
if
(
this
.
row
.
id
)
{
this
.
entity
.
upId
=
this
.
row
.
id
;
this
.
entity
.
level
=
this
.
row
.
level
;
this
.
entity
.
inheritCategoryId
=
this
.
row
.
id
;
}
else
{
this
.
entity
.
upId
=
0
;
this
.
entity
.
level
=
1
;
this
.
entity
.
inheritCategoryId
=
0
;
}
alert
(
55
);
let
data
=
{
cat
:
this
.
entity
,
pros
:
this
.
checkList
,
...
...
pages/word/classification/edit.vue
View file @
4c0814bb
...
...
@@ -37,7 +37,7 @@
<Col
:span=
"12"
>
<FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<!--
<Checkbox
v-model=
"entity.inheritCategoryId"
></Checkbox>
-->
<RadioGroup
v-model=
"
entity.inheritCategoryId
"
>
<RadioGroup
v-model=
"
inherit
"
>
<Radio
label=
"1"
>
是
</Radio>
<Radio
label=
"0"
>
否
</Radio>
</RadioGroup>
...
...
@@ -140,6 +140,7 @@ export default {
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
inherit
:
null
,
checkList
:
[
{
field
:
"code"
,
...
...
@@ -267,8 +268,13 @@ export default {
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
inheritCategoryId
=
r
.
result
.
inheritCategoryId
+
""
;
this
.
parms
.
eid
=
r
.
result
.
templateId
;
if
(
r
.
result
.
inheritCategoryId
==
0
)
{
this
.
inherit
=
"0"
;
}
else
{
this
.
inherit
=
"1"
;
}
let
conditions
=
[
{
conditionalType
:
"Equal"
,
...
...
@@ -331,9 +337,14 @@ export default {
if
(
this
.
$refs
.
refFile
.
nameList
.
length
>
0
)
{
this
.
entity
.
templateId
=
this
.
parms
.
eid
;
}
else
{
// this.entity.filePath = "";
this
.
entity
.
templateId
=
""
;
}
if
(
this
.
inherit
==
0
)
{
this
.
entity
.
inheritCategoryId
=
0
;
}
else
{
this
.
entity
.
inheritCategoryId
=
this
.
entity
.
id
;
}
let
data
=
{
cat
:
this
.
entity
,
pros
:
this
.
checkList
,
...
...
pages/word/classification/index.vue
View file @
4c0814bb
...
...
@@ -4,7 +4,7 @@
<Input
v-model
.
trim=
"searchValue"
placeholder=
"请输入库位名称"
clearable
style=
"width: 240px"
/>
<Button
type=
"primary"
class
@
click=
"handleSearch"
>
查询
</Button>
<div
class=
"fr"
>
<Button
type=
"primary"
@
click=
"add()"
>
新增
库位
</Button>
<Button
type=
"primary"
@
click=
"add()"
>
新增
分类
</Button>
</div>
</div>
<TreeGrid
:columns=
"columns"
:items=
"treeData"
></TreeGrid>
...
...
@@ -225,6 +225,7 @@ export default {
},
add
()
{
this
.
curId
=
0
;
this
.
row
.
id
=
''
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
...
...
pages/word/document/api.js
View file @
4c0814bb
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
technologyUr
l
}
documentref/paged`
,
index
:
`
${
materia
l
}
documentref/paged`
,
paged
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documentref/paged`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documentref/paged`
,
params
);
},
get
(
params
){
return
Api
.
get
(
`
${
technologyUr
l
}
documentref/get`
,
params
);
return
Api
.
get
(
`
${
materia
l
}
documentref/get`
,
params
);
},
create
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documentref/create`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documentref/create`
,
params
);
},
update
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documentref/update`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documentref/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
technologyUr
l
}
documentref/delete`
,{
params
:{
id
:
id
}});
return
Api
.
delete
(
`
${
materia
l
}
documentref/delete`
,{
params
:{
id
:
id
}});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
technologyUr
l
}
documentref/batchdelete`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documentref/batchdelete`
,
params
);
}
}
\ No newline at end of file
pages/word/document/index.vue
View file @
4c0814bb
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
><template
slot=
"easySearch"
><Form
ref=
"formInline"
:model=
"easySearch"
inline
><FormItem
prop=
"keys"
><Input
placeholder=
"请输入关键字引用的文档名称/文档名称"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem>
</Form></
template
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入关键字引用的文档名称/文档名称"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
...
...
@@ -16,108 +24,187 @@
</div>
</template>
<
script
>
import
Api
from
'./api'
import
Search
from
'./search'
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
'list'
,
components
:{
Search
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
"文档引用"
,
author
:
"henq"
,
description
:
"document_ref 9/18/2020 11:31:43 AM"
,
},
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:{
op
:
"refName,name"
,
value
:
null
}
},
keys
:
{
op
:
"refName,name"
,
value
:
null
},
},
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
columns
:
[
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
)
,
hide
:
true
,
align
:
"left"
,
high
:
true
},
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"documentId"
,
title
:
this
.
l
(
"documentId"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"refName"
,
title
:
this
.
l
(
"refName"
)
,
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"refId"
,
title
:
this
.
l
(
"refId"
)
,
align
:
"left"
,
high
:
true
},
{
key
:
"name"
,
title
:
this
.
l
(
"name"
)
,
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
title
:
'操作'
,
key
:
'action'
,
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
},
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"documentId"
,
title
:
this
.
l
(
"documentId"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"refName"
,
title
:
this
.
l
(
"refName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"refId"
,
title
:
this
.
l
(
"refId"
),
align
:
"left"
,
high
:
true
},
{
key
:
"name"
,
title
:
this
.
l
(
"name"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
'center'
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
'div'
,
{
class
:
"action"
},
[
h
(
'op'
,
{
attrs
:
{
oprate
:
'detail'
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
.
id
)
}
},
'查看'
),
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
.
id
)
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h
(
'op'
,
{
attrs
:
{
oprate
:
'edit'
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
}
},
'编辑'
),
h
(
'op'
,
{
attrs
:
{
oprate
:
'delete'
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
},
'删除'
)
])
}
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
},
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
},
},
"删除"
),
]);
},
]
}
},
mounted
(){
],
};
},
mounted
()
{
console
.
log
(
this
);
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:{
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
()
this
.
modal
=
false
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
)
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
'./add'
)
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
'./add'
)
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
'./detail'
)
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
'./edit'
)
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
'删除成功'
)
this
.
$Message
.
success
(
"删除成功"
);
}
})
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
this
.
modal
=
false
;
},
l
(
key
)
{
/*
...
...
@@ -136,10 +223,10 @@ keys:{op:"refName,name",value:null}
}
*/
let
vkey
=
"document_ref"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
}
}
}
return
this
.
$t
(
vkey
)
||
key
;
},
}
,
}
;
</
script
>
<
style
lang=
"less"
>
</
style
>
\ No newline at end of file
pages/word/template/add.vue
View file @
4c0814bb
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<InputNumber
v-model=
"entity.status"
></InputNumber>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('creator')"
prop=
"creator"
>
<Input
v-model=
"entity.creator"
>
</Input>
</FormItem></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
>
</Input>
</FormItem></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('url')"
prop=
"url"
>
<InputFile
v-model=
"entity.url"
></InputFile>
</FormItem></Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.creationTime"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<InputNumber
v-model=
"entity.creatorUserId"
></InputNumber>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"date"
v-model=
"entity.lastModificationTime"
></DatePicker>
</FormItem>
</Col>
-->
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<InputNumber
v-model=
"entity.lastModifierUserId"
></InputNumber>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('isDeleted')"
prop=
"isDeleted"
>
<InputNumber
v-model=
"entity.isDeleted"
></InputNumber>
</FormItem>
</Col>
-->
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"date"
v-model=
"entity.deletionTime"
></DatePicker>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('deleterUserId')"
prop=
"deleterUserId"
>
<InputNumber
v-model=
"entity.deleterUserId"
></InputNumber>
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"word_template_status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('creator')"
prop=
"creator"
>
<Input
v-model=
"entity.creator"
></Input>
</FormItem>
</Col>
-->
<!--
<Col
:span=
"12"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"24"
>
<FormItem
:label=
"l('url')"
prop=
"url"
>
<!--
<InputFile
v-model=
"entity.url"
></InputFile>
-->
<files
ref=
"refFile"
:parms=
"parms"
files
/>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
</
template
>
<
script
>
import
Api
from
'./api'
export
default
{
name
:
'Add'
,
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
creationTime
:
null
,
creatorUserId
:
null
,
lastModificationTime
:
null
,
lastModifierUserId
:
null
,
isDeleted
:
null
,
deletionTime
:
null
,
deleterUserId
:
null
,
name
:
""
,
status
:
null
,
creator
:
""
,
remark
:
""
,
url
:
""
},
entity
:
{
creationTime
:
null
,
creatorUserId
:
null
,
lastModificationTime
:
null
,
lastModifierUserId
:
null
,
isDeleted
:
null
,
deletionTime
:
null
,
deleterUserId
:
null
,
name
:
""
,
status
:
null
,
creator
:
""
,
remark
:
""
,
url
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
parms
:
{
app
:
"material"
,
eid
:
null
,
name
:
""
,
field
:
""
,
},
};
},
props
:
{
v
:
Object
,
eid
:
Number
eid
:
Number
,
},
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
this
.
parms
.
eid
=
this
.
$u
.
guid
();
this
.
$refs
.
refFile
.
intFiles
();
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
).
then
((
r
)
=>
{
this
.
disabled
=
false
;
if
(
this
.
$refs
.
refFile
.
nameList
.
length
>
0
)
{
this
.
entity
.
url
=
this
.
parms
.
eid
;
}
else
{
// this.entity.filePath = "";
this
.
entity
.
url
=
""
;
}
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$emit
(
'on-ok'
)
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
'保存失败'
)
this
.
$Message
.
error
(
"保存失败"
);
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'保存失败'
)
console
.
warn
(
err
)
})
.
catch
((
err
)
=>
{
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
;
});
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"document_template"
+
"."
+
key
;
return
this
.
$t
(
key
)
}
return
this
.
$t
(
key
);
},
watch
:
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
}
}
}
</
script
>
\ No newline at end of file
watch
:
{},
};
</
script
>
\ No newline at end of file
pages/word/template/api.js
View file @
4c0814bb
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
technologyUr
l
}
documenttemplate/paged`
,
index
:
`
${
materia
l
}
documenttemplate/paged`
,
paged
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documenttemplate/paged`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documenttemplate/paged`
,
params
);
},
get
(
params
){
return
Api
.
get
(
`
${
technologyUr
l
}
documenttemplate/get`
,
params
);
return
Api
.
get
(
`
${
materia
l
}
documenttemplate/get`
,
params
);
},
create
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documenttemplate/create`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documenttemplate/create`
,
params
);
},
update
(
params
){
return
Api
.
post
(
`
${
technologyUr
l
}
documenttemplate/update`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documenttemplate/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
technologyUr
l
}
documenttemplate/delete`
,{
params
:{
id
:
id
}});
return
Api
.
delete
(
`
${
materia
l
}
documenttemplate/delete`
,{
params
:{
id
:
id
}});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
technologyUr
l
}
documenttemplate/batchdelete`
,
params
);
return
Api
.
post
(
`
${
materia
l
}
documenttemplate/batchdelete`
,
params
);
}
}
\ No newline at end of file
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