@qqt-product/system 0.0.2 → 0.0.17

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 (179) hide show
  1. package/dist/index.es.js +53481 -10448
  2. package/dist/index.umd.js +94 -22
  3. package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2881 -0
  4. package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2874 -0
  5. package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2882 -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 +2867 -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 +2867 -0
  12. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2879 -0
  13. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +38 -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/QPermissionDataAuth.vue.d.ts +387 -3
  18. package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2875 -0
  19. package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
  20. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2867 -0
  21. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2890 -0
  22. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
  23. package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
  24. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +222 -28
  25. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
  26. package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
  27. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +32 -7
  28. package/dist/lib/components/QRoleList/src/components/userAuthorization/index.d.ts +4 -4
  29. package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
  30. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +25 -4
  31. package/dist/lib/components/QSupplierAccountList/src/useConfigData.d.ts +9 -0
  32. package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
  33. package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
  34. package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
  35. package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
  36. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1208 -0
  37. package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
  38. package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
  39. package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
  40. package/dist/lib/components/index.d.ts +2 -2
  41. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2866 -0
  42. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2875 -0
  43. package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
  44. package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
  45. package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
  46. package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
  47. package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
  48. package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
  49. package/dist/style.css +1 -1
  50. package/dist/vite-env.d.ts +13 -13
  51. package/package.json +24 -11
  52. package/.eslintignore +0 -4
  53. package/.eslintrc.cjs +0 -22
  54. package/.prettierignore +0 -4
  55. package/.prettierrc.cjs +0 -41
  56. package/.vscode/extensions.json +0 -3
  57. package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
  58. package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
  59. package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
  60. package/dist/vite.svg +0 -1
  61. package/index.html +0 -13
  62. package/public/vite.svg +0 -1
  63. package/src/App.vue +0 -8
  64. package/src/lib/components/QAccountList/index.ts +0 -6
  65. package/src/lib/components/QAccountList/src/QAccountDetail.vue +0 -191
  66. package/src/lib/components/QAccountList/src/QAccountEdit.vue +0 -241
  67. package/src/lib/components/QAccountList/src/QAccountList.vue +0 -530
  68. package/src/lib/components/QAccountList/src/useConfigData.ts +0 -53
  69. package/src/lib/components/QBackgroundFileTaskList/index.ts +0 -6
  70. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +0 -137
  71. package/src/lib/components/QBackgroundFileTaskList/src/useConfigData.ts +0 -20
  72. package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
  73. package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
  74. package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
  75. package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
  76. package/src/lib/components/QElsEmailSendLogList/index.ts +0 -6
  77. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +0 -166
  78. package/src/lib/components/QElsEmailSendLogList/src/useConfigData.ts +0 -19
  79. package/src/lib/components/QElsMsgRecordList/index.ts +0 -6
  80. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue +0 -148
  81. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +0 -124
  82. package/src/lib/components/QElsMsgRecordList/src/useConfigData.ts +0 -22
  83. package/src/lib/components/QElsTenantPortalNewsList/index.ts +0 -6
  84. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue +0 -139
  85. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +0 -196
  86. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +0 -122
  87. package/src/lib/components/QElsTenantPortalNewsList/src/useConfigData.ts +0 -20
  88. package/src/lib/components/QI18nList/index.ts +0 -6
  89. package/src/lib/components/QI18nList/src/QI18nForm.vue +0 -141
  90. package/src/lib/components/QI18nList/src/QI18nList.vue +0 -361
  91. package/src/lib/components/QI18nList/src/useConfigData.ts +0 -37
  92. package/src/lib/components/QImChatGroupList/index.ts +0 -6
  93. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +0 -94
  94. package/src/lib/components/QImChatGroupList/src/useConfigData.ts +0 -17
  95. package/src/lib/components/QMqRecordList/index.ts +0 -6
  96. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +0 -105
  97. package/src/lib/components/QMqRecordList/src/useConfigData.ts +0 -18
  98. package/src/lib/components/QPasswordSecurityPolicy/index.ts +0 -6
  99. package/src/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue +0 -266
  100. package/src/lib/components/QPermissionDataList/index.ts +0 -6
  101. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +0 -3
  102. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +0 -221
  103. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +0 -117
  104. package/src/lib/components/QPermissionDataList/src/form.vue +0 -109
  105. package/src/lib/components/QPurchaseNoticeList/index.ts +0 -6
  106. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +0 -147
  107. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +0 -244
  108. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +0 -163
  109. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +0 -22
  110. package/src/lib/components/QPurchaseNoticeTemplateList/index.ts +0 -6
  111. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +0 -85
  112. package/src/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.ts +0 -18
  113. package/src/lib/components/QQuartzJobList/index.ts +0 -6
  114. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +0 -263
  115. package/src/lib/components/QQuartzJobList/src/components/JCron.vue +0 -82
  116. package/src/lib/components/QQuartzJobList/src/components/JCronModal.vue +0 -985
  117. package/src/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue +0 -176
  118. package/src/lib/components/QQuartzJobList/src/useConfigData.ts +0 -26
  119. package/src/lib/components/QRoleList/index.ts +0 -6
  120. package/src/lib/components/QRoleList/src/QRoleList.vue +0 -288
  121. package/src/lib/components/QRoleList/src/components/content-header/contentHeader.less +0 -31
  122. package/src/lib/components/QRoleList/src/components/content-header/index.tsx +0 -42
  123. package/src/lib/components/QRoleList/src/components/userAuthorization/index.tsx +0 -690
  124. package/src/lib/components/QRoleList/src/components/userAuthorization/userAuthorization.less +0 -97
  125. package/src/lib/components/QRoleList/src/useConfigData.ts +0 -33
  126. package/src/lib/components/QSupplierAccountList/index.ts +0 -6
  127. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue +0 -187
  128. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +0 -302
  129. package/src/lib/components/QSupplierAccountList/src/useConfigData.ts +0 -29
  130. package/src/lib/components/QUsageList/index.ts +0 -6
  131. package/src/lib/components/QUsageList/src/QUsageList.vue +0 -82
  132. package/src/lib/components/QUsageList/src/useConfigData.ts +0 -20
  133. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +0 -140
  134. package/src/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue +0 -100
  135. package/src/lib/components/QcustomConfigEdit/component/dataFormatComponent.tsx +0 -100
  136. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +0 -71
  137. package/src/lib/components/QcustomConfigEdit/index.ts +0 -6
  138. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +0 -1807
  139. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +0 -242
  140. package/src/lib/components/QcustomConfigEdit/src/types.ts +0 -71
  141. package/src/lib/components/QcustomConfigEdit/src/useConfigComputed.ts +0 -75
  142. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +0 -123
  143. package/src/lib/components/QcustomConfigEdit/src/useConfigMethods.ts +0 -117
  144. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +0 -301
  145. package/src/lib/components/QcustomConfigEdit/style/index.less +0 -41
  146. package/src/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue +0 -135
  147. package/src/lib/components/QcustomConfigList/index.ts +0 -6
  148. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +0 -268
  149. package/src/lib/components/QcustomConfigList/src/types.ts +0 -1
  150. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +0 -23
  151. package/src/lib/components/QcustomConfigList/src/useMethods.ts +0 -36
  152. package/src/lib/components/QcustomConfigList/style/index.less +0 -3
  153. package/src/lib/components/QsysConfigList/index.ts +0 -6
  154. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +0 -125
  155. package/src/lib/components/QsysConfigList/src/types.ts +0 -1
  156. package/src/lib/components/QsysConfigList/src/useConfigData.ts +0 -17
  157. package/src/lib/components/QsysConfigList/src/useMethods.ts +0 -11
  158. package/src/lib/components/QsysConfigList/style/index.less +0 -3
  159. package/src/lib/components/index.ts +0 -78
  160. package/src/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue +0 -49
  161. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +0 -143
  162. package/src/lib/components/integratedNodesList/src/index.vue +0 -136
  163. package/src/lib/components/integratedReportList/src/index.vue +0 -86
  164. package/src/lib/components/integratedReportSearchList/src/index.vue +0 -66
  165. package/src/lib/components/loginAbnormalLogList/src/index.vue +0 -50
  166. package/src/lib/components/loginLogList/src/index.vue +0 -57
  167. package/src/lib/components/loginSupplierLogList/src/index.vue +0 -63
  168. package/src/lib/components/operateLogList/src/index.vue +0 -57
  169. package/src/lib/index.ts +0 -15
  170. package/src/lib/utils/constant.ts +0 -1
  171. package/src/lib/utils/global.hook.ts +0 -337
  172. package/src/lib/utils/global.types.ts +0 -49
  173. package/src/lib/utils/regexp.ts +0 -143
  174. package/src/main.ts +0 -11
  175. package/src/vite-env.d.ts +0 -13
  176. package/tsconfig.json +0 -24
  177. package/tsconfig.node.json +0 -9
  178. package/vite.config.ts +0 -61
  179. /package/dist/{index.es.d.ts → index.d.ts} +0 -0
@@ -1,137 +0,0 @@
1
- <template>
2
- <div style="height: 100%">
3
- <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts">
8
- //JS
9
- import { defineComponent, reactive, inject } from 'vue'
10
- //hook
11
- import { useConfigData } from './useConfigData'
12
- import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
13
- import { message, Modal } from '@qqt-product/ui'
14
- import { useConigApiMethods } from '../../../utils/global.hook'
15
- export default defineComponent({
16
- name: 'QBackgroundFileTaskList',
17
- props: {
18
- userInfo: {
19
- type: Object,
20
- defalut: () => {
21
- return {}
22
- },
23
- },
24
- },
25
- setup() {
26
- //data-hook
27
- const { showEditPage, apiUrls, listLayoutRef } = useConfigData()
28
- const qHttp = inject(INJECT_HTTP) as HttpClient
29
- const { handleExport } = useConigApiMethods(qHttp)
30
- // const { userIpnfo } = toRefs(props)
31
- // console.log('userInfos', userInfo)
32
-
33
- //data
34
- const pageData = reactive({
35
- statusConfig: {
36
- show: false,
37
- },
38
- optColumn: {
39
- attrs: {},
40
- extend: {},
41
- optColumnList: [
42
- { authorityCode: 'backgroundFileTask#BackgroundFileTask:runTask', type: 'run', title: '执行任务', click: handleRun, disabled: allowRun },
43
- {
44
- authorityCode: 'backgroundFileTask#BackgroundFileTask:downTaskFile',
45
- type: 'down',
46
- title: '下载文件',
47
- click: handleCustomDown,
48
- disabled: allowDown,
49
- },
50
- {
51
- authorityCode: 'backgroundFileTask#BackgroundFileTask:delete',
52
- type: 'delete',
53
- title: '删除',
54
- args: {
55
- url: apiUrls.value.delete,
56
- },
57
- },
58
- ],
59
- },
60
- buttonConfig: {
61
- attrs: {},
62
- extend: {},
63
- buttons: [
64
- // {label: srmI18n(`${getLangAccount()}#i18n_title_listCustom`, '列自定义'), icon: 'setting', clickFn: this.settingColumns},
65
- // {label: srmI18n(`${getLangAccount()}#i18n_title_helpText`, '帮助说明'), icon: 'file-text', folded: true, isDocument: true, clickFn: this.showHelpText},
66
- // {label: srmI18n(`${getLangAccount()}#i18n_title_attachment`, '说明附件'), icon: 'file-pdf', folded: true, isDocument: true, clickFn: this.showHelpPDF}
67
- ],
68
- },
69
- queryConfig: {
70
- attrs: {},
71
- extend: {},
72
- form: [],
73
- formState: {},
74
- },
75
- pagerConfig: {},
76
- })
77
- //methods
78
-
79
- function allowRun({ row = {} as MapObjectNoneType }) {
80
- return '0' !== row.taskStatus
81
- }
82
-
83
- function handleRun({ row = {} as MapObjectNoneType }) {
84
- if ('0' !== row.taskStatus) {
85
- message.warning('当前状态不允许执行文件任务')
86
- return
87
- }
88
- Modal.confirm({
89
- title: '执行文件任务',
90
- content: '是否执行文件任务?',
91
- onOk() {
92
- listLayoutRef.value.loading = true
93
- qHttp
94
- .post({
95
- url: apiUrls.value.runTask + '/' + row.id,
96
- })
97
- .then((res) => {
98
- if (res.success) {
99
- listLayoutRef.value.fetchListData()
100
- message.success(res.message)
101
- } else {
102
- message.warning(res.message)
103
- }
104
- })
105
- .finally(() => {
106
- listLayoutRef.value.loading = true
107
- })
108
- },
109
- })
110
- }
111
-
112
- function allowDown({ row = {} as MapObjectNoneType }) {
113
- return '1' !== row.taskStatus
114
- }
115
- function handleCustomDown({ row = {} as MapObjectNoneType }) {
116
- handleExport({
117
- exportXlsUrl: apiUrls.value.downTaskFile + '/' + row.id,
118
- type: 'xls',
119
- fileName: row.taskName,
120
- actionType: 'get',
121
- setPostParms: () => {
122
- return {}
123
- },
124
- berforCallback: () => {
125
- listLayoutRef.value.loading = true
126
- },
127
- afterCallback: () => {
128
- listLayoutRef.value.loading = false
129
- },
130
- })
131
- }
132
-
133
- return { listLayoutRef, showEditPage, apiUrls, pageData }
134
- },
135
- })
136
- </script>
137
- <style scoped></style>
@@ -1,20 +0,0 @@
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: '/base/fileTask/list',
10
- delete: '/base/fileTask/delete',
11
- runTask: '/base/fileTask/runTask',
12
- downTaskFile: '/base/fileTask/downTaskFile',
13
- columnsCode: 'BackgroundFileTaskList',
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
- }
@@ -1,291 +0,0 @@
1
- <template>
2
- <vxe-grid ref="xGrid" v-bind="gridOptions">
3
- <template #toolbar_buttons>
4
- <div class="toolbar-button-wrap">
5
- <vxe-button status="primary" @click="add">新增</vxe-button>
6
- </div>
7
- </template>
8
- <template #dragBtn>
9
- <span class="drag-btn">
10
- <i class="vxe-icon-sort"></i>
11
- </span>
12
- </template>
13
- <!-- <template #dragTip>
14
- <vxe-tooltip :content="dragTipContent" enterable>
15
- <i class="vxe-icon-question-circle-fill"></i>
16
- </vxe-tooltip>
17
- </template> -->
18
- <template #hiddenCol="{ row }">
19
- <span>{{ row.hidden ? '是' : '否' }}</span>
20
- </template>
21
- <template #menuTypeCol="{ row }">
22
- <span>
23
- {{ getMenuTypeLabel(row.menuType) }}
24
- </span>
25
- </template>
26
- <template #menuAttributeCol="{ row }">
27
- <span>
28
- {{ getMenuAttributeTypesLabel(row.menuAttribute) }}
29
- </span>
30
- </template>
31
- <template #optsCol="{ row }">
32
- <vxe-button type="text" status="primary" @click="edit(row, 'top')">编辑</vxe-button>
33
- <!-- <vxe-button type="text" status="primary" @click="addSubMenu(row)">新增</vxe-button>
34
- <vxe-button type="text" status="danger" @click="removeRow(row)">删除</vxe-button> -->
35
- <vxe-button type="text" status="success" v-if="showHelpBtn(row)" @click="toHelpCenter(row)">说明</vxe-button>
36
- </template>
37
- </vxe-grid>
38
- <PermissionForm
39
- v-if="showPermissionForm"
40
- :title="permissionFormTitle"
41
- :treeData="gridOptions.data"
42
- :show="showPermissionForm"
43
- :currentRow="permissioncurrentRow"
44
- :menuTypes="menuTypes"
45
- :menuAttributeTypes="menuAttributeTypes"
46
- @hide="showPermissionForm = false"
47
- @afterHandleSaveSuccess="afterHandleSavePermissionSuccess"
48
- ></PermissionForm>
49
- </template>
50
- <script lang="ts">
51
- import { defineComponent, reactive, ref, unref, onMounted, inject } from 'vue'
52
- import { VXETable, VxeGridInstance, VxeGridProps } from 'vxe-table'
53
- import { INJECT_HTTP, HttpClient } from '../../../../../src/lib/utils/global.types'
54
- import { PermissionDataType } from './types'
55
- import PermissionForm from './form.vue'
56
-
57
- export default defineComponent({
58
- props: {
59
- gridConfig: {
60
- type: Object,
61
- required: true,
62
- },
63
- },
64
- components: {
65
- PermissionForm,
66
- },
67
- setup(props) {
68
- const router = inject('Q_APPLICATION_ROUTER', { push: (obj: { path: string; query: object }) => console.log('router path: ' + obj.path) })
69
- // 菜单类型
70
- const menuTypes = unref([
71
- {
72
- key: 0,
73
- value: 0,
74
- label: '一级菜单',
75
- },
76
- {
77
- key: 1,
78
- value: 1,
79
- label: '子菜单',
80
- },
81
- {
82
- key: 2,
83
- value: 2,
84
- label: '按钮/权限',
85
- },
86
- ])
87
- // 菜单属性类型
88
- const menuAttributeTypes = ref([
89
- {
90
- key: '1',
91
- value: '1',
92
- label: '采购',
93
- },
94
- {
95
- key: '2',
96
- value: '2',
97
- label: '销售',
98
- },
99
- {
100
- key: '3',
101
- value: '3',
102
- label: '公共',
103
- },
104
- {
105
- key: '4',
106
- value: '4',
107
- label: '平台',
108
- },
109
- ])
110
- const getMenuTypeLabel = (value: string | number) => {
111
- let obj = menuTypes.find((item) => item.value === value)
112
- return obj?.label
113
- }
114
- const getMenuAttributeTypesLabel = (value: string | number) => {
115
- let obj = menuAttributeTypes.value.find((item) => item.value === value)
116
- return obj?.label
117
- }
118
- // 是否显示说明
119
- const showHelpBtn = (currentRow: PermissionDataType) => {
120
- const types = [0, 1]
121
- if (!types.includes(currentRow.menuType as number)) {
122
- return false
123
- }
124
- if (currentRow.menuType !== 1 && currentRow.children && currentRow.children.length) {
125
- return false
126
- }
127
- return true
128
- }
129
- const permissionFormTitle = ref('')
130
- const qHttp = inject(INJECT_HTTP) as HttpClient
131
- const showPermissionForm = ref(false)
132
- const permissioncurrentRow = ref<PermissionDataType>()
133
- const xGrid = ref({} as VxeGridInstance)
134
- const gridOptions = reactive({
135
- ...props.gridConfig,
136
- class: 'sortable-tree-demo',
137
- rowConfig: {
138
- useKey: true,
139
- },
140
- scrollY: {
141
- enabled: false,
142
- },
143
- treeConfig: {
144
- children: 'children',
145
- },
146
- columns: [
147
- // { width: 60, fixed: 'left', slots: { default: 'dragBtn', header: 'dragTip' } },
148
- { field: 'name', width: 200, title: '菜单名称', treeNode: true, fixed: 'left' },
149
- { field: 'nameI18nKey', width: 180, title: '菜单名称国际化' },
150
- { field: 'icon', width: 80, title: '图标' },
151
- { field: 'hidden', width: 80, title: '是否隐藏', slots: { default: 'hiddenCol' } },
152
- { field: 'menuType', width: 120, title: '菜单类型', slots: { default: 'menuTypeCol' } },
153
- { field: 'menuAttribute', width: 120, title: '菜单属性', slots: { default: 'menuAttributeCol' } },
154
- { field: 'component', width: 140, title: '前端组件路径' },
155
- { field: 'url', width: 160, title: '访问路由地址', titlePrefix: { content: "以'/'开头为嵌套路由的根路径,需要填写全路径,否则为嵌套的相对路径" } },
156
- { field: 'perms', width: 260, title: '授权标识' },
157
- { width: 300, title: '操作', fixed: 'right', slots: { default: 'optsCol' } },
158
- ],
159
- data: [],
160
- } as VxeGridProps)
161
- // 新增
162
- const add = () => {
163
- permissionFormTitle.value = '新增'
164
- permissioncurrentRow.value = {
165
- id: '',
166
- menuType: 0,
167
- name: '',
168
- nameI18nKey: '',
169
- url: '',
170
- menuAttribute: '',
171
- component: '',
172
- redirect: '',
173
- perms: '',
174
- icon: '',
175
- sortNo: null,
176
- hidden: false,
177
- keepAlive: true,
178
- mobile: true,
179
- }
180
- showPermissionForm.value = true
181
- }
182
- // 新增子菜单
183
- const addSubMenu = (currentRow?: PermissionDataType) => {
184
- permissionFormTitle.value = '添加子菜单'
185
- permissioncurrentRow.value = Object.assign({}, { parentId: currentRow?.id, menuType: 1, perms: currentRow?.perms })
186
- showPermissionForm.value = true
187
- }
188
- // 编辑
189
- const edit = (currentRow: PermissionDataType, locat: string) => {
190
- permissionFormTitle.value = '编辑'
191
- permissioncurrentRow.value = currentRow
192
- showPermissionForm.value = true
193
- console.log(currentRow, locat)
194
- }
195
- // 获取权限菜单
196
- const getPermissionList = () => {
197
- qHttp.registerModuleAction('PermissionModule/getCompanyPermissionList').then((res) => {
198
- if (res && res.success) {
199
- gridOptions.data = res.result
200
- }
201
- })
202
- }
203
- // 保存成功后
204
- const afterHandleSavePermissionSuccess = () => {
205
- VXETable.modal.message({ content: '保存成功,重新登录后生效', status: 'success' })
206
- //getPermissionList()
207
- }
208
- // 插入
209
- const insertRow = async (currentRow: PermissionDataType, locat: string) => {
210
- const $table = xGrid.value
211
- if ($table) {
212
- const waitInsertData = {
213
- id: Date.now(),
214
- parentId: locat === 'current' ? currentRow.parentId : currentRow.id,
215
- name: currentRow.name + '子菜单',
216
- }
217
- if (locat === 'current') {
218
- const { row: newRow } = await $table.insertAt(waitInsertData, currentRow)
219
- await $table.setEditRow(newRow)
220
- } else if (locat === 'top') {
221
- const { row: newRow } = await $table.insert(waitInsertData)
222
- await $table.setTreeExpand(currentRow, true) // 将父节点展开
223
- await $table.setEditRow(newRow)
224
- } else if (locat === 'bottom') {
225
- const { row: newRow } = await $table.insertAt(waitInsertData, -1)
226
- await $table.setTreeExpand(currentRow, true) // 将父节点展开
227
- await $table.setEditRow(newRow)
228
- }
229
- }
230
- }
231
- // 删除
232
- const removeRow = async (currentRow: PermissionDataType) => {
233
- const type = await VXETable.modal.confirm('是否确认删除', '提示')
234
- if (type === 'confirm') {
235
- if (xGrid.value) {
236
- qHttp.registerModuleAction('PermissionModule/deletePermissionSingle', { id: currentRow.id }).then((res) => {
237
- if (res && res.success) {
238
- VXETable.modal.message({ content: '删除成功,重新登录后生效', status: 'success' })
239
- getPermissionList()
240
- } else {
241
- VXETable.modal.message({ content: res.message, status: 'error' })
242
- }
243
- })
244
- }
245
- }
246
- }
247
- const toHelpCenter = (currentRow: PermissionDataType) => {
248
- router.push({ path: '/platform/menu/PermissionList/HelpCenter', query: { id: currentRow.id, title: currentRow.title, isCompany: false } })
249
- }
250
- onMounted(() => {
251
- getPermissionList()
252
- })
253
-
254
- return {
255
- permissionFormTitle,
256
- showPermissionForm,
257
- permissioncurrentRow,
258
- add,
259
- addSubMenu,
260
- edit,
261
- getPermissionList,
262
- afterHandleSavePermissionSuccess,
263
- xGrid,
264
- // dragTipContent,
265
- gridOptions,
266
- // treeDrop,
267
- insertRow,
268
- removeRow,
269
- menuTypes,
270
- menuAttributeTypes,
271
- getMenuTypeLabel,
272
- getMenuAttributeTypesLabel,
273
- showHelpBtn,
274
- toHelpCenter,
275
- }
276
- },
277
- })
278
- </script>
279
- <style scoped lang="scss">
280
- .sortable-tree-demo .drag-btn {
281
- cursor: move;
282
- font-size: 12px;
283
- }
284
- .sortable-tree-demo .vxe-body--row.sortable-ghost,
285
- .sortable-tree-demo .vxe-body--row.sortable-chosen {
286
- background-color: #dfecfb;
287
- }
288
- .toolbar-button-wrap {
289
- padding: 0 10px;
290
- }
291
- </style>
@@ -1,238 +0,0 @@
1
- <template>
2
- <vxe-modal :width="1100" :title="modalTitle" v-model="showModal" :hide="hideModal">
3
- <template #default>
4
- <vxe-form title-colon ref="xForm" title-align="right" title-width="160" :data="permission.formData" :rules="permission.formRules" :loading="permission.loading" @submit="submitEvent">
5
- <vxe-form-item align="center" span="24">
6
- <template #default="{ data }">
7
- <vxe-radio-group v-model="data.menuType">
8
- <vxe-radio v-for="menu in menuTypesOpts" :disabled="true" :key="menu.key" :label="menu.value" :content="menu.label"></vxe-radio>
9
- </vxe-radio-group>
10
- </template>
11
- </vxe-form-item>
12
- <vxe-form-gather span="12">
13
- <vxe-form-item :visible-method="previousMenusVisible" title="上级菜单" field="parentId" span="24" :item-render="{}" title-overflow="ellipsis">
14
- <template #default="{ data }">
15
- <a-tree-select
16
- v-model:value="data.parentId"
17
- style="width: 100%"
18
- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
19
- placeholder="请选择上级菜单"
20
- allow-clear
21
- tree-default-expand-all
22
- :tree-data="previousMenus"
23
- >
24
- </a-tree-select>
25
- </template>
26
- </vxe-form-item>
27
- <vxe-form-item title="菜单名称" field="name" span="24">
28
- <template #default="{ data }">
29
- <vxe-input v-model="data.name" type="text" placeholder="请输入菜单名称" clearable></vxe-input>
30
- </template>
31
- </vxe-form-item>
32
- <vxe-form-item title="菜单名称国际化key" field="nameI18nKey" span="24">
33
- <template #default="{ data }">
34
- <vxe-input v-model="data.nameI18nKey" type="text" placeholder="请输入菜单名称国际化key" clearable></vxe-input>
35
- </template>
36
- </vxe-form-item>
37
- <vxe-form-item title="菜单属性" field="menuAttribute" span="24" :item-render="{}" title-overflow="ellipsis">
38
- <template #default="{ data }">
39
- <vxe-select :disabled="true" v-model="data.menuAttribute" placeholder="请选择菜单属性" clearable>
40
- <vxe-option v-for="menuAttr in menuAttributeTypesOpts" :key="menuAttr.key" :value="menuAttr.value" :label="menuAttr.label"></vxe-option>
41
- </vxe-select>
42
- </template>
43
- </vxe-form-item>
44
- <vxe-form-item title="访问路由地址" field="url" span="24" :item-render="{}" title-overflow="title">
45
- <template #default="{ data }">
46
- <vxe-input :disabled="true" v-model="data.url" type="text" placeholder="请输入访问路由地址" clearable></vxe-input>
47
- </template>
48
- </vxe-form-item>
49
- <vxe-form-item title="前端组件路径" field="component" span="24" :item-render="{}" title-overflow="title">
50
- <template #default="{ data }">
51
- <vxe-input :disabled="true" v-model="data.component" type="text" placeholder="请输入前端组件路径" clearable></vxe-input>
52
- </template>
53
- </vxe-form-item>
54
- <vxe-form-item title="默认跳转地址" field="redirect" span="24" :item-render="{}" title-overflow="title">
55
- <template #default="{ data }">
56
- <vxe-input v-model="data.redirect" type="text" placeholder="请输入路由参数redirect" clearable></vxe-input>
57
- </template>
58
- </vxe-form-item>
59
- <vxe-form-item title="授权标识" field="perms" span="24" :item-render="{}" title-overflow="title">
60
- <template #default="{ data }">
61
- <vxe-input v-model="data.perms" type="text" placeholder="请输入授权标识,多个用分号隔开,如 user:list;user:edit" clearable></vxe-input>
62
- </template>
63
- </vxe-form-item>
64
- </vxe-form-gather>
65
- <vxe-form-gather span="12">
66
- <vxe-form-item title="排序" field="sortNo" span="24" :item-render="{}" title-overflow="title">
67
- <template #default="{ data }">
68
- <vxe-input v-model="data.sortNo" type="integer" placeholder="请输入顺序" clearable></vxe-input>
69
- </template>
70
- </vxe-form-item>
71
- <vxe-form-item title="图标" field="icon" span="24" :item-render="{}" title-overflow="title">
72
- <template #default="{ data }">
73
- <vxe-input v-model="data.icon" type="text" placeholder="请选择图标" clearable></vxe-input>
74
- </template>
75
- </vxe-form-item>
76
- <vxe-form-item title="是否隐藏菜单" field="hidden" span="24" :item-render="{}" title-overflow="title">
77
- <template #default="{ data }">
78
- <vxe-switch v-model="data.hidden" open-label="是" close-label="否"></vxe-switch>
79
- </template>
80
- </vxe-form-item>
81
- <vxe-form-item title="是否缓存路由" field="hidden" span="24" :item-render="{}" title-overflow="title">
82
- <template #default="{ data }">
83
- <vxe-switch v-model="data.keepAlive" open-label="是" close-label="否"></vxe-switch>
84
- </template>
85
- </vxe-form-item>
86
- <vxe-form-item title="是否移动端菜单" field="mobile" span="24" :item-render="{}" title-overflow="title">
87
- <template #default="{ data }">
88
- <vxe-switch :disabled="true" v-model="data.mobile" open-label="是" close-label="否"></vxe-switch>
89
- </template>
90
- </vxe-form-item>
91
- </vxe-form-gather>
92
- <vxe-form-item align="center" span="24">
93
- <template #default>
94
- <vxe-button content="取消" @click="hideModal"></vxe-button>
95
- <vxe-button type="submit" status="primary" content="确定"></vxe-button>
96
- </template>
97
- </vxe-form-item>
98
- </vxe-form>
99
- </template>
100
- </vxe-modal>
101
- </template>
102
- <script lang="ts">
103
- import { defineComponent, reactive, ref, onMounted, inject } from 'vue'
104
- import { VXETable, VxeFormEvents, VxeFormPropTypes } from 'vxe-table'
105
- import { INJECT_HTTP, HttpClient } from '../../../../../src/lib/utils/global.types'
106
- export default defineComponent({
107
- name: 'PermissionForm',
108
- props: {
109
- title: {
110
- type: String,
111
- default: '',
112
- },
113
- show: {
114
- type: Boolean,
115
- default: false,
116
- },
117
- treeData: {
118
- type: Object,
119
- },
120
- currentRow: {
121
- type: Object,
122
- },
123
- menuTypes: {
124
- type: Object,
125
- },
126
- menuAttributeTypes: {
127
- type: Object,
128
- },
129
- },
130
- setup(props, { emit }) {
131
- const qHttp = inject(INJECT_HTTP) as HttpClient
132
- const modalTitle = ref(props.title)
133
- const showModal = ref(props.show)
134
- const previousMenus = ref([])
135
- const menuTypesOpts = ref(props.menuTypes)
136
- const menuAttributeTypesOpts = ref(props.menuAttributeTypes)
137
- const hideModal = () => {
138
- emit('hide', false)
139
- }
140
- const permission = reactive({
141
- loading: false,
142
- formData: {
143
- id: null,
144
- parentId: null,
145
- menuType: null,
146
- name: null,
147
- nameI18nKey: null,
148
- url: null,
149
- menuAttribute: null,
150
- component: null,
151
- redirect: null,
152
- perms: null,
153
- keepAlive: null,
154
- icon: null,
155
- sortNo: null,
156
- hidden: null,
157
- mobile: null,
158
- },
159
- formRules: {
160
- name: [{ required: true, message: '请输入名称' }],
161
- url: [{ required: true, message: '请输入菜单路径' }],
162
- menuAttribute: [{ required: true, message: '请输入菜单属性' }],
163
- component: [{ required: true, message: '请输入前端组件路径' }],
164
- parentId: [
165
- { required: true, message: '请选择上级菜单' },
166
- {
167
- validator(valid) {
168
- if (!valid.itemValue) {
169
- return new Error('请选择上级菜单')
170
- }
171
- },
172
- },
173
- ],
174
- } as VxeFormPropTypes.Rules,
175
- })
176
- permission.formData = Object.assign({}, permission.formData, props.currentRow)
177
- // 是否显示上级菜单
178
- const previousMenusVisible = () => {
179
- if (permission.formData.menuType) {
180
- if (permission.formData.menuType === 0) {
181
- return false
182
- } else {
183
- return true
184
- }
185
- } else {
186
- return false
187
- }
188
- }
189
- // 保存
190
- const save = async () => {
191
- permission.loading = true
192
- const res = permission.formData.id
193
- ? await qHttp.registerModuleAction('PermissionModule/editPermission', permission.formData)
194
- : await qHttp.registerModuleAction('PermissionModule/addPermission', permission.formData)
195
- if (res && res.success) {
196
- hideModal()
197
- emit('afterHandleSaveSuccess')
198
- } else {
199
- VXETable.modal.message({ content: res.message, status: 'error' })
200
- }
201
- permission.loading = false
202
- }
203
- const submitEvent: VxeFormEvents.Submit = () => {
204
- save()
205
- }
206
- onMounted(() => {
207
- qHttp.registerModuleAction('PermissionModule/queryTreeList').then((res) => {
208
- if (res && res.success) {
209
- if (res.result && res.result.treeList) {
210
- previousMenus.value = res.result.treeList
211
- }
212
- }
213
- })
214
- })
215
-
216
- return {
217
- modalTitle,
218
- previousMenus,
219
- previousMenusVisible,
220
- showModal,
221
- hideModal,
222
- menuTypesOpts,
223
- menuAttributeTypesOpts,
224
- permission,
225
- save,
226
- submitEvent,
227
- }
228
- },
229
- })
230
- </script>
231
- <style lang="scss" scoped>
232
- :deep(.vxe-form--gather) {
233
- padding: 20px 0px;
234
- }
235
- :deep(.vxe-form--gather:first-child) {
236
- border-right: solid 1px #ddd;
237
- }
238
- </style>