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
1c31b6a6
Commit
1c31b6a6
authored
Nov 04, 2020
by
luo ying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
247ad9d1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
3517 additions
and
0 deletions
+3517
-0
add.vue
pages/system/project/atom/add.vue
+676
-0
detail.vue
pages/system/project/atom/detail.vue
+233
-0
index.vue
pages/system/project/atom/dtos/index.vue
+499
-0
inputDto.vue
pages/system/project/atom/dtos/inputDto.vue
+197
-0
outDto.vue
pages/system/project/atom/dtos/outDto.vue
+319
-0
edit.vue
pages/system/project/atom/edit.vue
+441
-0
index.vue
pages/system/project/atom/index.vue
+224
-0
search.vue
pages/system/project/atom/search.vue
+144
-0
index.vue
pages/system/project/index.vue
+39
-0
add.vue
pages/system/project/project/add.vue
+132
-0
api.js
pages/system/project/project/api.js
+25
-0
detail.vue
pages/system/project/project/detail.vue
+64
-0
edit.vue
pages/system/project/project/edit.vue
+141
-0
index.vue
pages/system/project/project/index.vue
+252
-0
search.vue
pages/system/project/project/search.vue
+131
-0
No files found.
pages/system/project/atom/add.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<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('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=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
code=
"base.project_atom.status"
v-model=
"entity.status"
type=
"radio"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<Row>
<Col
:span=
"24"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
</Row>
<Row
style=
"margin-top: 10px"
>
<Tabs>
<TabPane
label=
"实体定义"
name=
"base"
>
</TabPane>
<!--
<TabPane
v-for=
"tab in dtos"
:key=
"tab.code"
:label=
"tab.name"
>
</TabPane>
-->
<!--
<Button
@
click=
"modal1 = true"
size=
"small"
slot=
"extra"
>
增加
</Button
>
-->
<!--
<Modal
v-model=
"modal1"
title=
"增加"
@
on-ok=
"okModal('formline')"
@
on-cancel=
"cancelModal('formline')"
>
<Form
:model=
"formline"
ref=
"formline"
:rules=
"ruleInline"
:label-width=
"80"
>
<p>
<FormItem
label=
"名称:"
prop=
"name"
>
<Input
v-model=
"formline.name"
placeholder=
"请输入名称"
></Input>
</FormItem>
</p>
<p>
<FormItem
label=
"编码:"
prop=
"code"
>
<Input
v-model=
"formline.code"
placeholder=
"请输入编码"
></Input>
</FormItem>
</p>
</Form>
</Modal>
-->
</Tabs>
</Row>
<component
:is=
"detail"
:list=
"checkList"
:dtosList=
"dtos"
@
dtos=
"getDtos"
@
onchange=
"oncheckList"
/>
<!--
<Row>
-->
<!--
<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=
"columns1"
:data=
"checkList"
border
:draggable=
"true"
@
on-drag-drop=
"onDragDrop"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<Input
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<Input
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dbColumnName"
>
<Input
v-model=
"row.dbColumnName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.code"
:disabled=
"row.dataType != 3 && row.dataType != 10"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isNullable"
>
<Checkbox
v-model=
"row.isNullable"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unit"
>
<Dictionary
:disabled=
"row.dataType != 0 && row.dataType != 8"
@
on-change=
"setRow(row, index)"
v-model=
"row.unit"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"length"
>
<Input
:disabled=
"row.dataType != 0 && row.dataType != 8"
v-model=
"row.length"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"systemName"
>
<state
code=
"project.main.systemName"
:value=
"row.systemName"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"list"
>
<Checkbox
v-model=
"row.list"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"add"
>
<Checkbox
v-model=
"row.add"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"uniqueness"
>
<Checkbox
v-model=
"row.uniqueness"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"defaultValue"
>
<Input
v-model=
"row.defaultValue"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
-->
<!-- </Row> -->
</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>
</Row>
</Form>
</template>
<
script
>
// import Dtos from "./dtos"
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
detail
:
null
,
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
systemValue
:
0
,
columns1
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
70
,
align
:
"center"
,
},
{
title
:
"名称(*)"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
width
:
150
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
150
,
high
:
true
,
},
{
title
:
"字段名称"
,
key
:
"dbColumnName"
,
align
:
"center"
,
slot
:
"dbColumnName"
,
width
:
150
,
high
:
true
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"字段名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"属性(*)"
,
align
:
"center"
,
key
:
"propertyName"
,
slot
:
"propertyName"
,
high
:
false
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"属性("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"关联"
,
key
:
"code"
,
align
:
"center"
,
slot
:
"code"
,
},
{
title
:
"单位"
,
key
:
"unit"
,
align
:
"center"
,
slot
:
"unit"
,
},
{
title
:
"长度"
,
key
:
"length"
,
align
:
"center"
,
slot
:
"length"
,
},
{
title
:
"业务类型"
,
key
:
"systemName"
,
align
:
"center"
,
slot
:
"systemName"
,
width
:
190
,
},
{
title
:
"是否可空"
,
key
:
"isNullable"
,
align
:
"center"
,
slot
:
"isNullable"
,
width
:
100
,
},
{
title
:
"业务设置"
,
align
:
"center"
,
children
:
[
{
title
:
"列表"
,
key
:
"list"
,
align
:
"center"
,
slot
:
"list"
,
width
:
70
,
},
{
title
:
"新增"
,
key
:
"add"
,
align
:
"center"
,
slot
:
"add"
,
width
:
70
,
},
{
title
:
"唯一"
,
key
:
"uniqueness"
,
align
:
"center"
,
slot
:
"uniqueness"
,
width
:
70
,
},
{
title
:
"默认值"
,
key
:
"defaultValue"
,
align
:
"center"
,
slot
:
"defaultValue"
,
},
],
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
disabled
:
false
,
entity
:
{
name
:
""
,
upId
:
null
,
level
:
null
,
tenantId
:
null
,
type
:
0
,
englishFullName
:
""
,
englishName
:
""
,
status
:
null
,
description
:
""
,
inheritCategoryId
:
null
,
code
:
""
,
dtos
:
""
,
module
:
""
,
version
:
null
,
projectId
:
null
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"请填写名称"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"请填写编码"
,
trigger
:
"blur"
}],
// type:[{ required: true, message: '请选择类别', trigger: 'change' }]
},
// content:{
// base:[]
// },
dtos
:[]
};
},
props
:
{
v
:
Object
,
eid
:
Number
,
},
mounted
()
{
// this.seachChange();
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
this
.
detail
=
()
=>
import
(
'./dtos'
)
},
methods
:
{
oncheckList
(
v
)
{
this
.
checkList
=
v
;
},
getDtos
(
v
)
{
console
.
log
(
"getDtos"
,
v
)
this
.
dtos
=
v
;
},
// onDragDrop(a, b) {
// this.checkList.splice(b, 0, ...this.checkList.splice(a, 1));
// },
// 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(1, 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.columnDescription,
// // code: row.code,
// // id: row.id,
// // };
// // this.completeList.push(objArr);
// } else {
// row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
// this.$set(this.checkList, index, row);
// this.arr.push(row);
// this.checkList.splice(index, 1);
// }
// },
// setRow(row, index) {
// if (row.dataType == 0 || row.dataType == 8) {
// row.length = 50;
// }else{
// row.length = 0;
// }
// if (row.dbColumnName=="") {
// row.propertyName = row.dbColumnName;
// }
// this.$set(this.checkList, index, row);
// },
// addNew(index, e) {
// let name = "",
// flag = false;
// if (index == 0 && e == "{}") {
// this.checkList.forEach((s, index) => {
// if (s.columnDescription == "") {
// this.$Message.warning("请填写表格名称!");
// return (flag = true);
// }
// if (s.propertyName == "") {
// this.$Message.warning("请填写表格属性!");
// return (flag = true);
// }
// });
// if (flag == true) {
// return;
// }
// let obj = {
// dbColumnName: "",
// systemName: this.systemValue,
// columnDescription: name,
// defaultValue: "",
// isNullable: false,
// unit: 0,
// link: 0,
// dataType: 0,
// isKey: false, // 是否主键
// length: 50,
// propertyName: "", //程序中的字段名称
// propertyType: "", // 程序中的字段类型
// fieldType: 3,
// action: 1,
// add: 0, //新增标识
// };
// this.checkList.push(obj);
// } else if (index == 1 && JSON.stringify(e) != "{}") {
// JSON.parse(e.content).map((item) => {
// this.checkList.push(item);
// });
// } else {
// this.$Message.warning("请选择导入字段!");
// return;
// }
// },
handleSubmit
()
{
debugger
let
keys
=
false
;
let
name
=
""
;
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
keys
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
keys
=
true
);
}
});
if
(
this
.
checkList
.
length
>=
2
)
{
for
(
var
i
=
1
;
i
<
this
.
checkList
.
length
;
i
++
)
{
if
(
this
.
checkList
[
0
].
columnDescription
==
this
.
checkList
[
i
].
columnDescription
)
{
this
.
$Message
.
error
(
"表格名称重复!"
);
return
(
keys
=
true
);
}
if
(
this
.
checkList
[
0
].
propertyName
==
this
.
checkList
[
i
].
propertyName
)
{
this
.
$Message
.
error
(
"表格属性重复!"
);
return
(
keys
=
true
);
}
}
}
if
(
keys
==
true
)
{
return
;
}
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
if
(
this
.
checkList
)
{
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
}
else
{
this
.
checkList
=
[];
}
if
(
this
.
dtos
)
{
this
.
entity
.
dtos
=
JSON
.
stringify
(
this
.
dtos
);
}
else
{
this
.
dtos
=
[];
}
console
.
log
(
"this.entity"
,
this
.
entity
)
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
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
content
=
this
.
checkList
;
this
.
entity
.
id
=
0
;
});
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
"entity.type"
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
==
0
)
{
this
.
systemValue
=
0
;
}
else
if
(
newVal
==
1
)
{
this
.
systemValue
=
1
;
}
},
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
},
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
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/detail.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div
class=
"detail"
>
<Row
v-if=
"upDrop"
>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('level')"
>
{{
entity
.
level
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
>
{{
entity
.
type
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishFullName')"
>
{{
entity
.
englishFullName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishName')"
>
{{
entity
.
englishName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('status')"
>
{{
entity
.
status
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('module')"
>
{{
entity
.
module
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('version')"
>
{{
entity
.
version
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('description')"
>
{{
entity
.
description
}}
</Filed>
</Row>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<div
class=
"textIcon"
@
click=
"upClick(upDrop)"
>
<Icon
:type=
"iconType"
/>
{{
textUp
}}
</div>
</Row>
<Row>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
<Table
:columns=
"columns"
:data=
"checkList"
border
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div>
{{
row
.
title
}}
</div>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<Select
v-model=
"row.note"
clearable
transfer
disabled
>
<Option
v-for=
"item in codeList"
:value=
"item.code"
:key=
"item.code"
>
{{
item
.
name
}}
</Option
>
</Select>
<span>
{{
row
.
note
}}
</span>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
disabled
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unitName"
>
<Dictionary
disabled
v-model=
"row.unitName"
code=
"material.main.unitName"
type=
"select"
placeholder=
"请选择单位"
:value=
"row.unitName"
:key=
"row.unitName"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
{{
row
.
required
}}
<!--
<Checkbox
v-model=
"row.required"
disabled
></Checkbox>
-->
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isUnique"
>
{{
row
.
isUnique
}}
<!--
<Checkbox
v-model=
"row.isUnique"
disabled
></Checkbox>
-->
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a>
</
template
>
</Table>
</Row>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
columns
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
80
,
align
:
"center"
,
},
{
title
:
"属性名称"
,
key
:
"title"
,
slot
:
"title"
,
},
{
title
:
"属性类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
200
,
},
{
title
:
"设置"
,
key
:
"note"
,
align
:
"center"
,
slot
:
"note"
,
},
{
title
:
"单位"
,
key
:
"unitName"
,
align
:
"center"
,
slot
:
"unitName"
,
width
:
"150"
,
},
{
title
:
"必填"
,
key
:
"required"
,
align
:
"center"
,
slot
:
"required"
,
width
:
80
,
},
{
title
:
"唯一"
,
key
:
"isUnique"
,
align
:
"center"
,
slot
:
"isUnique"
,
width
:
80
,
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
entity
:
{},
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
);
this
.
seachChange
();
}
},
methods
:
{
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
this
.
entity
=
r
.
result
;
this
.
checkList
=
JSON
.
parse
(
r
.
result
.
content
);
console
.
log
(
this
.
checkList
);
this
.
checkList
.
map
((
v
)
=>
{
if
(
v
.
fieldType
>
1
)
{
v
.
fieldType
=
1
;
}
});
this
.
$emit
(
"on-load"
);
});
},
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
})
.
catch
((
err
)
=>
{});
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
<
style
scoped
>
.textIcon
{
margin-top
:
10px
;
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/dtos/index.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div>
<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=
"columns1"
:data=
"checkList"
border
:draggable=
"true"
@
on-drag-drop=
"onDragDrop"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<Input
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<Input
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dbColumnName"
>
<Input
v-model=
"row.dbColumnName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"code"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.code"
v-if=
"row.dataType == 3 || row.dataType == 10"
placeholder=
"请输入"
/>
<div
v-else
>
{{
row
.
code
}}
</div>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isNullable"
>
<Checkbox
v-model=
"row.isNullable"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unit"
>
<Dictionary
v-if=
"row.dataType == 1 || row.dataType == 2"
@
on-change=
"setRow(row, index)"
v-model=
"row.unit"
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
<div
v-else
>
{{
row
.
unit
}}
</div>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"length"
>
<Input
:disabled=
"row.dataType != 0 && row.dataType != 8"
v-model=
"row.length"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"systemName"
>
<state
code=
"project.main.systemName"
:value=
"row.systemName"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"list"
>
<Checkbox
v-model=
"row.list"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"add"
>
<Checkbox
v-model=
"row.add"
@
on-change=
"setRow(row, index)"
>
</Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"uniqueness"
>
<Checkbox
v-model=
"row.uniqueness"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"defaultValue"
>
<Input
v-model=
"row.defaultValue"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
checkList
:
this
.
list
,
completeValue
:
""
,
completeList
:
[],
columns1
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
70
,
align
:
"center"
,
},
{
title
:
"名称(*)"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
width
:
150
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"类型"
,
key
:
"dataType"
,
align
:
"center"
,
slot
:
"dataType"
,
width
:
150
,
high
:
true
,
},
{
title
:
"字段名称"
,
key
:
"dbColumnName"
,
align
:
"center"
,
slot
:
"dbColumnName"
,
width
:
200
,
high
:
true
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"字段名称("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"属性(*)"
,
align
:
"center"
,
key
:
"propertyName"
,
slot
:
"propertyName"
,
width
:
200
,
high
:
false
,
renderHeader
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
[
h
(
"span"
,
"属性("
),
h
(
"span"
,
{
style
:
{
color
:
"red"
}
},
"*"
),
h
(
"span"
,
")"
),
]);
},
},
{
title
:
"关联"
,
key
:
"code"
,
align
:
"center"
,
slot
:
"code"
,
},
{
title
:
"单位"
,
key
:
"unit"
,
align
:
"center"
,
slot
:
"unit"
,
},
{
title
:
"长度"
,
key
:
"length"
,
align
:
"center"
,
slot
:
"length"
,
width
:
100
,
},
{
title
:
"业务类型"
,
key
:
"systemName"
,
align
:
"center"
,
slot
:
"systemName"
,
width
:
190
,
},
{
title
:
"是否可空"
,
key
:
"isNullable"
,
align
:
"center"
,
slot
:
"isNullable"
,
width
:
100
,
},
{
title
:
"业务设置"
,
align
:
"center"
,
children
:
[
{
title
:
"列表"
,
key
:
"list"
,
align
:
"center"
,
slot
:
"list"
,
width
:
70
,
},
{
title
:
"新增"
,
key
:
"add"
,
align
:
"center"
,
slot
:
"add"
,
width
:
70
,
},
{
title
:
"唯一"
,
key
:
"uniqueness"
,
align
:
"center"
,
slot
:
"uniqueness"
,
width
:
70
,
},
{
title
:
"默认值"
,
key
:
"defaultValue"
,
align
:
"center"
,
slot
:
"defaultValue"
,
},
],
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
dtos
:
this
.
dtosList
,
};
},
props
:
{
dtosList
:
Array
,
default
:
()
=>
{
return
[];
},
list
:
Array
,
default
:
()
=>
{
return
[];
},
},
mounted
()
{
this
.
seachChange
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
seachChange
()
{
let
data
=
{
conditions
:
[],
pageSize
:
20
,
};
Api
.
list
(
data
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
completeList
=
r
.
result
;
}
else
{
}
})
.
catch
((
err
)
=>
{});
},
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
(
1
,
changeId
);
}
},
onDragDrop
(
a
,
b
)
{
this
.
checkList
.
splice
(
b
,
0
,
...
this
.
checkList
.
splice
(
a
,
1
));
},
remove
(
index
,
row
)
{
if
(
row
.
ident
==
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
);
this
.
arr
.
push
(
row
);
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
(
row
,
index
)
{
debugger
;
console
.
log
(
"dtosrow"
,
this
.
dtos
);
if
(
row
.
list
==
true
||
row
.
add
==
true
)
{
if
(
this
.
dtos
.
length
==
0
)
{
let
arr
=
[
{
name
:
"列表"
,
code
:
"list"
,
type
:
0
,
list
:
[],
},
{
name
:
"新增"
,
code
:
"add"
,
type
:
1
,
list
:
[],
},
{
name
:
"编辑"
,
code
:
"edit"
,
type
:
1
,
list
:
[],
},
{
name
:
"查询"
,
code
:
"search"
,
type
:
1
,
list
:
[],
},
];
this
.
dtos
=
[...
arr
];
}
this
.
dtos
.
forEach
((
e
,
index
)
=>
{
if
(
e
.
code
==
"list"
&&
row
.
list
==
true
)
{
this
.
dtos
[
index
].
list
.
push
(
row
);
}
else
if
(
e
.
code
==
"add"
&&
row
.
add
==
true
)
{
this
.
dtos
[
index
].
list
.
push
(
row
);
}
});
}
else
if
(
row
.
list
==
false
||
row
.
add
==
false
)
{
if
(
this
.
dtos
.
length
>
0
)
{
this
.
dtos
.
forEach
((
e
,
index
)
=>
{
if
(
e
.
code
==
"list"
&&
this
.
dtos
[
index
].
list
.
length
>
0
&&
row
.
list
==
false
)
{
this
.
dtos
[
index
].
list
.
map
((
q
,
i
)
=>
{
if
(
q
.
propertyName
==
row
.
propertyName
)
{
this
.
dtos
[
index
].
list
.
splice
(
i
,
1
);
}
});
}
else
if
(
e
.
code
==
"add"
&&
this
.
dtos
[
index
].
list
.
length
>
0
&&
row
.
add
==
false
)
{
this
.
dtos
[
index
].
list
.
map
((
q
,
i
)
=>
{
if
(
q
.
propertyName
==
row
.
propertyName
)
{
this
.
dtos
[
index
].
list
.
splice
(
i
,
1
);
}
});
}
});
}
}
if
(
row
.
dataType
==
0
||
row
.
dataType
==
8
)
{
row
.
length
=
50
;
}
else
{
row
.
length
=
0
;
}
if
(
row
.
propertyName
==
""
)
{
row
.
propertyName
=
row
.
dbColumnName
;
}
this
.
$set
(
this
.
checkList
,
index
,
row
);
this
.
$emit
(
"dtos"
,
this
.
dtos
);
if
(
this
.
dtos
.
length
>
0
)
{
this
.
checkList
[
index
].
dtos
=
JSON
.
stringify
(
this
.
dtos
);
}
this
.
$emit
(
"oncheckList"
,
this
.
checkList
);
},
addNew
(
index
,
e
)
{
console
.
log
(
"addNew"
,
e
);
let
name
=
""
,
flag
=
false
;
if
(
index
==
0
&&
e
==
"{}"
)
{
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
flag
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
flag
=
true
);
}
});
if
(
flag
==
true
)
{
return
;
}
let
obj
=
{
dbColumnName
:
""
,
systemName
:
this
.
systemValue
,
columnDescription
:
name
,
defaultValue
:
""
,
isNullable
:
false
,
unit
:
null
,
link
:
0
,
dataType
:
0
,
isKey
:
false
,
// 是否主键
length
:
50
,
propertyName
:
""
,
//程序中的字段名称
propertyType
:
""
,
// 程序中的字段类型
fieldType
:
3
,
action
:
1
,
add
:
false
,
uniqueness
:
false
,
list
:
false
,
ident
:
0
,
//新增标识
};
this
.
checkList
.
push
(
obj
);
}
else
if
(
index
==
1
&&
JSON
.
stringify
(
e
)
!=
"{}"
)
{
if
(
e
.
content
!=
""
)
{
this
.
checkList
=
[...
JSON
.
parse
(
e
.
content
)];
}
if
(
e
.
dtos
!=
""
)
{
this
.
dtos
=
[...
JSON
.
parse
(
e
.
dtos
)];
}
}
else
{
this
.
$Message
.
warning
(
"请选择导入字段!"
);
return
;
}
// this.$emit("dtos", this.dtos);
// if (this.dtos.length > 0) {
// this.checkList[index].dtos = JSON.stringify(this.dtos);
// }
// this.$emit("oncheckList", this.checkList);
},
},
watch
:
{
list
(
v
)
{
this
.
checkList
=
v
;
},
dtosList
(
v
)
{
this
.
dtos
=
v
;
console
.
log
(
"dtosList"
,
v
);
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/atom/dtos/inputDto.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div>
<Row>
<Table
:columns=
"inputColumns"
:data=
"data"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<div
v-if=
"row.columnDescription != ''"
>
{{
row
.
columnDescription
}}
</div>
<Input
v-else
@
on-change=
"setRow(row, index)"
v-model=
"row.columnDescription"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<div
v-if=
"row.propertyName != ''"
>
{{
row
.
propertyName
}}
</div>
<Input
v-else
@
on-change=
"setRow(row, index)"
v-model=
"row.propertyName"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"type"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.type"
code=
"base.project_atom.inputDtos"
:value=
"row.type"
:key=
"row.type"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"children"
>
<Checkbox
v-model=
"row.children"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.action == 0"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
</Row>
</div>
</template>
<
script
>
export
default
{
// name: '',
data
()
{
return
{
data
:
[],
inputColumns
:
[
{
title
:
"名称"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
},
{
title
:
"列类型"
,
key
:
"type"
,
align
:
"center"
,
slot
:
"type"
,
high
:
true
,
},
{
title
:
"属性"
,
key
:
"propertyName"
,
align
:
"center"
,
slot
:
"propertyName"
,
high
:
true
,
},
{
title
:
"表头分组"
,
align
:
"center"
,
key
:
"children"
,
slot
:
"children"
,
high
:
false
,
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
};
},
props
:
{
changeTabs
:
String
,
dtosList
:
Array
,
default
:
()
=>
{
return
[];
},
},
mounted
()
{
this
.
data
=
[];
console
.
log
(
"进入页面"
,
this
.
dtosList
);
let
arr
=
this
.
dtosList
.
filter
((
v
)
=>
v
.
code
==
this
.
changeTabs
);
console
.
log
(
arr
);
if
(
arr
[
0
].
list
.
length
>
0
)
{
arr
[
0
].
list
.
map
((
e
)
=>
{
let
obj
=
{
columnDescription
:
e
.
columnDescription
,
type
:
e
.
type
,
propertyName
:
e
.
propertyName
,
children
:
e
.
children
,
action
:
1
,
//不可删除项
};
this
.
data
.
push
(
obj
);
});
}
else
{
arr
[
0
].
list
.
map
((
e
)
=>
{
let
obj
=
{
columnDescription
:
e
.
columnDescription
,
type
:
""
,
propertyName
:
e
.
propertyName
,
children
:
""
,
action
:
1
,
//不可删除项
};
this
.
data
.
push
(
obj
);
});
}
},
methods
:
{
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
data
,
index
,
row
);
this
.
dtosList
.
forEach
((
v
)
=>
{
if
(
v
.
code
==
this
.
changeTabs
)
{
v
.
list
=
this
.
data
;
}
});
console
.
log
(
"提交"
,
this
.
dtosList
);
this
.
$emit
(
"dtos"
,
this
.
dtosList
);
},
remove
(
index
,
row
)
{
if
(
row
.
action
==
0
)
{
//新增的删除,直接删
this
.
data
.
splice
(
index
,
1
);
}
},
addNew
(
index
,
e
)
{
let
name
=
""
,
flag
=
false
;
if
(
index
==
0
&&
e
==
"{}"
)
{
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
flag
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
flag
=
true
);
}
});
if
(
flag
==
true
)
{
return
;
}
let
obj
=
{
columnDescription
:
""
,
type
:
""
,
propertyName
:
""
,
children
:
""
,
action
:
1
,
//不可删除项
};
this
.
checkList
.
push
(
obj
);
}
// else if (index == 1 && JSON.stringify(e) != "{}") {
// JSON.parse(e.content).map((item) => {
// this.checkList.push(item);
// });
// } else {
// this.$Message.warning("请选择导入字段!");
// return;
// }
},
},
watch
:
{
dtosList
(
v
)
{
this
.
data
=
v
;
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/atom/dtos/outDto.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div>
<h1>
输出页面
</h1>
<Row>
<Table
:columns=
"columns"
:data=
"data1"
>
<template
slot-scope=
"
{ row, index }" slot="columnDescription">
<div
v-if=
"row.action != 0"
>
{{
row
.
columnDescription
}}
</div>
<Input
v-else
v-model=
"row.columnDescription"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"propertyName"
>
<div
v-if=
"row.action != 0"
>
{{
row
.
propertyName
}}
</div>
<Input
v-else
v-model=
"row.propertyName"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"type"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.type"
code=
"base.project_atom.inputDtos"
:value=
"row.type"
:key=
"row.type"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"width"
>
<Input
v-model=
"row.width"
@
on-change=
"setRow(row, index)"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"align"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.align"
code=
"base.project_atom.align"
:value=
"row.align"
:key=
"row.align"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"fixed"
>
<Dictionary
@
on-change=
"setRow(row, index)"
v-model=
"row.fixed"
code=
"base.project_atom.fixed"
:value=
"row.fixed"
:key=
"row.fixed"
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"ellipsis"
>
<Checkbox
@
on-change=
"setRow(row, index)"
v-model=
"row.ellipsis"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"tooltip"
>
<Checkbox
@
on-change=
"setRow(row, index)"
v-model=
"row.tooltip"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"render"
>
<Checkbox
@
on-change=
"setRow(row, index)"
v-model=
"row.render"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"sortable"
>
<Checkbox
@
on-change=
"setRow(row, index)"
v-model=
"row.sortable"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"resizable"
>
<Input
@
on-change=
"setRow(row, index)"
v-model=
"row.resizable"
placeholder=
"请输入"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.action == 0"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew(0, '{}')"
class=
"mt10"
>
新增属性
</Button
>
</Row>
</div>
</template>
<
script
>
import
{
values
}
from
"lodash"
;
export
default
{
data
()
{
return
{
data1
:
[],
columns
:
[
{
title
:
"名称"
,
align
:
"center"
,
key
:
"columnDescription"
,
slot
:
"columnDescription"
,
},
{
title
:
"列类型"
,
key
:
"type"
,
align
:
"center"
,
slot
:
"type"
,
high
:
true
,
},
{
title
:
"属性"
,
key
:
"propertyName"
,
align
:
"center"
,
slot
:
"propertyName"
,
high
:
true
,
},
{
title
:
"列宽"
,
align
:
"center"
,
key
:
"width"
,
slot
:
"width"
,
high
:
false
,
},
{
title
:
"对齐方式"
,
align
:
"center"
,
key
:
"align"
,
slot
:
"align"
,
high
:
false
,
},
{
title
:
"列固定方位"
,
align
:
"center"
,
key
:
"fixed"
,
slot
:
"fixed"
,
high
:
false
,
},
{
title
:
"是否为省略号"
,
align
:
"center"
,
key
:
"ellipsis"
,
slot
:
"ellipsis"
,
high
:
false
,
},
{
title
:
"Tooltip 组件使用"
,
align
:
"center"
,
key
:
"tooltip"
,
slot
:
"tooltip"
,
high
:
false
,
},
{
title
:
"渲染render"
,
align
:
"center"
,
key
:
"render"
,
slot
:
"render"
,
high
:
false
,
},
{
title
:
"排序"
,
align
:
"center"
,
key
:
"sortable"
,
slot
:
"sortable"
,
high
:
false
,
},
{
title
:
"列宽度调整"
,
align
:
"center"
,
key
:
"resizable"
,
slot
:
"resizable"
,
high
:
false
,
},
{
width
:
80
,
title
:
"操作"
,
slot
:
"action"
,
align
:
"center"
,
},
],
};
},
props
:
{
changeTabs
:
String
,
dtosList
:
Array
,
default
:
()
=>
{
return
[];
},
},
mounted
()
{
this
.
data1
=
[];
console
.
log
(
"进入页面"
,
this
.
dtosList
)
let
arr
=
this
.
dtosList
.
filter
((
v
)
=>
v
.
code
==
this
.
changeTabs
);
if
(
arr
[
0
].
list
.
length
>
0
)
{
arr
[
0
].
list
.
map
((
e
)
=>
{
let
obj
=
{
columnDescription
:
e
.
columnDescription
,
type
:
e
.
type
,
propertyName
:
e
.
propertyName
,
width
:
e
.
width
,
align
:
e
.
align
,
fixed
:
e
.
fixed
,
ellipsis
:
e
.
ellipsis
,
tooltip
:
e
.
tooltip
,
render
:
e
.
render
,
sortable
:
e
.
sortable
,
resizable
:
e
.
resizable
,
action
:
1
,
//不可删除项
};
this
.
data1
.
push
(
obj
);
});
}
else
{
arr
[
0
].
list
.
map
((
e
)
=>
{
let
obj
=
{
columnDescription
:
e
.
columnDescription
,
type
:
""
,
propertyName
:
e
.
propertyName
,
width
:
""
,
align
:
""
,
fixed
:
""
,
ellipsis
:
""
,
tooltip
:
""
,
render
:
""
,
sortable
:
""
,
resizable
:
""
,
action
:
1
,
//不可删除项
};
this
.
data1
.
push
(
obj
);
});
}
},
methods
:
{
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
data1
,
index
,
row
);
this
.
dtosList
.
forEach
((
v
)
=>
{
if
(
v
.
code
==
this
.
changeTabs
){
v
.
list
=
this
.
data1
;
}
});
console
.
log
(
"提交"
,
this
.
dtosList
)
this
.
$emit
(
"dtos"
,
this
.
dtosList
);
},
addNew
(
index
,
e
)
{
let
name
=
""
,
flag
=
false
;
if
(
index
==
0
&&
e
==
"{}"
)
{
this
.
data1
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
flag
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
flag
=
true
);
}
});
if
(
flag
==
true
)
{
return
;
}
let
obj
=
{
columnDescription
:
""
,
type
:
""
,
propertyName
:
""
,
width
:
null
,
align
:
null
,
fixed
:
null
,
ellipsis
:
null
,
tooltip
:
null
,
render
:
null
,
sortable
:
null
,
resizable
:
null
,
action
:
0
,
//可删除项
};
this
.
data1
.
push
(
obj
);
}
},
remove
(
index
,
row
)
{
if
(
row
.
action
==
0
)
{
//新增的删除,直接删
this
.
data1
.
splice
(
index
,
1
);
}
// else {
// // row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
// this.$set(this.data1, index, row);
// // this.arr.push(row);
// this.data1.splice(index, 1);
// }
},
},
watch
:
{
dtosList
(
v
)
{
this
.
data1
=
v
;
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/atom/edit.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<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('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=
"12"
>
<FormItem
:label=
"l('status')"
prop=
"status"
>
<Dictionary
type=
"radio"
code=
"base.project_atom.status"
v-model=
"entity.status"
></Dictionary>
</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>
<Divider
orientation=
"left"
>
扩展属性
</Divider>
</Row>
<Row
style=
"margin-top: 10px"
>
<Tabs
type=
"card"
v-model=
"currTab"
@
on-click=
"handleContextMenu"
>
<TabPane
label=
"实体定义"
name=
"base"
>
</TabPane>
<TabPane
v-for=
"tab in dtos"
:key=
"tab.code"
:label=
"tab.name"
:name=
"tab.code"
></TabPane>
<Button
@
click=
"modal1 = true"
size=
"small"
slot=
"extra"
style=
"margin-right: 10px"
>
增加
</Button
>
<Button
size=
"small"
@
click=
"pushDtos"
slot=
"extra"
>
默认增加
</Button
>
<Modal
v-model=
"modal1"
title=
"增加"
:footer-hide=
"true"
>
<Form
:model=
"modelaForm"
ref=
"modelaForm"
:rules=
"ruleInline"
:label-width=
"80"
>
<p>
<FormItem
label=
"名称:"
prop=
"name"
>
<Input
v-model=
"modelaForm.name"
placeholder=
"请输入名称"
></Input>
</FormItem>
</p>
<p>
<FormItem
label=
"编码:"
prop=
"code"
>
<Input
v-model=
"modelaForm.code"
placeholder=
"请输入编码"
></Input>
</FormItem>
<FormItem
label=
"类型:"
prop=
"type"
>
<RadioGroup
v-model=
"modelaForm.type"
>
<Radio
label=
"0"
>
输入
</Radio>
<Radio
label=
"1"
>
输出
</Radio>
</RadioGroup>
</FormItem>
</p>
<p>
<FormItem
class=
"tr mt10"
>
<Button
type=
"primary"
@
click=
"okModal('modelaForm')"
>
确定
</Button
>
<Button
@
click=
"cancelModal('modelaForm')"
class=
"ml20"
>
取消
</Button
>
</FormItem>
</p>
</Form>
</Modal>
</Tabs>
</Row>
<component
:is=
"detail"
:list=
"checkList"
:dtosList=
"dtos"
@
dtos=
"getDtos"
:changeTabs=
"contextData"
@
onchange=
"oncheckList"
/>
</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>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
currTab
:
"base"
,
detail
:
null
,
contextData
:
null
,
modelaForm
:
{
name
:
""
,
code
:
""
,
type
:
""
,
},
ruleInline
:
{
name
:
[{
required
:
true
,
message
:
"请输入名称"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"请输入编码"
,
trigger
:
"blur"
}],
type
:
[{
required
:
true
,
message
:
"请选择类别"
,
trigger
:
"change"
}],
},
modal1
:
false
,
content
:
{
base
:
[],
},
dtos
:
[],
systemValue
:
0
,
iconType
:
"ios-arrow-up"
,
textUp
:
"收起"
,
upDrop
:
true
,
completeValue
:
""
,
completeList
:
[],
codeList
:
[],
checkList
:
[],
disabled
:
false
,
entity
:
{},
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
);
}
this
.
detail
=
()
=>
import
(
"./dtos"
);
},
methods
:
{
pushDtos
()
{
let
arr
=
[
{
name
:
"列表"
,
code
:
"list"
,
type
:
0
,
list
:
[],
},
{
name
:
"新增"
,
code
:
"add"
,
type
:
1
,
list
:
[],
},
{
name
:
"编辑"
,
code
:
"edit"
,
type
:
1
,
list
:
[],
},
{
name
:
"查询"
,
code
:
"search"
,
type
:
1
,
list
:
[],
},
];
let
flag
=
false
;
if
(
this
.
dtos
.
length
>
0
)
{
// arr.forEach((item,index) => {
// this.dtos.forEach((e) => {
// if (e.code == obj.code) {
// arr.splice(index,1);
// flag = true;
// return;
// }else{
// }
// });
// });
// if(flag==false){
// console.log(arr)
// this.dtos.concat(arr)
// }
// arr.forEach((item) => {
// this.dtos.forEach((e) => {
// if (e.code != item.code) {
// this.dtos.push(item);
// } else {
// this.$Message.warning("请不要重复添加编码!");
// return;
// }
// });
// });
}
else
{
arr
.
forEach
((
item
)
=>
{
this
.
dtos
.
push
(
item
);
});
}
},
oncheckList
(
v
)
{
this
.
checkList
=
v
;
},
getDtos
(
v
)
{
this
.
dtos
=
v
;
},
handleContextMenu
(
data
)
{
console
.
log
(
"tabs"
,
data
);
this
.
contextData
=
data
;
if
(
data
==
"list"
)
{
this
.
detail
=
()
=>
import
(
"./dtos/outDto"
);
}
else
if
(
data
==
"add"
)
{
this
.
detail
=
()
=>
import
(
"./dtos/inputDto"
);
}
else
if
(
data
==
"edit"
)
{
this
.
detail
=
()
=>
import
(
"./dtos/inputDto"
);
}
else
if
(
data
==
"search"
)
{
this
.
detail
=
()
=>
import
(
"./dtos/inputDto"
);
}
else
{
this
.
detail
=
()
=>
import
(
"./dtos"
);
}
},
okModal
(
name
)
{
this
.
$refs
[
name
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
obj
=
{
name
:
this
.
modelaForm
.
name
,
code
:
this
.
modelaForm
.
code
,
type
:
Number
(
this
.
modelaForm
.
type
),
list
:
[],
};
let
flag
=
false
;
if
(
this
.
dtos
.
length
>
0
)
{
this
.
dtos
.
forEach
((
e
)
=>
{
if
(
e
.
code
==
obj
.
code
)
{
flag
=
true
;
this
.
$Message
.
warning
(
"请不要重复添加编码!"
);
return
;
}
});
if
(
flag
==
false
)
{
this
.
dtos
.
push
(
obj
);
this
.
modal1
=
false
;
}
}
else
{
this
.
modal1
=
false
;
this
.
dtos
.
push
(
obj
);
}
this
.
$refs
[
name
].
resetFields
();
}
});
},
cancelModal
(
name
)
{
this
.
$refs
[
name
].
resetFields
();
this
.
modal1
=
false
;
},
upClick
(
value
)
{
this
.
upDrop
=
!
value
;
if
(
value
)
{
this
.
textUp
=
"下拉"
;
this
.
iconType
=
"ios-arrow-down"
;
}
else
{
this
.
textUp
=
"收起"
;
this
.
iconType
=
"ios-arrow-up"
;
}
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
debugger
;
this
.
entity
=
r
.
result
;
if
(
r
.
result
.
content
)
{
this
.
checkList
=
JSON
.
parse
(
r
.
result
.
content
);
}
if
(
r
.
result
.
dtos
)
{
this
.
dtos
=
JSON
.
parse
(
r
.
result
.
dtos
);
}
console
.
log
(
" this.entity"
,
this
.
entity
);
console
.
log
(
" this.checkList"
,
this
.
checkList
);
console
.
log
(
" this.dtos"
,
this
.
dtos
);
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
);
}
});
});
});
},
handleSubmit
()
{
let
keys
=
false
;
let
name
=
""
;
this
.
checkList
.
forEach
((
s
,
index
)
=>
{
if
(
s
.
columnDescription
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格名称!"
);
return
(
keys
=
true
);
}
if
(
s
.
propertyName
==
""
)
{
this
.
$Message
.
warning
(
"请填写表格属性!"
);
return
(
keys
=
true
);
}
});
if
(
this
.
checkList
.
length
>=
2
)
{
for
(
var
i
=
1
;
i
<
this
.
checkList
.
length
;
i
++
)
{
if
(
this
.
checkList
[
0
].
columnDescription
==
this
.
checkList
[
i
].
columnDescription
)
{
this
.
$Message
.
error
(
"表格名称重复!"
);
return
(
keys
=
true
);
}
if
(
this
.
checkList
[
0
].
propertyName
==
this
.
checkList
[
i
].
propertyName
)
{
this
.
$Message
.
error
(
"表格属性重复!"
);
return
(
keys
=
true
);
}
}
}
if
(
keys
==
true
)
{
return
;
}
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
if
(
this
.
checkList
)
{
this
.
entity
.
content
=
JSON
.
stringify
(
this
.
checkList
);
}
else
{
this
.
checkList
=
[];
}
if
(
this
.
dtos
)
{
this
.
entity
.
dtos
=
JSON
.
stringify
(
this
.
dtos
);
}
else
{
this
.
dtos
=
[];
}
Api
.
update
(
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
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
"entity.type"
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
==
0
)
{
this
.
systemValue
=
0
;
}
else
if
(
newVal
==
1
)
{
this
.
systemValue
=
1
;
}
},
},
};
</
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
0 → 100644
View file @
1c31b6a6
<
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
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
</DataGrid>
<!-- fullscreen -->
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
fullscreen
>
<component
:is=
"detail"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
"项目对象"
,
author
:
"henq"
,
description
:
"project_atom 10/14/2020 11:41:27 AM"
,
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"name,englishFullName,englishName,code"
,
value
:
null
},
},
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
columns
:
[
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
},
{
key
:
"name"
,
title
:
this
.
l
(
"name"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project_atom.status"
,
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"base.project_atom.type"
,
},
{
key
:
"englishFullName"
,
title
:
this
.
l
(
"englishFullName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"englishName"
,
title
:
this
.
l
(
"englishName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"module"
,
title
:
this
.
l
(
"module"
),
align
:
"left"
,
high
:
true
},
{
key
:
"version"
,
title
:
this
.
l
(
"version"
),
align
:
"left"
,
high
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
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
()
{},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
// copy(id) {
// this.curId = id;
// this.title = "克隆";
// this.detail = () => import("./add");
// this.modal = true;
// },
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
l
(
key
)
{
/*
project_atom:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
content:'内容',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
version:'版本',
projectId:'项目',
}
*/
let
vkey
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
pages/system/project/atom/search.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"condition"
:label-width=
"90"
>
<Row>
<!--
<Col
:span=
"12"
:v-if=
"condition.id.show"
>
<FormItem
:label=
"$t('id')"
prop=
"id"
>
<Input
v-model=
"condition.id.value"
number
>
</Input>
</FormItem
>
</Col>
<Col
:span=
"12"
:v-if=
"condition.creationTime.show"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.creationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creatorUserId.show"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<Input
v-model=
"condition.creatorUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModificationTime.show"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.lastModificationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModifierUserId.show"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<Input
v-model=
"condition.lastModifierUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.deletionTime.show"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.deletionTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.name.show"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"condition.name.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.upId.show"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<Input
v-model=
"condition.upId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.level.show"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"condition.level.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.tenantId.show"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<Input
v-model=
"condition.tenantId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.type.show"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Input
v-model=
"condition.type.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishFullName.show"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"condition.englishFullName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishName.show"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"condition.englishName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.status.show"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"condition.status.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
:v-if=
"condition.description.show"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"condition.description.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.inheritCategoryId.show"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<Input
v-model=
"condition.inheritCategoryId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.code.show"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"condition.code.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.module.show"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"condition.module.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.version.show"
><FormItem
:label=
"l('version')"
prop=
"version"
>
<Input
v-model=
"condition.version.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.projectId.show"
><FormItem
:label=
"l('projectId')"
prop=
"projectId"
>
<Input
v-model=
"condition.projectId.value"
>
</Input>
</FormItem
></Col>
-->
</Row>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
condition
:
{
id
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
creationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
creatorUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
lastModificationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
lastModifierUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
deletionTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
name
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
upId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
level
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
tenantId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
type
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishFullName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
status
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
description
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
inheritCategoryId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
code
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
module
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
version
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
projectId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
},
};
},
methods
:
{
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project_atom"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/index.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div
id=
'sysproject'
>
<div
class=
"tree_left"
>
<Project></Project>
</div>
<div
class=
"count_right"
>
<Atom></Atom>
</div>
</div>
</
template
>
<
script
>
import
Atom
from
"./atom"
;
import
Project
from
"./project"
;
export
default
{
// name: 'sysproject',
data
()
{
return
{};
},
components
:{
Project
,
Atom
}
};
</
script
>
<
style
lang=
"less"
scoped
>
#sysproject{
display: flex;
}
.tree_left {
width: 300px;
height: 100%;
}
.count_right {
width: calc(100% - 300px);
}
</
style
>
\ No newline at end of file
pages/system/project/project/add.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</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('type')"
prop=
"type"
>
<Dictionary
code=
"base.project.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.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{
name
:
""
,
upId
:
this
.
eid
,
level
:
null
,
tenantId
:
null
,
type
:
null
,
englishFullName
:
""
,
englishName
:
""
,
status
:
null
,
description
:
""
,
inheritCategoryId
:
null
,
code
:
""
,
module
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
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
;
});
},
l
(
key
)
{
key
=
"project"
+
"."
+
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
pages/system/project/project/api.js
0 → 100644
View file @
1c31b6a6
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
systemUrl
}
/project/paged`
,
treepaged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/list`
,
params
);
},
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/paged`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/project/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/create`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
systemUrl
}
/project/delete`
,
{
params
:
{
id
:
id
}
});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/project/batchdelete`
,
params
);
}
}
\ No newline at end of file
pages/system/project/project/detail.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div
class=
"detail"
>
<Row>
<Filed
:span=
"12"
:name=
"l('name')"
>
{{
entity
.
name
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('type')"
><state
code=
"base.project.type"
:value=
"entity.type"
/></Filed>
<Filed
:span=
"12"
:name=
"l('englishFullName')"
>
{{
entity
.
englishFullName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('englishName')"
>
{{
entity
.
englishName
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('status')"
><state
code=
"base.project.status"
:value=
"entity.status"
/></Filed>
<Filed
:span=
"12"
:name=
"l('code')"
>
{{
entity
.
code
}}
</Filed>
<Filed
:span=
"12"
:name=
"l('module')"
>
{{
entity
.
module
}}
</Filed>
<Filed
:span=
"24"
:name=
"l('description')"
>
{{
entity
.
description
}}
</Filed>
</Row>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
entity
:
{},
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"
);
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/project/edit.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
</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('type')"
prop=
"type"
>
<Dictionary
code=
"base.project.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.status"
v-model=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"12"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"entity.module"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"5"
></Input>
</FormItem
></Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
rules
:
{
name
:
[{
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
;
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
let
datas
=
{
creationTime
:
this
.
entity
.
creationTime
,
creatorUserId
:
this
.
entity
.
creatorUserId
,
description
:
this
.
entity
.
description
,
code
:
this
.
entity
.
code
,
id
:
this
.
entity
.
id
,
englishFullName
:
this
.
entity
.
englishFullName
,
englishName
:
this
.
entity
.
englishName
,
inheritCategoryId
:
this
.
entity
.
inheritCategoryId
,
lastModificationTime
:
this
.
entity
.
lastModificationTime
,
lastModifierUserId
:
this
.
entity
.
lastModifierUserId
,
level
:
this
.
entity
.
level
,
module
:
this
.
entity
.
module
,
name
:
this
.
entity
.
name
,
status
:
this
.
entity
.
status
,
tenantId
:
this
.
entity
.
tenantId
,
type
:
this
.
entity
.
type
,
upId
:
this
.
entity
.
upId
,
};
Api
.
update
(
datas
)
.
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"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
\ No newline at end of file
pages/system/project/project/index.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<div
style=
"padding-top: 10px"
>
<TreeGrid
:columns=
"columns"
:items=
"treeData"
ref=
"grid"
>
<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
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
</TreeGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
"项目"
,
author
:
"henq"
,
description
:
"project 10/14/2020 10:22:51 AM"
,
},
data
()
{
return
{
treeList
:
[],
treeData
:
[],
// action: Api.index,
easySearch
:
{
keys
:
{
op
:
"name,englishFullName,englishName,code"
,
value
:
null
},
},
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
columns
:
[
{
key
:
"label"
,
title
:
"分类名称"
,
align
:
"left"
,
},
{
key
:
"name"
,
title
:
this
.
l
(
"name"
),
align
:
"left"
,
hide
:
true
,
easy
:
true
,
high
:
true
,
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
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"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"englishName"
,
title
:
this
.
l
(
"englishName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"module"
,
title
:
this
.
l
(
"module"
),
align
:
"left"
,
high
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
160
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
view
(
params
.
row
.
id
)
},
},
"查看"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"add"
},
on
:
{
click
:
()
=>
this
.
rowadd
(
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
()
{
this
.
init
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
init
()
{
let
data
=
{
conditions
:
[],
};
Api
.
treepaged
(
data
).
then
((
r
)
=>
{
this
.
treeData
=
[];
this
.
treeData
=
r
.
result
;
this
.
treeData
=
this
.
$u
.
toTree
(
r
.
result
,
0
,
(
u
)
=>
{
u
.
label
=
u
.
name
;
},
"upId"
);
});
},
ok
()
{
this
.
init
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
console
.
log
(
this
.
easySearch
);
console
.
log
(
this
.
$refs
.
grid
);
// this.init();
// this.$refs.grid.reload(this.easySearch);
},
add
()
{
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
rowadd
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
init
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
l
(
key
)
{
/*
project:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
}
*/
let
vkey
=
"project"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
<
style
lang=
"less"
></
style
>
pages/system/project/project/search.vue
0 → 100644
View file @
1c31b6a6
<
template
>
<Form
ref=
"form"
:model=
"condition"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
:v-if=
"condition.id.show"
><FormItem
:label=
"$t('id')"
prop=
"id"
>
<Input
v-model=
"condition.id.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creationTime.show"
><FormItem
:label=
"l('creationTime')"
prop=
"creationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.creationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.creatorUserId.show"
><FormItem
:label=
"l('creatorUserId')"
prop=
"creatorUserId"
>
<Input
v-model=
"condition.creatorUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModificationTime.show"
><FormItem
:label=
"l('lastModificationTime')"
prop=
"lastModificationTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.lastModificationTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.lastModifierUserId.show"
><FormItem
:label=
"l('lastModifierUserId')"
prop=
"lastModifierUserId"
>
<Input
v-model=
"condition.lastModifierUserId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.deletionTime.show"
><FormItem
:label=
"l('deletionTime')"
prop=
"deletionTime"
>
<DatePicker
type=
"daterange"
v-model=
"condition.deletionTime.value"
></DatePicker>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.name.show"
><FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"condition.name.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.upId.show"
><FormItem
:label=
"l('upId')"
prop=
"upId"
>
<Input
v-model=
"condition.upId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.level.show"
><FormItem
:label=
"l('level')"
prop=
"level"
>
<Input
v-model=
"condition.level.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.tenantId.show"
><FormItem
:label=
"l('tenantId')"
prop=
"tenantId"
>
<Input
v-model=
"condition.tenantId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.type.show"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Input
v-model=
"condition.type.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishFullName.show"
><FormItem
:label=
"l('englishFullName')"
prop=
"englishFullName"
>
<Input
v-model=
"condition.englishFullName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.englishName.show"
><FormItem
:label=
"l('englishName')"
prop=
"englishName"
>
<Input
v-model=
"condition.englishName.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.status.show"
><FormItem
:label=
"l('status')"
prop=
"status"
>
<Input
v-model=
"condition.status.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"24"
:v-if=
"condition.description.show"
><FormItem
:label=
"l('description')"
prop=
"description"
>
<Input
v-model=
"condition.description.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.inheritCategoryId.show"
><FormItem
:label=
"l('inheritCategoryId')"
prop=
"inheritCategoryId"
>
<Input
v-model=
"condition.inheritCategoryId.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.code.show"
><FormItem
:label=
"l('code')"
prop=
"code"
>
<Input
v-model=
"condition.code.value"
>
</Input>
</FormItem
></Col>
<Col
:span=
"12"
:v-if=
"condition.module.show"
><FormItem
:label=
"l('module')"
prop=
"module"
>
<Input
v-model=
"condition.module.value"
>
</Input>
</FormItem
></Col>
</Row>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Add"
,
data
()
{
return
{
condition
:
{
id
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
creationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
creatorUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
lastModificationTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
lastModifierUserId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
deletionTime
:
{
op
:
"Range"
,
value
:
null
,
show
:
true
},
name
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
upId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
level
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
tenantId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
type
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishFullName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
englishName
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
status
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
description
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
inheritCategoryId
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
code
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
module
:
{
op
:
"Equal"
,
value
:
null
,
show
:
true
},
},
};
},
methods
:
{
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"project"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
};
</
script
>
\ 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