@qqt-product/system 0.0.1 → 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.
Files changed (105) hide show
  1. package/dist/index.es.js +53240 -10634
  2. package/dist/index.umd.js +94 -21
  3. package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2878 -0
  4. package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2871 -0
  5. package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2878 -0
  6. package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +23 -4
  7. package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +9 -4
  8. package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +9 -4
  9. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +2864 -0
  10. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +2 -3
  11. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +2864 -0
  12. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2876 -0
  13. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +29 -14
  14. package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +2 -6
  15. package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +5 -8
  16. package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +9 -4
  17. package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2872 -0
  18. package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
  19. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2864 -0
  20. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2887 -0
  21. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
  22. package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
  23. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +221 -28
  24. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
  25. package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
  26. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +23 -7
  27. package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
  28. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +7 -3
  29. package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
  30. package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
  31. package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
  32. package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
  33. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1209 -0
  34. package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
  35. package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
  36. package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
  37. package/dist/lib/components/index.d.ts +2 -2
  38. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2863 -0
  39. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2872 -0
  40. package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
  41. package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
  42. package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
  43. package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
  44. package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
  45. package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
  46. package/dist/style.css +1 -1
  47. package/dist/vite-env.d.ts +13 -13
  48. package/package.json +13 -11
  49. package/src/lib/components/QAccountList/src/QAccountCreate.vue +272 -0
  50. package/src/lib/components/QAccountList/src/QAccountDetail.vue +82 -14
  51. package/src/lib/components/QAccountList/src/QAccountEdit.vue +65 -33
  52. package/src/lib/components/QAccountList/src/QAccountList.vue +532 -530
  53. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +143 -137
  54. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +172 -166
  55. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +123 -124
  56. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +66 -18
  57. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +151 -122
  58. package/src/lib/components/QI18nList/src/QI18nList.vue +365 -361
  59. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +103 -94
  60. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +109 -105
  61. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -3
  62. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +218 -221
  63. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +110 -117
  64. package/src/lib/components/QPermissionDataList/src/form.vue +109 -109
  65. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +1 -1
  66. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +120 -32
  67. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +189 -163
  68. package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +84 -0
  69. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -22
  70. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +134 -85
  71. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +91 -0
  72. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +276 -263
  73. package/src/lib/components/QRoleList/src/QRoleList.vue +332 -288
  74. package/src/lib/components/QRoleList/src/useConfigData.ts +1 -6
  75. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +304 -302
  76. package/src/lib/components/QUsageList/src/QUsageList.vue +287 -82
  77. package/src/lib/components/QUsageList/src/useConfigData.ts +147 -13
  78. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -140
  79. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +28 -28
  80. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +130 -42
  81. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +2 -2
  82. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +2 -2
  83. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +12 -12
  84. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +276 -268
  85. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +1 -1
  86. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +124 -125
  87. package/src/lib/components/index.ts +78 -78
  88. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +2 -10
  89. package/src/lib/components/integratedNodesList/src/index.vue +130 -136
  90. package/src/lib/components/integratedReportList/src/index.vue +55 -30
  91. package/src/lib/components/integratedReportSearchList/src/index.vue +106 -66
  92. package/src/lib/components/loginAbnormalLogList/src/index.vue +43 -50
  93. package/src/lib/components/loginLogList/src/index.vue +51 -57
  94. package/src/lib/components/loginSupplierLogList/src/index.vue +53 -63
  95. package/src/lib/components/operateLogList/src/index.vue +46 -57
  96. package/src/vite-env.d.ts +13 -13
  97. package/tsconfig.json +24 -24
  98. package/vite.config.ts +1 -1
  99. package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
  100. package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
  101. package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
  102. package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
  103. package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
  104. package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
  105. package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
@@ -1,361 +1,365 @@
1
- <template>
2
- <div style="height: 100%">
3
- <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
-
5
- <!--新增-->
6
- <vxe-modal v-model="addZhWord" title="添加词条" type="confirm" show-footer @confirm="addZhWordHandle('confirm')" @cancel="addZhWordHandle('cancel')">
7
- <vxe-form title-colon title-align="right" title-width="160" :data="addZhWordFrom" :loading="addZhWordLoading">
8
- <vxe-form-gather span="24">
9
- <vxe-form-item title="词条类型" field="translateType" span="24">
10
- <template #default="{ data }">
11
- <q-select style="width: 200px" v-model:value="data.translateType" dict-code="translateType"></q-select>
12
- </template>
13
- </vxe-form-item>
14
- <vxe-form-item title="中文内容" field="i18nValue" span="24">
15
- <template #default="{ data }">
16
- <vxe-input v-model="data.i18nValue" type="text" placeholder="请输入中文内容" clearable></vxe-input>
17
- </template>
18
- </vxe-form-item>
19
- </vxe-form-gather>
20
- </vxe-form>
21
- </vxe-modal>
22
-
23
- <!--翻译-->
24
- <vxe-modal v-model="translateVisible" title="翻译" type="confirm" show-footer @confirm="translateHandle('confirm')">
25
- <q-select style="width: 200px" v-model:value="languageValue" dict-code="language"></q-select>
26
- </vxe-modal>
27
-
28
- <!--编辑-->
29
- <QI18nForm v-if="showEditPage" title="编辑" :currentRow="itemInfoRow" @hide="showEditPage = false" />
30
- </div>
31
- </template>
32
-
33
- <script lang="ts">
34
- //JS
35
- import { defineComponent, reactive, ref, inject, nextTick } from 'vue'
36
- //hook
37
- import { useConfigData } from './useConfigData'
38
- //组件
39
- import { Modal, message } from '@qqt-product/ui'
40
- import QI18nForm from './QI18nForm.vue'
41
- //ts
42
- import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
43
-
44
- export default defineComponent({
45
- name: 'QI18nList',
46
- components: {
47
- QI18nForm,
48
- },
49
- props: {
50
- userInfo: {
51
- type: Object,
52
- defalut: () => {
53
- return {}
54
- },
55
- },
56
- },
57
- setup() {
58
- //data-hook
59
- const { itemInfoRow, languageValue, translateVisible, showEditPage, apiUrls, addZhWord, addZhWordFrom, addZhWordLoading } = useConfigData()
60
- //data
61
- const qHttp = inject(INJECT_HTTP) as HttpClient
62
- const pageData = reactive({
63
- statusConfig: {
64
- show: false,
65
- },
66
- optColumn: {
67
- attrs: {},
68
- extend: {},
69
- optColumnList: [
70
- { authorityCode: 'i18n#I18n:editNew', type: 'edit', title: '编辑', click: handleEdit },
71
- {
72
- type: 'delete',
73
- title: '删除',
74
- authorityCode: 'i18n#I18n:delete',
75
- // args: {
76
- // url: apiUrls.value.deleteWord,
77
- // },
78
- click: I18nRowDel,
79
- // allow: allowDelete,
80
- },
81
- ],
82
- },
83
- buttonConfig: {
84
- attrs: {},
85
- extend: {},
86
- buttons: [
87
- {
88
- authorityCode: 'i18n#I18n:add',
89
- label: '新增',
90
- icon: {
91
- type: 'icon-Q-add',
92
- },
93
- attrs: {
94
- type: 'primary',
95
- },
96
- click: addRow,
97
- },
98
- {
99
- label: '导入',
100
- icon: {
101
- type: 'icon-Q-import',
102
- },
103
- type: 'import',
104
- args: {
105
- url: '/base/i18n/importExcel',
106
- excelCode: 'i18n',
107
- },
108
- },
109
- {
110
- label: '导出',
111
- icon: {
112
- type: 'icon-Q-export',
113
- },
114
- args: {
115
- url: '/base/i18n/exportXls',
116
- },
117
- type: 'export',
118
- },
119
- { authorityCode: 'i18n#I18n:delRedisData', label: '清除缓存', click: delRedis },
120
- { authorityCode: 'i18n#I18n:delRedisData', label: '清除菜单缓存', click: delPerRedis },
121
- { authorityCode: 'i18n#I18n:translateData', label: '翻译', click: translate },
122
- { authorityCode: 'i18n#I18n:translateAll', label: '一键翻译', click: translateAll },
123
- {
124
- label: '列自定义',
125
- icon: {
126
- type: 'icon-Q-setting',
127
- },
128
- type: 'setting',
129
- },
130
- {
131
- label: '帮助说明',
132
- icon: {
133
- type: 'icon-Q-help-text',
134
- },
135
- type: 'help-text',
136
- },
137
- {
138
- label: '附件说明',
139
- icon: {
140
- type: 'icon-Q-attachment-text',
141
- },
142
- type: 'attachment-text',
143
- },
144
- ],
145
- },
146
- queryConfig: {
147
- attrs: {},
148
- extend: {},
149
- form: [
150
- {
151
- type: 'input',
152
- label: '国际化key',
153
- fieldName: 'i18nKey',
154
- placeholder: '请输入国际化key',
155
- },
156
- {
157
- type: 'input',
158
- label: '国际化名称',
159
- fieldName: 'chinese',
160
- placeholder: '请输入国际化名称',
161
- },
162
- ],
163
- formState: {
164
- i18nKey: '',
165
- chinese: '',
166
- },
167
- },
168
- pagerConfig: {},
169
- })
170
- const listLayoutRef = ref()
171
-
172
- function delRedis() {
173
- Modal.confirm({
174
- title: '提示',
175
- content: '确认清除缓存?',
176
- onOk() {
177
- listLayoutRef.value.loading = true
178
- qHttp
179
- .get({
180
- url: apiUrls.value.delRedisData,
181
- })
182
- .then((res) => {
183
- if (res.success) {
184
- message.success(res.message)
185
- listLayoutRef.value.fetchListData()
186
- } else {
187
- message.warning(res.message)
188
- }
189
- })
190
- .finally(() => {
191
- listLayoutRef.value.loading = true
192
- })
193
- },
194
- })
195
- }
196
-
197
- function delPerRedis() {
198
- Modal.confirm({
199
- title: '提示',
200
- content: '确认清除缓存?',
201
- onOk() {
202
- listLayoutRef.value.loading = true
203
- qHttp
204
- .get({
205
- url: apiUrls.value.delPerRedis,
206
- })
207
- .then((res) => {
208
- if (res.success) {
209
- message.success(res.message)
210
- listLayoutRef.value.fetchListData()
211
- } else {
212
- message.warning(res.message)
213
- }
214
- })
215
- .finally(() => {
216
- listLayoutRef.value.loading = true
217
- })
218
- },
219
- })
220
- }
221
-
222
- function translateAll() {
223
- listLayoutRef.value.loading = true
224
- qHttp
225
- .get({
226
- url: apiUrls.value.translateAll,
227
- })
228
- .then((res) => {
229
- listLayoutRef.value.loading = false
230
- if (res.success) {
231
- // this.$message.success(res.message)
232
- message.success('操作成功')
233
- } else {
234
- // this.$message.warning(res.message)
235
- message.warning('操作失败')
236
- }
237
- })
238
- .catch(() => {
239
- listLayoutRef.value.loading = false
240
- })
241
- }
242
-
243
- function addRow() {
244
- addZhWord.value = true
245
- }
246
- function addZhWordHandle(handleType: string) {
247
- if (handleType == 'confirm') {
248
- if (!addZhWordFrom.value.i18nValue && !addZhWordFrom.value.i18nValue) {
249
- message.error('请填写词条类型和中文内容')
250
- } else {
251
- listLayoutRef.value.loading = true
252
- qHttp
253
- .post({
254
- url: apiUrls.value.add,
255
- data: {
256
- translateType: addZhWordFrom.value.translateType,
257
- i18nValue: addZhWordFrom.value.i18nValue,
258
- },
259
- })
260
- .then((res) => {
261
- listLayoutRef.value.loading = false
262
- if (res.success) {
263
- // this.$message.success(res.message)
264
- message.success('操作成功')
265
- listLayoutRef.value.fetchListData()
266
- } else {
267
- // this.$message.warning(res.message)
268
- message.warning('操作失败')
269
- }
270
- })
271
- .catch(() => {
272
- listLayoutRef.value.loading = false
273
- })
274
- }
275
- } else {
276
- addZhWordFrom.value = {
277
- translateType: '',
278
- i18nValue: '',
279
- }
280
- }
281
- }
282
-
283
- function I18nRowDel({ row = {} as MapObjectNoneType }) {
284
- Modal.confirm({
285
- title: '提示',
286
- content: '是否需要删除行?',
287
- onOk() {
288
- listLayoutRef.value.loading = true
289
- qHttp
290
- .get({
291
- url: apiUrls.value.deleteWord,
292
- params: { i18nKey: row.i18nKey },
293
- })
294
- .then((res) => {
295
- if (res.success) {
296
- message.success(res.message)
297
- listLayoutRef.value.fetchListData()
298
- } else {
299
- message.warning(res.message)
300
- }
301
- })
302
- .finally(() => {
303
- listLayoutRef.value.loading = true
304
- })
305
- },
306
- })
307
- }
308
-
309
- function translate() {
310
- translateVisible.value = true
311
- }
312
-
313
- function translateHandle(handleType: string) {
314
- if (handleType == 'confirm') {
315
- if (languageValue.value == 'zh') {
316
- message.warning('中文不需要翻译!')
317
- } else {
318
- listLayoutRef.value.loading = true
319
- qHttp
320
- .get({
321
- url: apiUrls.value.translateData,
322
- params: { to: languageValue.value },
323
- })
324
- .then((res) => {
325
- if (res.success) {
326
- message.success('操作成功!')
327
- listLayoutRef.value.fetchListData()
328
- }
329
- })
330
- .finally(() => {
331
- listLayoutRef.value.loading = false
332
- translateVisible.value = false
333
- })
334
- }
335
- }
336
- }
337
-
338
- function handleEdit({ row = {} as MapObjectNoneType }) {
339
- itemInfoRow.value = row
340
- nextTick(() => {
341
- showEditPage.value = true
342
- })
343
- }
344
-
345
- return {
346
- itemInfoRow,
347
- translateHandle,
348
- languageValue,
349
- translateVisible,
350
- addZhWordHandle,
351
- showEditPage,
352
- apiUrls,
353
- pageData,
354
- listLayoutRef,
355
- addZhWord,
356
- addZhWordFrom,
357
- addZhWordLoading,
358
- }
359
- },
360
- })
361
- </script>
1
+ <template>
2
+ <div style="height: 100%">
3
+ <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
+
5
+ <!--新增-->
6
+ <vxe-modal v-model="addZhWord" title="添加词条" type="confirm" width="600" show-footer @confirm="addZhWordHandle('confirm')" @cancel="addZhWordHandle('cancel')">
7
+ <vxe-form title-colon title-align="right" title-width="120" :data="addZhWordFrom" :loading="addZhWordLoading">
8
+ <vxe-form-gather span="24">
9
+ <vxe-form-item title="词条类型" field="translateType" span="24">
10
+ <template #default="{ data }">
11
+ <q-select style="width: 100%" v-model:value="data.translateType" dict-code="translateType"></q-select>
12
+ </template>
13
+ </vxe-form-item>
14
+ <vxe-form-item title="中文内容" field="i18nValue" span="24">
15
+ <template #default="{ data }">
16
+ <vxe-input style="width: 100%" v-model="data.i18nValue" type="text" placeholder="请输入中文内容" clearable></vxe-input>
17
+ <!-- <a-input style="width: 200px" v-model:value="data.i18nValue" placeholder="请输入中文内容" clearable /> -->
18
+ </template>
19
+ </vxe-form-item>
20
+ </vxe-form-gather>
21
+ </vxe-form>
22
+ </vxe-modal>
23
+
24
+ <!--翻译-->
25
+ <vxe-modal v-model="translateVisible" title="翻译" type="confirm" show-footer @confirm="translateHandle('confirm')">
26
+ <q-select style="width: 200px" v-model:value="languageValue" dict-code="language"></q-select>
27
+ </vxe-modal>
28
+
29
+ <!--编辑-->
30
+ <QI18nForm v-if="showEditPage" title="编辑" :currentRow="itemInfoRow" @hide="showEditPage = false" />
31
+ </div>
32
+ </template>
33
+
34
+ <script lang="ts">
35
+ //JS
36
+ import { defineComponent, reactive, ref, inject, nextTick } from 'vue'
37
+ //hook
38
+ import { useConfigData } from './useConfigData'
39
+ //组件
40
+ import { Modal, message } from '@qqt-product/ui'
41
+ import QI18nForm from './QI18nForm.vue'
42
+ //ts
43
+ import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
44
+
45
+ export default defineComponent({
46
+ name: 'QI18nList',
47
+ components: {
48
+ QI18nForm,
49
+ },
50
+ props: {
51
+ userInfo: {
52
+ type: Object,
53
+ defalut: () => {
54
+ return {}
55
+ },
56
+ },
57
+ },
58
+ setup(props) {
59
+ //data-hook
60
+ const { itemInfoRow, languageValue, translateVisible, showEditPage, apiUrls, addZhWord, addZhWordFrom, addZhWordLoading } = useConfigData()
61
+ //data
62
+ const qHttp = inject(INJECT_HTTP) as HttpClient
63
+ const pageData = reactive({
64
+ statusConfig: {
65
+ show: false,
66
+ },
67
+ optionConfig: {
68
+ attrs: {},
69
+ extend: {},
70
+ options: [
71
+ { authorityCode: 'i18n#I18n:editNew', type: 'edit', title: '编辑', click: handleEdit },
72
+ {
73
+ type: 'delete',
74
+ title: '删除',
75
+ authorityCode: 'i18n#I18n:delete',
76
+ // args: {
77
+ // url: apiUrls.value.deleteWord,
78
+ // },
79
+ click: I18nRowDel,
80
+ // allow: allowDelete,
81
+ },
82
+ ],
83
+ },
84
+ buttonConfig: {
85
+ attrs: {},
86
+ extend: {},
87
+ buttons: [
88
+ {
89
+ authorityCode: 'i18n#I18n:add',
90
+ label: '新增',
91
+ icon: {
92
+ type: 'icon-Q-add',
93
+ },
94
+ attrs: {
95
+ type: 'primary',
96
+ },
97
+ click: addRow,
98
+ },
99
+ {
100
+ label: '导入',
101
+ icon: {
102
+ type: 'icon-Q-import',
103
+ },
104
+ type: 'import',
105
+ args: {
106
+ url: '/base/i18n/importExcel',
107
+ excelCode: 'i18n',
108
+ },
109
+ },
110
+ {
111
+ label: '导出',
112
+ icon: {
113
+ type: 'icon-Q-export',
114
+ },
115
+ args: {
116
+ url: '/base/i18n/exportXls',
117
+ },
118
+ type: 'export',
119
+ },
120
+ { authorityCode: 'i18n#I18n:delRedisData', label: '清除缓存', click: delRedis },
121
+ { authorityCode: 'i18n#I18n:delRedisData', label: '清除菜单缓存', click: delPerRedis },
122
+ { authorityCode: 'i18n#I18n:translateData', label: '翻译', click: translate },
123
+ { authorityCode: 'i18n#I18n:translateAll', label: '一键翻译', click: translateAll },
124
+ {
125
+ label: '列自定义',
126
+ icon: {
127
+ type: 'icon-Q-setting',
128
+ },
129
+ type: 'setting',
130
+ },
131
+ {
132
+ label: '帮助说明',
133
+ icon: {
134
+ type: 'icon-Q-help-text',
135
+ },
136
+ type: 'help-text',
137
+ },
138
+ {
139
+ label: '附件说明',
140
+ icon: {
141
+ type: 'icon-Q-attachment-text',
142
+ },
143
+ type: 'attachment-text',
144
+ },
145
+ ],
146
+ },
147
+ queryConfig: {
148
+ attrs: {},
149
+ extend: {},
150
+ form: [
151
+ {
152
+ type: 'input',
153
+ label: '国际化key',
154
+ fieldName: 'i18nKey',
155
+ placeholder: '请输入国际化key',
156
+ },
157
+ {
158
+ type: 'input',
159
+ label: '国际化名称',
160
+ fieldName: 'chinese',
161
+ placeholder: '请输入国际化名称',
162
+ },
163
+ ],
164
+ },
165
+ pagerConfig: {},
166
+ })
167
+ const listLayoutRef = ref()
168
+
169
+ function delRedis() {
170
+ Modal.confirm({
171
+ title: '提示',
172
+ content: '确认清除缓存?',
173
+ onOk() {
174
+ listLayoutRef.value.loading = true
175
+ qHttp
176
+ .get({
177
+ url: apiUrls.value.delRedisData,
178
+ })
179
+ .then((res) => {
180
+ if (res.success) {
181
+ message.success(res.message)
182
+ listLayoutRef.value.fetchListData()
183
+ } else {
184
+ message.warning(res.message)
185
+ }
186
+ })
187
+ .finally(() => {
188
+ listLayoutRef.value.loading = true
189
+ })
190
+ },
191
+ })
192
+ }
193
+
194
+ function delPerRedis() {
195
+ Modal.confirm({
196
+ title: '提示',
197
+ content: '确认清除缓存?',
198
+ onOk() {
199
+ listLayoutRef.value.loading = true
200
+ qHttp
201
+ .get({
202
+ url: apiUrls.value.delPerRedis,
203
+ })
204
+ .then((res) => {
205
+ if (res.success) {
206
+ message.success(res.message)
207
+ listLayoutRef.value.fetchListData()
208
+ } else {
209
+ message.warning(res.message)
210
+ }
211
+ })
212
+ .finally(() => {
213
+ listLayoutRef.value.loading = true
214
+ })
215
+ },
216
+ })
217
+ }
218
+
219
+ function translateAll() {
220
+ listLayoutRef.value.loading = true
221
+ qHttp
222
+ .get({
223
+ url: apiUrls.value.translateAll,
224
+ })
225
+ .then((res) => {
226
+ listLayoutRef.value.loading = false
227
+ if (res.success) {
228
+ // this.$message.success(res.message)
229
+ message.success('操作成功')
230
+ } else {
231
+ // this.$message.warning(res.message)
232
+ message.warning('操作失败')
233
+ }
234
+ })
235
+ .catch(() => {
236
+ listLayoutRef.value.loading = false
237
+ })
238
+ }
239
+
240
+ function addRow() {
241
+ // console.log(props.userInfo?.userInfo?.elsAccount)
242
+ const elsAccount = props.userInfo?.userInfo?.elsAccount
243
+
244
+ if (elsAccount != '100000') {
245
+ message.warning('请在平台添加词条!')
246
+ return
247
+ }
248
+ addZhWord.value = true
249
+ }
250
+ function addZhWordHandle(handleType: string) {
251
+ if (handleType == 'confirm') {
252
+ if (!addZhWordFrom.value.i18nValue && !addZhWordFrom.value.i18nValue) {
253
+ message.error('请填写词条类型和中文内容')
254
+ } else {
255
+ listLayoutRef.value.loading = true
256
+ qHttp
257
+ .post({
258
+ url: apiUrls.value.add,
259
+ data: {
260
+ translateType: addZhWordFrom.value.translateType,
261
+ i18nValue: addZhWordFrom.value.i18nValue,
262
+ },
263
+ })
264
+ .then((res) => {
265
+ listLayoutRef.value.loading = false
266
+ if (res.success) {
267
+ // this.$message.success(res.message)
268
+ message.success('操作成功')
269
+ listLayoutRef.value.fetchListData()
270
+ } else {
271
+ // this.$message.warning(res.message)
272
+ message.warning('操作失败')
273
+ }
274
+ })
275
+ .catch(() => {
276
+ listLayoutRef.value.loading = false
277
+ })
278
+ }
279
+ } else {
280
+ addZhWordFrom.value = {
281
+ translateType: '',
282
+ i18nValue: '',
283
+ }
284
+ }
285
+ }
286
+
287
+ function I18nRowDel({ row = {} as MapObjectNoneType }) {
288
+ Modal.confirm({
289
+ title: '提示',
290
+ content: '是否需要删除行?',
291
+ onOk() {
292
+ listLayoutRef.value.loading = true
293
+ qHttp
294
+ .get({
295
+ url: apiUrls.value.deleteWord,
296
+ params: { i18nKey: row.i18nKey },
297
+ })
298
+ .then((res) => {
299
+ if (res.success) {
300
+ message.success(res.message)
301
+ listLayoutRef.value.fetchListData()
302
+ } else {
303
+ message.warning(res.message)
304
+ }
305
+ })
306
+ .finally(() => {
307
+ listLayoutRef.value.loading = true
308
+ })
309
+ },
310
+ })
311
+ }
312
+
313
+ function translate() {
314
+ translateVisible.value = true
315
+ }
316
+
317
+ function translateHandle(handleType: string) {
318
+ if (handleType == 'confirm') {
319
+ if (languageValue.value == 'zh') {
320
+ message.warning('中文不需要翻译!')
321
+ } else {
322
+ listLayoutRef.value.loading = true
323
+ qHttp
324
+ .get({
325
+ url: apiUrls.value.translateData,
326
+ params: { to: languageValue.value },
327
+ })
328
+ .then((res) => {
329
+ if (res.success) {
330
+ message.success('操作成功!')
331
+ listLayoutRef.value.fetchListData()
332
+ }
333
+ })
334
+ .finally(() => {
335
+ listLayoutRef.value.loading = false
336
+ translateVisible.value = false
337
+ })
338
+ }
339
+ }
340
+ }
341
+
342
+ function handleEdit({ row = {} as MapObjectNoneType }) {
343
+ itemInfoRow.value = row
344
+ nextTick(() => {
345
+ showEditPage.value = true
346
+ })
347
+ }
348
+
349
+ return {
350
+ itemInfoRow,
351
+ translateHandle,
352
+ languageValue,
353
+ translateVisible,
354
+ addZhWordHandle,
355
+ showEditPage,
356
+ apiUrls,
357
+ pageData,
358
+ listLayoutRef,
359
+ addZhWord,
360
+ addZhWordFrom,
361
+ addZhWordLoading,
362
+ }
363
+ },
364
+ })
365
+ </script>