@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.
- package/dist/index.es.js +53240 -10634
- package/dist/index.umd.js +94 -21
- package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2878 -0
- package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2871 -0
- package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2878 -0
- package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +23 -4
- package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +9 -4
- package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +9 -4
- package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +2 -3
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2876 -0
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +29 -14
- package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +2 -6
- package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +5 -8
- package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +9 -4
- package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2872 -0
- package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2864 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2887 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
- package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +221 -28
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
- package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
- package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +23 -7
- package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
- package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +7 -3
- package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
- package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
- package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
- package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
- package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1209 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
- package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
- package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2863 -0
- package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2872 -0
- package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
- package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
- package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
- package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
- package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
- package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
- package/dist/style.css +1 -1
- package/dist/vite-env.d.ts +13 -13
- package/package.json +13 -11
- package/src/lib/components/QAccountList/src/QAccountCreate.vue +272 -0
- package/src/lib/components/QAccountList/src/QAccountDetail.vue +82 -14
- package/src/lib/components/QAccountList/src/QAccountEdit.vue +65 -33
- package/src/lib/components/QAccountList/src/QAccountList.vue +532 -530
- package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +143 -137
- package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +172 -166
- package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +123 -124
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +66 -18
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +151 -122
- package/src/lib/components/QI18nList/src/QI18nList.vue +365 -361
- package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +103 -94
- package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +109 -105
- package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -3
- package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +218 -221
- package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +110 -117
- package/src/lib/components/QPermissionDataList/src/form.vue +109 -109
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +1 -1
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +120 -32
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +189 -163
- package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +84 -0
- package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -22
- package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +134 -85
- package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +91 -0
- package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +276 -263
- package/src/lib/components/QRoleList/src/QRoleList.vue +332 -288
- package/src/lib/components/QRoleList/src/useConfigData.ts +1 -6
- package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +304 -302
- package/src/lib/components/QUsageList/src/QUsageList.vue +287 -82
- package/src/lib/components/QUsageList/src/useConfigData.ts +147 -13
- package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -140
- package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +28 -28
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +130 -42
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +2 -2
- package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +2 -2
- package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +12 -12
- package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +276 -268
- package/src/lib/components/QcustomConfigList/src/useConfigData.ts +1 -1
- package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +124 -125
- package/src/lib/components/index.ts +78 -78
- package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +2 -10
- package/src/lib/components/integratedNodesList/src/index.vue +130 -136
- package/src/lib/components/integratedReportList/src/index.vue +55 -30
- package/src/lib/components/integratedReportSearchList/src/index.vue +106 -66
- package/src/lib/components/loginAbnormalLogList/src/index.vue +43 -50
- package/src/lib/components/loginLogList/src/index.vue +51 -57
- package/src/lib/components/loginSupplierLogList/src/index.vue +53 -63
- package/src/lib/components/operateLogList/src/index.vue +46 -57
- package/src/vite-env.d.ts +13 -13
- package/tsconfig.json +24 -24
- package/vite.config.ts +1 -1
- package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
- package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
- package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
- package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
- package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
- package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
- package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="edit-page">
|
|
3
3
|
<a-spin :spinning="customLoading">
|
|
4
|
-
<q-edit-page-layout
|
|
4
|
+
<q-edit-page-layout
|
|
5
|
+
ref="layoutRef"
|
|
6
|
+
v-bind="options"
|
|
7
|
+
@supplierListRowAdd="handleSupplierListRowAdd"
|
|
8
|
+
@customSave="handleCustomSave"
|
|
9
|
+
@customPublish="handleCustomPublish"
|
|
10
|
+
@validate-success="handleValidateSuccess"
|
|
11
|
+
@back="back"
|
|
12
|
+
>
|
|
5
13
|
</q-edit-page-layout>
|
|
6
14
|
</a-spin>
|
|
15
|
+
<q-field-select-modal ref="fieldSelectModal" @ok="ok"></q-field-select-modal>
|
|
7
16
|
</div>
|
|
8
17
|
</template>
|
|
9
18
|
|
|
10
19
|
<script setup lang="ts">
|
|
11
20
|
import { ref, reactive, inject } from 'vue'
|
|
12
21
|
import type { ComponentPublicInstance } from 'vue'
|
|
13
|
-
import
|
|
22
|
+
import qqtUtils from '@qqt-product/utils'
|
|
23
|
+
import type { CreatePromise } from '@qqt-product/utils'
|
|
24
|
+
import qqtApi from '@qqt-product/api'
|
|
25
|
+
import { BUTTON_CUSTOM, BUTTON_DELETE_ROW, BUTTON_SAVE, BUTTON_CUSTOM_PRIMARY, BUTTON_UPLOAD } from '@qqt-product/ui'
|
|
14
26
|
|
|
15
27
|
// ui组件库 types
|
|
16
28
|
import type { GlobalPageLayoutTypes } from '@qqt-product/ui'
|
|
17
|
-
import { usePromiseStepHook, useRefInstanceHook } from '@qqt-product/ui'
|
|
29
|
+
import { usePromiseStepHook, useRefInstanceHook, message as Message } from '@qqt-product/ui'
|
|
30
|
+
|
|
31
|
+
import useFieldSelectModal from './use-field-select-modal-hook'
|
|
32
|
+
import { Modal } from 'ant-design-vue'
|
|
18
33
|
|
|
19
34
|
const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
|
|
20
35
|
if (i18nKey) {
|
|
@@ -25,7 +40,7 @@ const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, acc
|
|
|
25
40
|
}
|
|
26
41
|
return defaultValue
|
|
27
42
|
})
|
|
28
|
-
|
|
43
|
+
const router = inject('Q_APPLICATION_ROUTER', { go: (num: number) => console.log('router go back: ' + num) })
|
|
29
44
|
// 传参 props
|
|
30
45
|
const props = defineProps<{
|
|
31
46
|
currentRow: GlobalPageLayoutTypes.CurrentRow | null
|
|
@@ -41,10 +56,40 @@ const currentRow = props.currentRow
|
|
|
41
56
|
busAccount: '',
|
|
42
57
|
elsAccount: '',
|
|
43
58
|
})
|
|
59
|
+
const { createPromise, cloneDeep } = qqtUtils
|
|
60
|
+
const qHttp: qqtApi.Request = qqtApi.useHttp()
|
|
61
|
+
// const handleBeforePublish = (args: GlobalPageLayoutTypes.ExposeWithPageButtons) => {
|
|
62
|
+
// const fn: CreatePromise<GlobalPageLayoutTypes.ExposeWithPageButtons> = async (resolve) => {
|
|
63
|
+
// const pageData = args.pageData
|
|
64
|
+
// const cloneData = cloneDeep(pageData.value)
|
|
65
|
+
// if (!cloneData.id) {
|
|
66
|
+
// const res = await qHttp.post({ url: '/notice/purchaseNotice/add', data: pageData.value })
|
|
67
|
+
// if (res && res.success) {
|
|
68
|
+
// cloneData.id = res.result.id
|
|
69
|
+
// cloneData.noticeStatus = res.result.noticeStatus
|
|
70
|
+
// cloneData.publishUser = res.result.publishUser
|
|
71
|
+
// cloneData.noticeContent = res.result.noticeContent
|
|
72
|
+
// cloneData.noticeNumber = res.result.noticeNumber
|
|
73
|
+
// delete cloneData.busAccount
|
|
74
|
+
// delete cloneData.elsAccount
|
|
75
|
+
// delete cloneData.templateNumber
|
|
76
|
+
// delete cloneData.templateVersion
|
|
77
|
+
// delete cloneData.templateAccount
|
|
78
|
+
// }
|
|
79
|
+
// }
|
|
80
|
+
// let formatData = {
|
|
81
|
+
// ...cloneData,
|
|
82
|
+
// }
|
|
83
|
+
// resolve({ ...args, pageData: ref(formatData) })
|
|
84
|
+
// }
|
|
44
85
|
|
|
86
|
+
// return createPromise(fn) as Promise<GlobalPageLayoutTypes.ExposeWithPageButtons>
|
|
87
|
+
// }
|
|
45
88
|
// 编辑组件 ref
|
|
46
89
|
const layoutRef = ref<ComponentPublicInstance | null>(null)
|
|
47
90
|
|
|
91
|
+
const { fieldSelectModal, handleSupplierListRowAdd, ok } = useFieldSelectModal(layoutRef, srmI18n)
|
|
92
|
+
|
|
48
93
|
// 配置
|
|
49
94
|
const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
50
95
|
/**
|
|
@@ -55,7 +100,7 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
55
100
|
businessType: 'custom',
|
|
56
101
|
// 布局模式
|
|
57
102
|
pattern: 'vertical',
|
|
58
|
-
// 当前已选行数据
|
|
103
|
+
// 当前已选行数据
|
|
59
104
|
currentRow: currentRow as GlobalPageLayoutTypes.CurrentRow,
|
|
60
105
|
refreshMethods(row?: GlobalPageLayoutTypes.CurrentRow) {
|
|
61
106
|
if (options.currentRow) {
|
|
@@ -84,8 +129,10 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
84
129
|
groupType: 'item',
|
|
85
130
|
buttons: [
|
|
86
131
|
{
|
|
87
|
-
...
|
|
132
|
+
...BUTTON_CUSTOM,
|
|
88
133
|
title: srmI18n('i18n_title_add', '新增'),
|
|
134
|
+
emit: true,
|
|
135
|
+
emitKey: 'supplierListRowAdd',
|
|
89
136
|
},
|
|
90
137
|
BUTTON_DELETE_ROW,
|
|
91
138
|
],
|
|
@@ -100,17 +147,17 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
100
147
|
args: {
|
|
101
148
|
url: '/attachment/purchaseAttachment/upload', // 上传的路径
|
|
102
149
|
// groupCode: 'purchaseBiddingHeadList', // 可不填 默认是 itemInfo
|
|
103
|
-
property: 'biddingDesc', // 行项目显示的名称字段编码
|
|
104
|
-
dictCode: 'srmFileType', // 文件类型数据字典编码
|
|
105
|
-
actionRoutePath: '/srm/notice/purchase/PurchaseNoticeList',
|
|
106
|
-
sourceNumber: 'noticeNumber', // 原v5 的获值写法 this.currentEditRow.projectNumber,
|
|
150
|
+
// property: 'biddingDesc', // 行项目显示的名称字段编码
|
|
151
|
+
// dictCode: 'srmFileType', // 文件类型数据字典编码
|
|
152
|
+
// actionRoutePath: '/srm/notice/purchase/PurchaseNoticeList',
|
|
153
|
+
// sourceNumber: 'noticeNumber', // 原v5 的获值写法 this.currentEditRow.projectNumber,
|
|
154
|
+
// },
|
|
155
|
+
// callback 函数若上传附件后无他业务操作可不加
|
|
156
|
+
// callback: (tableData, pageData, fileData) => {
|
|
157
|
+
// fileData?.forEach((n) => {
|
|
158
|
+
// tableData.push({ _row_id: uniqueId('_row_id_'), ...n })
|
|
159
|
+
// })
|
|
107
160
|
},
|
|
108
|
-
// callback 函数若上传附件后无他业务操作可不加
|
|
109
|
-
// callback: (tableData, pageData, fileData) => {
|
|
110
|
-
// fileData?.forEach((n) => {
|
|
111
|
-
// tableData.push({ _id: uniqueId('_id_'), ...n })
|
|
112
|
-
// })
|
|
113
|
-
// },
|
|
114
161
|
},
|
|
115
162
|
BUTTON_DELETE_ROW,
|
|
116
163
|
],
|
|
@@ -135,7 +182,7 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
135
182
|
{
|
|
136
183
|
groupCode: 'baseForm',
|
|
137
184
|
fieldType: 'select',
|
|
138
|
-
fieldLabel: srmI18n('i18n_field_msgCategory', '
|
|
185
|
+
fieldLabel: srmI18n('i18n_field_msgCategory', '消息类型'),
|
|
139
186
|
fieldName: 'noticeType',
|
|
140
187
|
placeholder: srmI18n('i18n_title_selectType', '请选择类型'),
|
|
141
188
|
dictCode: 'srmNoticeType',
|
|
@@ -171,10 +218,11 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
171
218
|
fieldType: 'switch',
|
|
172
219
|
fieldLabel: srmI18n('i18n_title_isPlacedTop', '是否置顶'),
|
|
173
220
|
fieldName: 'top',
|
|
221
|
+
defaultValue: '0',
|
|
174
222
|
},
|
|
175
223
|
{
|
|
176
224
|
groupCode: 'baseForm',
|
|
177
|
-
fieldType: '
|
|
225
|
+
fieldType: 'editor',
|
|
178
226
|
fieldLabel: '',
|
|
179
227
|
fieldName: 'noticeContent',
|
|
180
228
|
},
|
|
@@ -200,45 +248,85 @@ const options = reactive<Partial<GlobalPageLayoutTypes.EditPageLayoutProps>>({
|
|
|
200
248
|
},
|
|
201
249
|
},
|
|
202
250
|
{
|
|
203
|
-
...
|
|
251
|
+
...BUTTON_CUSTOM_PRIMARY,
|
|
252
|
+
title: srmI18n('i18n_title_publish', '发布'),
|
|
204
253
|
emit: true,
|
|
205
254
|
emitKey: 'customPublish',
|
|
255
|
+
// handleBefore: handleBeforePublish,
|
|
206
256
|
args: {
|
|
207
257
|
url: '/notice/purchaseNotice/publish',
|
|
208
258
|
},
|
|
209
259
|
},
|
|
210
260
|
],
|
|
211
261
|
})
|
|
212
|
-
const pageButtons = options.pageButtons as GlobalPageLayoutTypes.PageButton[]
|
|
213
|
-
const refreshMethods = options.refreshMethods
|
|
214
262
|
|
|
215
263
|
const { pageData, layoutConfig, defaultValues } = useRefInstanceHook(layoutRef)
|
|
216
|
-
const { stepTriggerValidate, composeSave, composePublish, customLoading } = usePromiseStepHook({ pageData, layoutConfig, defaultValues,
|
|
264
|
+
const { stepTriggerValidate, composeSave, composePublish, customLoading } = usePromiseStepHook({ pageData, layoutConfig, defaultValues, options })
|
|
217
265
|
|
|
218
266
|
// 自定义保存
|
|
219
267
|
const handleCustomSave = () => {
|
|
220
268
|
stepTriggerValidate()
|
|
221
269
|
}
|
|
270
|
+
// 执行自定义校验
|
|
271
|
+
const customCheck: (pageData: GlobalPageLayoutTypes.RecordStringNumber) => boolean = (pageData) => {
|
|
272
|
+
if (pageData.effectiveTime && pageData.expiryTime) {
|
|
273
|
+
if (pageData.effectiveTime > pageData.expiryTime) {
|
|
274
|
+
Message.warning('公告发布生效时间必须小于失效时间')
|
|
275
|
+
return false
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return true
|
|
280
|
+
}
|
|
222
281
|
// 自定义发布
|
|
223
282
|
const handleCustomPublish = () => {
|
|
224
|
-
|
|
283
|
+
if (!customCheck(pageData.value)) {
|
|
284
|
+
return
|
|
285
|
+
}
|
|
286
|
+
stepTriggerValidate()
|
|
225
287
|
}
|
|
226
288
|
|
|
227
289
|
// 页面校验成功后执行下一步回调步骤
|
|
228
290
|
const handleValidateSuccess = (button: GlobalPageLayoutTypes.PageButton) => {
|
|
229
|
-
console.log(button.key ===
|
|
291
|
+
console.log(button.key === BUTTON_CUSTOM_PRIMARY.key)
|
|
230
292
|
if (button.key === BUTTON_SAVE.key) {
|
|
231
293
|
composeSave()
|
|
232
|
-
} else if (button.key ===
|
|
233
|
-
|
|
294
|
+
} else if (button.key === BUTTON_CUSTOM_PRIMARY.key) {
|
|
295
|
+
let purchaseNoticeSupplierList = pageData.value.purchaseNoticeSupplierList as []
|
|
296
|
+
if (pageData.value.noticeScope == '4') {
|
|
297
|
+
if (purchaseNoticeSupplierList && purchaseNoticeSupplierList.length) {
|
|
298
|
+
Message.warning(srmI18n('i18n_field_RIRdXWVKRdXABSuRdX_d20c2f0d', '指定供应商,请在供应商列表添加供应商'))
|
|
299
|
+
return false
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
if (purchaseNoticeSupplierList && purchaseNoticeSupplierList.length > 0) {
|
|
303
|
+
Message.warning(srmI18n('i18n_field_RxvLKuWRIRdXWWxTPiFRdXWVQG_962d5139', '公告范围是非“指定供应商”,不需要选择供应商,请删除'))
|
|
304
|
+
return false
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
Modal.confirm({
|
|
308
|
+
title: '发布',
|
|
309
|
+
content: '是否确认发布',
|
|
310
|
+
onOk() {
|
|
311
|
+
return new Promise((resolve, reject) => {
|
|
312
|
+
qHttp.post({ url: '/notice/purchaseNotice/publish', data: pageData.value }).then((res) => {
|
|
313
|
+
if (res.success) {
|
|
314
|
+
Message.success(res.message)
|
|
315
|
+
router.go(-1)
|
|
316
|
+
resolve(true)
|
|
317
|
+
} else {
|
|
318
|
+
Message.error(res.message)
|
|
319
|
+
reject(false)
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
},
|
|
324
|
+
})
|
|
234
325
|
}
|
|
235
326
|
}
|
|
236
327
|
|
|
237
|
-
//
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
if (options.currentRow) {
|
|
241
|
-
options.currentRow._t = +new Date()
|
|
242
|
-
}
|
|
328
|
+
// 发布成功后返回
|
|
329
|
+
const back = () => {
|
|
330
|
+
router.go(-1)
|
|
243
331
|
}
|
|
244
332
|
</script>
|
|
@@ -1,163 +1,189 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-list-layout ref="listLayoutRef" :pageData="pageData" :apiUrls="apiUrls" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { useConfigData } from './useConfigData'
|
|
10
|
-
|
|
11
|
-
export default defineComponent({
|
|
12
|
-
name: 'QPurchaseNoticeList',
|
|
13
|
-
props: {
|
|
14
|
-
userInfo: {
|
|
15
|
-
type: Object,
|
|
16
|
-
defalut: () => {
|
|
17
|
-
return {}
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
setup(props, { emit }) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<q-list-layout ref="listLayoutRef" :pageData="pageData" :apiUrls="apiUrls" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { ref, defineComponent, reactive, toRefs, inject } from 'vue'
|
|
7
|
+
import qqtApi from '@qqt-product/api'
|
|
8
|
+
import { message } from '@qqt-product/ui'
|
|
9
|
+
import { useConfigData } from './useConfigData'
|
|
10
|
+
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
name: 'QPurchaseNoticeList',
|
|
13
|
+
props: {
|
|
14
|
+
userInfo: {
|
|
15
|
+
type: Object,
|
|
16
|
+
defalut: () => {
|
|
17
|
+
return {}
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
setup(props, { emit }) {
|
|
22
|
+
const listLayoutRef = ref()
|
|
23
|
+
const qHttp: qqtApi.Request = qqtApi.useHttp()
|
|
24
|
+
const srmI18n = inject('Q_SRM_I18N', (i18nKey: string, defaultValue: string, account?: string | number): string => {
|
|
25
|
+
if (i18nKey) {
|
|
26
|
+
if (account) {
|
|
27
|
+
return account + defaultValue
|
|
28
|
+
}
|
|
29
|
+
return defaultValue
|
|
30
|
+
}
|
|
31
|
+
return defaultValue
|
|
32
|
+
})
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
const handleTopSet = async (row: any) => {
|
|
35
|
+
const params = {
|
|
36
|
+
id: row.id,
|
|
37
|
+
}
|
|
38
|
+
qHttp.get({ url: '/notice/purchaseNotice/topOpt', params: params }).then((res) => {
|
|
39
|
+
if (res && res.success) {
|
|
40
|
+
message.success(res.message)
|
|
41
|
+
listLayoutRef.value.fetchListData()
|
|
42
|
+
} else {
|
|
43
|
+
message.error(res.message)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
const handleCancel = async (row: any) => {
|
|
49
|
+
const params = {
|
|
50
|
+
id: row.id,
|
|
51
|
+
}
|
|
52
|
+
qHttp.get({ url: '/notice/purchaseNotice/cancel', params: params }).then((res) => {
|
|
53
|
+
if (res && res.success) {
|
|
54
|
+
message.success(res.message)
|
|
55
|
+
listLayoutRef.value.fetchListData()
|
|
56
|
+
} else {
|
|
57
|
+
message.success(res.message)
|
|
58
|
+
listLayoutRef.value.fetchListData()
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
const pageData = reactive({
|
|
63
|
+
statusConfig: {
|
|
64
|
+
show: false,
|
|
65
|
+
},
|
|
66
|
+
optionConfig: {
|
|
67
|
+
attrs: {},
|
|
68
|
+
extend: {},
|
|
69
|
+
options: [
|
|
70
|
+
{
|
|
71
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:view',
|
|
72
|
+
type: 'view',
|
|
73
|
+
title: srmI18n('i18n_title_see', '查看'),
|
|
74
|
+
click: ({ row }) => {
|
|
75
|
+
emit('detail', row)
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:edit',
|
|
80
|
+
type: 'edit',
|
|
81
|
+
title: srmI18n('i18n_title_edit', '编辑'),
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
+
click: ({ row }: any) => {
|
|
84
|
+
emit('edit', row)
|
|
85
|
+
},
|
|
86
|
+
disabled: ({ row }) => row.noticeStatus !== '1',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:topOpt',
|
|
90
|
+
type: 'topOpt',
|
|
91
|
+
title: srmI18n('i18n_title_TopCancel', '置顶/取消'),
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
|
+
click: ({ row }: any) => {
|
|
94
|
+
handleTopSet(row)
|
|
95
|
+
},
|
|
96
|
+
disabled: ({ row }) => row.noticeStatus !== '2',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:cancel',
|
|
100
|
+
type: 'cancel',
|
|
101
|
+
title: srmI18n('i18n_title_void', '作废'),
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
click: ({ row }: any) => {
|
|
104
|
+
handleCancel(row)
|
|
105
|
+
},
|
|
106
|
+
disabled: ({ row }) => row.noticeStatus !== '2',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: 'delete',
|
|
110
|
+
title: srmI18n('i18n_title_delete', '删除'),
|
|
111
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:delete',
|
|
112
|
+
args: {
|
|
113
|
+
url: '/notice/purchaseNotice/delete',
|
|
114
|
+
},
|
|
115
|
+
disabled: ({ row }) => row.noticeStatus !== '1',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
buttonConfig: {
|
|
120
|
+
attrs: {},
|
|
121
|
+
extend: {},
|
|
122
|
+
buttons: [
|
|
123
|
+
{
|
|
124
|
+
authorityCode: 'purchaseNotice#PurchaseNotice:add',
|
|
125
|
+
label: srmI18n('i18n_title_add', '新增'),
|
|
126
|
+
icon: {
|
|
127
|
+
type: 'icon-Q-add',
|
|
128
|
+
},
|
|
129
|
+
attrs: {
|
|
130
|
+
type: 'primary',
|
|
131
|
+
},
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
+
click: ({ row }: any) => {
|
|
134
|
+
emit('create', row)
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: srmI18n('i18n_title_listCustom', '列自定义'),
|
|
139
|
+
icon: {
|
|
140
|
+
type: 'icon-Q-setting',
|
|
141
|
+
},
|
|
142
|
+
type: 'setting',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: srmI18n('i18n_title_helpText', '帮助说明'),
|
|
146
|
+
icon: {
|
|
147
|
+
type: 'icon-Q-help-text',
|
|
148
|
+
},
|
|
149
|
+
type: 'help-text',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: srmI18n('i18n_title_attachment', '说明附件'),
|
|
153
|
+
icon: {
|
|
154
|
+
type: 'icon-Q-attachment-text',
|
|
155
|
+
},
|
|
156
|
+
type: 'attachment-text',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
queryConfig: {
|
|
161
|
+
attrs: {},
|
|
162
|
+
extend: {},
|
|
163
|
+
form: [
|
|
164
|
+
{
|
|
165
|
+
type: 'input',
|
|
166
|
+
label: '标题',
|
|
167
|
+
fieldName: 'noticeTitle',
|
|
168
|
+
placeholder: '请输入标题',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: 'select',
|
|
172
|
+
label: '状态',
|
|
173
|
+
fieldName: 'noticeStatus',
|
|
174
|
+
dictCode: 'srmNoticeStatus',
|
|
175
|
+
placeholder: '请选择状态',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
pagerConfig: {},
|
|
180
|
+
})
|
|
181
|
+
//data-hook
|
|
182
|
+
const { apiUrls } = useConfigData()
|
|
183
|
+
const { userInfo } = toRefs(props)
|
|
184
|
+
console.log('userInfos', userInfo)
|
|
185
|
+
return { listLayoutRef, apiUrls, pageData, handleTopSet }
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
</script>
|
|
189
|
+
<style scoped></style>
|