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
04223034
Commit
04223034
authored
Oct 16, 2020
by
骆瑛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导入功能
parent
56e60186
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
387 additions
and
410 deletions
+387
-410
add.vue
pages/system/project/atom/add.vue
+166
-148
api.js
pages/system/project/atom/api.js
+3
-0
edit.vue
pages/system/project/atom/edit.vue
+191
-218
index.vue
pages/system/project/atom/index.vue
+2
-2
add.vue
pages/system/project/project/add.vue
+2
-2
detail.vue
pages/system/project/project/detail.vue
+0
-19
index.vue
pages/system/project/project/index.vue
+23
-21
No files found.
pages/system/project/atom/add.vue
View file @
04223034
<
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('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem
></Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem
></Col>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<InputNumber
v-model=
"entity.upId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<InputNumber
v-model=
"entity.tenantId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<InputNumber
v-model=
"entity.inheritCategoryId"
></InputNumber>
</FormItem
></Col>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('projectId')"
prop=
"projectId"
>
<InputNumber
v-model=
"entity.projectId"
></InputNumber>
</FormItem
></Col>
-->
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
<Col
:span=
"12"
v-if=
"eid != 0"
>
<FormItem
label=
"扩展属性"
prop=
"inheritCategoryId"
>
<!--
<Checkbox
v-model=
"entity.inheritCategoryId"
></Checkbox>
-->
<RadioGroup
v-model=
"inherit"
>
<Radio
label=
"1"
>
继承
</Radio>
<Radio
label=
"0"
>
自定义
</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col
:span=
"24"
v-if=
"inherit == '0'"
>
<Row
v-if=
"upDrop"
>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<Col
:span=
"24"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
</Row>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
<Row
style=
"margin-bottom: 10px"
:gutter=
"10"
>
<Col
:span=
"6"
>
<AutoComplete
v-model=
"completeValue"
icon=
"ios-search"
placeholder=
"请搜索"
style=
"width: 100%"
>
<Option
v-for=
"option in completeList"
:value=
"option.name"
:key=
"option.id"
>
<span
class=
"demo-auto-complete-title"
>
{{
option
.
name
}}
</span>
<span
class=
"demo-auto-complete-count"
style=
"float: right"
>
{{
option
.
code
}}
</span>
</Option>
</AutoComplete>
</Col>
<Col
:span=
"2"
>
<Button
type=
"primary"
@
click=
"importColumns"
>
导入
</Button>
</Col>
</Row>
<Table
:columns=
"columns"
:data=
"checkList"
border
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType == 1 || row.fieldType == 2"
>
...
...
@@ -207,25 +156,31 @@
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew"
class=
"mt10"
<Button
type=
"dashed"
long
@
click=
"addNew
('{}')
"
class=
"mt10"
>
新增属性
</Button
>
</Col>
<Col
:span=
"24"
class=
"tr mt10"
>
<Col
:span=
"24"
class=
"tr mt10"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<
script
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[
{
...
...
@@ -347,16 +302,8 @@ export default {
align
:
"center"
,
},
],
inherit
:
this
.
eid
?
"1"
:
"0"
,
disabled
:
false
,
entity
:
{
// creationTime: null,
// creatorUserId: null,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
name
:
""
,
upId
:
null
,
level
:
null
,
...
...
@@ -375,6 +322,7 @@ export default {
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
...
...
@@ -383,15 +331,58 @@ export default {
eid
:
Number
,
},
mounted
()
{
this
.
seachChange
();
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
importColumns
()
{
//导入
let
changeId
=
{};
if
(
this
.
completeList
.
length
>
0
)
{
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
e
.
name
==
this
.
completeValue
)
{
changeId
=
e
;
this
.
completeList
.
splice
(
index
,
1
);
this
.
completeValue
=
""
;
}
});
this
.
addNew
(
changeId
);
}
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
});
},
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
//新增的删除,直接删
this
.
checkList
.
splice
(
index
,
1
);
let
objArr
=
{
name
:
row
.
title
,
code
:
row
.
code
,
id
:
row
.
id
,
};
this
.
completeList
.
push
(
objArr
);
}
else
{
row
.
action
=
2
;
//返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this
.
$set
(
this
.
checkList
,
index
,
row
);
...
...
@@ -402,7 +393,19 @@ export default {
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{
addNew
(
e
)
{
let
id
=
""
,
code
=
""
,
name
=
""
;
if
(
e
==
"{}"
)
{
id
=
""
;
code
=
""
;
name
=
""
;
}
else
{
id
=
e
.
id
;
code
=
e
.
code
;
name
=
e
.
name
;
}
let
maxId
=
0
;
this
.
checkList
.
map
((
u
)
=>
{
if
(
u
.
mid
>
maxId
)
{
...
...
@@ -410,9 +413,11 @@ export default {
}
});
let
obj
=
{
id
:
id
,
code
:
code
,
mid
:
maxId
+
1
,
field
:
"c"
+
maxId
,
title
:
""
,
title
:
name
,
note
:
""
,
unitName
:
""
,
dataType
:
0
,
...
...
@@ -429,7 +434,7 @@ export default {
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
Api
.
create
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
...
...
@@ -443,7 +448,6 @@ export default {
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
...
...
@@ -473,4 +477,18 @@ export default {
},
},
};
</
script
>
\ No newline at end of file
</
script
>
<
style
scoped
>
.textIcon
{
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#2d8cf0
;
border-radius
:
4px
;
text-align
:
center
;
color
:
#ffffff
;
}
.textIcon
:hover
{
opacity
:
0.7
;
}
</
style
>
>
pages/system/project/atom/api.js
View file @
04223034
...
...
@@ -4,6 +4,9 @@ export default {
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/paged`
,
params
);
},
list
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/projectatom/list`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/projectatom/get`
,
params
);
},
...
...
pages/system/project/atom/edit.vue
View file @
04223034
<
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('level')"
prop=
"level"
>
<Input
v-model=
"entity.level"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<!--
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Input
v-model=
"entity.type"
>
</Input>
</FormItem
>
-->
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<!--
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"entity.status"
>
</Input>
</FormItem
>
-->
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('content')"
prop=
"content"
>
<Input
v-model=
"entity.content"
>
</Input>
</FormItem
></Col>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<InputNumber
v-model=
"entity.upId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<InputNumber
v-model=
"entity.tenantId"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<InputNumber
v-model=
"entity.inheritCategoryId"
></InputNumber>
</FormItem
></Col>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<!--
<Col
:span=
"12"
><FormItem
:label=
"l('projectId')"
prop=
"projectId"
>
<InputNumber
v-model=
"entity.projectId"
></InputNumber>
</FormItem
></Col>
-->
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
<Col
:span=
"12"
v-if=
"eid != 0"
>
<FormItem
label=
"扩展属性"
prop=
"inheritCategoryId"
>
<!--
<Checkbox
v-model=
"entity.inheritCategoryId"
></Checkbox>
-->
<RadioGroup
v-model=
"inherit"
>
<Radio
label=
"1"
>
继承
</Radio>
<Radio
label=
"0"
>
自定义
</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col
:span=
"24"
v-if=
"inherit == '0'"
>
<Row
v-if=
"upDrop"
>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"base.project_atom.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"entity.englishFullName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"entity.englishName"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"entity.code"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<InputNumber
v-model=
"entity.version"
></InputNumber>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<Col
:span=
"24"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
</Row>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
<Row
style=
"margin-bottom: 10px"
:gutter=
"10"
>
<Col
:span=
"6"
>
<AutoComplete
v-model=
"completeValue"
icon=
"ios-search"
placeholder=
"请搜索"
style=
"width: 100%"
>
<Option
v-for=
"option in completeList"
:value=
"option.name"
:key=
"option.code"
>
<span
class=
"demo-auto-complete-title"
>
{{
option
.
name
}}
</span>
<span
class=
"demo-auto-complete-count"
style=
"float: right"
>
{{
option
.
code
}}
</span>
</Option>
</AutoComplete>
</Col>
<Col
:span=
"2"
>
<Button
type=
"primary"
@
click=
"importColumns"
>
导入
</Button>
</Col>
</Row>
<Table
:columns=
"columns"
:data=
"checkList"
border
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType == 1 || row.fieldType == 2"
>
...
...
@@ -150,7 +97,6 @@
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<!--
<Input
v-if=
"row.dataType==3"
v-model=
"row.note"
placeholder=
"请输入字典编码"
@
on-blur=
"setRow(row,index)"
/>
-->
<Select
v-if=
"row.dataType == 3"
v-model=
"row.note"
...
...
@@ -207,21 +153,22 @@
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
>
删除
</a>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew"
class=
"mt10"
<Button
type=
"dashed"
long
@
click=
"addNew
('{}')
"
class=
"mt10"
>
新增属性
</Button
>
</Col>
<Col
:span=
"24"
class=
"tr mt10"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</template>
<
script
>
...
...
@@ -230,74 +177,13 @@ export default {
name
:
"Edit"
,
data
()
{
return
{
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[
{
field
:
"code"
,
title
:
"编号"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
1
,
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"version"
,
title
:
"版本"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"secret"
,
title
:
"密级"
,
note
:
""
,
dataType
:
3
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"name"
,
title
:
"标题"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
//共有属性(不能删除)
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"description"
,
title
:
"文档详细说明"
,
note
:
""
,
dataType
:
8
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
//共有属性(不能删除)
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
],
checkList
:
[],
columns
:
[
{
title
:
"序号"
,
...
...
@@ -351,11 +237,11 @@ export default {
align
:
"center"
,
},
],
inherit
:
this
.
eid
?
"1"
:
"0"
,
disabled
:
false
,
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
...
...
@@ -365,13 +251,59 @@ export default {
mounted
()
{
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
this
.
seachChange
();
}
},
methods
:
{
remove
(
index
,
row
)
{
importColumns
()
{
//导入
let
changeId
=
{};
if
(
this
.
completeList
.
length
>
0
)
{
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
e
.
name
==
this
.
completeValue
)
{
changeId
=
e
;
this
.
completeList
.
splice
(
index
,
1
);
this
.
completeValue
=
""
;
}
});
this
.
addNew
(
changeId
);
}
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
})
.
catch
((
err
)
=>
{});
},
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
//新增的删除,直接删
this
.
checkList
.
splice
(
index
,
1
);
let
objArr
=
{
name
:
row
.
title
,
code
:
row
.
code
,
id
:
row
.
id
,
};
this
.
completeList
.
push
(
objArr
);
}
else
{
row
.
action
=
2
;
//返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this
.
$set
(
this
.
checkList
,
index
,
row
);
...
...
@@ -382,7 +314,19 @@ export default {
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{
addNew
(
e
)
{
let
id
=
""
,
code
=
""
,
name
=
""
;
if
(
e
==
"{}"
)
{
id
=
""
;
code
=
""
;
name
=
""
;
}
else
{
id
=
e
.
id
;
code
=
e
.
code
;
name
=
e
.
name
;
}
let
maxId
=
0
;
this
.
checkList
.
map
((
u
)
=>
{
if
(
u
.
mid
>
maxId
)
{
...
...
@@ -390,9 +334,11 @@ export default {
}
});
let
obj
=
{
id
:
id
,
code
:
code
,
mid
:
maxId
+
1
,
field
:
"c"
+
maxId
,
title
:
""
,
title
:
name
,
note
:
""
,
unitName
:
""
,
dataType
:
0
,
...
...
@@ -408,12 +354,26 @@ export default {
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
checkList
=
JSON
.
parse
(
r
.
result
.
content
);
this
.
checkList
.
map
((
v
)
=>
{
if
(
v
.
fieldType
>
1
)
{
v
.
fieldType
=
1
;
}
this
.
completeList
.
map
((
e
,
index
)
=>
{
if
(
v
.
title
==
e
.
name
)
{
this
.
completeList
.
splice
(
index
,
1
);
}
});
});
console
.
log
(
this
.
checkList
);
console
.
log
(
this
.
completeList
);
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
Api
.
update
(
this
.
entity
)
.
then
((
r
)
=>
{
this
.
disabled
=
false
;
...
...
@@ -427,7 +387,6 @@ export default {
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
...
...
@@ -448,4 +407,18 @@ export default {
},
},
};
</
script
>
\ No newline at end of file
</
script
>
<
style
scoped
>
.textIcon
{
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#2d8cf0
;
border-radius
:
4px
;
text-align
:
center
;
color
:
#ffffff
;
}
.textIcon
:hover
{
opacity
:
0.7
;
}
</
style
>
>
\ No newline at end of file
pages/system/project/atom/index.vue
View file @
04223034
...
...
@@ -113,7 +113,7 @@ export default {
easy
:
true
,
high
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
'base.project_atom.status'
},
// { key: "upId", title: this.l("upId"), align: "left", high: true },
// { key: "level", title: this.l("level"), align: "left", high: true },
// {
...
...
@@ -122,7 +122,7 @@ export default {
// align: "left",
// high: true,
// },
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
'base.project_atom.type'
},
{
key
:
"englishFullName"
,
title
:
this
.
l
(
"englishFullName"
),
...
...
pages/system/project/project/add.vue
View file @
04223034
...
...
@@ -57,7 +57,7 @@
<Input
v-model=
"entity.type"
>
</Input>
</FormItem
>
-->
<FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
code=
"project.type"
v-model=
"entity.type"
></Dictionary>
<Dictionary
code=
"
base.
project.type"
v-model=
"entity.type"
></Dictionary>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
...
...
@@ -78,7 +78,7 @@
<Input
v-model=
"entity.status"
>
</Input>
</FormItem
>
-->
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"project.status"
v-model=
"entity.status"
></Dictionary>
<Dictionary
code=
"
base.
project.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
...
...
pages/system/project/project/detail.vue
View file @
04223034
<
template
>
<div
class=
"detail"
>
<Row>
<!--
<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('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('upId')"
>
{{
entity
.
upId
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('level')"
>
{{
entity
.
level
}}
</Filed>
...
...
pages/system/project/project/index.vue
View file @
04223034
...
...
@@ -116,15 +116,25 @@ export default {
easy
:
true
,
high
:
true
,
},
{
key
:
"upId"
,
title
:
this
.
l
(
"upId"
),
align
:
"left"
,
high
:
true
},
{
key
:
"level"
,
title
:
this
.
l
(
"level"
),
align
:
"left"
,
high
:
true
},
{
key
:
"tenantId"
,
title
:
this
.
l
(
"tenantId"
),
// { key: "upId", title: this.l("upId"), align: "left", high: true },
// { key: "level", title: this.l("level"), align: "left", high: true },
// {
// key: "tenantId",
// title: this.l("tenantId"),
// align: "left",
// high: true,
// },
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
code
:
"project.base.code"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"project.base.type"
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project.type"
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project.status"
},
{
key
:
"englishFullName"
,
title
:
this
.
l
(
"englishFullName"
),
...
...
@@ -139,21 +149,13 @@ export default {
easy
:
true
,
high
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
"project.base.status"
},
{
key
:
"inheritCategoryId"
,
title
:
this
.
l
(
"inheritCategoryId"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
code
:
"project.base.code"
,
easy
:
true
,
high
:
true
,
},
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// align: "left",
// high: true,
// },
{
key
:
"module"
,
title
:
this
.
l
(
"module"
),
align
:
"left"
,
high
:
true
},
{
title
:
"操作"
,
...
...
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