@qqt-product/system 0.0.2 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/index.es.js +53240 -10634
  2. package/dist/index.umd.js +94 -21
  3. package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2878 -0
  4. package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2871 -0
  5. package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2878 -0
  6. package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +23 -4
  7. package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +9 -4
  8. package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +9 -4
  9. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +2864 -0
  10. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +2 -3
  11. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +2864 -0
  12. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2876 -0
  13. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +29 -14
  14. package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +2 -6
  15. package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +5 -8
  16. package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +9 -4
  17. package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2872 -0
  18. package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
  19. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2864 -0
  20. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2887 -0
  21. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
  22. package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
  23. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +221 -28
  24. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
  25. package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
  26. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +23 -7
  27. package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
  28. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +7 -3
  29. package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
  30. package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
  31. package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
  32. package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
  33. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1209 -0
  34. package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
  35. package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
  36. package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
  37. package/dist/lib/components/index.d.ts +2 -2
  38. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2863 -0
  39. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2872 -0
  40. package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
  41. package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
  42. package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
  43. package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
  44. package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
  45. package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
  46. package/dist/style.css +1 -1
  47. package/dist/vite-env.d.ts +13 -13
  48. package/package.json +13 -11
  49. package/src/lib/components/QAccountList/src/QAccountCreate.vue +272 -0
  50. package/src/lib/components/QAccountList/src/QAccountDetail.vue +82 -14
  51. package/src/lib/components/QAccountList/src/QAccountEdit.vue +65 -33
  52. package/src/lib/components/QAccountList/src/QAccountList.vue +532 -530
  53. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +143 -137
  54. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +172 -166
  55. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +123 -124
  56. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +66 -18
  57. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +151 -122
  58. package/src/lib/components/QI18nList/src/QI18nList.vue +365 -361
  59. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +103 -94
  60. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +109 -105
  61. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -3
  62. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +218 -221
  63. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +110 -117
  64. package/src/lib/components/QPermissionDataList/src/form.vue +109 -109
  65. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +1 -1
  66. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +120 -32
  67. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +189 -163
  68. package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +84 -0
  69. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -22
  70. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +134 -85
  71. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +91 -0
  72. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +276 -263
  73. package/src/lib/components/QRoleList/src/QRoleList.vue +332 -288
  74. package/src/lib/components/QRoleList/src/useConfigData.ts +1 -6
  75. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +304 -302
  76. package/src/lib/components/QUsageList/src/QUsageList.vue +287 -82
  77. package/src/lib/components/QUsageList/src/useConfigData.ts +147 -13
  78. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -140
  79. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +28 -28
  80. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +130 -42
  81. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +2 -2
  82. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +2 -2
  83. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +12 -12
  84. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +276 -268
  85. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +1 -1
  86. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +124 -125
  87. package/src/lib/components/index.ts +78 -78
  88. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +2 -10
  89. package/src/lib/components/integratedNodesList/src/index.vue +130 -136
  90. package/src/lib/components/integratedReportList/src/index.vue +55 -30
  91. package/src/lib/components/integratedReportSearchList/src/index.vue +106 -66
  92. package/src/lib/components/loginAbnormalLogList/src/index.vue +43 -50
  93. package/src/lib/components/loginLogList/src/index.vue +51 -57
  94. package/src/lib/components/loginSupplierLogList/src/index.vue +53 -63
  95. package/src/lib/components/operateLogList/src/index.vue +46 -57
  96. package/src/vite-env.d.ts +13 -13
  97. package/tsconfig.json +24 -24
  98. package/vite.config.ts +1 -1
  99. package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
  100. package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
  101. package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
  102. package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
  103. package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
  104. package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
  105. package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
@@ -0,0 +1,84 @@
1
+ import { ref, watchEffect } from 'vue'
2
+ import type { Ref, ComponentPublicInstance } from 'vue'
3
+ // import { srmI18n } from '@/utils/srmI18n'
4
+
5
+ import { GlobalPageLayoutTypes } from '@qqt-product/ui'
6
+
7
+ import qqtUtils from '@qqt-product/utils'
8
+ const { uniqueId } = qqtUtils
9
+
10
+ export default function useFieldSelectModal(layoutRef: Ref<ComponentPublicInstance | null>, srmI18n) {
11
+ const fieldSelectModal = ref()
12
+ const handleSupplierListRowAdd: Ref<((btn: GlobalPageLayoutTypes.PageButtonWithGroupCode) => void) | null> = ref(null)
13
+ const ok: Ref<((data: GlobalPageLayoutTypes.RecordStringNumber[]) => void) | null> = ref(null)
14
+ const cache: Ref<GlobalPageLayoutTypes.PageButtonWithGroupCode | null> = ref(null)
15
+
16
+ watchEffect(() => {
17
+ if (layoutRef.value) {
18
+ const instance = layoutRef.value.instance
19
+ const { pageData, defaultValues } = instance
20
+
21
+ handleSupplierListRowAdd.value = (btn) => {
22
+ // 缓存当前按钮配置
23
+ cache.value = btn
24
+ const url = '/supplier/supplierMaster/list'
25
+ const columns = [
26
+ {
27
+ field: 'toElsAccount',
28
+ title: srmI18n('i18n_title_supplierELSAccount', '供应商ELS账号'),
29
+ width: 120,
30
+ },
31
+ {
32
+ field: 'supplierCode',
33
+ title: srmI18n('i18n_massProdHead88b_supplierErpCode', '供应商ERP编码'),
34
+ width: 120,
35
+ },
36
+ {
37
+ field: 'supplierName',
38
+ title: srmI18n('i18n_massProdHeade95_supplierName', '供应商名称'),
39
+ width: 120,
40
+ },
41
+ {
42
+ field: 'supplierStatus_dictText',
43
+ title: srmI18n('i18n_title_supplierState', '供应商状态'),
44
+ width: 100,
45
+ },
46
+ ]
47
+ const params = {}
48
+ const $fieldSelectModal = fieldSelectModal.value
49
+ if ($fieldSelectModal) {
50
+ $fieldSelectModal.open({ url, params, columns, selectModal: 'multiple' })
51
+ }
52
+ }
53
+
54
+ ok.value = (data) => {
55
+ if (!data.length) {
56
+ return
57
+ }
58
+ const emitKey = cache.value?.emitKey
59
+ if (!emitKey) {
60
+ return
61
+ }
62
+ if (emitKey === 'supplierListRowAdd') {
63
+ const insertData = data
64
+ const groupCode = cache.value?.groupCode
65
+ if (!groupCode) {
66
+ return
67
+ }
68
+
69
+ const row = defaultValues[groupCode] as GlobalPageLayoutTypes.RecordStringNumber
70
+ const tableData = pageData[groupCode] as GlobalPageLayoutTypes.RecordStringNumber[]
71
+ insertData.forEach((n) => {
72
+ tableData.push({ ...row, _row_id: uniqueId('_row_id_'), ...n })
73
+ })
74
+ }
75
+ }
76
+ }
77
+ })
78
+
79
+ return {
80
+ fieldSelectModal,
81
+ handleSupplierListRowAdd,
82
+ ok,
83
+ }
84
+ }
@@ -1,22 +1,22 @@
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: '/notice/purchaseNotice/list',
10
- columnsCode: 'PurchaseNotice',
11
- add: '/notice/purchaseNotice/add',
12
-
13
- delete: '/notice/purchaseNotice/delete',
14
- cancel: '/notice/purchaseNotice/cancel',
15
- topSet: '/notice/purchaseNotice/topOpt',
16
- })
17
- const uploadShow = shallowRef<boolean>(false)
18
- const showEditPage = shallowRef<boolean>(false)
19
- const currentEditRow = ref({})
20
- const listLayoutRef = ref()
21
- return { apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
22
- }
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: '/notice/purchaseNotice/list',
10
+ columnsCode: 'PurchaseNotice',
11
+ add: '/notice/purchaseNotice/add',
12
+
13
+ delete: '/notice/purchaseNotice/delete',
14
+ cancel: '/notice/purchaseNotice/cancel',
15
+ topSet: '/notice/purchaseNotice/topOpt',
16
+ })
17
+ const uploadShow = shallowRef<boolean>(false)
18
+ const showEditPage = shallowRef<boolean>(false)
19
+ const currentEditRow = ref({})
20
+ const listLayoutRef = ref()
21
+ return { apiUrls, showEditPage, currentEditRow, listLayoutRef, uploadShow }
22
+ }
@@ -1,85 +1,134 @@
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, toRefs } from 'vue'
10
- //hook
11
- import { useConfigData } from './useConfigData'
12
-
13
- export default defineComponent({
14
- name: 'QPurchaseNoticeTemplateList',
15
- props: {
16
- userInfo: {
17
- type: Object,
18
- defalut: () => {
19
- return {}
20
- },
21
- },
22
- },
23
- setup(props) {
24
- //data
25
- const pageData = reactive({
26
- statusConfig: {
27
- show: false,
28
- },
29
- optColumn: {
30
- attrs: {},
31
- extend: {},
32
- optColumnList: [
33
- // { authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:edit', type: 'edit', title: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_edit`, '编辑'), clickFn: this.handleEdit },
34
- // { authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:view', type: 'view', title: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_see`, '查看'), clickFn: this.handleShow },
35
- // {
36
- // authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:delete',
37
- // type: 'delete',
38
- // title: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_delete`, '删除'),
39
- // clickFn: this.handleDelete,
40
- // },
41
- ],
42
- },
43
- buttonConfig: {
44
- attrs: {},
45
- extend: {},
46
- buttons: [
47
- // {authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:add', label: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_add`, '新增'), clickFn: this.handleAdd, type: 'primary'},
48
- // {label: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_listCustom`, '列自定义'), icon: 'setting', clickFn: this.settingColumns},
49
- // {label: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_helpText`, '帮助说明'), icon: 'file-text', folded: true, isDocument: true, clickFn: this.showHelpText},
50
- // {label: this.$srmI18n(`${this.$getLangAccount()}#i18n_title_attachment`, '说明附件'), icon: 'file-pdf', folded: true, isDocument: true, clickFn: this.showHelpPDF}
51
- ],
52
- },
53
- queryConfig: {
54
- attrs: {},
55
- extend: {},
56
- form: [
57
- {
58
- type: 'input',
59
- label: '模板名称',
60
- fieldName: 'templateName',
61
- placeholder: '请输入模板名称',
62
- },
63
- ],
64
- formState: {},
65
- },
66
- pagerConfig: {},
67
- })
68
- //data-hook
69
- const { showEditPage, apiUrls } = useConfigData()
70
- const { userInfo } = toRefs(props)
71
- console.log('userInfos', userInfo)
72
- //methods
73
- // function allowDelete() {
74
- // console.log('userInfo.value?.userInfo?.elsAccount', userInfo.value?.userInfo?.elsAccount)
75
- // if (userInfo.value?.userInfo?.elsAccount != '100000') {
76
- // return true
77
- // } else {
78
- // return false
79
- // }
80
- // }
81
- return { showEditPage, apiUrls, pageData }
82
- },
83
- })
84
- </script>
85
- <style scoped></style>
1
+ <template>
2
+ <div style="height: 100%">
3
+ <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
+ <q-purchase-notice-template-modal v-if="visible" v-model="visible" @fetch-list-data="fetchListData" :currentRow="noticeTemplateRow"></q-purchase-notice-template-modal>
5
+ <a-modal :width="900" v-model:visible="viewTemplateVisible" :title="viewTemplateModalTitle" @cancel="handleViewCancel" @ok="handleViewCancel">
6
+ <a-form>
7
+ <a-form-item :label="srmI18n('i18n_title_templateName', '模板名称')">
8
+ <a-input :placeholder="srmI18n('i18n_title_enterATemplateName', '请输入模板名称')" v-model:value="viewTemplateRow.templateName" style="width: 400px" />
9
+ </a-form-item>
10
+ <a-form-item :label="srmI18n('i18n_title_templateContent', '模板内容')">
11
+ <span v-html="viewTemplateRow.templateContent"></span>
12
+ </a-form-item>
13
+ </a-form>
14
+ </a-modal>
15
+ </div>
16
+ </template>
17
+
18
+ <script lang="ts" setup>
19
+ //JS
20
+ import type { GlobalListPageLayoutTypes } from '@qqt-product/ui'
21
+ import { reactive, toRefs, inject, ref } from 'vue'
22
+ //hook
23
+ import QPurchaseNoticeTemplateModal from './QPurchaseNoticeTemplateModal.vue'
24
+ import { useConfigData } from './useConfigData'
25
+
26
+ const props = defineProps<{
27
+ userInfo: GlobalListPageLayoutTypes.UserInfo
28
+ }>()
29
+
30
+ const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
31
+ if (i18nKey) {
32
+ if (account) {
33
+ return account + defaultValue
34
+ }
35
+ return defaultValue
36
+ }
37
+ return defaultValue
38
+ })
39
+ const listLayoutRef = ref()
40
+ const fetchListData = () => {
41
+ listLayoutRef.value.fetchListData()
42
+ visible.value = false
43
+ }
44
+ //data
45
+ const visible = ref<boolean>(false)
46
+ const viewTemplateVisible = ref(false)
47
+ const viewTemplateModalTitle = ref(srmI18n('i18n_title_see', '查看'))
48
+ const handleViewCancel = () => {
49
+ viewTemplateVisible.value = false
50
+ }
51
+ const viewTemplateRow = ref<GlobalListPageLayoutTypes.CurrentRow | { templateName: string; templateContent: string }>({
52
+ templateName: '',
53
+ templateContent: '',
54
+ id: '',
55
+ })
56
+ const noticeTemplateRow = ref({})
57
+ // 编辑
58
+ const handleEdit = (payload: GlobalListPageLayoutTypes.ListOptionsEventParams) => {
59
+ noticeTemplateRow.value = Object.assign({}, payload.row)
60
+ visible.value = true
61
+ }
62
+ // 查看
63
+ const handleView = (payload: GlobalListPageLayoutTypes.ListOptionsEventParams) => {
64
+ viewTemplateRow.value = Object.assign({}, payload.row)
65
+ viewTemplateVisible.value = true
66
+ }
67
+
68
+ const pageData = reactive<GlobalListPageLayoutTypes.PageData>({
69
+ statusConfig: {
70
+ show: false,
71
+ },
72
+ optionConfig: {
73
+ attrs: {},
74
+ extend: {},
75
+ options: [
76
+ { authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:edit', type: 'edit', title: srmI18n('i18n_title_edit', '编辑'), click: handleEdit },
77
+ { authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:view', type: 'view', title: srmI18n('i18n_title_see', '查看'), click: handleView },
78
+ {
79
+ authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:delete',
80
+ type: 'delete',
81
+ title: srmI18n('i18n_title_delete', '删除'),
82
+ args: {
83
+ url: '/notice/purchaseNoticeTemplate/delete',
84
+ },
85
+ },
86
+ ],
87
+ },
88
+ buttonConfig: {
89
+ attrs: {},
90
+ extend: {},
91
+ buttons: [
92
+ {
93
+ authorityCode: 'purchaseNoticeTemplate#PurchaseNoticeTemplate:add',
94
+ label: srmI18n('i18n_title_add', '新增'),
95
+ icon: {
96
+ type: 'icon-Q-add',
97
+ },
98
+ attrs: {
99
+ type: 'primary',
100
+ },
101
+ click: () => {
102
+ noticeTemplateRow.value = Object.assign({}, {})
103
+ visible.value = true
104
+ },
105
+ },
106
+ {
107
+ label: srmI18n('i18n_title_listCustom', '列自定义'),
108
+ icon: {
109
+ type: 'icon-Q-setting',
110
+ },
111
+ type: 'setting',
112
+ },
113
+ ],
114
+ },
115
+ queryConfig: {
116
+ attrs: {},
117
+ extend: {},
118
+ form: [
119
+ {
120
+ type: 'input',
121
+ label: srmI18n('i18n_title_templateName', '模板名称'),
122
+ fieldName: 'templateName',
123
+ placeholder: srmI18n('i18n_title_enterATemplateName', '请输入模板名称'),
124
+ },
125
+ ],
126
+ },
127
+ pagerConfig: {},
128
+ })
129
+ //data-hook
130
+ const { showEditPage, apiUrls } = useConfigData()
131
+ const { userInfo } = toRefs(props)
132
+ console.log('userInfos', userInfo)
133
+ </script>
134
+ <style scoped></style>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <a-modal :visible="modelValue" :title="modalTitle" :width="900" @cancel="handleCancel" @ok="handleOk">
3
+ <a-form :model="form">
4
+ <a-form-item :label="srmI18n('i18n_title_templateName', '模板名称')">
5
+ <a-input :placeholder="srmI18n('i18n_title_enterATemplateName', '请输入模板名称')" v-model:value="form.templateName" style="width: 400px" />
6
+ </a-form-item>
7
+ </a-form>
8
+ <a-form :model="form">
9
+ <a-form-item>
10
+ <QEditor v-if="modelValue" v-model:content="form.templateContent"></QEditor>
11
+ </a-form-item>
12
+ </a-form>
13
+ </a-modal>
14
+ </template>
15
+
16
+ <script lang="ts" setup>
17
+ import { ref, reactive, toRefs, inject } from 'vue'
18
+ import { Modal } from 'ant-design-vue'
19
+ import { message } from '@qqt-product/ui'
20
+ import qqtApi from '@qqt-product/api'
21
+ export interface Values {
22
+ templateName: string
23
+ id: string
24
+ templateContent: string
25
+ }
26
+ const qHttp: qqtApi.Request = qqtApi.useHttp()
27
+
28
+ const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
29
+ if (i18nKey) {
30
+ if (account) {
31
+ return account + defaultValue
32
+ }
33
+ return defaultValue
34
+ }
35
+ return defaultValue
36
+ })
37
+ const modalTitle = ref(srmI18n('i18n_title_editTemplate', '编辑模板'))
38
+ const props = defineProps<{
39
+ modelValue: boolean
40
+ currentRow: object
41
+ }>()
42
+ const { modelValue } = toRefs(props)
43
+ const emit = defineEmits<{
44
+ (e: 'update:modelValue', modalVisible: boolean): void
45
+ (e: 'fetch-list-data')
46
+ }>()
47
+
48
+ const form = reactive<Values>(
49
+ Object.assign(
50
+ {},
51
+ {
52
+ templateContent: '',
53
+ id: '',
54
+ templateName: '',
55
+ },
56
+ props.currentRow,
57
+ ),
58
+ )
59
+ const handleCancel = () => {
60
+ emit('update:modelValue', false)
61
+ }
62
+ const handleOk = (e: MouseEvent) => {
63
+ console.log(e)
64
+ Modal.confirm({
65
+ title: srmI18n('i18n_title_confirmtoSave', '确认保存'),
66
+ content: srmI18n('i18n_title_isConfirmtoSave', '是否确认保存?'),
67
+ onOk() {
68
+ postData()
69
+ },
70
+ })
71
+ }
72
+ const postData = () => {
73
+ let url = '/notice/purchaseNoticeTemplate/add'
74
+ if (form.id && form.id != '') {
75
+ url = '/notice/purchaseNoticeTemplate/edit'
76
+ }
77
+ qHttp
78
+ .post({
79
+ url,
80
+ data: form,
81
+ })
82
+ .then((res) => {
83
+ if (res && res.success) {
84
+ message.success(res.message)
85
+ emit('fetch-list-data')
86
+ } else {
87
+ message.error(res.message)
88
+ }
89
+ })
90
+ }
91
+ </script>