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
03245e5d
Commit
03245e5d
authored
Sep 27, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档分类选择模板,分类前加图标
parent
590fddf4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
136 deletions
+105
-136
zh-CN.js
i18n/locale/zh-CN.js
+3
-2
add.vue
pages/word/classification/add.vue
+36
-50
edit.vue
pages/word/classification/edit.vue
+34
-28
index.vue
pages/word/document/index.vue
+25
-40
add.vue
pages/word/template/add.vue
+3
-13
edit.vue
pages/word/template/edit.vue
+4
-3
No files found.
i18n/locale/zh-CN.js
View file @
03245e5d
...
...
@@ -1733,8 +1733,9 @@ export default {
englishName
:
'英文简称'
,
status
:
''
,
inheritCategoryId
:
'继承'
,
//继承分类id
template
:
'上传模板'
,
//模板路径
templateId
:
''
,
url
:
'上传模板'
,
//模板路径
template
:
''
,
//模板路径
templateId
:
'选择模板'
,
status
:
'状态'
,
description
:
'备注'
},
...
...
pages/word/classification/add.vue
View file @
03245e5d
...
...
@@ -57,23 +57,14 @@
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('template')"
prop=
"template"
>
<!--
<Input
v-model=
"entity.template"
type=
"textarea"
:rows=
"5"
></Input>
-->
<inputFile
class=
"tphoto"
ref=
"refmovieFile1"
v-model=
"imgName"
:parms=
"parmsName"
files
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('template')"
prop=
"template"
>
<!--
<Input
v-model=
"entity.template"
type=
"textarea"
:rows=
"5"
></Input>
-->
<Select
v-model=
"template"
@
on-select-change=
"setTemplate"
>
<FormItem
:label=
"l('templateId')"
prop=
"templateId"
>
<Select
v-model=
"entity.templateId"
@
on-change=
"setTemplate"
clearable
filterable
>
<Option
v-for=
"(t, i) in templates"
:key=
"i"
:value=
"t.id"
>
{{
t
.
name
}}
</Option>
...
...
@@ -180,11 +171,8 @@ export default {
name
:
"Add"
,
data
()
{
return
{
imgName
:
""
,
parmsName
:
"app=material&eid=1&name=documentTemplate"
,
codeList
:
[],
temlplates
:
[],
template
:
null
,
templates
:
[],
entity
:
{
creatorUserId
:
this
.
$store
.
state
.
userInfo
.
userId
,
name
:
""
,
...
...
@@ -324,12 +312,12 @@ export default {
align
:
"center"
,
},
],
parms
:
{
app
:
"material"
,
eid
:
null
,
name
:
""
,
field
:
""
,
},
//
parms: {
//
app: "material",
//
eid: null,
//
name: "",
//
field: "",
//
},
};
},
props
:
{
...
...
@@ -339,8 +327,7 @@ export default {
mounted
()
{
this
.
tebleSet
();
this
.
loadTemplate
();
this
.
parms
.
eid
=
this
.
$u
.
guid
();
this
.
$refs
.
refFile
.
intFiles
();
},
methods
:
{
tebleSet
()
{
...
...
@@ -358,11 +345,17 @@ export default {
};
Api
.
filesList
(
data
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
// this.templates = r.result;
this
.
templates
=
r
.
result
.
items
;
}
});
},
setTemplate
(
a
)
{
this
.
templates
.
forEach
((
r
)
=>
{
if
(
a
==
r
.
id
)
{
this
.
entity
.
template
=
r
.
name
;
}
});
},
setTemplate
()
{},
addNew
()
{
let
maxId
=
0
;
this
.
checkList
.
map
((
u
)
=>
{
...
...
@@ -403,18 +396,18 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
if
(
this
.
$refs
.
refFile
.
nameList
.
length
>
0
)
{
let
nameList
=
this
.
$refs
.
refFile
.
nameList
;
let
names
=
[];
nameList
.
forEach
((
e
)
=>
{
names
.
push
(
e
.
fileName
);
});
this
.
entity
.
templateId
=
this
.
parms
.
eid
;
this
.
entity
.
template
=
names
.
join
(
","
);
}
else
{
// this.entity.filePath = "";
this
.
entity
.
templateId
=
""
;
}
//
if (this.$refs.refFile.nameList.length > 0) {
//
let nameList = this.$refs.refFile.nameList;
//
let names = [];
//
nameList.forEach((e) => {
//
names.push(e.fileName);
//
});
//
this.entity.templateId = this.parms.eid;
//
this.entity.template = names.join(",");
//
} else {
//
// this.entity.filePath = "";
//
this.entity.templateId = "";
//
}
if
(
this
.
row
.
id
)
{
this
.
entity
.
upId
=
this
.
row
.
id
;
this
.
entity
.
level
=
this
.
row
.
level
;
...
...
@@ -460,14 +453,7 @@ export default {
},
},
watch
:
{
// v() {
// this.entity = this.$u.clone(this.v);
// },
// eid(v) {
// if (v > 0) {
// this.load(v);
// }
// },
},
};
</
script
>
\ No newline at end of file
pages/word/classification/edit.vue
View file @
03245e5d
...
...
@@ -59,23 +59,20 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('template')"
prop=
"template"
>
<!--
<Input
v-model=
"entity.template"
type=
"textarea"
:rows=
"5"
></Input>
-->
<inputFile
class=
"tphoto"
ref=
"refmovieFile1"
v-model=
"imgName"
:parms=
"parmsName"
files
/>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('template')"
prop=
"templateId"
>
<!--
<Input
v-model=
"entity.template"
type=
"textarea"
:rows=
"5"
></Input>
-->
<files
ref=
"refFile"
:parms=
"parms"
files
/>
<FormItem
:label=
"l('templateId')"
prop=
"templateId"
>
<Select
v-model=
"entity.templateId"
@
on-change=
"setTemplate"
clearable
filterable
>
<Option
v-for=
"(t, i) in templates"
:key=
"i"
:value=
"t.id"
>
{{
t
.
name
}}
</Option>
</Select>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
<FormItem
:label=
"l('templateId')"
prop=
"templateId"
>
<Input
v-model=
"entity.templateId"
></Input>
...
...
@@ -176,13 +173,13 @@ export default {
name
:
"Edit"
,
data
()
{
return
{
imgName
:
""
,
parmsName
:
"app=material&eid=1&name=documentTemplate"
,
codeList
:
[],
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
templates
:
[],
inherit
:
null
,
checkList
:
[
{
...
...
@@ -304,12 +301,6 @@ export default {
align
:
"center"
,
},
],
parms
:
{
app
:
"material"
,
eid
:
null
,
name
:
""
,
field
:
""
,
},
};
},
props
:
{
...
...
@@ -317,11 +308,31 @@ export default {
},
mounted
()
{
this
.
tebleSet
();
this
.
loadTemplate
();
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
loadTemplate
()
{
let
data
=
{
pageIndex
:
1
,
pageSize
:
100
,
conditions
:
[],
};
Api
.
filesList
(
data
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
this
.
templates
=
r
.
result
.
items
;
}
});
},
setTemplate
(
a
)
{
this
.
templates
.
forEach
((
r
)
=>
{
if
(
a
==
r
.
id
)
{
this
.
entity
.
template
=
r
.
name
;
}
});
},
tebleSet
()
{
Api
.
getChildren
({
id
:
582
}).
then
((
r
)
=>
{
if
(
r
.
result
)
{
...
...
@@ -332,7 +343,7 @@ export default {
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
parms
.
eid
=
r
.
result
.
templateId
;
// this.entity.templateId = r.result.template
;
if
(
r
.
result
.
inheritCategoryId
==
0
)
{
this
.
inherit
=
"0"
;
}
else
{
...
...
@@ -398,11 +409,6 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
if
(
this
.
$refs
.
refFile
.
nameList
.
length
>
0
)
{
this
.
entity
.
templateId
=
this
.
parms
.
eid
;
}
else
{
this
.
entity
.
templateId
=
""
;
}
if
(
this
.
inherit
==
0
)
{
this
.
entity
.
inheritCategoryId
=
0
;
}
else
{
...
...
pages/word/document/index.vue
View file @
03245e5d
...
...
@@ -127,6 +127,7 @@ export default {
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
// console.log(this.list);
});
},
toggle
()
{
...
...
@@ -141,7 +142,7 @@ export default {
},
change
(
a
,
b
)
{
// console.log(a)
console
.
log
(
b
);
//
console.log(b);
this
.
treeId
=
b
.
id
;
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
...
...
@@ -166,47 +167,31 @@ export default {
this
.
ids
=
ids
;
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
return
h
(
"span"
,
{
on
:
{
click
:
()
=>
{
this
.
handleSelect
(
root
,
data
);
//手动选择树节点
},
let
type
=
""
;
if
(
data
.
type
==
0
)
{
type
=
"md-folder"
;
}
else
if
(
data
.
type
==
1
)
{
type
=
"ios-copy"
;
}
else
{
type
=
"ios-book"
;
}
return
h
(
"span"
,
[
h
(
"Icon"
,
{
props
:
{
type
:
type
,
},
},
data
.
title
);
},
handleSelect
(
root
,
data
)
{
// let pid = -1; //定义最顶级id
// var pname = "";
// var upId = data.upId;
// let roots = root;
// function addId(roots, upId) {
// roots.map((u) => {
// if (u.node.id == upId) {
// if (u.node.upId == 0) {
// pid = u.node.id;
// pname = u.node.name;
// } else {
// upId = u.node.upId;
// addId(roots, upId);
// }
// }
// });
// }
// addId(roots, upId);
// this.nodeInfo.categoryId = data.id;
// this.nodeInfo.rootCategoryName = data.name;
// if (pid == -1) {
// this.nodeInfo.rootCategoryId = data.id;
// this.nodeInfo.rootCategoryName = data.name;
// } else {
// this.nodeInfo.rootCategoryId = pid;
// this.nodeInfo.rootCategoryName = pname;
// }
style
:
{
marginRight
:
"8px"
,
},
}),
h
(
"span"
,
data
.
title
),
]);
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
...
...
pages/word/template/add.vue
View file @
03245e5d
...
...
@@ -92,8 +92,7 @@ export default {
status
:
1
,
creator
:
""
,
remark
:
""
,
template
:
""
,
//上传名称
templateId
:
""
,
//上传id
url
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
...
...
@@ -105,19 +104,11 @@ export default {
v
:
Object
,
eid
:
Number
,
},
mounted
()
{
// this.parms.eid = this.$u.guid();
// this.$refs.refFile.intFiles();
},
mounted
()
{},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
// if (this.$refs.refFile.nameList.length > 0) {
// this.entity.url = this.parms.eid;
// } else {
// this.entity.url = "";
// }
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
...
...
@@ -147,8 +138,7 @@ export default {
imgName
(
newName
,
oldName
)
{
if
(
newName
!=
""
)
{
const
imgPathsArr
=
JSON
.
parse
(
newName
);
this
.
entity
.
templateId
=
imgPathsArr
[
0
].
filePath
;
this
.
entity
.
template
=
imgPathsArr
[
0
].
fileName
;
this
.
entity
.
url
=
imgPathsArr
[
0
].
filePath
;
}
},
},
...
...
pages/word/template/edit.vue
View file @
03245e5d
...
...
@@ -56,6 +56,7 @@
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
{{
imgName
}}
<FormItem
:label=
"l('url')"
prop=
"url"
>
<inputFile
class=
"tphoto"
...
...
@@ -104,7 +105,8 @@ export default {
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
imgName
=
r
.
result
.
templateId
;
this
.
entity
.
url
=
r
.
result
.
url
;
this
.
imgName
=
r
.
result
.
url
;
});
},
handleSubmit
()
{
...
...
@@ -138,8 +140,7 @@ export default {
imgName
(
newName
,
oldName
)
{
if
(
newName
!=
""
)
{
const
imgPathsArr
=
JSON
.
parse
(
newName
);
this
.
entity
.
templateId
=
imgPathsArr
[
0
].
filePath
;
this
.
entity
.
template
=
imgPathsArr
[
0
].
fileName
;
this
.
entity
.
url
=
imgPathsArr
[
0
].
filePath
;
}
},
eid
(
v
)
{
...
...
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