@qqt-product/system 0.0.2 → 0.0.16
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/dist/index.es.js +53240 -10634
- package/dist/index.umd.js +94 -21
- package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2878 -0
- package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2871 -0
- package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2878 -0
- package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +23 -4
- package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +9 -4
- package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +9 -4
- package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +2 -3
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2876 -0
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +29 -14
- package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +2 -6
- package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +5 -8
- package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +9 -4
- package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2872 -0
- package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2887 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
- package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +221 -28
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
- package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
- package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +23 -7
- package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
- package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +7 -3
- package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
- package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
- package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
- package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
- package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1209 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
- package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
- package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2863 -0
- package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2872 -0
- package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
- package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
- package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
- package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
- package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
- package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
- package/dist/style.css +1 -1
- package/dist/vite-env.d.ts +13 -13
- package/package.json +13 -11
- package/src/lib/components/QAccountList/src/QAccountCreate.vue +272 -0
- package/src/lib/components/QAccountList/src/QAccountDetail.vue +82 -14
- package/src/lib/components/QAccountList/src/QAccountEdit.vue +65 -33
- package/src/lib/components/QAccountList/src/QAccountList.vue +532 -530
- package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +143 -137
- package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +172 -166
- package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +123 -124
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +66 -18
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +151 -122
- package/src/lib/components/QI18nList/src/QI18nList.vue +365 -361
- package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +103 -94
- package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +109 -105
- package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -3
- package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +218 -221
- package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +110 -117
- package/src/lib/components/QPermissionDataList/src/form.vue +109 -109
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +1 -1
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +120 -32
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +189 -163
- package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +84 -0
- package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -22
- package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +134 -85
- package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +91 -0
- package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +276 -263
- package/src/lib/components/QRoleList/src/QRoleList.vue +332 -288
- package/src/lib/components/QRoleList/src/useConfigData.ts +1 -6
- package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +304 -302
- package/src/lib/components/QUsageList/src/QUsageList.vue +287 -82
- package/src/lib/components/QUsageList/src/useConfigData.ts +147 -13
- package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -140
- package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +28 -28
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +130 -42
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +2 -2
- package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +2 -2
- package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +12 -12
- package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +276 -268
- package/src/lib/components/QcustomConfigList/src/useConfigData.ts +1 -1
- package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +124 -125
- package/src/lib/components/index.ts +78 -78
- package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +2 -10
- package/src/lib/components/integratedNodesList/src/index.vue +130 -136
- package/src/lib/components/integratedReportList/src/index.vue +55 -30
- package/src/lib/components/integratedReportSearchList/src/index.vue +106 -66
- package/src/lib/components/loginAbnormalLogList/src/index.vue +43 -50
- package/src/lib/components/loginLogList/src/index.vue +51 -57
- package/src/lib/components/loginSupplierLogList/src/index.vue +53 -63
- package/src/lib/components/operateLogList/src/index.vue +46 -57
- package/src/vite-env.d.ts +13 -13
- package/tsconfig.json +24 -24
- package/vite.config.ts +1 -1
- package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
- package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
- package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
- package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
- package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
- package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
- package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
|
@@ -1,288 +1,332 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="height: 100%">
|
|
3
|
-
<q-list-layout ref="listLayoutRef" v-if="!showAuth && !showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
|
|
4
|
-
|
|
5
|
-
<!--复制功能-->
|
|
6
|
-
<vxe-modal v-model="copyRoleShow" title="复制角色" type="confirm" :showFooter="false">
|
|
7
|
-
<vxe-form title-colon title-align="right" title-width="160" :data="copyRoleFrom" :rules="userInformsFromRules" @submit="copyRolesubmitEvent">
|
|
8
|
-
<vxe-form-gather span="24">
|
|
9
|
-
<vxe-form-item title="角色名称" field="roleName" span="24">
|
|
10
|
-
<template #default="{ data }">
|
|
11
|
-
<vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
|
|
12
|
-
</template>
|
|
13
|
-
</vxe-form-item>
|
|
14
|
-
<vxe-form-item title="角色编码" field="roleCode" span="24">
|
|
15
|
-
<template #default="{ data }">
|
|
16
|
-
<vxe-input v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
|
|
17
|
-
</template>
|
|
18
|
-
</vxe-form-item>
|
|
19
|
-
|
|
20
|
-
<vxe-form-item align="center" span="24">
|
|
21
|
-
<template #default>
|
|
22
|
-
<vxe-button content="取消" @click="copyRoleShow = false"></vxe-button>
|
|
23
|
-
<vxe-button type="submit" status="primary" content="保存"></vxe-button>
|
|
24
|
-
</template>
|
|
25
|
-
</vxe-form-item>
|
|
26
|
-
</vxe-form-gather>
|
|
27
|
-
</vxe-form>
|
|
28
|
-
</vxe-modal>
|
|
29
|
-
|
|
30
|
-
<!--新增-->
|
|
31
|
-
|
|
32
|
-
<vxe-modal v-model="userInformsFromShow" title="基本信息" type="confirm" :showFooter="false">
|
|
33
|
-
<vxe-form title-colon title-align="right" title-width="
|
|
34
|
-
<vxe-form-gather span="24">
|
|
35
|
-
<vxe-form-item title="角色名称" field="roleName" span="24">
|
|
36
|
-
<template #default="{ data }">
|
|
37
|
-
<vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
|
|
38
|
-
</template>
|
|
39
|
-
</vxe-form-item>
|
|
40
|
-
<vxe-form-item title="角色编码" field="roleCode" span="24">
|
|
41
|
-
<template #default="{ data }">
|
|
42
|
-
<vxe-input :disabled="!!userInformsFrom.id" v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
|
|
43
|
-
</template>
|
|
44
|
-
</vxe-form-item>
|
|
45
|
-
|
|
46
|
-
<vxe-form-item title="描述" field="description" span="24">
|
|
47
|
-
<template #default="{ data }">
|
|
48
|
-
<vxe-textarea :autosize="{ minRows: 6, maxRows: 10 }" v-model="data.description" type="text" placeholder="请输入描述"></vxe-textarea>
|
|
49
|
-
</template>
|
|
50
|
-
</vxe-form-item>
|
|
51
|
-
|
|
52
|
-
<vxe-form-item span="24">
|
|
53
|
-
<template #default>
|
|
54
|
-
<vxe-button
|
|
55
|
-
content="取消"
|
|
56
|
-
@click="
|
|
57
|
-
() => {
|
|
58
|
-
userInformsFromShow = false
|
|
59
|
-
userInformsFrom = {}
|
|
60
|
-
}
|
|
61
|
-
"
|
|
62
|
-
></vxe-button>
|
|
63
|
-
<vxe-button type="submit" status="primary" content="保存"></vxe-button>
|
|
64
|
-
</template>
|
|
65
|
-
</vxe-form-item>
|
|
66
|
-
</vxe-form-gather>
|
|
67
|
-
</vxe-form>
|
|
68
|
-
</vxe-modal>
|
|
69
|
-
|
|
70
|
-
<!-- 租户授权 -->
|
|
71
|
-
<user-authorization v-if="showAuth" parentPath="RoleList" :rows="currentRows" @authCancel="handleAuthCancel"></user-authorization>
|
|
72
|
-
</div>
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<script lang="ts">
|
|
76
|
-
//JS
|
|
77
|
-
import { ref, defineComponent, reactive, nextTick, inject } from 'vue'
|
|
78
|
-
//hook
|
|
79
|
-
import { useConfigData } from './useConfigData'
|
|
80
|
-
import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
|
|
81
|
-
import { message } from '@qqt-product/ui'
|
|
82
|
-
|
|
83
|
-
import UserAuthorization from './components/userAuthorization'
|
|
84
|
-
|
|
85
|
-
export default defineComponent({
|
|
86
|
-
name: 'QRoleList',
|
|
87
|
-
props: {
|
|
88
|
-
userInfo: {
|
|
89
|
-
type: Object,
|
|
90
|
-
defalut: () => {
|
|
91
|
-
return {}
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
components: {
|
|
96
|
-
UserAuthorization,
|
|
97
|
-
},
|
|
98
|
-
setup() {
|
|
99
|
-
//data-hook
|
|
100
|
-
const {
|
|
101
|
-
// const { userInfo } = toRefs(props)
|
|
102
|
-
const qHttp = inject(INJECT_HTTP) as HttpClient
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
type: '
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
})
|
|
264
|
-
.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div style="height: 100%">
|
|
3
|
+
<q-list-layout ref="listLayoutRef" v-if="!showAuth && !showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
|
|
4
|
+
|
|
5
|
+
<!--复制功能-->
|
|
6
|
+
<vxe-modal v-model="copyRoleShow" title="复制角色" type="confirm" :showFooter="false">
|
|
7
|
+
<vxe-form title-colon title-align="right" title-width="160" :data="copyRoleFrom" :rules="userInformsFromRules" @submit="copyRolesubmitEvent">
|
|
8
|
+
<vxe-form-gather span="24">
|
|
9
|
+
<vxe-form-item title="角色名称" field="roleName" span="24">
|
|
10
|
+
<template #default="{ data }">
|
|
11
|
+
<vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
|
|
12
|
+
</template>
|
|
13
|
+
</vxe-form-item>
|
|
14
|
+
<vxe-form-item title="角色编码" field="roleCode" span="24">
|
|
15
|
+
<template #default="{ data }">
|
|
16
|
+
<vxe-input v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
|
|
17
|
+
</template>
|
|
18
|
+
</vxe-form-item>
|
|
19
|
+
|
|
20
|
+
<vxe-form-item align="center" span="24">
|
|
21
|
+
<template #default>
|
|
22
|
+
<vxe-button content="取消" @click="copyRoleShow = false"></vxe-button>
|
|
23
|
+
<vxe-button type="submit" status="primary" content="保存"></vxe-button>
|
|
24
|
+
</template>
|
|
25
|
+
</vxe-form-item>
|
|
26
|
+
</vxe-form-gather>
|
|
27
|
+
</vxe-form>
|
|
28
|
+
</vxe-modal>
|
|
29
|
+
|
|
30
|
+
<!--新增-->
|
|
31
|
+
|
|
32
|
+
<vxe-modal :width="560" v-model="userInformsFromShow" title="基本信息" type="confirm" :showFooter="false">
|
|
33
|
+
<vxe-form title-colon title-align="right" title-width="100" :rules="userInformsFromRules" :data="userInformsFrom" @submit="userInformFormEvent">
|
|
34
|
+
<vxe-form-gather span="24">
|
|
35
|
+
<vxe-form-item title="角色名称" field="roleName" span="24">
|
|
36
|
+
<template #default="{ data }">
|
|
37
|
+
<vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
|
|
38
|
+
</template>
|
|
39
|
+
</vxe-form-item>
|
|
40
|
+
<vxe-form-item title="角色编码" field="roleCode" span="24">
|
|
41
|
+
<template #default="{ data }">
|
|
42
|
+
<vxe-input :disabled="!!userInformsFrom.id" v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
|
|
43
|
+
</template>
|
|
44
|
+
</vxe-form-item>
|
|
45
|
+
|
|
46
|
+
<vxe-form-item title="描述" field="description" span="24">
|
|
47
|
+
<template #default="{ data }">
|
|
48
|
+
<vxe-textarea :autosize="{ minRows: 6, maxRows: 10 }" v-model="data.description" type="text" placeholder="请输入描述"></vxe-textarea>
|
|
49
|
+
</template>
|
|
50
|
+
</vxe-form-item>
|
|
51
|
+
|
|
52
|
+
<vxe-form-item align="center" span="24">
|
|
53
|
+
<template #default>
|
|
54
|
+
<vxe-button
|
|
55
|
+
content="取消"
|
|
56
|
+
@click="
|
|
57
|
+
() => {
|
|
58
|
+
userInformsFromShow = false
|
|
59
|
+
userInformsFrom = {}
|
|
60
|
+
}
|
|
61
|
+
"
|
|
62
|
+
></vxe-button>
|
|
63
|
+
<vxe-button type="submit" status="primary" content="保存"></vxe-button>
|
|
64
|
+
</template>
|
|
65
|
+
</vxe-form-item>
|
|
66
|
+
</vxe-form-gather>
|
|
67
|
+
</vxe-form>
|
|
68
|
+
</vxe-modal>
|
|
69
|
+
|
|
70
|
+
<!-- 租户授权 -->
|
|
71
|
+
<user-authorization v-if="showAuth" parentPath="RoleList" :rows="currentRows" @authCancel="handleAuthCancel"></user-authorization>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script lang="ts">
|
|
76
|
+
//JS
|
|
77
|
+
import { ref, defineComponent, reactive, nextTick, inject } from 'vue'
|
|
78
|
+
//hook
|
|
79
|
+
import { useConfigData } from './useConfigData'
|
|
80
|
+
import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
|
|
81
|
+
import { message } from '@qqt-product/ui'
|
|
82
|
+
|
|
83
|
+
import UserAuthorization from './components/userAuthorization'
|
|
84
|
+
|
|
85
|
+
export default defineComponent({
|
|
86
|
+
name: 'QRoleList',
|
|
87
|
+
props: {
|
|
88
|
+
userInfo: {
|
|
89
|
+
type: Object,
|
|
90
|
+
defalut: () => {
|
|
91
|
+
return {}
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
components: {
|
|
96
|
+
UserAuthorization,
|
|
97
|
+
},
|
|
98
|
+
setup() {
|
|
99
|
+
//data-hook
|
|
100
|
+
const { userInformsFromShow, userInformsFrom, showEditPage, apiUrls, copyRoleShow, copyRoleFrom, itemRow, listLayoutRef } = useConfigData()
|
|
101
|
+
// const { userInfo } = toRefs(props)
|
|
102
|
+
const qHttp = inject(INJECT_HTTP) as HttpClient
|
|
103
|
+
const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
|
|
104
|
+
if (i18nKey) {
|
|
105
|
+
if (account) {
|
|
106
|
+
return account + defaultValue
|
|
107
|
+
}
|
|
108
|
+
return defaultValue
|
|
109
|
+
}
|
|
110
|
+
return defaultValue
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const userInformsFromRules = ref({
|
|
114
|
+
roleName: [{ required: true, message: '请输入角色名称' }],
|
|
115
|
+
roleCode: [
|
|
116
|
+
{ required: true, message: '请输入角色编码' },
|
|
117
|
+
{
|
|
118
|
+
// todo:异步校验
|
|
119
|
+
validator: async ({ itemValue }) => {
|
|
120
|
+
if (/[\u4E00-\u9FA5]/g.test(itemValue)) {
|
|
121
|
+
message.warn('角色编码不可输入汉字!')
|
|
122
|
+
return Promise.reject('角色编码不可输入汉字!')
|
|
123
|
+
} else {
|
|
124
|
+
if (userInformsFrom.value.id) {
|
|
125
|
+
return Promise.resolve()
|
|
126
|
+
} else {
|
|
127
|
+
const params = {
|
|
128
|
+
tableName: 'els_role',
|
|
129
|
+
fieldName: 'role_code',
|
|
130
|
+
fieldVal: itemValue,
|
|
131
|
+
dataId: copyRoleFrom.value.id,
|
|
132
|
+
}
|
|
133
|
+
const res = await qHttp.get({ url: '/base/duplicate/check', params })
|
|
134
|
+
if (res && res.success) {
|
|
135
|
+
return Promise.resolve()
|
|
136
|
+
} else {
|
|
137
|
+
message.warn(res.message)
|
|
138
|
+
return Promise.reject(res.message)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
})
|
|
146
|
+
const showAuth = ref(false)
|
|
147
|
+
const currentRows = ref([])
|
|
148
|
+
|
|
149
|
+
const handleAuth = ({ row }: { row: never }) => {
|
|
150
|
+
showAuth.value = true
|
|
151
|
+
if (Array.isArray(row)) {
|
|
152
|
+
currentRows.value = [...row] as never
|
|
153
|
+
} else {
|
|
154
|
+
currentRows.value.push(row as never)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const handleAuthCancel = () => {
|
|
159
|
+
showAuth.value = false
|
|
160
|
+
currentRows.value = []
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//data
|
|
164
|
+
const pageData = reactive({
|
|
165
|
+
statusConfig: {
|
|
166
|
+
show: false,
|
|
167
|
+
},
|
|
168
|
+
optionConfig: {
|
|
169
|
+
attrs: {},
|
|
170
|
+
extend: {},
|
|
171
|
+
options: [
|
|
172
|
+
{ authorityCode: 'role#Role:edit', type: 'edit', title: '编辑', click: handleEdit },
|
|
173
|
+
{ authorityCode: 'role#Role:copy', type: 'copy', title: '复制', click: handleCopy },
|
|
174
|
+
{
|
|
175
|
+
type: 'authorization',
|
|
176
|
+
title: '授权',
|
|
177
|
+
click: handleAuth,
|
|
178
|
+
authorityCode: 'role#Permissio:saveRolePermission',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
authorityCode: 'role#Role:delete',
|
|
182
|
+
type: 'delete',
|
|
183
|
+
title: '删除',
|
|
184
|
+
args: {
|
|
185
|
+
url: apiUrls.value.delete,
|
|
186
|
+
},
|
|
187
|
+
disabled: allowDelete,
|
|
188
|
+
},
|
|
189
|
+
// { authorityCode: 'role#Role:userSet', type: 'usersList', title: srmI18n(`${getLangAccount()}#i18n_btn_jDER_36c46210`, '用户配置'), clickFn: this.handleUsersList },
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
buttonConfig: {
|
|
193
|
+
attrs: {},
|
|
194
|
+
extend: {},
|
|
195
|
+
buttons: [
|
|
196
|
+
{
|
|
197
|
+
authorityCode: 'role#Role:add',
|
|
198
|
+
label: srmI18n('i18n_title_add', '新增'),
|
|
199
|
+
icon: {
|
|
200
|
+
type: 'icon-Q-add',
|
|
201
|
+
},
|
|
202
|
+
attrs: {
|
|
203
|
+
type: 'primary',
|
|
204
|
+
},
|
|
205
|
+
click: handleAdd,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: srmI18n('i18n_title_listCustom', '列自定义'),
|
|
209
|
+
icon: {
|
|
210
|
+
type: 'icon-Q-setting',
|
|
211
|
+
},
|
|
212
|
+
type: 'setting',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
queryConfig: {
|
|
217
|
+
attrs: {},
|
|
218
|
+
extend: {},
|
|
219
|
+
form: [
|
|
220
|
+
{
|
|
221
|
+
type: 'input',
|
|
222
|
+
label: '角色名称',
|
|
223
|
+
fieldName: 'roleName',
|
|
224
|
+
placeholder: '请输入角色名称',
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
pagerConfig: {},
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
//method
|
|
232
|
+
function handleCopy({ row = {} as MapObjectNoneType }) {
|
|
233
|
+
itemRow.value = row
|
|
234
|
+
nextTick(() => {
|
|
235
|
+
copyRoleShow.value = true
|
|
236
|
+
})
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function allowDelete({ row = {} as MapObjectNoneType }) {
|
|
240
|
+
if (row.roleCode == 'companyAdmin' || row.roleCode == 'admin') {
|
|
241
|
+
return true
|
|
242
|
+
} else {
|
|
243
|
+
return false
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function copyRolesubmitEvent() {
|
|
248
|
+
if (copyRoleFrom.value.roleName == '') {
|
|
249
|
+
message.warning('请输入角色名称')
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
if (copyRoleFrom.value.roleCode == '') {
|
|
253
|
+
message.warning('请输入角色编码')
|
|
254
|
+
return
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let data = { id: itemRow.value.id, roleName: copyRoleFrom.value.roleName, roleCode: copyRoleFrom.value.roleCode }
|
|
258
|
+
listLayoutRef.value.loading = true
|
|
259
|
+
qHttp
|
|
260
|
+
.post({
|
|
261
|
+
url: apiUrls.value.copy,
|
|
262
|
+
data,
|
|
263
|
+
})
|
|
264
|
+
.then((res) => {
|
|
265
|
+
listLayoutRef.value.loading = false
|
|
266
|
+
if (res.success) {
|
|
267
|
+
listLayoutRef.value.fetchListData()
|
|
268
|
+
message.success(res.message)
|
|
269
|
+
} else {
|
|
270
|
+
message.warning(res.message)
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
.finally(() => {
|
|
274
|
+
itemRow.value = {}
|
|
275
|
+
copyRoleFrom.value = {}
|
|
276
|
+
copyRoleShow.value = false
|
|
277
|
+
})
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function handleAdd() {
|
|
281
|
+
userInformsFrom.value = {}
|
|
282
|
+
nextTick(() => {
|
|
283
|
+
userInformsFromShow.value = true
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
function handleEdit({ row = {} as MapObjectNoneType }) {
|
|
287
|
+
userInformsFrom.value = { ...row }
|
|
288
|
+
nextTick(() => {
|
|
289
|
+
userInformsFromShow.value = true
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
function userInformFormEvent() {
|
|
293
|
+
let url = userInformsFrom.value.id ? '/account/role/edit' : '/account/role/add'
|
|
294
|
+
qHttp
|
|
295
|
+
.post({
|
|
296
|
+
url,
|
|
297
|
+
data: {
|
|
298
|
+
...userInformsFrom.value,
|
|
299
|
+
},
|
|
300
|
+
})
|
|
301
|
+
.then((res) => {
|
|
302
|
+
listLayoutRef.value.loading = false
|
|
303
|
+
if (res.success) {
|
|
304
|
+
listLayoutRef.value.fetchListData()
|
|
305
|
+
message.success(res.message)
|
|
306
|
+
userInformsFrom.value = {}
|
|
307
|
+
userInformsFromShow.value = false
|
|
308
|
+
} else {
|
|
309
|
+
message.warning(res.message)
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return {
|
|
315
|
+
userInformsFromRules,
|
|
316
|
+
userInformFormEvent,
|
|
317
|
+
userInformsFromShow,
|
|
318
|
+
userInformsFrom,
|
|
319
|
+
listLayoutRef,
|
|
320
|
+
copyRolesubmitEvent,
|
|
321
|
+
copyRoleFrom,
|
|
322
|
+
showEditPage,
|
|
323
|
+
apiUrls,
|
|
324
|
+
pageData,
|
|
325
|
+
copyRoleShow,
|
|
326
|
+
showAuth,
|
|
327
|
+
currentRows,
|
|
328
|
+
handleAuthCancel,
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
})
|
|
332
|
+
</script>
|
|
@@ -24,10 +24,5 @@ export function useConfigData() {
|
|
|
24
24
|
const userInformsFrom = ref<MapObjectNoneType>({})
|
|
25
25
|
const userInformsFromShow = shallowRef<boolean>(false)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
roleName: [{ required: true, message: '请输入角色名称' }],
|
|
29
|
-
roleCode: [{ required: true, message: '请输入角色编码' }],
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
return { userInformsFromRules, userInformsFromShow, userInformsFrom, itemRow, copyRoleFrom, copyRoleShow, apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
|
|
27
|
+
return { userInformsFromShow, userInformsFrom, itemRow, copyRoleFrom, copyRoleShow, apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
|
|
33
28
|
}
|