@qqt-product/system 0.0.16 → 0.0.18

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 (148) hide show
  1. package/dist/index.es.js +9601 -9171
  2. package/dist/index.umd.js +34 -35
  3. package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +16 -12
  4. package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +14 -10
  5. package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +17 -12
  6. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +13 -9
  7. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +13 -9
  8. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +16 -12
  9. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +9 -0
  10. package/dist/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue.d.ts +387 -3
  11. package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +16 -12
  12. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +13 -9
  13. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +18 -14
  14. package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +1 -1
  15. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +2 -1
  16. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +21 -1
  17. package/dist/lib/components/QRoleList/src/components/userAuthorization/index.d.ts +4 -4
  18. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +19 -2
  19. package/dist/lib/components/QSupplierAccountList/src/useConfigData.d.ts +9 -0
  20. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +0 -1
  21. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +13 -9
  22. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +16 -12
  23. package/dist/style.css +1 -1
  24. package/package.json +20 -9
  25. package/.eslintignore +0 -4
  26. package/.eslintrc.cjs +0 -22
  27. package/.prettierignore +0 -4
  28. package/.prettierrc.cjs +0 -41
  29. package/.vscode/extensions.json +0 -3
  30. package/dist/vite.svg +0 -1
  31. package/index.html +0 -13
  32. package/public/vite.svg +0 -1
  33. package/src/App.vue +0 -8
  34. package/src/lib/components/QAccountList/index.ts +0 -6
  35. package/src/lib/components/QAccountList/src/QAccountCreate.vue +0 -272
  36. package/src/lib/components/QAccountList/src/QAccountDetail.vue +0 -259
  37. package/src/lib/components/QAccountList/src/QAccountEdit.vue +0 -273
  38. package/src/lib/components/QAccountList/src/QAccountList.vue +0 -532
  39. package/src/lib/components/QAccountList/src/useConfigData.ts +0 -53
  40. package/src/lib/components/QBackgroundFileTaskList/index.ts +0 -6
  41. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +0 -143
  42. package/src/lib/components/QBackgroundFileTaskList/src/useConfigData.ts +0 -20
  43. package/src/lib/components/QElsEmailSendLogList/index.ts +0 -6
  44. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +0 -172
  45. package/src/lib/components/QElsEmailSendLogList/src/useConfigData.ts +0 -19
  46. package/src/lib/components/QElsMsgRecordList/index.ts +0 -6
  47. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue +0 -148
  48. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +0 -123
  49. package/src/lib/components/QElsMsgRecordList/src/useConfigData.ts +0 -22
  50. package/src/lib/components/QElsTenantPortalNewsList/index.ts +0 -6
  51. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue +0 -139
  52. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +0 -244
  53. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +0 -151
  54. package/src/lib/components/QElsTenantPortalNewsList/src/useConfigData.ts +0 -20
  55. package/src/lib/components/QI18nList/index.ts +0 -6
  56. package/src/lib/components/QI18nList/src/QI18nForm.vue +0 -141
  57. package/src/lib/components/QI18nList/src/QI18nList.vue +0 -365
  58. package/src/lib/components/QI18nList/src/useConfigData.ts +0 -37
  59. package/src/lib/components/QImChatGroupList/index.ts +0 -6
  60. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +0 -103
  61. package/src/lib/components/QImChatGroupList/src/useConfigData.ts +0 -17
  62. package/src/lib/components/QMqRecordList/index.ts +0 -6
  63. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +0 -109
  64. package/src/lib/components/QMqRecordList/src/useConfigData.ts +0 -18
  65. package/src/lib/components/QPasswordSecurityPolicy/index.ts +0 -6
  66. package/src/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue +0 -266
  67. package/src/lib/components/QPermissionDataList/index.ts +0 -6
  68. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +0 -3
  69. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +0 -218
  70. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +0 -110
  71. package/src/lib/components/QPermissionDataList/src/form.vue +0 -109
  72. package/src/lib/components/QPurchaseNoticeList/index.ts +0 -6
  73. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +0 -147
  74. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +0 -332
  75. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +0 -189
  76. package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +0 -84
  77. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +0 -22
  78. package/src/lib/components/QPurchaseNoticeTemplateList/index.ts +0 -6
  79. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +0 -134
  80. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +0 -91
  81. package/src/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.ts +0 -18
  82. package/src/lib/components/QQuartzJobList/index.ts +0 -6
  83. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +0 -276
  84. package/src/lib/components/QQuartzJobList/src/components/JCron.vue +0 -82
  85. package/src/lib/components/QQuartzJobList/src/components/JCronModal.vue +0 -985
  86. package/src/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue +0 -176
  87. package/src/lib/components/QQuartzJobList/src/useConfigData.ts +0 -26
  88. package/src/lib/components/QRoleList/index.ts +0 -6
  89. package/src/lib/components/QRoleList/src/QRoleList.vue +0 -332
  90. package/src/lib/components/QRoleList/src/components/content-header/contentHeader.less +0 -31
  91. package/src/lib/components/QRoleList/src/components/content-header/index.tsx +0 -42
  92. package/src/lib/components/QRoleList/src/components/userAuthorization/index.tsx +0 -690
  93. package/src/lib/components/QRoleList/src/components/userAuthorization/userAuthorization.less +0 -97
  94. package/src/lib/components/QRoleList/src/useConfigData.ts +0 -28
  95. package/src/lib/components/QSupplierAccountList/index.ts +0 -6
  96. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue +0 -187
  97. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +0 -304
  98. package/src/lib/components/QSupplierAccountList/src/useConfigData.ts +0 -29
  99. package/src/lib/components/QUsageList/index.ts +0 -6
  100. package/src/lib/components/QUsageList/src/QUsageList.vue +0 -287
  101. package/src/lib/components/QUsageList/src/useConfigData.ts +0 -154
  102. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +0 -140
  103. package/src/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue +0 -100
  104. package/src/lib/components/QcustomConfigEdit/component/dataFormatComponent.tsx +0 -100
  105. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +0 -71
  106. package/src/lib/components/QcustomConfigEdit/index.ts +0 -6
  107. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +0 -1895
  108. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +0 -242
  109. package/src/lib/components/QcustomConfigEdit/src/types.ts +0 -71
  110. package/src/lib/components/QcustomConfigEdit/src/useConfigComputed.ts +0 -75
  111. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +0 -123
  112. package/src/lib/components/QcustomConfigEdit/src/useConfigMethods.ts +0 -117
  113. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +0 -301
  114. package/src/lib/components/QcustomConfigEdit/style/index.less +0 -41
  115. package/src/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue +0 -135
  116. package/src/lib/components/QcustomConfigList/index.ts +0 -6
  117. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +0 -276
  118. package/src/lib/components/QcustomConfigList/src/types.ts +0 -1
  119. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +0 -23
  120. package/src/lib/components/QcustomConfigList/src/useMethods.ts +0 -36
  121. package/src/lib/components/QcustomConfigList/style/index.less +0 -3
  122. package/src/lib/components/QsysConfigList/index.ts +0 -6
  123. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +0 -124
  124. package/src/lib/components/QsysConfigList/src/types.ts +0 -1
  125. package/src/lib/components/QsysConfigList/src/useConfigData.ts +0 -17
  126. package/src/lib/components/QsysConfigList/src/useMethods.ts +0 -11
  127. package/src/lib/components/QsysConfigList/style/index.less +0 -3
  128. package/src/lib/components/index.ts +0 -78
  129. package/src/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue +0 -49
  130. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +0 -135
  131. package/src/lib/components/integratedNodesList/src/index.vue +0 -130
  132. package/src/lib/components/integratedReportList/src/index.vue +0 -111
  133. package/src/lib/components/integratedReportSearchList/src/index.vue +0 -106
  134. package/src/lib/components/loginAbnormalLogList/src/index.vue +0 -43
  135. package/src/lib/components/loginLogList/src/index.vue +0 -51
  136. package/src/lib/components/loginSupplierLogList/src/index.vue +0 -53
  137. package/src/lib/components/operateLogList/src/index.vue +0 -46
  138. package/src/lib/index.ts +0 -15
  139. package/src/lib/utils/constant.ts +0 -1
  140. package/src/lib/utils/global.hook.ts +0 -337
  141. package/src/lib/utils/global.types.ts +0 -49
  142. package/src/lib/utils/regexp.ts +0 -143
  143. package/src/main.ts +0 -11
  144. package/src/vite-env.d.ts +0 -13
  145. package/tsconfig.json +0 -24
  146. package/tsconfig.node.json +0 -9
  147. package/vite.config.ts +0 -61
  148. /package/dist/{index.es.d.ts → index.d.ts} +0 -0
@@ -1,176 +0,0 @@
1
- <template>
2
- <a-modal :title="title" :width="800" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel" ok-text="保存并安排任务" cancel-text="关闭">
3
- <a-spin :spinning="confirmLoading">
4
- <a-form ref="Aform" :model="form">
5
- <a-form-item name="jobNameKey" :rules="[{ required: true, message: '请输入任务编码!' }]" :label-col="labelCol" :wrapper-col="wrapperCol" label="任务编码">
6
- <a-input placeholder="请输入任务编码" :disabled="isJobNameKey" v-model:value="form.jobNameKey" />
7
- </a-form-item>
8
- <a-form-item name="jobClassName" :rules="[{ required: true, message: '请输入任务类名!' }]" :label-col="labelCol" :wrapper-col="wrapperCol" label="任务类名" has-feedback>
9
- <a-input placeholder="请输入任务类名" v-model:value="form.jobClassName" />
10
- </a-form-item>
11
- <a-form-item
12
- name="cronExpression"
13
- :rules="[
14
- {
15
- required: true,
16
- message: '请输入cron表达式!',
17
- },
18
- ]"
19
- :label-col="labelCol"
20
- :wrapper-col="wrapperCol"
21
- label="cron表达式"
22
- >
23
- <!-- <a-input placeholder="请输入cron表达式" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入任务类名!' }]}]" />-->
24
- <!-- <a target="_blank" href="http://cron.qqe2.com/">-->
25
- <!-- <a-icon type="share-alt" />-->
26
- <!-- 在线cron表达式生成-->
27
- <!-- </a>-->
28
- <!-- <j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>-->
29
- <j-cron ref="innerVueCron" v-model:value="form.cronExpression" @change="setCorn" />
30
- </a-form-item>
31
- <a-form-item name="parameter" :label-col="labelCol" :wrapper-col="wrapperCol" label="参数">
32
- <a-input placeholder="请输入参数" v-model:value="form.parameter" />
33
- </a-form-item>
34
- <a-form-item name="description" :label-col="labelCol" :wrapper-col="wrapperCol" label="描述">
35
- <a-input placeholder="请输入描述" v-model:value="form.description" />
36
- </a-form-item>
37
- <a-form-item :rules="[{ required: true, message: '请选择状态!' }]" name="status" :label-col="labelCol" :wrapper-col="wrapperCol" label="状态">
38
- <a-radio-group button-style="solid" v-model:value="form.status">
39
- <a-radio-button :value="0"> 正常 </a-radio-button>
40
- <a-radio-button :value="-1"> 停止 </a-radio-button>
41
- </a-radio-group>
42
- </a-form-item>
43
- </a-form>
44
- </a-spin>
45
- </a-modal>
46
- </template>
47
-
48
- <script lang="ts">
49
- import { defineComponent, ref, inject, nextTick } from 'vue'
50
- // import { postAction } from '@/api/manage'
51
- import JCron from '../components/JCron.vue'
52
-
53
- import { HttpClient, INJECT_HTTP, MapObjectNoneType } from '../../../../utils/global.types'
54
- import { message } from '@qqt-product/ui'
55
- // import moment from "moment"
56
-
57
- export default defineComponent({
58
- name: 'QuartzJobModal',
59
- emits: ['close', 'ok'],
60
- components: {
61
- JCron,
62
- },
63
- setup() {
64
- const Aform = ref()
65
- const qHttp = inject(INJECT_HTTP) as HttpClient
66
- return { Aform, qHttp }
67
- },
68
- data() {
69
- return {
70
- title: '操作',
71
- visible: false,
72
- isJobNameKey: false,
73
- model: {} as MapObjectNoneType,
74
- labelCol: {
75
- xs: { span: 24 },
76
- sm: { span: 5 },
77
- },
78
- wrapperCol: {
79
- xs: { span: 24 },
80
- sm: { span: 16 },
81
- },
82
- cron: {
83
- label: '',
84
- value: '',
85
- },
86
- confirmLoading: false,
87
- form: {
88
- jobNameKey: '',
89
- jobClassName: '',
90
- cronExpression: '* * * * * ? *',
91
- parameter: undefined,
92
- description: '',
93
- status: undefined,
94
- },
95
-
96
- url: {
97
- add: '/job/quartzJob/add',
98
- edit: '/job/quartzJob/edit',
99
- },
100
- }
101
- },
102
- methods: {
103
- add() {
104
- this.edit({})
105
- },
106
- edit(record: MapObjectNoneType) {
107
- this.visible = true
108
- // let _that = this
109
- nextTick(() => {
110
- this.Aform.resetFields()
111
- this.model = Object.assign({}, record)
112
- if (this.model.id) {
113
- this.isJobNameKey = true
114
- }
115
- nextTick(() => {
116
- console.log('this.Aform', this.Aform)
117
- this.form = { ...this.form, ...this.model }
118
- })
119
- })
120
- },
121
- close() {
122
- this.$emit('close')
123
- this.visible = false
124
- },
125
- handleOk() {
126
- // const that = this
127
- // 触发表单验证
128
- console.log('this.Aform', this.Aform)
129
- this.Aform.validate().then(() => {
130
- this.confirmLoading = true
131
- let httpurl = ''
132
- if (!this.model.id) {
133
- httpurl += this.url.add
134
- } else {
135
- httpurl += this.url.edit
136
- }
137
- let formData: MapObjectNoneType = this.form
138
- //时间格式化
139
- this.qHttp
140
- .post({
141
- url: httpurl,
142
- data: formData,
143
- })
144
- .then((res: MapObjectNoneType) => {
145
- if (res.success) {
146
- message.success(res.message)
147
- this.$emit('ok')
148
- } else {
149
- message.warning(res.message)
150
- }
151
- })
152
- .finally(() => {
153
- this.confirmLoading = false
154
- this.close()
155
- })
156
- })
157
- },
158
- handleCancel() {
159
- this.close()
160
- },
161
- setCorn(data: string) {
162
- console.log('data)', data)
163
- this.$nextTick(() => {
164
- this.form.cronExpression = data
165
- })
166
-
167
- // console.log(Object.keys(data).length==0);
168
- if (Object.keys(data).length == 0) {
169
- message.warning('请输入cron表达式!')
170
- }
171
- },
172
- },
173
- })
174
- </script>
175
-
176
- <style scoped></style>
@@ -1,26 +0,0 @@
1
- import { MapObjectNoneType } from '../../../utils/global.types'
2
- import { shallowRef, ref } from 'vue'
3
- // import type { MapObjectNoneType } from './types'
4
- // import { VxeTableInstance } from 'vxe-table'
5
- // import type {}
6
- export function useConfigData() {
7
- //响应
8
-
9
- const apiUrls = shallowRef({
10
- list: '/job/quartzJob/list',
11
- delete: '/job/quartzJob/delete',
12
- deleteBatch: '/job/quartzJob/deleteBatch',
13
- pause: '/job/quartzJob/pause',
14
- manualExecute: '/job/quartzJob/manualExecute',
15
- resume: '/job/quartzJob/resume',
16
- exportXlsUrl: 'job/quartzJob/exportXls',
17
- importExcelUrl: 'job/quartzJob/importExcel',
18
- columnsCode: 'ElsQuartzJob',
19
- })
20
- const uploadShow = shallowRef<boolean>(false)
21
- const showEditPage = shallowRef<boolean>(false)
22
- const currentEditRow = ref<MapObjectNoneType>({})
23
- const listLayoutRef = ref()
24
- const editPage = ref()
25
- return { editPage, apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
26
- }
@@ -1,6 +0,0 @@
1
- import QRoleList from './src/QRoleList.vue'
2
- import qqtUtils from '@qqt-product/utils'
3
-
4
- export default qqtUtils.withInstall(QRoleList)
5
-
6
- export { QRoleList }
@@ -1,332 +0,0 @@
1
- <template>
2
- <div style="height: 100%">
3
- <q-list-layout ref="listLayoutRef" v-if="!showAuth && !showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
-
5
- <!--复制功能-->
6
- <vxe-modal v-model="copyRoleShow" title="复制角色" type="confirm" :showFooter="false">
7
- <vxe-form title-colon title-align="right" title-width="160" :data="copyRoleFrom" :rules="userInformsFromRules" @submit="copyRolesubmitEvent">
8
- <vxe-form-gather span="24">
9
- <vxe-form-item title="角色名称" field="roleName" span="24">
10
- <template #default="{ data }">
11
- <vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
12
- </template>
13
- </vxe-form-item>
14
- <vxe-form-item title="角色编码" field="roleCode" span="24">
15
- <template #default="{ data }">
16
- <vxe-input v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
17
- </template>
18
- </vxe-form-item>
19
-
20
- <vxe-form-item align="center" span="24">
21
- <template #default>
22
- <vxe-button content="取消" @click="copyRoleShow = false"></vxe-button>
23
- <vxe-button type="submit" status="primary" content="保存"></vxe-button>
24
- </template>
25
- </vxe-form-item>
26
- </vxe-form-gather>
27
- </vxe-form>
28
- </vxe-modal>
29
-
30
- <!--新增-->
31
-
32
- <vxe-modal :width="560" v-model="userInformsFromShow" title="基本信息" type="confirm" :showFooter="false">
33
- <vxe-form title-colon title-align="right" title-width="100" :rules="userInformsFromRules" :data="userInformsFrom" @submit="userInformFormEvent">
34
- <vxe-form-gather span="24">
35
- <vxe-form-item title="角色名称" field="roleName" span="24">
36
- <template #default="{ data }">
37
- <vxe-input v-model="data.roleName" type="text" placeholder="请输入角色名称"></vxe-input>
38
- </template>
39
- </vxe-form-item>
40
- <vxe-form-item title="角色编码" field="roleCode" span="24">
41
- <template #default="{ data }">
42
- <vxe-input :disabled="!!userInformsFrom.id" v-model="data.roleCode" type="text" placeholder="请输入角色编码"></vxe-input>
43
- </template>
44
- </vxe-form-item>
45
-
46
- <vxe-form-item title="描述" field="description" span="24">
47
- <template #default="{ data }">
48
- <vxe-textarea :autosize="{ minRows: 6, maxRows: 10 }" v-model="data.description" type="text" placeholder="请输入描述"></vxe-textarea>
49
- </template>
50
- </vxe-form-item>
51
-
52
- <vxe-form-item align="center" span="24">
53
- <template #default>
54
- <vxe-button
55
- content="取消"
56
- @click="
57
- () => {
58
- userInformsFromShow = false
59
- userInformsFrom = {}
60
- }
61
- "
62
- ></vxe-button>
63
- <vxe-button type="submit" status="primary" content="保存"></vxe-button>
64
- </template>
65
- </vxe-form-item>
66
- </vxe-form-gather>
67
- </vxe-form>
68
- </vxe-modal>
69
-
70
- <!-- 租户授权 -->
71
- <user-authorization v-if="showAuth" parentPath="RoleList" :rows="currentRows" @authCancel="handleAuthCancel"></user-authorization>
72
- </div>
73
- </template>
74
-
75
- <script lang="ts">
76
- //JS
77
- import { ref, defineComponent, reactive, nextTick, inject } from 'vue'
78
- //hook
79
- import { useConfigData } from './useConfigData'
80
- import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
81
- import { message } from '@qqt-product/ui'
82
-
83
- import UserAuthorization from './components/userAuthorization'
84
-
85
- export default defineComponent({
86
- name: 'QRoleList',
87
- props: {
88
- userInfo: {
89
- type: Object,
90
- defalut: () => {
91
- return {}
92
- },
93
- },
94
- },
95
- components: {
96
- UserAuthorization,
97
- },
98
- setup() {
99
- //data-hook
100
- const { userInformsFromShow, userInformsFrom, showEditPage, apiUrls, copyRoleShow, copyRoleFrom, itemRow, listLayoutRef } = useConfigData()
101
- // const { userInfo } = toRefs(props)
102
- const qHttp = inject(INJECT_HTTP) as HttpClient
103
- const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
104
- if (i18nKey) {
105
- if (account) {
106
- return account + defaultValue
107
- }
108
- return defaultValue
109
- }
110
- return defaultValue
111
- })
112
-
113
- const userInformsFromRules = ref({
114
- roleName: [{ required: true, message: '请输入角色名称' }],
115
- roleCode: [
116
- { required: true, message: '请输入角色编码' },
117
- {
118
- // todo:异步校验
119
- validator: async ({ itemValue }) => {
120
- if (/[\u4E00-\u9FA5]/g.test(itemValue)) {
121
- message.warn('角色编码不可输入汉字!')
122
- return Promise.reject('角色编码不可输入汉字!')
123
- } else {
124
- if (userInformsFrom.value.id) {
125
- return Promise.resolve()
126
- } else {
127
- const params = {
128
- tableName: 'els_role',
129
- fieldName: 'role_code',
130
- fieldVal: itemValue,
131
- dataId: copyRoleFrom.value.id,
132
- }
133
- const res = await qHttp.get({ url: '/base/duplicate/check', params })
134
- if (res && res.success) {
135
- return Promise.resolve()
136
- } else {
137
- message.warn(res.message)
138
- return Promise.reject(res.message)
139
- }
140
- }
141
- }
142
- },
143
- },
144
- ],
145
- })
146
- const showAuth = ref(false)
147
- const currentRows = ref([])
148
-
149
- const handleAuth = ({ row }: { row: never }) => {
150
- showAuth.value = true
151
- if (Array.isArray(row)) {
152
- currentRows.value = [...row] as never
153
- } else {
154
- currentRows.value.push(row as never)
155
- }
156
- }
157
-
158
- const handleAuthCancel = () => {
159
- showAuth.value = false
160
- currentRows.value = []
161
- }
162
-
163
- //data
164
- const pageData = reactive({
165
- statusConfig: {
166
- show: false,
167
- },
168
- optionConfig: {
169
- attrs: {},
170
- extend: {},
171
- options: [
172
- { authorityCode: 'role#Role:edit', type: 'edit', title: '编辑', click: handleEdit },
173
- { authorityCode: 'role#Role:copy', type: 'copy', title: '复制', click: handleCopy },
174
- {
175
- type: 'authorization',
176
- title: '授权',
177
- click: handleAuth,
178
- authorityCode: 'role#Permissio:saveRolePermission',
179
- },
180
- {
181
- authorityCode: 'role#Role:delete',
182
- type: 'delete',
183
- title: '删除',
184
- args: {
185
- url: apiUrls.value.delete,
186
- },
187
- disabled: allowDelete,
188
- },
189
- // { authorityCode: 'role#Role:userSet', type: 'usersList', title: srmI18n(`${getLangAccount()}#i18n_btn_jDER_36c46210`, '用户配置'), clickFn: this.handleUsersList },
190
- ],
191
- },
192
- buttonConfig: {
193
- attrs: {},
194
- extend: {},
195
- buttons: [
196
- {
197
- authorityCode: 'role#Role:add',
198
- label: srmI18n('i18n_title_add', '新增'),
199
- icon: {
200
- type: 'icon-Q-add',
201
- },
202
- attrs: {
203
- type: 'primary',
204
- },
205
- click: handleAdd,
206
- },
207
- {
208
- label: srmI18n('i18n_title_listCustom', '列自定义'),
209
- icon: {
210
- type: 'icon-Q-setting',
211
- },
212
- type: 'setting',
213
- },
214
- ],
215
- },
216
- queryConfig: {
217
- attrs: {},
218
- extend: {},
219
- form: [
220
- {
221
- type: 'input',
222
- label: '角色名称',
223
- fieldName: 'roleName',
224
- placeholder: '请输入角色名称',
225
- },
226
- ],
227
- },
228
- pagerConfig: {},
229
- })
230
-
231
- //method
232
- function handleCopy({ row = {} as MapObjectNoneType }) {
233
- itemRow.value = row
234
- nextTick(() => {
235
- copyRoleShow.value = true
236
- })
237
- }
238
-
239
- function allowDelete({ row = {} as MapObjectNoneType }) {
240
- if (row.roleCode == 'companyAdmin' || row.roleCode == 'admin') {
241
- return true
242
- } else {
243
- return false
244
- }
245
- }
246
-
247
- function copyRolesubmitEvent() {
248
- if (copyRoleFrom.value.roleName == '') {
249
- message.warning('请输入角色名称')
250
- return
251
- }
252
- if (copyRoleFrom.value.roleCode == '') {
253
- message.warning('请输入角色编码')
254
- return
255
- }
256
-
257
- let data = { id: itemRow.value.id, roleName: copyRoleFrom.value.roleName, roleCode: copyRoleFrom.value.roleCode }
258
- listLayoutRef.value.loading = true
259
- qHttp
260
- .post({
261
- url: apiUrls.value.copy,
262
- data,
263
- })
264
- .then((res) => {
265
- listLayoutRef.value.loading = false
266
- if (res.success) {
267
- listLayoutRef.value.fetchListData()
268
- message.success(res.message)
269
- } else {
270
- message.warning(res.message)
271
- }
272
- })
273
- .finally(() => {
274
- itemRow.value = {}
275
- copyRoleFrom.value = {}
276
- copyRoleShow.value = false
277
- })
278
- }
279
-
280
- function handleAdd() {
281
- userInformsFrom.value = {}
282
- nextTick(() => {
283
- userInformsFromShow.value = true
284
- })
285
- }
286
- function handleEdit({ row = {} as MapObjectNoneType }) {
287
- userInformsFrom.value = { ...row }
288
- nextTick(() => {
289
- userInformsFromShow.value = true
290
- })
291
- }
292
- function userInformFormEvent() {
293
- let url = userInformsFrom.value.id ? '/account/role/edit' : '/account/role/add'
294
- qHttp
295
- .post({
296
- url,
297
- data: {
298
- ...userInformsFrom.value,
299
- },
300
- })
301
- .then((res) => {
302
- listLayoutRef.value.loading = false
303
- if (res.success) {
304
- listLayoutRef.value.fetchListData()
305
- message.success(res.message)
306
- userInformsFrom.value = {}
307
- userInformsFromShow.value = false
308
- } else {
309
- message.warning(res.message)
310
- }
311
- })
312
- }
313
-
314
- return {
315
- userInformsFromRules,
316
- userInformFormEvent,
317
- userInformsFromShow,
318
- userInformsFrom,
319
- listLayoutRef,
320
- copyRolesubmitEvent,
321
- copyRoleFrom,
322
- showEditPage,
323
- apiUrls,
324
- pageData,
325
- copyRoleShow,
326
- showAuth,
327
- currentRows,
328
- handleAuthCancel,
329
- }
330
- },
331
- })
332
- </script>
@@ -1,31 +0,0 @@
1
- .content-Header {
2
- width: 100%;
3
- position: sticky;
4
- top: 0;
5
- z-index: 99;
6
- box-shadow: 0 3px 12px rgba(98, 107, 181, .25);
7
- &.posA {
8
- position: absolute;
9
- left: 0;
10
- top: 0;
11
- }
12
- .topWrap {
13
- display: flex;
14
- justify-content: space-between;
15
- align-items: center;
16
- background: #fff;
17
- padding: 10px 24px 10px 10px;
18
- .box {
19
- display: flex;
20
- align-items: center;
21
- }
22
- .extra {
23
- & +.menu {
24
- margin-left: 24px;
25
- }
26
- }
27
- .menu {
28
- text-align: right;
29
- }
30
- }
31
- }
@@ -1,42 +0,0 @@
1
- import { defineComponent, PropType, ExtractPropTypes } from 'vue'
2
- import './contentHeader.less'
3
-
4
- import type { GlobalPageLayoutTypes } from '@qqt-product/ui'
5
-
6
- const headerProps = {
7
- buttons: {
8
- type: Array as PropType<GlobalPageLayoutTypes.PageButton[]>,
9
- default() {
10
- return []
11
- },
12
- },
13
- }
14
-
15
- export type HeaderProps = ExtractPropTypes<typeof headerProps>
16
-
17
- export default defineComponent({
18
- name: 'QContentHeader',
19
- props: headerProps,
20
- setup(prop: HeaderProps, ctx) {
21
- const btnProps = {
22
- buttons: prop.buttons,
23
- ...ctx.attrs,
24
- }
25
- return () => {
26
- return (
27
- <div class="content-Header">
28
- <div class="topWrap">
29
- <div class="breadcrumb">
30
- <q-breadcrumb></q-breadcrumb>
31
- </div>
32
- <div class="box">
33
- <div class="menu">
34
- <q-layout-buttons {...btnProps}></q-layout-buttons>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- )
40
- }
41
- },
42
- })