@qqt-product/system 0.0.1

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 (198) hide show
  1. package/.eslintignore +4 -0
  2. package/.eslintrc.cjs +22 -0
  3. package/.prettierignore +4 -0
  4. package/.prettierrc.cjs +41 -0
  5. package/.vscode/extensions.json +3 -0
  6. package/README.md +16 -0
  7. package/dist/index.es.d.ts +1 -0
  8. package/dist/index.es.js +14234 -0
  9. package/dist/index.umd.js +311 -0
  10. package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +143 -0
  11. package/dist/lib/components/QAccountList/src/useConfigData.d.ts +37 -0
  12. package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +66 -0
  13. package/dist/lib/components/QBackgroundFileTaskList/src/useConfigData.d.ts +14 -0
  14. package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +80 -0
  15. package/dist/lib/components/QCompanyermissionList/src/types.d.ts +44 -0
  16. package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +68 -0
  17. package/dist/lib/components/QElsEmailSendLogList/src/useConfigData.d.ts +13 -0
  18. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +72 -0
  19. package/dist/lib/components/QElsMsgRecordList/src/useConfigData.d.ts +16 -0
  20. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +75 -0
  21. package/dist/lib/components/QI18nList/src/QI18nForm.vue.d.ts +47 -0
  22. package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +136 -0
  23. package/dist/lib/components/QI18nList/src/useConfigData.d.ts +31 -0
  24. package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +61 -0
  25. package/dist/lib/components/QImChatGroupList/src/useConfigData.d.ts +11 -0
  26. package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +60 -0
  27. package/dist/lib/components/QMqRecordList/src/useConfigData.d.ts +12 -0
  28. package/dist/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue.d.ts +49 -0
  29. package/dist/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue.d.ts +3 -0
  30. package/dist/lib/components/QPermissionDataList/src/form.vue.d.ts +50 -0
  31. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +86 -0
  32. package/dist/lib/components/QPurchaseNoticeList/src/useConfigData.d.ts +15 -0
  33. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +47 -0
  34. package/dist/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.d.ts +12 -0
  35. package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +129 -0
  36. package/dist/lib/components/QQuartzJobList/src/components/JCron.vue.d.ts +23 -0
  37. package/dist/lib/components/QQuartzJobList/src/components/JCronModal.vue.d.ts +100 -0
  38. package/dist/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue.d.ts +55 -0
  39. package/dist/lib/components/QQuartzJobList/src/useConfigData.d.ts +20 -0
  40. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +100 -0
  41. package/dist/lib/components/QRoleList/src/components/content-header/index.d.ts +23 -0
  42. package/dist/lib/components/QRoleList/src/components/userAuthorization/index.d.ts +79 -0
  43. package/dist/lib/components/QRoleList/src/useConfigData.d.ts +30 -0
  44. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue.d.ts +55 -0
  45. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +104 -0
  46. package/dist/lib/components/QSupplierAccountList/src/useConfigData.d.ts +29 -0
  47. package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +49 -0
  48. package/dist/lib/components/QUsageList/src/useConfigData.d.ts +14 -0
  49. package/dist/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue.d.ts +31 -0
  50. package/dist/lib/components/QcustomConfigEdit/component/dataFormatComponent.d.ts +46 -0
  51. package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +41 -0
  52. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigRender.d.ts +12 -0
  53. package/dist/lib/components/QcustomConfigEdit/src/types.d.ts +61 -0
  54. package/dist/lib/components/QcustomConfigEdit/src/useConfigComputed.d.ts +7 -0
  55. package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +85 -0
  56. package/dist/lib/components/QcustomConfigEdit/src/useConfigMethods.d.ts +16 -0
  57. package/dist/lib/components/QcustomConfigEdit/src/useConstant.d.ts +18 -0
  58. package/dist/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue.d.ts +50 -0
  59. package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +112 -0
  60. package/dist/lib/components/QcustomConfigList/src/useConfigData.d.ts +17 -0
  61. package/dist/lib/components/QcustomConfigList/src/useMethods.d.ts +15 -0
  62. package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +66 -0
  63. package/dist/lib/components/QsysConfigList/src/useConfigData.d.ts +11 -0
  64. package/dist/lib/components/QsysConfigList/src/useMethods.d.ts +6 -0
  65. package/dist/lib/components/index.d.ts +39 -0
  66. package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +107 -0
  67. package/dist/lib/components/integratedReportList/src/index.vue.d.ts +70 -0
  68. package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +61 -0
  69. package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +46 -0
  70. package/dist/lib/components/loginLogList/src/index.vue.d.ts +45 -0
  71. package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +45 -0
  72. package/dist/lib/components/operateLogList/src/index.vue.d.ts +53 -0
  73. package/dist/lib/index.d.ts +6 -0
  74. package/dist/lib/utils/global.hook.d.ts +31 -0
  75. package/dist/lib/utils/global.types.d.ts +41 -0
  76. package/dist/lib/utils/regexp.d.ts +27 -0
  77. package/dist/style.css +1 -0
  78. package/dist/vite-env.d.ts +13 -0
  79. package/dist/vite.svg +1 -0
  80. package/index.html +13 -0
  81. package/package.json +65 -0
  82. package/public/vite.svg +1 -0
  83. package/src/App.vue +8 -0
  84. package/src/lib/components/QAccountList/index.ts +6 -0
  85. package/src/lib/components/QAccountList/src/QAccountDetail.vue +191 -0
  86. package/src/lib/components/QAccountList/src/QAccountEdit.vue +241 -0
  87. package/src/lib/components/QAccountList/src/QAccountList.vue +530 -0
  88. package/src/lib/components/QAccountList/src/useConfigData.ts +53 -0
  89. package/src/lib/components/QBackgroundFileTaskList/index.ts +6 -0
  90. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +137 -0
  91. package/src/lib/components/QBackgroundFileTaskList/src/useConfigData.ts +20 -0
  92. package/src/lib/components/QCompanyermissionList/src/editTree.vue +291 -0
  93. package/src/lib/components/QCompanyermissionList/src/form.vue +238 -0
  94. package/src/lib/components/QCompanyermissionList/src/index.vue +309 -0
  95. package/src/lib/components/QCompanyermissionList/src/types.ts +44 -0
  96. package/src/lib/components/QElsEmailSendLogList/index.ts +6 -0
  97. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +166 -0
  98. package/src/lib/components/QElsEmailSendLogList/src/useConfigData.ts +19 -0
  99. package/src/lib/components/QElsMsgRecordList/index.ts +6 -0
  100. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue +148 -0
  101. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +124 -0
  102. package/src/lib/components/QElsMsgRecordList/src/useConfigData.ts +22 -0
  103. package/src/lib/components/QElsTenantPortalNewsList/index.ts +6 -0
  104. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue +139 -0
  105. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +196 -0
  106. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +122 -0
  107. package/src/lib/components/QElsTenantPortalNewsList/src/useConfigData.ts +20 -0
  108. package/src/lib/components/QI18nList/index.ts +6 -0
  109. package/src/lib/components/QI18nList/src/QI18nForm.vue +141 -0
  110. package/src/lib/components/QI18nList/src/QI18nList.vue +361 -0
  111. package/src/lib/components/QI18nList/src/useConfigData.ts +37 -0
  112. package/src/lib/components/QImChatGroupList/index.ts +6 -0
  113. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +94 -0
  114. package/src/lib/components/QImChatGroupList/src/useConfigData.ts +17 -0
  115. package/src/lib/components/QMqRecordList/index.ts +6 -0
  116. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +105 -0
  117. package/src/lib/components/QMqRecordList/src/useConfigData.ts +18 -0
  118. package/src/lib/components/QPasswordSecurityPolicy/index.ts +6 -0
  119. package/src/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue +266 -0
  120. package/src/lib/components/QPermissionDataList/index.ts +6 -0
  121. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -0
  122. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +221 -0
  123. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +117 -0
  124. package/src/lib/components/QPermissionDataList/src/form.vue +109 -0
  125. package/src/lib/components/QPurchaseNoticeList/index.ts +6 -0
  126. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +147 -0
  127. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +244 -0
  128. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +163 -0
  129. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -0
  130. package/src/lib/components/QPurchaseNoticeTemplateList/index.ts +6 -0
  131. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +85 -0
  132. package/src/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.ts +18 -0
  133. package/src/lib/components/QQuartzJobList/index.ts +6 -0
  134. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +263 -0
  135. package/src/lib/components/QQuartzJobList/src/components/JCron.vue +82 -0
  136. package/src/lib/components/QQuartzJobList/src/components/JCronModal.vue +985 -0
  137. package/src/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue +176 -0
  138. package/src/lib/components/QQuartzJobList/src/useConfigData.ts +26 -0
  139. package/src/lib/components/QRoleList/index.ts +6 -0
  140. package/src/lib/components/QRoleList/src/QRoleList.vue +288 -0
  141. package/src/lib/components/QRoleList/src/components/content-header/contentHeader.less +31 -0
  142. package/src/lib/components/QRoleList/src/components/content-header/index.tsx +42 -0
  143. package/src/lib/components/QRoleList/src/components/userAuthorization/index.tsx +690 -0
  144. package/src/lib/components/QRoleList/src/components/userAuthorization/userAuthorization.less +97 -0
  145. package/src/lib/components/QRoleList/src/useConfigData.ts +33 -0
  146. package/src/lib/components/QSupplierAccountList/index.ts +6 -0
  147. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue +187 -0
  148. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +302 -0
  149. package/src/lib/components/QSupplierAccountList/src/useConfigData.ts +29 -0
  150. package/src/lib/components/QUsageList/index.ts +6 -0
  151. package/src/lib/components/QUsageList/src/QUsageList.vue +82 -0
  152. package/src/lib/components/QUsageList/src/useConfigData.ts +20 -0
  153. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -0
  154. package/src/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue +100 -0
  155. package/src/lib/components/QcustomConfigEdit/component/dataFormatComponent.tsx +100 -0
  156. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +71 -0
  157. package/src/lib/components/QcustomConfigEdit/index.ts +6 -0
  158. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +1807 -0
  159. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +242 -0
  160. package/src/lib/components/QcustomConfigEdit/src/types.ts +71 -0
  161. package/src/lib/components/QcustomConfigEdit/src/useConfigComputed.ts +75 -0
  162. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +123 -0
  163. package/src/lib/components/QcustomConfigEdit/src/useConfigMethods.ts +117 -0
  164. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +301 -0
  165. package/src/lib/components/QcustomConfigEdit/style/index.less +41 -0
  166. package/src/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue +135 -0
  167. package/src/lib/components/QcustomConfigList/index.ts +6 -0
  168. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +268 -0
  169. package/src/lib/components/QcustomConfigList/src/types.ts +1 -0
  170. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +23 -0
  171. package/src/lib/components/QcustomConfigList/src/useMethods.ts +36 -0
  172. package/src/lib/components/QcustomConfigList/style/index.less +3 -0
  173. package/src/lib/components/QsysConfigList/index.ts +6 -0
  174. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +125 -0
  175. package/src/lib/components/QsysConfigList/src/types.ts +1 -0
  176. package/src/lib/components/QsysConfigList/src/useConfigData.ts +17 -0
  177. package/src/lib/components/QsysConfigList/src/useMethods.ts +11 -0
  178. package/src/lib/components/QsysConfigList/style/index.less +3 -0
  179. package/src/lib/components/index.ts +78 -0
  180. package/src/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue +49 -0
  181. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +143 -0
  182. package/src/lib/components/integratedNodesList/src/index.vue +136 -0
  183. package/src/lib/components/integratedReportList/src/index.vue +86 -0
  184. package/src/lib/components/integratedReportSearchList/src/index.vue +66 -0
  185. package/src/lib/components/loginAbnormalLogList/src/index.vue +50 -0
  186. package/src/lib/components/loginLogList/src/index.vue +57 -0
  187. package/src/lib/components/loginSupplierLogList/src/index.vue +63 -0
  188. package/src/lib/components/operateLogList/src/index.vue +57 -0
  189. package/src/lib/index.ts +15 -0
  190. package/src/lib/utils/constant.ts +1 -0
  191. package/src/lib/utils/global.hook.ts +337 -0
  192. package/src/lib/utils/global.types.ts +49 -0
  193. package/src/lib/utils/regexp.ts +143 -0
  194. package/src/main.ts +11 -0
  195. package/src/vite-env.d.ts +13 -0
  196. package/tsconfig.json +24 -0
  197. package/tsconfig.node.json +9 -0
  198. package/vite.config.ts +61 -0
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <q-list-layout ref="listLayoutRef" :pageData="pageData" :apiUrls="apiUrls" />
3
+ </template>
4
+ <script setup lang="ts">
5
+ import { reactive, ref, inject } from 'vue'
6
+ const listLayoutRef = ref()
7
+ const emit = defineEmits(['create', 'detail', 'edit', 'delete', 'publish'])
8
+ const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
9
+ if (i18nKey) {
10
+ if (account) {
11
+ return account + defaultValue
12
+ }
13
+ return defaultValue
14
+ }
15
+ return defaultValue
16
+ })
17
+ const apiUrls = {
18
+ list: '/news/elsTenantPortalNews/list',
19
+ columnsCode: 'elsTenantPortalNewsList',
20
+ }
21
+ const pageData = reactive({
22
+ statusConfig: {
23
+ show: false,
24
+ },
25
+ optColumn: {
26
+ attrs: {},
27
+ extend: {},
28
+ optColumnList: [
29
+ {
30
+ type: 'view',
31
+ title: srmI18n('i18n_title_view', '查看'),
32
+ click: ({ row }) => {
33
+ emit('detail', row)
34
+ },
35
+ },
36
+ {
37
+ type: 'edit',
38
+ title: srmI18n('i18n_title_edit', '编辑'),
39
+ click: ({ row }) => {
40
+ emit('edit', row)
41
+ },
42
+ disabled: ({ row }) => row.status == '1',
43
+ },
44
+ {
45
+ type: 'delete',
46
+ title: '删除',
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ click: ({ row }: any) => {
49
+ emit('delete', row)
50
+ },
51
+ },
52
+ {
53
+ type: 'publish',
54
+ title: srmI18n('i18n_title_publish', '发布'),
55
+ disabled: ({ row }) => row.status == '1',
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ click: ({ row }: any) => {
58
+ emit('publish', row)
59
+ },
60
+ },
61
+ ],
62
+ },
63
+ buttonConfig: {
64
+ attrs: {},
65
+ extend: {},
66
+ buttons: [
67
+ {
68
+ label: srmI18n('i18n_title_add', '新增'),
69
+ icon: {
70
+ type: 'icon-Q-add',
71
+ },
72
+ type: 'add',
73
+ click: () => {
74
+ emit('create')
75
+ },
76
+ },
77
+ {
78
+ label: srmI18n('i18n_title_listCustom', '列自定义'),
79
+ icon: {
80
+ type: 'icon-Q-setting',
81
+ },
82
+ type: 'setting',
83
+ },
84
+ {
85
+ label: srmI18n('i18n_title_helpText', '帮助说明'),
86
+ icon: {
87
+ type: 'icon-Q-help-text',
88
+ },
89
+ type: 'help-text',
90
+ },
91
+ {
92
+ label: srmI18n('i18n_title_attachment', '说明附件'),
93
+ icon: {
94
+ type: 'icon-Q-attachment-text',
95
+ },
96
+ type: 'attachment-text',
97
+ },
98
+ ],
99
+ },
100
+ queryConfig: {
101
+ attrs: {},
102
+ extend: {},
103
+ form: [
104
+ {
105
+ type: 'input',
106
+ label: '关键字',
107
+ fieldName: 'keyWord',
108
+ placeholder: '请输入新闻标题、新闻简介',
109
+ },
110
+ ],
111
+ formState: {},
112
+ },
113
+ pagerConfig: {},
114
+ })
115
+ const refresh = () => {
116
+ listLayoutRef.value.fetchListData()
117
+ }
118
+ defineExpose({
119
+ refresh,
120
+ })
121
+ </script>
122
+ <style scoped></style>
@@ -0,0 +1,20 @@
1
+ import { shallowRef, ref } from 'vue'
2
+ // import type { MapObjectNoneType } from './types'
3
+ // import { VxeTableInstance } from 'vxe-table'
4
+ // import type {}
5
+ export function useConfigData() {
6
+ //响应
7
+
8
+ const apiUrls = shallowRef({
9
+ list: '/news/elsTenantPortalNews/list',
10
+ columnsCode: 'elsTenantPortalNewsList',
11
+ add: '/news/elsTenantPortalNews/add',
12
+ delete: '/news/elsTenantPortalNews/delete',
13
+ publish: '/news/elsTenantPortalNews/publish',
14
+ })
15
+ const uploadShow = shallowRef<boolean>(false)
16
+ const showEditPage = shallowRef<boolean>(false)
17
+ const currentEditRow = ref({})
18
+ const listLayoutRef = ref()
19
+ return { apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
20
+ }
@@ -0,0 +1,6 @@
1
+ import QI18nList from './src/QI18nList.vue'
2
+ import qqtUtils from '@qqt-product/utils'
3
+
4
+ export default qqtUtils.withInstall(QI18nList)
5
+
6
+ export { QI18nList }
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <vxe-modal v-model="showModal" :width="800" :title="modalTitle" :hide="hideModal">
3
+ <template #default>
4
+ <vxe-form title-colon title-align="right" title-width="160" :data="itemInfo.formData" :rules="itemInfo.formRules" :loading="itemInfo.loading" @submit="submitEvent">
5
+ <vxe-form-gather span="24">
6
+ <vxe-form-item title="国际化key" field="i18nKey" span="24">
7
+ <template #default="{ data }">
8
+ <vxe-input :disabled="true" v-model="data.i18nKey" type="text" placeholder="请输入国际化key" clearable></vxe-input>
9
+ </template>
10
+ </vxe-form-item>
11
+
12
+ <vxe-form-item title="中文内容" field="chinese" span="24">
13
+ <template #default="{ data }">
14
+ <vxe-input :disabled="true" v-model="data.chinese" type="text" placeholder="请输入中文内容" clearable></vxe-input>
15
+ </template>
16
+ </vxe-form-item>
17
+
18
+ <vxe-form-item title="英文内容" field="english" span="24">
19
+ <template #default="{ data }">
20
+ <vxe-input v-model="data.english" type="text" placeholder="请输入英文内容" clearable></vxe-input>
21
+ </template>
22
+ </vxe-form-item>
23
+
24
+ <vxe-form-item title="繁体中文" field="traditionalChinese" span="24">
25
+ <template #default="{ data }">
26
+ <vxe-input v-model="data.traditionalChinese" type="text" placeholder="请输入繁体中文" clearable></vxe-input>
27
+ </template>
28
+ </vxe-form-item>
29
+
30
+ <vxe-form-item title="法语" field="french" span="24">
31
+ <template #default="{ data }">
32
+ <vxe-input v-model="data.french" type="text" placeholder="请输入法语" clearable></vxe-input>
33
+ </template>
34
+ </vxe-form-item>
35
+
36
+ <vxe-form-item title="德语" field="german" span="24">
37
+ <template #default="{ data }">
38
+ <vxe-input v-model="data.german" type="text" placeholder="请输入德语" clearable></vxe-input>
39
+ </template>
40
+ </vxe-form-item>
41
+ <vxe-form-item title="越南" field="vietnamese" span="24">
42
+ <template #default="{ data }">
43
+ <vxe-input v-model="data.vietnamese" type="text" placeholder="请输入越南" clearable></vxe-input>
44
+ </template>
45
+ </vxe-form-item>
46
+ </vxe-form-gather>
47
+ <vxe-form-item align="center" span="24">
48
+ <template #default>
49
+ <vxe-button content="取消" @click="hideModal"></vxe-button>
50
+ <vxe-button type="submit" status="primary" content="保存"></vxe-button>
51
+ </template>
52
+ </vxe-form-item>
53
+ </vxe-form>
54
+ </template>
55
+ </vxe-modal>
56
+ </template>
57
+ <script lang="ts">
58
+ import { defineComponent, reactive, ref, inject } from 'vue'
59
+ import { VXETable, VxeFormEvents, VxeFormPropTypes } from 'vxe-table'
60
+ import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
61
+
62
+ export default defineComponent({
63
+ name: 'QI18nForm',
64
+ props: {
65
+ title: {
66
+ type: String,
67
+ default: '',
68
+ },
69
+ currentRow: {
70
+ type: Object,
71
+ },
72
+
73
+ itemTypeList: {
74
+ type: Object,
75
+ },
76
+ },
77
+ setup(props, { emit }) {
78
+ const qHttp = inject(INJECT_HTTP) as HttpClient
79
+ const modalTitle = ref(props.title)
80
+ const showModal = ref(true)
81
+ const hideModal = () => {
82
+ emit('hide', false)
83
+ }
84
+ const itemInfo = reactive({
85
+ loading: false,
86
+ formData: {
87
+ i18nKey: '',
88
+ chinese: '',
89
+ english: '',
90
+ traditionalChinese: '',
91
+ french: '',
92
+ german: '',
93
+ vietnamese: '',
94
+ },
95
+ formRules: {
96
+ i18nKey: [{ required: true, message: '当前内容为必填项' }],
97
+ chinese: [{ required: true, message: '当前内容为必填项' }],
98
+ english: [{ required: true, message: '当前内容为必填项' }],
99
+ traditionalChinese: [{ required: true, message: '当前内容为必填项' }],
100
+ french: [{ required: true, message: '当前内容为必填项' }],
101
+ german: [{ required: true, message: '当前内容为必填项' }],
102
+ vietnamese: [{ required: true, message: '当前内容为必填项' }],
103
+ // defaultValue: [{ required: true, message: '请输入默认值' }],
104
+ } as VxeFormPropTypes.Rules,
105
+ })
106
+ itemInfo.formData = Object.assign({}, itemInfo.formData, props.currentRow)
107
+ // 保存
108
+
109
+ const save = async () => {
110
+ itemInfo.loading = true
111
+ let params: MapObjectNoneType = { ...itemInfo.formData }
112
+
113
+ const res = await qHttp.post({ url: '/base/i18n/editNew', data: params })
114
+ if (res && res.success) {
115
+ VXETable.modal.message({ content: res.message, status: 'success' })
116
+ hideModal()
117
+ emit('afterHandleSaveSuccess')
118
+ } else {
119
+ VXETable.modal.message({ content: res.message, status: 'error' })
120
+ }
121
+ itemInfo.loading = false
122
+ }
123
+ const submitEvent: VxeFormEvents.Submit = () => {
124
+ save()
125
+ }
126
+ return {
127
+ modalTitle,
128
+ showModal,
129
+ hideModal,
130
+ itemInfo,
131
+ save,
132
+ submitEvent,
133
+ }
134
+ },
135
+ })
136
+ </script>
137
+ <style lang="scss" scoped>
138
+ :deep(.vxe-form--gather) {
139
+ padding: 20px 0px;
140
+ }
141
+ </style>
@@ -0,0 +1,361 @@
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>
@@ -0,0 +1,37 @@
1
+ import { shallowRef, reactive, ref } from 'vue'
2
+ // import type { MapObjectNoneType } from './types'
3
+ // import { VxeTableInstance } from 'vxe-table'
4
+ // import type {}
5
+ export function useConfigData() {
6
+ //响应
7
+
8
+ const apiUrls = shallowRef({
9
+ list: '/base/i18n/listAll',
10
+ columnsCode: 'i18nListAll',
11
+ delete: '/base/i18n/delete',
12
+ deleteWord: '/base/i18n/deleteWord',
13
+ add: '/base/i18n/add',
14
+ delRedisData: '/base/i18n/delRedisData',
15
+ delPerRedis: '/account/permission/delPerRedisData',
16
+ translateData: '/base/i18n/translateData',
17
+ translateAll: '/base/i18n/translateAll',
18
+ deleteBatch: '/base/i18n/deleteBatch',
19
+ importExcelUrl: '/base/i18n/importExcel',
20
+ excelCode: 'i18n',
21
+ exportXlsUrl: '/base/i18n/exportXls',
22
+ })
23
+ const uploadShow = shallowRef<boolean>(false)
24
+ const showEditPage = shallowRef<boolean>(false)
25
+ const addZhWord = shallowRef<boolean>(false)
26
+ const currentEditRow = ref({})
27
+ const listLayoutRef = ref()
28
+ const addZhWordFrom = ref({
29
+ translateType: '',
30
+ i18nValue: '',
31
+ })
32
+ const languageValue = ref('en')
33
+ const addZhWordLoading = shallowRef<boolean>(false)
34
+ const translateVisible = shallowRef<boolean>(false)
35
+ const itemInfoRow = ref({})
36
+ return { itemInfoRow, translateVisible, languageValue, addZhWordLoading, addZhWordFrom, addZhWord, apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
37
+ }
@@ -0,0 +1,6 @@
1
+ import QImChatGroupList from './src/QImChatGroupList.vue'
2
+ import qqtUtils from '@qqt-product/utils'
3
+
4
+ export default qqtUtils.withInstall(QImChatGroupList)
5
+
6
+ export { QImChatGroupList }