create-jnrs-template-vue 1.2.3 → 1.2.4
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/jnrs-template-vue/.env.development +1 -1
- package/jnrs-template-vue/index.html +1 -1
- package/jnrs-template-vue/package.json +3 -3
- package/jnrs-template-vue/public/system/menu.json +11 -2
- package/jnrs-template-vue/src/api/demos/index.ts +17 -10
- package/jnrs-template-vue/src/api/system/index.ts +11 -1
- package/jnrs-template-vue/src/assets/styles/index.scss +0 -24
- package/jnrs-template-vue/src/assets/styles/init.scss +24 -0
- package/jnrs-template-vue/src/assets/styles/root.scss +4 -0
- package/jnrs-template-vue/src/components/common/CardTable.vue +89 -0
- package/jnrs-template-vue/src/components/common/DictTag.vue +8 -4
- package/jnrs-template-vue/src/components/common/ImageView.vue +16 -7
- package/jnrs-template-vue/src/components/common/PdfView.vue +14 -5
- package/jnrs-template-vue/src/components/select/SelectManager.vue +2 -2
- package/jnrs-template-vue/src/layout/SideMenu.vue +0 -1
- package/jnrs-template-vue/src/layout/TopHeader.vue +7 -14
- package/jnrs-template-vue/src/types/webSocket.ts +19 -0
- package/jnrs-template-vue/src/utils/file.ts +36 -1
- package/jnrs-template-vue/src/views/demos/crud/index.vue +24 -36
- package/jnrs-template-vue/src/views/demos/simpleTable/index.vue +41 -0
- package/jnrs-template-vue/src/views/demos/unitTest/RequestPage.vue +2 -2
- package/jnrs-template-vue/src/views/login/index.vue +18 -15
- package/jnrs-template-vue/src/views/system/dict/index.vue +63 -76
- package/jnrs-template-vue/src/views/system/menu/index.vue +42 -54
- package/jnrs-template-vue/src/views/system/mine/baseInfo.vue +26 -59
- package/jnrs-template-vue/src/views/system/role/index.vue +20 -29
- package/jnrs-template-vue/src/views/visual/index.vue +130 -15
- package/package.json +1 -1
- package/jnrs-template-vue/src/composables/base/useAvatar.ts +0 -36
- package/jnrs-template-vue/src/composables/tools/useMouseSelection.ts +0 -150
|
@@ -8,14 +8,8 @@ import { Plus } from '@element-plus/icons-vue'
|
|
|
8
8
|
import { objectMatchAssign, dateFormatsToObject } from '@jnrs/shared'
|
|
9
9
|
import { debounce } from '@jnrs/shared/lodash'
|
|
10
10
|
import { isNumberGtZero } from '@jnrs/shared/validator'
|
|
11
|
-
import { getDictList,
|
|
12
|
-
import {
|
|
13
|
-
DemosTableApi,
|
|
14
|
-
DemosFormApi,
|
|
15
|
-
DemosImportTemplateApi,
|
|
16
|
-
DemosImportDataApi,
|
|
17
|
-
DemosExportApi
|
|
18
|
-
} from '@/api/demos/index'
|
|
11
|
+
import { getDictList, downloadFile } from '@/utils/packages'
|
|
12
|
+
import { TableApi, EditApi, ImportTemplateApi, ImportDataApi, ExportApi } from '@/api/demos/index'
|
|
19
13
|
|
|
20
14
|
import { JnDialog, JnDatetime, JnPagination, JnFileUpload, JnTable, JnImportAndExport } from '@jnrs/vue-core/components'
|
|
21
15
|
import ImageView from '@/components/common/ImageView.vue'
|
|
@@ -39,7 +33,6 @@ const ruleFormRef = ref<FormInstance>()
|
|
|
39
33
|
const ruleForm = ref<AddProjectItem>({
|
|
40
34
|
id: '',
|
|
41
35
|
name: '',
|
|
42
|
-
program: '',
|
|
43
36
|
projectType: undefined,
|
|
44
37
|
managerId: undefined,
|
|
45
38
|
budget: 0,
|
|
@@ -50,7 +43,6 @@ const ruleForm = ref<AddProjectItem>({
|
|
|
50
43
|
})
|
|
51
44
|
const rules = ref<FormRules>({
|
|
52
45
|
name: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
53
|
-
program: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
54
46
|
projectType: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
55
47
|
plannedStartDate: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
56
48
|
newImageFiles: [{ required: true, message: '请上传', trigger: 'change' }],
|
|
@@ -76,9 +68,10 @@ const handleSelectionChange = (row: ProjectItem[]) => {
|
|
|
76
68
|
console.log(row)
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
const
|
|
71
|
+
const getTable = debounce(async () => {
|
|
72
|
+
loading.value = true
|
|
80
73
|
try {
|
|
81
|
-
const res = await
|
|
74
|
+
const res = await TableApi({
|
|
82
75
|
...pagination.value,
|
|
83
76
|
...queryForm.value
|
|
84
77
|
})
|
|
@@ -90,6 +83,8 @@ const getDemosTable = debounce(async () => {
|
|
|
90
83
|
total.value = res.count
|
|
91
84
|
} catch (error) {
|
|
92
85
|
console.error(error)
|
|
86
|
+
} finally {
|
|
87
|
+
loading.value = false
|
|
93
88
|
}
|
|
94
89
|
}, 300)
|
|
95
90
|
|
|
@@ -115,15 +110,12 @@ const submitForm = () => {
|
|
|
115
110
|
ruleFormRef.value?.validate(async (valid) => {
|
|
116
111
|
if (valid) {
|
|
117
112
|
loading.value = true
|
|
118
|
-
const formData = objectToFormData({
|
|
119
|
-
...ruleForm.value,
|
|
120
|
-
managerId: ruleForm.value.managerId?.managerId
|
|
121
|
-
})
|
|
122
113
|
try {
|
|
123
|
-
await
|
|
114
|
+
await EditApi(ruleForm.value)
|
|
124
115
|
ElMessage({
|
|
125
116
|
message: '数据已保存',
|
|
126
117
|
grouping: true,
|
|
118
|
+
showClose: true,
|
|
127
119
|
type: 'success'
|
|
128
120
|
})
|
|
129
121
|
} catch (err) {
|
|
@@ -136,7 +128,7 @@ const submitForm = () => {
|
|
|
136
128
|
}
|
|
137
129
|
|
|
138
130
|
onActivated(() => {
|
|
139
|
-
|
|
131
|
+
getTable()
|
|
140
132
|
})
|
|
141
133
|
</script>
|
|
142
134
|
|
|
@@ -216,17 +208,17 @@ onActivated(() => {
|
|
|
216
208
|
</template>
|
|
217
209
|
</JnDialog>
|
|
218
210
|
|
|
219
|
-
<el-card>
|
|
211
|
+
<el-card v-loading="loading">
|
|
220
212
|
<template #header>
|
|
221
213
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
|
222
214
|
<span>项目管理</span>
|
|
223
215
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
|
224
216
|
<JnImportAndExport
|
|
225
|
-
:importTemplateApi="
|
|
217
|
+
:importTemplateApi="ImportTemplateApi"
|
|
226
218
|
importBtnName="导入项目"
|
|
227
|
-
:importApi="
|
|
219
|
+
:importApi="ImportDataApi"
|
|
228
220
|
exportBtnName="导出项目"
|
|
229
|
-
:exportApi="
|
|
221
|
+
:exportApi="ExportApi"
|
|
230
222
|
:exportParams="{
|
|
231
223
|
...dateFormatsToObject(queryForm.plannedStartDate)
|
|
232
224
|
}"
|
|
@@ -236,7 +228,7 @@ onActivated(() => {
|
|
|
236
228
|
}"
|
|
237
229
|
:exportDisabled="tableData.length === 0"
|
|
238
230
|
size="small"
|
|
239
|
-
@change="
|
|
231
|
+
@change="getTable()"
|
|
240
232
|
/>
|
|
241
233
|
<el-button type="primary" size="small" :icon="Plus" @click="handleEdit()" style="margin-left: 12px">
|
|
242
234
|
新增
|
|
@@ -248,9 +240,9 @@ onActivated(() => {
|
|
|
248
240
|
<!-- 查询条件 -->
|
|
249
241
|
<el-form :model="queryForm" size="small" inline v-loading="loading">
|
|
250
242
|
<el-form-item label="项目编号" prop="code">
|
|
251
|
-
<el-input v-model="queryForm.code" clearable style="width:
|
|
243
|
+
<el-input v-model="queryForm.code" clearable style="width: 200px">
|
|
252
244
|
<template #append>
|
|
253
|
-
<el-button icon="Search" @click="
|
|
245
|
+
<el-button icon="Search" @click="getTable()" />
|
|
254
246
|
</template>
|
|
255
247
|
</el-input>
|
|
256
248
|
</el-form-item>
|
|
@@ -260,8 +252,8 @@ onActivated(() => {
|
|
|
260
252
|
filterable
|
|
261
253
|
placeholder=""
|
|
262
254
|
clearable
|
|
263
|
-
style="width:
|
|
264
|
-
@change="
|
|
255
|
+
style="width: 200px"
|
|
256
|
+
@change="getTable()"
|
|
265
257
|
>
|
|
266
258
|
<el-option
|
|
267
259
|
:label="item.label"
|
|
@@ -277,7 +269,7 @@ onActivated(() => {
|
|
|
277
269
|
:initialParams="{ role: 1 }"
|
|
278
270
|
size="small"
|
|
279
271
|
width="200px"
|
|
280
|
-
@change="
|
|
272
|
+
@change="getTable()"
|
|
281
273
|
></SelectManager>
|
|
282
274
|
</el-form-item>
|
|
283
275
|
<el-form-item label="计划开始时间" prop="plannedStartDate">
|
|
@@ -285,8 +277,8 @@ onActivated(() => {
|
|
|
285
277
|
v-model="queryForm.plannedStartDate"
|
|
286
278
|
value-format="YYYY-MM-DD"
|
|
287
279
|
size="small"
|
|
288
|
-
style="width:
|
|
289
|
-
@change="
|
|
280
|
+
style="width: 200px"
|
|
281
|
+
@change="getTable()"
|
|
290
282
|
/>
|
|
291
283
|
</el-form-item>
|
|
292
284
|
</el-form>
|
|
@@ -303,11 +295,7 @@ onActivated(() => {
|
|
|
303
295
|
@selection-change="handleSelectionChange"
|
|
304
296
|
>
|
|
305
297
|
<el-table-column prop="code" label="项目编号" min-width="200" sortable show-overflow-tooltip />
|
|
306
|
-
<el-table-column prop="name" label="项目名称" min-width="200" sortable show-overflow-tooltip
|
|
307
|
-
<template #default="{ row }">
|
|
308
|
-
{{ row.name }}
|
|
309
|
-
</template>
|
|
310
|
-
</el-table-column>
|
|
298
|
+
<el-table-column prop="name" label="项目名称" min-width="200" sortable show-overflow-tooltip />
|
|
311
299
|
<el-table-column prop="program" label="项目集名称" min-width="200" sortable show-overflow-tooltip />
|
|
312
300
|
<el-table-column prop="projectType" label="项目类型" width="100" align="center" sortable>
|
|
313
301
|
<template #default="{ row }">
|
|
@@ -359,6 +347,6 @@ onActivated(() => {
|
|
|
359
347
|
</JnTable>
|
|
360
348
|
|
|
361
349
|
<!-- 表格分页 -->
|
|
362
|
-
<JnPagination :total="total" v-model="pagination" @change="
|
|
350
|
+
<JnPagination :total="total" v-model="pagination" @change="getTable" />
|
|
363
351
|
</el-card>
|
|
364
352
|
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TableApi } from '@/api/demos/index'
|
|
3
|
+
import { JnDatetime } from '@jnrs/vue-core/components'
|
|
4
|
+
import CardTable from '@/components/common/CardTable.vue'
|
|
5
|
+
import ImageView from '@/components/common/ImageView.vue'
|
|
6
|
+
import PdfView from '@/components/common/PdfView.vue'
|
|
7
|
+
import DictTag from '@/components/common/DictTag.vue'
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<CardTable :getTableDataApi="TableApi">
|
|
12
|
+
<template #header>项目列表</template>
|
|
13
|
+
<template #table>
|
|
14
|
+
<el-table-column prop="name" label="项目名称" min-width="200" sortable show-overflow-tooltip />
|
|
15
|
+
<el-table-column prop="projectType" label="项目类型" width="100" align="center" sortable>
|
|
16
|
+
<template #default="{ row }">
|
|
17
|
+
<DictTag dictName="projectType" :value="row.projectType" />
|
|
18
|
+
</template>
|
|
19
|
+
</el-table-column>
|
|
20
|
+
<el-table-column prop="manager" label="项目经理" width="100" align="center" sortable />
|
|
21
|
+
<el-table-column prop="plannedStartDate" label="计划开始时间" width="130" align="center" sortable>
|
|
22
|
+
<template #default="{ row }">
|
|
23
|
+
<JnDatetime :value="row.plannedStartDate" />
|
|
24
|
+
</template>
|
|
25
|
+
</el-table-column>
|
|
26
|
+
<el-table-column prop="description" label="描述" min-width="200" show-overflow-tooltip />
|
|
27
|
+
<el-table-column prop="imageDocument" label="图片" width="100" align="center" sortable>
|
|
28
|
+
<template #default="{ row }">
|
|
29
|
+
<ImageView :loadKeys="row.newImageFiles" preview height="50px" />
|
|
30
|
+
</template>
|
|
31
|
+
</el-table-column>
|
|
32
|
+
<el-table-column prop="attachmentDocument" label="附件" width="100" align="center" sortable>
|
|
33
|
+
<template #default="{ row }">
|
|
34
|
+
<PdfView :loadKeys="row.newAttachmentFile" isPdf />
|
|
35
|
+
</template>
|
|
36
|
+
</el-table-column>
|
|
37
|
+
</template>
|
|
38
|
+
</CardTable>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style lang="scss" scoped></style>
|
|
@@ -3,7 +3,7 @@ import { ref } from 'vue'
|
|
|
3
3
|
import { ElMessage } from 'element-plus'
|
|
4
4
|
import { objectToFormData } from '@/utils/packages'
|
|
5
5
|
import { LoginApi, UserInfoApi } from '@/api/system'
|
|
6
|
-
import { NotFoundApi,
|
|
6
|
+
import { NotFoundApi, NoAuthApi, DetailsApi } from '@/api/demos'
|
|
7
7
|
import { getFileUrl } from '@/utils/file'
|
|
8
8
|
import { downloadFile } from '@/utils/packages'
|
|
9
9
|
|
|
@@ -36,7 +36,7 @@ const handleNotFoundApi = async () => {
|
|
|
36
36
|
|
|
37
37
|
const handleNoAuth = async (showErrorMsg = true) => {
|
|
38
38
|
try {
|
|
39
|
-
const res = await
|
|
39
|
+
const res = await NoAuthApi(showErrorMsg)
|
|
40
40
|
console.log(res)
|
|
41
41
|
} catch (error) {
|
|
42
42
|
console.log(error)
|
|
@@ -45,18 +45,22 @@ const submitForm = async () => {
|
|
|
45
45
|
const { token, dict, ...restParameter } = loginRes
|
|
46
46
|
const loginDateTime = formatDateTime() + ' ' + formatWeekday()
|
|
47
47
|
|
|
48
|
-
// 获取角色列表,将登录人角色对应的权限叠加给当前登录人(一次性获取叠加)
|
|
49
|
-
const roleRes = await RoleApi()
|
|
50
48
|
let permissionsMerger = restParameter.permissions
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
try {
|
|
50
|
+
// 获取角色列表,将登录人角色对应的权限叠加给当前登录人(一次性获取叠加)
|
|
51
|
+
const roleRes = await RoleApi()
|
|
52
|
+
if (Array.isArray(restParameter.permissions)) {
|
|
53
|
+
permissionsMerger = [
|
|
54
|
+
...new Set([
|
|
55
|
+
...restParameter.permissions,
|
|
56
|
+
...(roleRes.find((r) => r.value === restParameter.role)?.permissions ?? []).flat()
|
|
57
|
+
])
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
setRole(roleRes) // 由于是一次性获取叠加,此处不需要保存角色列表到全局状态
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.log(e)
|
|
58
63
|
}
|
|
59
|
-
setRole(roleRes) // 由于是一次性获取叠加,此处不需要保存角色列表到全局状态
|
|
60
64
|
|
|
61
65
|
setUserInfo({
|
|
62
66
|
...restParameter,
|
|
@@ -153,6 +157,7 @@ const submitForm = async () => {
|
|
|
153
157
|
|
|
154
158
|
.topBarBtn {
|
|
155
159
|
font-size: 22px;
|
|
160
|
+
color: #c2c2c2;
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
.topFixed_right {
|
|
@@ -163,9 +168,9 @@ const submitForm = async () => {
|
|
|
163
168
|
display: flex;
|
|
164
169
|
align-items: center;
|
|
165
170
|
justify-content: space-around;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
border-radius: 10px;
|
|
171
|
+
padding: 8px 16px;
|
|
172
|
+
// background: var(--jnrs-card-primary);
|
|
173
|
+
// border-radius: 10px;
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
.card {
|
|
@@ -204,7 +209,6 @@ const submitForm = async () => {
|
|
|
204
209
|
.title {
|
|
205
210
|
text-align: center;
|
|
206
211
|
font-size: 24px;
|
|
207
|
-
letter-spacing: 4px;
|
|
208
212
|
white-space: nowrap;
|
|
209
213
|
font-weight: normal;
|
|
210
214
|
font-family: AlimamaShuHeiTi-Bold;
|
|
@@ -289,7 +293,6 @@ const submitForm = async () => {
|
|
|
289
293
|
position: absolute;
|
|
290
294
|
bottom: 5px;
|
|
291
295
|
font-size: 12px;
|
|
292
|
-
letter-spacing: 2px;
|
|
293
296
|
text-transform: uppercase;
|
|
294
297
|
color: rgba(0, 0, 0, 0.1);
|
|
295
298
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { DictItem } from '@jnrs/shared'
|
|
2
3
|
import { ElMessage } from 'element-plus'
|
|
3
4
|
import { ref, onActivated } from 'vue'
|
|
4
5
|
import { DictApi, DictDetailApi, DictChangeApi } from '@/api/system'
|
|
5
|
-
import { useReactivityTableHeight } from '@jnrs/vue-core/composables'
|
|
6
|
-
import type { DictItem } from '@jnrs/shared'
|
|
7
6
|
import { hasPermission } from '@/utils/permissions'
|
|
7
|
+
import { JnTable } from '@jnrs/vue-core/components'
|
|
8
8
|
|
|
9
|
-
const { maxHeight } = useReactivityTableHeight({ className: 'el_table_dict', bottomGap: 0 })
|
|
10
9
|
const PERMISSION_EDIT = ['dict:edit']
|
|
11
10
|
const loading = ref(false)
|
|
12
11
|
const tableData = ref<DictItem[]>()
|
|
@@ -73,80 +72,68 @@ const editKeyValue = (row: DictItem) => {
|
|
|
73
72
|
</script>
|
|
74
73
|
|
|
75
74
|
<template>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<el-table
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
v-loading="loading"
|
|
90
|
-
row-key="id"
|
|
91
|
-
@expand-change="handleExpandChange"
|
|
92
|
-
>
|
|
93
|
-
<el-table-column prop="dictName" label="字典名" />
|
|
94
|
-
<el-table-column prop="describe" label="说明" />
|
|
95
|
-
<el-table-column type="expand" fixed="right" label="字典值" width="100">
|
|
96
|
-
<template #default="scope">
|
|
97
|
-
<div class="table_expand animation15" style="animation-duration: 0.5s; animation-delay: 0s">
|
|
98
|
-
<div class="table_expand_top">
|
|
99
|
-
<h5>字典值列表</h5>
|
|
100
|
-
</div>
|
|
101
|
-
<el-table :data="scope.row.options" :border="true" size="small" row-key="value">
|
|
102
|
-
<el-table-column label="value" prop="value" width="100" align="center"></el-table-column>
|
|
103
|
-
<el-table-column label="label" prop="label">
|
|
104
|
-
<template #default="optionScope">
|
|
105
|
-
<el-input
|
|
106
|
-
v-model="optionScope.row.label"
|
|
107
|
-
maxlength="20"
|
|
108
|
-
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
109
|
-
/>
|
|
110
|
-
</template>
|
|
111
|
-
</el-table-column>
|
|
112
|
-
<el-table-column label="颜色" prop="displayColor">
|
|
113
|
-
<template #default="optionScope">
|
|
114
|
-
<el-color-picker
|
|
115
|
-
v-model="optionScope.row.displayColor"
|
|
116
|
-
:predefine="predefineColors"
|
|
117
|
-
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
118
|
-
/>
|
|
119
|
-
<span style="margin-left: 10px">
|
|
120
|
-
{{ optionScope.row.displayColor || '无' }}
|
|
121
|
-
</span>
|
|
122
|
-
</template>
|
|
123
|
-
</el-table-column>
|
|
124
|
-
<el-table-column prop="sequence" label="排序" width="180" align="center">
|
|
125
|
-
<template #default="optionScope">
|
|
126
|
-
<el-input-number
|
|
127
|
-
v-model="optionScope.row.sequence"
|
|
128
|
-
:min="1"
|
|
129
|
-
:max="999"
|
|
130
|
-
:step="1"
|
|
131
|
-
controls-position="right"
|
|
132
|
-
step-strictly
|
|
133
|
-
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
134
|
-
style="width: 140px"
|
|
135
|
-
/>
|
|
136
|
-
</template>
|
|
137
|
-
</el-table-column>
|
|
138
|
-
<el-table-column label="操作" width="100" align="center" fixed="right" v-permissions="PERMISSION_EDIT">
|
|
139
|
-
<template #default="optionScope">
|
|
140
|
-
<el-button type="success" size="small" @click="editKeyValue(optionScope.row)">确认修改</el-button>
|
|
141
|
-
</template>
|
|
142
|
-
</el-table-column>
|
|
143
|
-
</el-table>
|
|
75
|
+
<el-card v-loading="loading">
|
|
76
|
+
<template #header>
|
|
77
|
+
<span>字典管理</span>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<JnTable :data="tableData" @expand-change="handleExpandChange">
|
|
81
|
+
<el-table-column prop="dictName" label="字典名" />
|
|
82
|
+
<el-table-column prop="describe" label="说明" />
|
|
83
|
+
<el-table-column type="expand" fixed="right" label="字典值" width="100">
|
|
84
|
+
<template #default="scope">
|
|
85
|
+
<div class="table_expand">
|
|
86
|
+
<div class="table_expand_top">
|
|
87
|
+
<h5>字典值列表</h5>
|
|
144
88
|
</div>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
89
|
+
<el-table :data="scope.row.options" :border="true" size="small" row-key="value">
|
|
90
|
+
<el-table-column label="value" prop="value" width="100" align="center"></el-table-column>
|
|
91
|
+
<el-table-column label="label" prop="label">
|
|
92
|
+
<template #default="optionScope">
|
|
93
|
+
<el-input
|
|
94
|
+
v-model="optionScope.row.label"
|
|
95
|
+
maxlength="20"
|
|
96
|
+
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
97
|
+
/>
|
|
98
|
+
</template>
|
|
99
|
+
</el-table-column>
|
|
100
|
+
<el-table-column label="颜色" prop="displayColor">
|
|
101
|
+
<template #default="optionScope">
|
|
102
|
+
<el-color-picker
|
|
103
|
+
v-model="optionScope.row.displayColor"
|
|
104
|
+
:predefine="predefineColors"
|
|
105
|
+
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
106
|
+
/>
|
|
107
|
+
<span style="margin-left: 10px">
|
|
108
|
+
{{ optionScope.row.displayColor || '无' }}
|
|
109
|
+
</span>
|
|
110
|
+
</template>
|
|
111
|
+
</el-table-column>
|
|
112
|
+
<el-table-column prop="sequence" label="排序" width="180" align="center">
|
|
113
|
+
<template #default="optionScope">
|
|
114
|
+
<el-input-number
|
|
115
|
+
v-model="optionScope.row.sequence"
|
|
116
|
+
:min="1"
|
|
117
|
+
:max="999"
|
|
118
|
+
:step="1"
|
|
119
|
+
controls-position="right"
|
|
120
|
+
step-strictly
|
|
121
|
+
:disabled="!hasPermission(PERMISSION_EDIT)"
|
|
122
|
+
style="width: 140px"
|
|
123
|
+
/>
|
|
124
|
+
</template>
|
|
125
|
+
</el-table-column>
|
|
126
|
+
<el-table-column label="操作" width="100" align="center" fixed="right" v-permissions="PERMISSION_EDIT">
|
|
127
|
+
<template #default="optionScope">
|
|
128
|
+
<el-button type="success" size="small" @click="editKeyValue(optionScope.row)">确认修改</el-button>
|
|
129
|
+
</template>
|
|
130
|
+
</el-table-column>
|
|
131
|
+
</el-table>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
134
|
+
</el-table-column>
|
|
135
|
+
</JnTable>
|
|
136
|
+
</el-card>
|
|
150
137
|
</template>
|
|
151
138
|
|
|
152
139
|
<style scoped lang="scss">
|
|
@@ -1,65 +1,53 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { useMenuStore } from '@jnrs/vue-core/pinia'
|
|
4
|
-
import {
|
|
4
|
+
import { JnTable } from '@jnrs/vue-core/components'
|
|
5
5
|
|
|
6
|
-
const { maxHeight } = useReactivityTableHeight({ className: 'el_table_menu', bottomGap: 0 })
|
|
7
6
|
const loading = ref(false)
|
|
8
7
|
|
|
9
8
|
const { menus } = useMenuStore()
|
|
10
9
|
</script>
|
|
11
10
|
|
|
12
11
|
<template>
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<el-table
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</template>
|
|
55
|
-
</el-table-column>
|
|
56
|
-
<el-table-column prop="type" label="Global" width="80" align="center">
|
|
57
|
-
<template #default="{ row }">
|
|
58
|
-
<el-tag type="success" v-if="row.meta.global">是</el-tag>
|
|
59
|
-
<el-tag type="primary" v-else>否</el-tag>
|
|
60
|
-
</template>
|
|
61
|
-
</el-table-column>
|
|
62
|
-
</el-table>
|
|
63
|
-
</el-card>
|
|
64
|
-
</div>
|
|
12
|
+
<el-card v-loading="loading">
|
|
13
|
+
<template #header>
|
|
14
|
+
<span>菜单管理</span>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<JnTable :data="menus" row-key="meta.uuid" :showScrollbar="true">
|
|
18
|
+
<el-table-column prop="meta.title" label="标题" min-width="120" header-align="center" />
|
|
19
|
+
<el-table-column prop="icon" label="图标" width="60" align="center">
|
|
20
|
+
<template #default="{ row }">
|
|
21
|
+
<el-icon v-if="row.meta.icon"><component :is="row.meta.icon" /></el-icon>
|
|
22
|
+
</template>
|
|
23
|
+
</el-table-column>
|
|
24
|
+
<el-table-column prop="path" label="路由地址" min-width="120" header-align="center" />
|
|
25
|
+
<el-table-column prop="component" label="component path" min-width="120" header-align="center" />
|
|
26
|
+
<el-table-column prop="redirect" label="redirect" min-width="120" header-align="center" />
|
|
27
|
+
<el-table-column prop="editRole" label="权限标识" min-width="120" header-align="center">
|
|
28
|
+
<template #default="{ row }">
|
|
29
|
+
<span v-if="!row.meta.permissions" style="color: #999">auto</span>
|
|
30
|
+
<span v-else>{{ row.meta.permissions }}</span>
|
|
31
|
+
</template>
|
|
32
|
+
</el-table-column>
|
|
33
|
+
<el-table-column prop="type" label="类型" width="80" align="center">
|
|
34
|
+
<template #default="{ row }">
|
|
35
|
+
<el-tag type="primary" v-if="row.path">菜单</el-tag>
|
|
36
|
+
<el-tag type="success" v-else>目录</el-tag>
|
|
37
|
+
</template>
|
|
38
|
+
</el-table-column>
|
|
39
|
+
<el-table-column prop="type" label="NoAuthApi" width="80" align="center">
|
|
40
|
+
<template #default="{ row }">
|
|
41
|
+
<el-tag type="danger" v-if="row.meta.noAuth">否</el-tag>
|
|
42
|
+
<el-tag type="success" v-else>是</el-tag>
|
|
43
|
+
</template>
|
|
44
|
+
</el-table-column>
|
|
45
|
+
<el-table-column prop="type" label="Global" width="80" align="center">
|
|
46
|
+
<template #default="{ row }">
|
|
47
|
+
<el-tag type="success" v-if="row.meta.global">是</el-tag>
|
|
48
|
+
<el-tag type="primary" v-else>否</el-tag>
|
|
49
|
+
</template>
|
|
50
|
+
</el-table-column>
|
|
51
|
+
</JnTable>
|
|
52
|
+
</el-card>
|
|
65
53
|
</template>
|