haiwei-module-common 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +2 -0
- package/.eslintrc.js +18 -0
- package/.prettierrc +6 -0
- package/.vscode/settings.json +10 -0
- package/babel.config.js +10 -0
- package/package.json +41 -0
- package/postcss.config.js +5 -0
- package/script/npm_install.bat +4 -0
- package/script/npm_install.ps1 +10 -0
- package/script/npm_publish.bat +4 -0
- package/script/npm_publish.ps1 +10 -0
- package/script/npm_update.bat +4 -0
- package/script/npm_update.ps1 +10 -0
- package/src/api/components/area.js +22 -0
- package/src/api/components/attachment.js +30 -0
- package/src/api/components/dict.js +24 -0
- package/src/api/components/dictGroup.js +17 -0
- package/src/api/components/dictItem.js +10 -0
- package/src/api/components/mediaType.js +10 -0
- package/src/api/index.js +11 -0
- package/src/components/area-select/index.vue +147 -0
- package/src/components/area-select/item.vue +85 -0
- package/src/components/attachment-download/index.vue +70 -0
- package/src/components/attachment-img/index.vue +58 -0
- package/src/components/attachment-upload-img/index.vue +244 -0
- package/src/components/attachment-upload-single/index.vue +143 -0
- package/src/components/ccdieet-upload/index_.vue +51 -0
- package/src/components/config-common/index.vue +41 -0
- package/src/components/dict-checkbox/index.vue +29 -0
- package/src/components/dict-radio/index.vue +29 -0
- package/src/components/dict-select/index.vue +29 -0
- package/src/components/dict-tree/index.vue +97 -0
- package/src/components/index.js +10 -0
- package/src/components/upload-mixins.js +118 -0
- package/src/config/index.js +11 -0
- package/src/index.js +23 -0
- package/src/main.js +9 -0
- package/src/module.js +10 -0
- package/src/routes/index.js +3 -0
- package/src/store/index.js +3 -0
- package/src/views/area/components/cascader/index.vue +16 -0
- package/src/views/area/components/save/index.vue +96 -0
- package/src/views/area/index/cols.js +47 -0
- package/src/views/area/index/index.vue +126 -0
- package/src/views/area/index/page.js +42 -0
- package/src/views/attachment/index/cols.js +59 -0
- package/src/views/attachment/index/index.vue +60 -0
- package/src/views/attachment/index/page.js +36 -0
- package/src/views/dict/components/save/index.vue +63 -0
- package/src/views/dict/index/cols.js +35 -0
- package/src/views/dict/index/index.vue +79 -0
- package/src/views/dict/index/page.js +49 -0
- package/src/views/dictGroup/components/save/index.vue +57 -0
- package/src/views/dictGroup/components/select/index.vue +14 -0
- package/src/views/dictGroup/index/cols.js +36 -0
- package/src/views/dictGroup/index/index.vue +67 -0
- package/src/views/dictGroup/index/page.js +42 -0
- package/src/views/dictItem/components/extend-editor/index.vue +57 -0
- package/src/views/dictItem/components/index/cols.js +40 -0
- package/src/views/dictItem/components/index/index.vue +86 -0
- package/src/views/dictItem/components/save/index.vue +94 -0
- package/src/views/dictItem/components/tree/index.vue +133 -0
- package/src/views/dictItem/index.vue +51 -0
- package/src/views/mediaType/components/save/index.vue +45 -0
- package/src/views/mediaType/index/cols.js +16 -0
- package/src/views/mediaType/index/index.vue +55 -0
- package/src/views/mediaType/index/page.js +42 -0
- package/vue.config.js +108 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
|
|
3
|
+
<el-row>
|
|
4
|
+
<el-col :span="20" :offset="1">
|
|
5
|
+
<el-form-item label="分组:" prop="groupCode">
|
|
6
|
+
<group-select v-model="form.model.groupCode" clearable />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
<el-form-item label="名称:" prop="name">
|
|
9
|
+
<el-input v-model="form.model.name" clearable autofocus />
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="编码:" prop="code">
|
|
12
|
+
<el-input v-model="form.model.code" clearable />
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item label="排序:" prop="sort">
|
|
15
|
+
<el-input type="number" v-model.number="form.model.sort" clearable />
|
|
16
|
+
</el-form-item>
|
|
17
|
+
</el-col>
|
|
18
|
+
</el-row>
|
|
19
|
+
</nm-form-dialog>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
import { mixins } from 'haiwei-ui'
|
|
23
|
+
import GroupSelect from '../../../dictGroup/components/select'
|
|
24
|
+
|
|
25
|
+
// 接口
|
|
26
|
+
const { add, edit, update } = $api.common.dict
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
mixins: [mixins.formSave],
|
|
30
|
+
components: { GroupSelect },
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
title: '字典',
|
|
34
|
+
actions: {
|
|
35
|
+
add,
|
|
36
|
+
edit,
|
|
37
|
+
update
|
|
38
|
+
},
|
|
39
|
+
form: {
|
|
40
|
+
width: '650px',
|
|
41
|
+
model: {
|
|
42
|
+
groupCode: '',
|
|
43
|
+
/** 名称 */
|
|
44
|
+
name: '',
|
|
45
|
+
/** 值 */
|
|
46
|
+
code: '',
|
|
47
|
+
/** 排序 */
|
|
48
|
+
sort: ''
|
|
49
|
+
},
|
|
50
|
+
rules: {
|
|
51
|
+
groupCode: [{ required: true, message: '请选择分组' }],
|
|
52
|
+
name: [{ required: true, message: '请输入名称' }],
|
|
53
|
+
code: [{ required: true, message: '请输入编码' }],
|
|
54
|
+
sort: [
|
|
55
|
+
{ required: true, message: '请输入序号' },
|
|
56
|
+
{ type: 'number', message: '序号必须为数字' }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
show: false
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'groupName',
|
|
9
|
+
label: '分组'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'name',
|
|
13
|
+
label: '名称'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'code',
|
|
17
|
+
label: '编码'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'sort',
|
|
21
|
+
label: '排序'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'creator',
|
|
25
|
+
label: '创建人',
|
|
26
|
+
width: 100,
|
|
27
|
+
show: false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'createdTime',
|
|
31
|
+
label: '创建时间',
|
|
32
|
+
width: 150,
|
|
33
|
+
show: false
|
|
34
|
+
}
|
|
35
|
+
]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-list ref="list" v-bind="list">
|
|
4
|
+
<!--查询条件-->
|
|
5
|
+
<template v-slot:querybar>
|
|
6
|
+
<el-form-item label="分组:" prop="groupCode">
|
|
7
|
+
<group-select v-model="list.model.groupCode" clearable />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="名称:" prop="name">
|
|
10
|
+
<el-input v-model="list.model.name" clearable />
|
|
11
|
+
</el-form-item>
|
|
12
|
+
<el-form-item label="编码:" prop="code">
|
|
13
|
+
<el-input v-model="list.model.code" clearable />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<!--按钮-->
|
|
18
|
+
<template v-slot:querybar-buttons="{ total }">
|
|
19
|
+
<nm-button v-bind="buttons.add" @click="add(total)" />
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<!--操作列-->
|
|
23
|
+
<template v-slot:col-operation="{ row }">
|
|
24
|
+
<nm-button v-bind="buttons.item" @click="manageItem(row)" />
|
|
25
|
+
<nm-button v-bind="buttons.edit" @click="edit(row)" />
|
|
26
|
+
<nm-button-delete v-bind="buttons.del" :id="row.id" :action="removeAction" @success="refresh" />
|
|
27
|
+
</template>
|
|
28
|
+
</nm-list>
|
|
29
|
+
|
|
30
|
+
<save-page :id="curr.id" :total="total" :visible.sync="dialog.save" @success="refresh" />
|
|
31
|
+
<!--管理数据项-->
|
|
32
|
+
<dict-item :dict="curr" :visible.sync="dialog.item" />
|
|
33
|
+
</nm-container>
|
|
34
|
+
</template>
|
|
35
|
+
<script>
|
|
36
|
+
import { mixins } from 'haiwei-ui'
|
|
37
|
+
import page from './page'
|
|
38
|
+
import cols from './cols'
|
|
39
|
+
import GroupSelect from '../../dictGroup/components/select'
|
|
40
|
+
import SavePage from '../components/save'
|
|
41
|
+
import DictItem from '../../dictItem'
|
|
42
|
+
|
|
43
|
+
// 接口
|
|
44
|
+
const api = $api.common.dict
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
name: page.name,
|
|
48
|
+
mixins: [mixins.list],
|
|
49
|
+
components: { SavePage, GroupSelect, DictItem },
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
curr: { code: '' },
|
|
53
|
+
list: {
|
|
54
|
+
title: '字典列表',
|
|
55
|
+
cols,
|
|
56
|
+
action: api.query,
|
|
57
|
+
model: {
|
|
58
|
+
groupCode: '',
|
|
59
|
+
/** 名称 */
|
|
60
|
+
name: '',
|
|
61
|
+
// 编码
|
|
62
|
+
code: ''
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
removeAction: api.remove,
|
|
66
|
+
buttons: page.buttons,
|
|
67
|
+
dialog: {
|
|
68
|
+
item: false
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
methods: {
|
|
73
|
+
manageItem(row) {
|
|
74
|
+
this.curr = row
|
|
75
|
+
this.dialog.item = true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '字典列表'
|
|
4
|
+
this.icon = 'tag'
|
|
5
|
+
this.name = 'common_dict'
|
|
6
|
+
this.path = '/common/dict'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`, `${this.name}_querychildren_get`]
|
|
10
|
+
|
|
11
|
+
this.buttons = {
|
|
12
|
+
add: {
|
|
13
|
+
text: '添加',
|
|
14
|
+
type: 'success',
|
|
15
|
+
code: `${this.name}_add`,
|
|
16
|
+
icon: 'add',
|
|
17
|
+
permissions: [`${this.name}_add_post`]
|
|
18
|
+
},
|
|
19
|
+
edit: {
|
|
20
|
+
text: '编辑',
|
|
21
|
+
icon: 'edit',
|
|
22
|
+
type: 'text',
|
|
23
|
+
code: `${this.name}_edit`,
|
|
24
|
+
permissions: [`${this.name}_edit_get`, `${this.name}_update_post`]
|
|
25
|
+
},
|
|
26
|
+
del: {
|
|
27
|
+
text: '删除',
|
|
28
|
+
icon: 'delete',
|
|
29
|
+
type: 'text',
|
|
30
|
+
code: `${this.name}_del`,
|
|
31
|
+
permissions: [`${this.name}_delete_delete`]
|
|
32
|
+
},
|
|
33
|
+
item: {
|
|
34
|
+
text: '管理数据项',
|
|
35
|
+
icon: 'edit',
|
|
36
|
+
type: 'text',
|
|
37
|
+
code: `${this.name}_item`,
|
|
38
|
+
permissions: [`common_dictitem_query_get`, `common_dictitem_add_post`, `common_dictitem_edit_get`, `common_dictitem_update_post`, `common_dictitem_delete_delete`]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
})()
|
|
42
|
+
|
|
43
|
+
/** 路由信息 */
|
|
44
|
+
export const route = {
|
|
45
|
+
page,
|
|
46
|
+
component: () => import(/* webpackChunkName: "Common.Dict" */ './index')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default page
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
|
|
3
|
+
<el-row>
|
|
4
|
+
<el-col :span="20" :offset="1">
|
|
5
|
+
<el-form-item label="名称:" prop="name">
|
|
6
|
+
<el-input v-model="form.model.name" clearable />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
<el-form-item label="编码:" prop="code">
|
|
9
|
+
<el-input v-model="form.model.code" clearable />
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="图标:" prop="icon">
|
|
12
|
+
<nm-icon-picker v-model="form.model.icon" />
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item label="排序:" prop="sort">
|
|
15
|
+
<el-input type="number" v-model.number="form.model.sort" clearable />
|
|
16
|
+
</el-form-item>
|
|
17
|
+
</el-col>
|
|
18
|
+
</el-row>
|
|
19
|
+
</nm-form-dialog>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
import { mixins } from 'haiwei-ui'
|
|
23
|
+
|
|
24
|
+
// 接口
|
|
25
|
+
const { add, edit, update } = $api.common.dictGroup
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
mixins: [mixins.formSave],
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
title: '字典分组',
|
|
32
|
+
actions: { add, edit, update },
|
|
33
|
+
form: {
|
|
34
|
+
width: '500px',
|
|
35
|
+
model: {
|
|
36
|
+
/** 名称 */
|
|
37
|
+
name: '',
|
|
38
|
+
/** 编码 */
|
|
39
|
+
code: '',
|
|
40
|
+
// 图标
|
|
41
|
+
icon: '',
|
|
42
|
+
/** 排序 */
|
|
43
|
+
sort: 0
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
name: [{ required: true, message: '请输入名称' }],
|
|
47
|
+
code: [{ required: true, message: '请输入编码' }],
|
|
48
|
+
sort: [
|
|
49
|
+
{ required: true, message: '请输入序号' },
|
|
50
|
+
{ type: 'number', message: '请输入数字' }
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
width: 250,
|
|
6
|
+
show: false
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'name',
|
|
10
|
+
label: '名称'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'code',
|
|
14
|
+
label: '编码'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'icon',
|
|
18
|
+
label: '图标'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'sort',
|
|
22
|
+
label: '排序'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'creator',
|
|
26
|
+
label: '创建人',
|
|
27
|
+
width: 100,
|
|
28
|
+
show: false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'createdTime',
|
|
32
|
+
label: '创建时间',
|
|
33
|
+
width: 150,
|
|
34
|
+
show: false
|
|
35
|
+
}
|
|
36
|
+
]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-list ref="list" v-bind="list">
|
|
4
|
+
<!--查询条件-->
|
|
5
|
+
<template v-slot:querybar>
|
|
6
|
+
<el-form-item label="名称:" prop="name">
|
|
7
|
+
<el-input v-model="list.model.name" clearable />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="编码:" prop="code">
|
|
10
|
+
<el-input v-model="list.model.code" clearable />
|
|
11
|
+
</el-form-item>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<!--按钮-->
|
|
15
|
+
<template v-slot:querybar-buttons="{ total }">
|
|
16
|
+
<nm-button v-bind="buttons.add" @click="add(total)" />
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<template v-slot:col-icon="{ row }">
|
|
20
|
+
<nm-icon class="nm-size-20" :name="row.icon" />
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<!--操作列-->
|
|
24
|
+
<template v-slot:col-operation="{ row }">
|
|
25
|
+
<nm-button v-bind="buttons.edit" @click="edit(row)" />
|
|
26
|
+
<nm-button-delete v-bind="buttons.del" :id="row.id" :action="removeAction" @success="refresh" />
|
|
27
|
+
</template>
|
|
28
|
+
</nm-list>
|
|
29
|
+
|
|
30
|
+
<!--编辑-->
|
|
31
|
+
<save-page :id="curr.id" :total="total" :visible.sync="dialog.save" @success="refresh" />
|
|
32
|
+
</nm-container>
|
|
33
|
+
</template>
|
|
34
|
+
<script>
|
|
35
|
+
import { mixins } from 'haiwei-ui'
|
|
36
|
+
import page from './page'
|
|
37
|
+
import cols from './cols'
|
|
38
|
+
import SavePage from '../components/save'
|
|
39
|
+
|
|
40
|
+
// 接口
|
|
41
|
+
const api = $api.common.dictGroup
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: page.name,
|
|
45
|
+
mixins: [mixins.list],
|
|
46
|
+
components: { SavePage },
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
list: {
|
|
50
|
+
title: page.title,
|
|
51
|
+
cols,
|
|
52
|
+
action: api.query,
|
|
53
|
+
model: {
|
|
54
|
+
/** 名称 */
|
|
55
|
+
name: '',
|
|
56
|
+
/** 编码 */
|
|
57
|
+
code: '',
|
|
58
|
+
//图标
|
|
59
|
+
icon: ''
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
removeAction: api.remove,
|
|
63
|
+
buttons: page.buttons
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '字典分组'
|
|
4
|
+
this.icon = 'entity'
|
|
5
|
+
this.name = 'common_dictgroup'
|
|
6
|
+
this.path = '/common/dictgroup'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`]
|
|
10
|
+
|
|
11
|
+
this.buttons = {
|
|
12
|
+
add: {
|
|
13
|
+
text: '添加',
|
|
14
|
+
type: 'success',
|
|
15
|
+
icon: 'add',
|
|
16
|
+
code: `${this.name}_add`,
|
|
17
|
+
permissions: [`${this.name}_add_post`]
|
|
18
|
+
},
|
|
19
|
+
edit: {
|
|
20
|
+
text: '编辑',
|
|
21
|
+
type: 'text',
|
|
22
|
+
icon: 'edit',
|
|
23
|
+
code: `${this.name}_edit`,
|
|
24
|
+
permissions: [`${this.name}_edit_get`, `${this.name}_update_post`]
|
|
25
|
+
},
|
|
26
|
+
del: {
|
|
27
|
+
text: '删除',
|
|
28
|
+
type: 'text',
|
|
29
|
+
icon: 'delete',
|
|
30
|
+
code: `${this.name}_del`,
|
|
31
|
+
permissions: [`${this.name}_delete_delete`]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})()
|
|
35
|
+
|
|
36
|
+
/** 路由信息 */
|
|
37
|
+
export const route = {
|
|
38
|
+
page,
|
|
39
|
+
component: () => import(/* webpackChunkName: "Common.DictGroup" */ './index')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default page
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="nm-common-dict-extend-editor">
|
|
3
|
+
<el-button-group class="nm-common-dict-extend-editor-toolbar">
|
|
4
|
+
<template v-for="tool in tools">
|
|
5
|
+
<component :is="tool" :key="tool" :value="value_" @success="onSuccess"></component>
|
|
6
|
+
</template>
|
|
7
|
+
</el-button-group>
|
|
8
|
+
<el-input type="textarea" :rows="5" v-model="value_" clearable />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
import { mapState } from 'vuex'
|
|
13
|
+
export default {
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
value_: this.value
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
value: String
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
...mapState('app/system', { globalComponents: s => s.globalComponents }),
|
|
24
|
+
tools() {
|
|
25
|
+
return this.globalComponents.filter(name => {
|
|
26
|
+
//自定义组件名称为nm-common-dict-item-extend-editor-tool的缩写
|
|
27
|
+
return name.startsWith('nm-ccdieet-')
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
onSuccess(text) {
|
|
33
|
+
this.value_ = text
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
watch: {
|
|
37
|
+
value(val) {
|
|
38
|
+
if (val !== this.value_) this.value_ = val
|
|
39
|
+
},
|
|
40
|
+
value_(val) {
|
|
41
|
+
this.$emit('input', val)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
.nm-common-dict-extend-editor {
|
|
48
|
+
&-toolbar {
|
|
49
|
+
> div {
|
|
50
|
+
float: left;
|
|
51
|
+
> .el-button {
|
|
52
|
+
padding: 5px 10px !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
show: false
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'name',
|
|
9
|
+
label: '名称'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'value',
|
|
13
|
+
label: '值'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'extend',
|
|
17
|
+
label: '扩展数据'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'icon',
|
|
21
|
+
label: '图标'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'sort',
|
|
25
|
+
label: '排序',
|
|
26
|
+
sortable: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'creator',
|
|
30
|
+
label: '创建人',
|
|
31
|
+
width: 100,
|
|
32
|
+
show: false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'createdTime',
|
|
36
|
+
label: '创建时间',
|
|
37
|
+
width: 150,
|
|
38
|
+
show: false
|
|
39
|
+
}
|
|
40
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-list ref="list" v-bind="list">
|
|
3
|
+
<!--查询条件-->
|
|
4
|
+
<template v-slot:querybar>
|
|
5
|
+
<el-form-item label="名称:" prop="name">
|
|
6
|
+
<el-input v-model="list.model.name" clearable />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<!--按钮-->
|
|
11
|
+
<template v-slot:querybar-buttons="{ total }">
|
|
12
|
+
<nm-button text="添加" type="success" icon="add" @click="add(total)" />
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<!--操作列-->
|
|
16
|
+
<template v-slot:col-operation="{ row }">
|
|
17
|
+
<nm-button text="编辑" type="text" icon="edit" @click="edit(row)" />
|
|
18
|
+
<nm-button-delete type="text" icon="delete" :id="row.id" :action="removeAction" @success="onDelete(row)" />
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<save-page :id="curr.id" :total="total" :parent-id="parentId" :dict="dict" :visible.sync="dialog.save" @success="onSave" />
|
|
22
|
+
</nm-list>
|
|
23
|
+
</template>
|
|
24
|
+
<script>
|
|
25
|
+
import { mixins } from 'haiwei-ui'
|
|
26
|
+
import cols from './cols'
|
|
27
|
+
import SavePage from '../save'
|
|
28
|
+
|
|
29
|
+
const api = $api.common.dictItem
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
mixins: [mixins.list],
|
|
33
|
+
components: { SavePage },
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
list: {
|
|
37
|
+
title: '数据项列表',
|
|
38
|
+
cols,
|
|
39
|
+
action: api.query,
|
|
40
|
+
model: {
|
|
41
|
+
groupCode: this.dict.groupCode,
|
|
42
|
+
dictCode: this.dict.code,
|
|
43
|
+
parentId: this.parentId,
|
|
44
|
+
name: '',
|
|
45
|
+
code: ''
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
removeAction: api.remove
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
dict: Object,
|
|
53
|
+
parentId: Number
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
refresh() {
|
|
57
|
+
this.list.model.groupCode = this.dict.groupCode
|
|
58
|
+
this.list.model.dictCode = this.dict.code
|
|
59
|
+
this.list.model.parentId = this.parentId
|
|
60
|
+
this.$nextTick(() => {
|
|
61
|
+
this.$refs.list.refresh()
|
|
62
|
+
})
|
|
63
|
+
},
|
|
64
|
+
onSave(isAdd, model) {
|
|
65
|
+
if (isAdd) {
|
|
66
|
+
this.$emit('add-success', model)
|
|
67
|
+
} else {
|
|
68
|
+
this.$emit('edit-success', model)
|
|
69
|
+
}
|
|
70
|
+
this.refresh()
|
|
71
|
+
},
|
|
72
|
+
onDelete(row) {
|
|
73
|
+
this.$emit('del-success', row.value)
|
|
74
|
+
this.refresh()
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
watch: {
|
|
78
|
+
parentId() {
|
|
79
|
+
this.refresh()
|
|
80
|
+
},
|
|
81
|
+
dict() {
|
|
82
|
+
this.refresh()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</script>
|