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,118 @@
|
|
|
1
|
+
import { mapState } from 'vuex'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
data() {
|
|
5
|
+
return {
|
|
6
|
+
id: this.value,
|
|
7
|
+
loading: false
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
value: {
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
/** 模块 */
|
|
15
|
+
module: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
/** 分组 */
|
|
20
|
+
group: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
/** 文件名 */
|
|
25
|
+
name: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
/** 是否需要授权访问 */
|
|
30
|
+
auth: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
/** 上传前函数 */
|
|
35
|
+
beforeUpload: Function,
|
|
36
|
+
/** 接受上传的文件类型 */
|
|
37
|
+
accept: String,
|
|
38
|
+
/** 文件最大大小 */
|
|
39
|
+
maxSize: String,
|
|
40
|
+
/** 是否可拖拽上传 */
|
|
41
|
+
drag: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
/** 可接受文件类型 */
|
|
46
|
+
fileType: {
|
|
47
|
+
type: Array
|
|
48
|
+
},
|
|
49
|
+
//禁用
|
|
50
|
+
disabled: Boolean
|
|
51
|
+
},
|
|
52
|
+
computed: {
|
|
53
|
+
...mapState('app/token', ['accessToken']),
|
|
54
|
+
maxSizeBytes() {
|
|
55
|
+
if (this.maxSize) {
|
|
56
|
+
const max = this.maxSize.toLowerCase()
|
|
57
|
+
if (max.endsWith('kb')) {
|
|
58
|
+
return parseFloat(max.replace('kb', '')) * 1024
|
|
59
|
+
} else if (max.endsWith('mb')) {
|
|
60
|
+
return parseFloat(max.replace('mb', '')) * 1024 * 1024
|
|
61
|
+
} else if (max.endsWith('gb')) {
|
|
62
|
+
return parseFloat(max.replace('gb', '')) * 1024 * 1024 * 1024
|
|
63
|
+
} else if (max.endsWith('tb')) {
|
|
64
|
+
return parseFloat(max.replace('tb', '')) * 1024 * 1024 * 1024 * 1024
|
|
65
|
+
} else if (max.endsWith('b')) {
|
|
66
|
+
return parseFloat(max.replace('b', ''))
|
|
67
|
+
} else {
|
|
68
|
+
return parseFloat(max)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return ''
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
onError() {
|
|
76
|
+
this._error('上传失败')
|
|
77
|
+
this.$emit('error')
|
|
78
|
+
this.loading = false
|
|
79
|
+
},
|
|
80
|
+
getSizeUnit(size) {
|
|
81
|
+
if (size === null || size === '') {
|
|
82
|
+
return '0 B'
|
|
83
|
+
}
|
|
84
|
+
var unitArr = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
85
|
+
var index = 0
|
|
86
|
+
var srcsize = parseFloat(size)
|
|
87
|
+
index = Math.floor(Math.log(srcsize) / Math.log(1024))
|
|
88
|
+
var s = srcsize / Math.pow(1024, index)
|
|
89
|
+
s = s.toFixed(2)
|
|
90
|
+
return s + unitArr[index]
|
|
91
|
+
},
|
|
92
|
+
/** 获取文件后缀名 */
|
|
93
|
+
getFileExt(name) {
|
|
94
|
+
let ext = ''
|
|
95
|
+
const arr = name.split('.')
|
|
96
|
+
if (arr.length > 1) {
|
|
97
|
+
ext = arr[arr.length - 1]
|
|
98
|
+
}
|
|
99
|
+
return ext
|
|
100
|
+
},
|
|
101
|
+
/** 验证文件类型 */
|
|
102
|
+
verifyFileType(file) {
|
|
103
|
+
if (this.fileType && this.fileType.length > 0) {
|
|
104
|
+
var ext = this.getFileExt(file.name)
|
|
105
|
+
if (this.fileType.every(m => m.toLowerCase() !== ext)) {
|
|
106
|
+
this._error(`.${ext} 文件类型不支持!`)
|
|
107
|
+
return false
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
watch: {
|
|
114
|
+
value(val) {
|
|
115
|
+
this.id = val
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './api'
|
|
2
|
+
import store from './store'
|
|
3
|
+
import routes from './routes'
|
|
4
|
+
import components from './components'
|
|
5
|
+
import module from './module'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
module,
|
|
9
|
+
routes,
|
|
10
|
+
store,
|
|
11
|
+
components,
|
|
12
|
+
callback({ Vue }) {
|
|
13
|
+
// 附件上传地址
|
|
14
|
+
Vue.prototype.$attachment = {
|
|
15
|
+
// 上传地址
|
|
16
|
+
uploadUrl: $api.common.attachment.getUploadUrl(),
|
|
17
|
+
// 下载方法
|
|
18
|
+
download(id) {
|
|
19
|
+
$api.common.attachment.download(id)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/main.js
ADDED
package/src/module.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
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="parentId">
|
|
6
|
+
<el-input v-model="parent.fullPath" disabled />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
</el-row>
|
|
10
|
+
<el-row>
|
|
11
|
+
<el-col :span="10" :offset="1">
|
|
12
|
+
<el-form-item label="名称:" prop="name">
|
|
13
|
+
<el-input v-model="form.model.name" clearable />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</el-col>
|
|
16
|
+
<el-col :span="10">
|
|
17
|
+
<el-form-item label="编码:" prop="code">
|
|
18
|
+
<el-input v-model="form.model.code" clearable />
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
</el-row>
|
|
22
|
+
<el-row>
|
|
23
|
+
<el-col :span="10" :offset="1">
|
|
24
|
+
<el-form-item label="精度:" prop="longitude">
|
|
25
|
+
<el-input v-model="form.model.longitude" clearable />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
</el-col>
|
|
28
|
+
<el-col :span="10">
|
|
29
|
+
<el-form-item label="纬度:" prop="latitude">
|
|
30
|
+
<el-input v-model="form.model.latitude" clearable />
|
|
31
|
+
</el-form-item>
|
|
32
|
+
</el-col>
|
|
33
|
+
</el-row>
|
|
34
|
+
<el-row>
|
|
35
|
+
<el-col :span="10" :offset="1">
|
|
36
|
+
<el-form-item label="邮编:" prop="zipCode">
|
|
37
|
+
<el-input v-model="form.model.zipCode" clearable />
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</el-col>
|
|
40
|
+
<el-col :span="10">
|
|
41
|
+
<el-form-item label="区号:" prop="areaCode">
|
|
42
|
+
<el-input v-model="form.model.areaCode" clearable />
|
|
43
|
+
</el-form-item>
|
|
44
|
+
</el-col>
|
|
45
|
+
</el-row>
|
|
46
|
+
</nm-form-dialog>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import { mixins } from 'haiwei-ui'
|
|
50
|
+
|
|
51
|
+
// 接口
|
|
52
|
+
const { add, edit, update } = $api.common.area
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
mixins: [mixins.formSave],
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
title: '区划代码',
|
|
59
|
+
actions: { add, edit, update },
|
|
60
|
+
form: {
|
|
61
|
+
model: {
|
|
62
|
+
/** 父节点 */
|
|
63
|
+
parentId: '',
|
|
64
|
+
/** 名称 */
|
|
65
|
+
name: '',
|
|
66
|
+
/** 编码 */
|
|
67
|
+
code: '',
|
|
68
|
+
/** 精度 */
|
|
69
|
+
longitude: '',
|
|
70
|
+
/** 纬度 */
|
|
71
|
+
latitude: '',
|
|
72
|
+
/** 邮编 */
|
|
73
|
+
zipCode: '',
|
|
74
|
+
/** 区号 */
|
|
75
|
+
areaCode: ''
|
|
76
|
+
},
|
|
77
|
+
rules: {
|
|
78
|
+
parentId: [{ required: true, message: '请选择父节点' }],
|
|
79
|
+
name: [{ required: true, message: '请输入名称' }],
|
|
80
|
+
code: [{ required: true, message: '请输入编码' }]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
props: {
|
|
86
|
+
parent: Object
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
afterOpen() {
|
|
90
|
+
if (this.isAdd_) {
|
|
91
|
+
this.form.model.parentId = this.parent.id
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
show: false
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'code',
|
|
9
|
+
label: '编码'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'name',
|
|
13
|
+
label: '名称',
|
|
14
|
+
width: 200
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pinyin',
|
|
18
|
+
label: '拼音',
|
|
19
|
+
width: 200,
|
|
20
|
+
show: false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'jianpin',
|
|
24
|
+
label: '简拼'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'longitude',
|
|
28
|
+
label: '精度'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'latitude',
|
|
32
|
+
label: '纬度'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'areaCode',
|
|
36
|
+
label: '区号'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'zipCode',
|
|
40
|
+
label: '邮编'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'level',
|
|
44
|
+
label: '级别',
|
|
45
|
+
width: 50
|
|
46
|
+
}
|
|
47
|
+
]
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-split v-model="split">
|
|
4
|
+
<template v-slot:left>
|
|
5
|
+
<nm-box page header title="行政区划代码" type="success" icon="menu" :toolbar="null">
|
|
6
|
+
<el-tree
|
|
7
|
+
ref="tree"
|
|
8
|
+
node-key="id"
|
|
9
|
+
highlight-current
|
|
10
|
+
lazy
|
|
11
|
+
:data="tree"
|
|
12
|
+
:load="treeLoad"
|
|
13
|
+
:show-checkbox="false"
|
|
14
|
+
:expand-on-click-node="false"
|
|
15
|
+
:current-node-key="0"
|
|
16
|
+
:default-expanded-keys="[0]"
|
|
17
|
+
:props="{ isLeaf: 'leaf' }"
|
|
18
|
+
@current-change="onSelectChange"
|
|
19
|
+
></el-tree>
|
|
20
|
+
</nm-box>
|
|
21
|
+
</template>
|
|
22
|
+
<template v-slot:right>
|
|
23
|
+
<nm-list ref="list" v-bind="list">
|
|
24
|
+
<!--查询条件-->
|
|
25
|
+
<template v-slot:querybar>
|
|
26
|
+
<el-form-item label="名称:" prop="name">
|
|
27
|
+
<el-input v-model="list.model.name" clearable />
|
|
28
|
+
</el-form-item>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<!--按钮-->
|
|
32
|
+
<template v-slot:querybar-buttons>
|
|
33
|
+
<nm-button v-bind="buttons.add" @click="add" />
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<!--操作列-->
|
|
37
|
+
<template v-slot:col-operation="{ row }">
|
|
38
|
+
<nm-button v-bind="buttons.edit" @click="edit(row)" />
|
|
39
|
+
<nm-button-delete v-bind="buttons.del" :action="removeAction" :id="row.id" @success="refresh" />
|
|
40
|
+
</template>
|
|
41
|
+
</nm-list>
|
|
42
|
+
</template>
|
|
43
|
+
</nm-split>
|
|
44
|
+
|
|
45
|
+
<save-page :id="curr.id" :parent="parent" :visible.sync="dialog.save" @success="refresh" />
|
|
46
|
+
</nm-container>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import { mixins } from 'haiwei-ui'
|
|
50
|
+
import page from './page'
|
|
51
|
+
import cols from './cols'
|
|
52
|
+
import SavePage from '../components/save'
|
|
53
|
+
|
|
54
|
+
// 接口
|
|
55
|
+
const api = $api.common.area
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
name: page.name,
|
|
59
|
+
mixins: [mixins.list],
|
|
60
|
+
components: { SavePage },
|
|
61
|
+
data() {
|
|
62
|
+
return {
|
|
63
|
+
split: 0.2,
|
|
64
|
+
list: {
|
|
65
|
+
title: page.title,
|
|
66
|
+
cols,
|
|
67
|
+
action: api.query,
|
|
68
|
+
model: {
|
|
69
|
+
parentId: 0,
|
|
70
|
+
/** 名称 */
|
|
71
|
+
name: ''
|
|
72
|
+
},
|
|
73
|
+
operationWidth: 130,
|
|
74
|
+
loading: false,
|
|
75
|
+
loadingText: '正在努力加载数据,请稍后...'
|
|
76
|
+
},
|
|
77
|
+
removeAction: api.remove,
|
|
78
|
+
buttons: page.buttons,
|
|
79
|
+
tree: [],
|
|
80
|
+
parent: {
|
|
81
|
+
id: 0,
|
|
82
|
+
fullPath: ''
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
async treeLoad(node, resolve) {
|
|
88
|
+
const id = node.data.id
|
|
89
|
+
if (id !== 0 && !id) {
|
|
90
|
+
resolve([{ id: 0, label: '行政区划代码' }])
|
|
91
|
+
} else {
|
|
92
|
+
const data = await api.queryChildren(node.data.code)
|
|
93
|
+
const children = data.map(item => {
|
|
94
|
+
return {
|
|
95
|
+
id: item.id,
|
|
96
|
+
code: item.code,
|
|
97
|
+
label: item.name,
|
|
98
|
+
leaf: item.level === 3
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
resolve(children)
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
onSelectChange(data, node) {
|
|
105
|
+
this.parent.id = data.id
|
|
106
|
+
this.parent.fullPath = this.getFullPath(node)
|
|
107
|
+
this.list.model.parentId = data.id
|
|
108
|
+
this.refresh()
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* 获取节点的完整路径
|
|
112
|
+
*/
|
|
113
|
+
getFullPath(node) {
|
|
114
|
+
if (node.parent === null || node.data.id === 0) {
|
|
115
|
+
return ''
|
|
116
|
+
}
|
|
117
|
+
const parentPath = this.getFullPath(node.parent)
|
|
118
|
+
if (parentPath === '') {
|
|
119
|
+
return node.data.label
|
|
120
|
+
} else {
|
|
121
|
+
return parentPath + ' / ' + node.data.label
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '区划代码'
|
|
4
|
+
this.icon = 'area'
|
|
5
|
+
this.name = 'common_area'
|
|
6
|
+
this.path = '/common/area'
|
|
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
|
+
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.Area" */ './index')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default page
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
width: 250,
|
|
6
|
+
show: false
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'fileName',
|
|
10
|
+
label: '名称'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'saveName',
|
|
14
|
+
label: '存储名称',
|
|
15
|
+
show: false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'module',
|
|
19
|
+
label: '所属模块',
|
|
20
|
+
width: 120
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'group',
|
|
24
|
+
label: '分组',
|
|
25
|
+
width: 120
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'ext',
|
|
29
|
+
label: '扩展名',
|
|
30
|
+
width: 120
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'sizeCn',
|
|
34
|
+
label: '大小',
|
|
35
|
+
width: 150
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'md5',
|
|
39
|
+
label: 'MD5',
|
|
40
|
+
show: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'fullPath',
|
|
44
|
+
label: '路径',
|
|
45
|
+
show: false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'creator',
|
|
49
|
+
label: '创建人',
|
|
50
|
+
width: 100,
|
|
51
|
+
show: false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'createdTime',
|
|
55
|
+
label: '创建时间',
|
|
56
|
+
width: 150,
|
|
57
|
+
show: false
|
|
58
|
+
}
|
|
59
|
+
]
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<!--操作列-->
|
|
12
|
+
<template v-slot:col-operation="{ row }">
|
|
13
|
+
<nm-button v-bind="buttons.export" @click="onDownload(row)" />
|
|
14
|
+
<nm-button-delete v-bind="buttons.del" :id="row.id" :action="removeAction" @success="refresh" />
|
|
15
|
+
</template>
|
|
16
|
+
</nm-list>
|
|
17
|
+
</nm-container>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import page from './page'
|
|
21
|
+
import cols from './cols'
|
|
22
|
+
|
|
23
|
+
// 接口
|
|
24
|
+
const api = $api.common.attachment
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: page.name,
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
curr: { id: '' },
|
|
31
|
+
list: {
|
|
32
|
+
title: page.title,
|
|
33
|
+
operationWidth: '150',
|
|
34
|
+
cols,
|
|
35
|
+
action: api.query,
|
|
36
|
+
model: {
|
|
37
|
+
/** 名称 */
|
|
38
|
+
name: ''
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
removeAction: api.remove,
|
|
42
|
+
buttons: page.buttons,
|
|
43
|
+
dialog: {
|
|
44
|
+
upload: false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
refresh() {
|
|
50
|
+
this.$refs.list.refresh()
|
|
51
|
+
},
|
|
52
|
+
upload() {
|
|
53
|
+
this.dialog.upload = true
|
|
54
|
+
},
|
|
55
|
+
onDownload(row) {
|
|
56
|
+
api.download(row.id)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '附件管理'
|
|
4
|
+
this.icon = 'attachment'
|
|
5
|
+
this.name = 'common_attachment'
|
|
6
|
+
this.path = '/common/attachment'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`]
|
|
10
|
+
|
|
11
|
+
// 按钮
|
|
12
|
+
this.buttons = {
|
|
13
|
+
del: {
|
|
14
|
+
text: '删除',
|
|
15
|
+
type: 'text',
|
|
16
|
+
icon: 'delete',
|
|
17
|
+
code: `${this.name}_del`,
|
|
18
|
+
permissions: [`${this.name}_delete_delete`]
|
|
19
|
+
},
|
|
20
|
+
export: {
|
|
21
|
+
text: '导出',
|
|
22
|
+
type: 'text',
|
|
23
|
+
icon: 'export',
|
|
24
|
+
code: `${this.name}_export`,
|
|
25
|
+
permissions: [`${this.name}_export_get`]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})()
|
|
29
|
+
|
|
30
|
+
/** 路由信息 */
|
|
31
|
+
export const route = {
|
|
32
|
+
page,
|
|
33
|
+
component: () => import(/* webpackChunkName: "Common.Attachment" */ './index')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default page
|