@qqt-product/system 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +4 -0
- package/.eslintrc.cjs +22 -0
- package/.prettierignore +4 -0
- package/.prettierrc.cjs +41 -0
- package/.vscode/extensions.json +3 -0
- package/README.md +16 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +14234 -0
- package/dist/index.umd.js +311 -0
- package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +143 -0
- package/dist/lib/components/QAccountList/src/useConfigData.d.ts +37 -0
- package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +66 -0
- package/dist/lib/components/QBackgroundFileTaskList/src/useConfigData.d.ts +14 -0
- package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +80 -0
- package/dist/lib/components/QCompanyermissionList/src/types.d.ts +44 -0
- package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +68 -0
- package/dist/lib/components/QElsEmailSendLogList/src/useConfigData.d.ts +13 -0
- package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +72 -0
- package/dist/lib/components/QElsMsgRecordList/src/useConfigData.d.ts +16 -0
- package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +75 -0
- package/dist/lib/components/QI18nList/src/QI18nForm.vue.d.ts +47 -0
- package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +136 -0
- package/dist/lib/components/QI18nList/src/useConfigData.d.ts +31 -0
- package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +61 -0
- package/dist/lib/components/QImChatGroupList/src/useConfigData.d.ts +11 -0
- package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +60 -0
- package/dist/lib/components/QMqRecordList/src/useConfigData.d.ts +12 -0
- package/dist/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue.d.ts +49 -0
- package/dist/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue.d.ts +3 -0
- package/dist/lib/components/QPermissionDataList/src/form.vue.d.ts +50 -0
- package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +86 -0
- package/dist/lib/components/QPurchaseNoticeList/src/useConfigData.d.ts +15 -0
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +47 -0
- package/dist/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.d.ts +12 -0
- package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +129 -0
- package/dist/lib/components/QQuartzJobList/src/components/JCron.vue.d.ts +23 -0
- package/dist/lib/components/QQuartzJobList/src/components/JCronModal.vue.d.ts +100 -0
- package/dist/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue.d.ts +55 -0
- package/dist/lib/components/QQuartzJobList/src/useConfigData.d.ts +20 -0
- package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +100 -0
- package/dist/lib/components/QRoleList/src/components/content-header/index.d.ts +23 -0
- package/dist/lib/components/QRoleList/src/components/userAuthorization/index.d.ts +79 -0
- package/dist/lib/components/QRoleList/src/useConfigData.d.ts +30 -0
- package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue.d.ts +55 -0
- package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +104 -0
- package/dist/lib/components/QSupplierAccountList/src/useConfigData.d.ts +29 -0
- package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +49 -0
- package/dist/lib/components/QUsageList/src/useConfigData.d.ts +14 -0
- package/dist/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue.d.ts +31 -0
- package/dist/lib/components/QcustomConfigEdit/component/dataFormatComponent.d.ts +46 -0
- package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +41 -0
- package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigRender.d.ts +12 -0
- package/dist/lib/components/QcustomConfigEdit/src/types.d.ts +61 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConfigComputed.d.ts +7 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +85 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConfigMethods.d.ts +16 -0
- package/dist/lib/components/QcustomConfigEdit/src/useConstant.d.ts +18 -0
- package/dist/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue.d.ts +50 -0
- package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +112 -0
- package/dist/lib/components/QcustomConfigList/src/useConfigData.d.ts +17 -0
- package/dist/lib/components/QcustomConfigList/src/useMethods.d.ts +15 -0
- package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +66 -0
- package/dist/lib/components/QsysConfigList/src/useConfigData.d.ts +11 -0
- package/dist/lib/components/QsysConfigList/src/useMethods.d.ts +6 -0
- package/dist/lib/components/index.d.ts +39 -0
- package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +107 -0
- package/dist/lib/components/integratedReportList/src/index.vue.d.ts +70 -0
- package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +61 -0
- package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +46 -0
- package/dist/lib/components/loginLogList/src/index.vue.d.ts +45 -0
- package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +45 -0
- package/dist/lib/components/operateLogList/src/index.vue.d.ts +53 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/utils/global.hook.d.ts +31 -0
- package/dist/lib/utils/global.types.d.ts +41 -0
- package/dist/lib/utils/regexp.d.ts +27 -0
- package/dist/style.css +1 -0
- package/dist/vite-env.d.ts +13 -0
- package/dist/vite.svg +1 -0
- package/index.html +13 -0
- package/package.json +65 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +8 -0
- package/src/lib/components/QAccountList/index.ts +6 -0
- package/src/lib/components/QAccountList/src/QAccountDetail.vue +191 -0
- package/src/lib/components/QAccountList/src/QAccountEdit.vue +241 -0
- package/src/lib/components/QAccountList/src/QAccountList.vue +530 -0
- package/src/lib/components/QAccountList/src/useConfigData.ts +53 -0
- package/src/lib/components/QBackgroundFileTaskList/index.ts +6 -0
- package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +137 -0
- package/src/lib/components/QBackgroundFileTaskList/src/useConfigData.ts +20 -0
- package/src/lib/components/QCompanyermissionList/src/editTree.vue +291 -0
- package/src/lib/components/QCompanyermissionList/src/form.vue +238 -0
- package/src/lib/components/QCompanyermissionList/src/index.vue +309 -0
- package/src/lib/components/QCompanyermissionList/src/types.ts +44 -0
- package/src/lib/components/QElsEmailSendLogList/index.ts +6 -0
- package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +166 -0
- package/src/lib/components/QElsEmailSendLogList/src/useConfigData.ts +19 -0
- package/src/lib/components/QElsMsgRecordList/index.ts +6 -0
- package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue +148 -0
- package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +124 -0
- package/src/lib/components/QElsMsgRecordList/src/useConfigData.ts +22 -0
- package/src/lib/components/QElsTenantPortalNewsList/index.ts +6 -0
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue +139 -0
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +196 -0
- package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +122 -0
- package/src/lib/components/QElsTenantPortalNewsList/src/useConfigData.ts +20 -0
- package/src/lib/components/QI18nList/index.ts +6 -0
- package/src/lib/components/QI18nList/src/QI18nForm.vue +141 -0
- package/src/lib/components/QI18nList/src/QI18nList.vue +361 -0
- package/src/lib/components/QI18nList/src/useConfigData.ts +37 -0
- package/src/lib/components/QImChatGroupList/index.ts +6 -0
- package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +94 -0
- package/src/lib/components/QImChatGroupList/src/useConfigData.ts +17 -0
- package/src/lib/components/QMqRecordList/index.ts +6 -0
- package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +105 -0
- package/src/lib/components/QMqRecordList/src/useConfigData.ts +18 -0
- package/src/lib/components/QPasswordSecurityPolicy/index.ts +6 -0
- package/src/lib/components/QPasswordSecurityPolicy/src/QPasswordSecurityPolicy.vue +266 -0
- package/src/lib/components/QPermissionDataList/index.ts +6 -0
- package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -0
- package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +221 -0
- package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +117 -0
- package/src/lib/components/QPermissionDataList/src/form.vue +109 -0
- package/src/lib/components/QPurchaseNoticeList/index.ts +6 -0
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +147 -0
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +244 -0
- package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +163 -0
- package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -0
- package/src/lib/components/QPurchaseNoticeTemplateList/index.ts +6 -0
- package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +85 -0
- package/src/lib/components/QPurchaseNoticeTemplateList/src/useConfigData.ts +18 -0
- package/src/lib/components/QQuartzJobList/index.ts +6 -0
- package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +263 -0
- package/src/lib/components/QQuartzJobList/src/components/JCron.vue +82 -0
- package/src/lib/components/QQuartzJobList/src/components/JCronModal.vue +985 -0
- package/src/lib/components/QQuartzJobList/src/components/QuartzJobModal.vue +176 -0
- package/src/lib/components/QQuartzJobList/src/useConfigData.ts +26 -0
- package/src/lib/components/QRoleList/index.ts +6 -0
- package/src/lib/components/QRoleList/src/QRoleList.vue +288 -0
- package/src/lib/components/QRoleList/src/components/content-header/contentHeader.less +31 -0
- package/src/lib/components/QRoleList/src/components/content-header/index.tsx +42 -0
- package/src/lib/components/QRoleList/src/components/userAuthorization/index.tsx +690 -0
- package/src/lib/components/QRoleList/src/components/userAuthorization/userAuthorization.less +97 -0
- package/src/lib/components/QRoleList/src/useConfigData.ts +33 -0
- package/src/lib/components/QSupplierAccountList/index.ts +6 -0
- package/src/lib/components/QSupplierAccountList/src/QSupplierAccountForm.vue +187 -0
- package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +302 -0
- package/src/lib/components/QSupplierAccountList/src/useConfigData.ts +29 -0
- package/src/lib/components/QUsageList/index.ts +6 -0
- package/src/lib/components/QUsageList/src/QUsageList.vue +82 -0
- package/src/lib/components/QUsageList/src/useConfigData.ts +20 -0
- package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -0
- package/src/lib/components/QcustomConfigEdit/component/TempalePreviewModal.vue +100 -0
- package/src/lib/components/QcustomConfigEdit/component/dataFormatComponent.tsx +100 -0
- package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +71 -0
- package/src/lib/components/QcustomConfigEdit/index.ts +6 -0
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +1807 -0
- package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +242 -0
- package/src/lib/components/QcustomConfigEdit/src/types.ts +71 -0
- package/src/lib/components/QcustomConfigEdit/src/useConfigComputed.ts +75 -0
- package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +123 -0
- package/src/lib/components/QcustomConfigEdit/src/useConfigMethods.ts +117 -0
- package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +301 -0
- package/src/lib/components/QcustomConfigEdit/style/index.less +41 -0
- package/src/lib/components/QcustomConfigList/component/ImportJsonCustomConfig.vue +135 -0
- package/src/lib/components/QcustomConfigList/index.ts +6 -0
- package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +268 -0
- package/src/lib/components/QcustomConfigList/src/types.ts +1 -0
- package/src/lib/components/QcustomConfigList/src/useConfigData.ts +23 -0
- package/src/lib/components/QcustomConfigList/src/useMethods.ts +36 -0
- package/src/lib/components/QcustomConfigList/style/index.less +3 -0
- package/src/lib/components/QsysConfigList/index.ts +6 -0
- package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +125 -0
- package/src/lib/components/QsysConfigList/src/types.ts +1 -0
- package/src/lib/components/QsysConfigList/src/useConfigData.ts +17 -0
- package/src/lib/components/QsysConfigList/src/useMethods.ts +11 -0
- package/src/lib/components/QsysConfigList/style/index.less +3 -0
- package/src/lib/components/index.ts +78 -0
- package/src/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue +49 -0
- package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +143 -0
- package/src/lib/components/integratedNodesList/src/index.vue +136 -0
- package/src/lib/components/integratedReportList/src/index.vue +86 -0
- package/src/lib/components/integratedReportSearchList/src/index.vue +66 -0
- package/src/lib/components/loginAbnormalLogList/src/index.vue +50 -0
- package/src/lib/components/loginLogList/src/index.vue +57 -0
- package/src/lib/components/loginSupplierLogList/src/index.vue +63 -0
- package/src/lib/components/operateLogList/src/index.vue +57 -0
- package/src/lib/index.ts +15 -0
- package/src/lib/utils/constant.ts +1 -0
- package/src/lib/utils/global.hook.ts +337 -0
- package/src/lib/utils/global.types.ts +49 -0
- package/src/lib/utils/regexp.ts +143 -0
- package/src/main.ts +11 -0
- package/src/vite-env.d.ts +13 -0
- package/tsconfig.json +24 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +61 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// ########### 表头 ###################
|
|
2
|
+
// ############## PC绑定函数: ####################
|
|
3
|
+
const bindFunctionHead =
|
|
4
|
+
`// editlayout 字段类型:下拉 示列
|
|
5
|
+
function callback(parentRef, pageData, groupData, value, opt, oldVal, form) {
|
|
6
|
+
|
|
7
|
+
let setDisabledByProp = (prop, flag) => {
|
|
8
|
+
for (let group of pageData.groups) {
|
|
9
|
+
if (group.type) continue;
|
|
10
|
+
let formFields = group.custom.formFields || [];
|
|
11
|
+
for (let sub of formFields) {
|
|
12
|
+
if (sub.fieldName === prop) {
|
|
13
|
+
sub.disabled = flag;
|
|
14
|
+
break;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let flag = (value === '0' || form.ebiddingMethod !== '0');
|
|
21
|
+
let disabledFlag = (value === '0' || value === '1' || form.ebiddingMethod !== '0');
|
|
22
|
+
setDisabledByProp('beforeEndMinute', flag);
|
|
23
|
+
setDisabledByProp('delayMinute', flag);
|
|
24
|
+
setDisabledByProp('delayCount', disabledFlag);
|
|
25
|
+
|
|
26
|
+
let setValidateRuleByProp = (prop, flag) => {
|
|
27
|
+
let index = -1;
|
|
28
|
+
let fieldLabel;
|
|
29
|
+
let rule = {};
|
|
30
|
+
for (let group of pageData.groups) {
|
|
31
|
+
if (group.type) continue;
|
|
32
|
+
let formFields = group.custom.formFields || [];
|
|
33
|
+
for (let sub of formFields) {
|
|
34
|
+
if (sub.fieldName === prop) {
|
|
35
|
+
sub.required = flag ? '1' : '0';
|
|
36
|
+
fieldLabel = sub.fieldLabel;
|
|
37
|
+
index = pageData.groups.indexOf(group);
|
|
38
|
+
break;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
rule[prop] = [{
|
|
44
|
+
required: flag,
|
|
45
|
+
message: \`` +
|
|
46
|
+
'${fieldLabel}' +
|
|
47
|
+
`必填\`
|
|
48
|
+
}];
|
|
49
|
+
if (index !== -1) {
|
|
50
|
+
pageData.groups[index].custom.validateRules = Object.assign({}, pageData.groups[index].custom.validateRules, rule);
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
let validateFlag = (value === '1' || value === '2') && form.ebiddingMethod === '0';
|
|
55
|
+
let delayCountValidateFlag = (value === '2' && form.ebiddingMethod === '0');
|
|
56
|
+
|
|
57
|
+
setValidateRuleByProp('beforeEndMinute', validateFlag);
|
|
58
|
+
setValidateRuleByProp('delayMinute', validateFlag);
|
|
59
|
+
setValidateRuleByProp('delayCount', delayCountValidateFlag);
|
|
60
|
+
}`
|
|
61
|
+
|
|
62
|
+
// ############## M端绑定函数: ####################
|
|
63
|
+
const initFunctionHead =
|
|
64
|
+
`/**
|
|
65
|
+
* 业务规则
|
|
66
|
+
* 延期规则, prop: 'delayRule', 0 不允许延期,1 不限制延期次数, 2 有限制次数延期
|
|
67
|
+
* 结束前多少分钟, prop: 'beforeEndMinute'
|
|
68
|
+
* 延期多少分钟, prop: 'delayMinute'
|
|
69
|
+
* 可以延期次数, prop: 'delayCount'
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} Vue 整个实例
|
|
72
|
+
* @param {Object} _pageData 页面原所有数据,包括 分组 groups + formFields itemColumns
|
|
73
|
+
* @param {Object} _form 当前表单对象(表头状态时才有)
|
|
74
|
+
* @param {Object} _row 当前表格行所有对象(表行状态时才有)
|
|
75
|
+
* @param {String} _value 当前所选值
|
|
76
|
+
* @param {object} _cacheAllData 页面当前所有实时数据
|
|
77
|
+
* @param {Array} _data 弹窗选择行勾选数据
|
|
78
|
+
*/
|
|
79
|
+
function initFunction(Vue, { _pageData, _form, _row, _value, _cacheAllData, _data }) {
|
|
80
|
+
|
|
81
|
+
let setDisabledByProp = (targetProp, flag) => {
|
|
82
|
+
for (let group of _pageData.groups) {
|
|
83
|
+
if (group.type || group.type === 'item') continue;
|
|
84
|
+
let formFields = group.custom.formFields || [];
|
|
85
|
+
for (let sub of formFields) {
|
|
86
|
+
if (sub.fieldName === targetProp) {
|
|
87
|
+
sub.disabled = flag;
|
|
88
|
+
break;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
let flag = (_value === '0' || _form.ebiddingMethod !== '0');
|
|
95
|
+
let disabledFlag = (_value === '0' || _value === '1' || _form.ebiddingMethod !== '0');
|
|
96
|
+
setDisabledByProp('beforeEndMinute', flag);
|
|
97
|
+
setDisabledByProp('delayMinute', flag);
|
|
98
|
+
setDisabledByProp('delayCount', disabledFlag);
|
|
99
|
+
|
|
100
|
+
let setValidateRuleByProp = (targetProp, flag) => {
|
|
101
|
+
let index = -1;
|
|
102
|
+
let fieldLabel;
|
|
103
|
+
let rule = {};
|
|
104
|
+
for (let group of _pageData.groups) {
|
|
105
|
+
if (group.type || group.type === 'item') continue;
|
|
106
|
+
let formFields = group.custom.formFields || [];
|
|
107
|
+
for (let sub of formFields) {
|
|
108
|
+
if (sub.fieldName === targetProp) {
|
|
109
|
+
sub.required = flag ? '1' : '0';
|
|
110
|
+
fieldLabel = sub.fieldLabel;
|
|
111
|
+
index = _pageData.groups.indexOf(group);
|
|
112
|
+
break
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
rule[targetProp] = [{
|
|
118
|
+
required: flag,
|
|
119
|
+
message: \`请输入` +
|
|
120
|
+
'${fieldLabel}' +
|
|
121
|
+
`\`,
|
|
122
|
+
trigger: ["change", "blur"],
|
|
123
|
+
}];
|
|
124
|
+
if (index !== -1) {
|
|
125
|
+
_pageData.groups[index].custom.validateRules = Object.assign({}, _pageData.groups[index].custom.validateRules, rule);
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
let validateFlag = (_value === '1' || _value === '2') && _form.ebiddingMethod === '0';
|
|
130
|
+
let delayCountValidateFlag = (_value === '2' && _form.ebiddingMethod === '0');
|
|
131
|
+
|
|
132
|
+
setValidateRuleByProp('beforeEndMinute', validateFlag);
|
|
133
|
+
setValidateRuleByProp('delayMinute', validateFlag);
|
|
134
|
+
setValidateRuleByProp('delayCount', delayCountValidateFlag);
|
|
135
|
+
}`
|
|
136
|
+
|
|
137
|
+
// ############## 拓展: ####################
|
|
138
|
+
const extendHead = `/* extend 原设计是对字段自定义配置,也是对绑定函数callback 的补充
|
|
139
|
+
* 以下是结合弹窗组件的示列
|
|
140
|
+
*/
|
|
141
|
+
{
|
|
142
|
+
modalColumns: [{
|
|
143
|
+
field: 'toElsAccount',
|
|
144
|
+
fieldLabelI18nKey: 'i18n_title_supplierAccount',
|
|
145
|
+
title: '供应商ELS账号',
|
|
146
|
+
with: 150,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
field: 'supplierCode',
|
|
150
|
+
fieldLabelI18nKey: 'i18n_title_supplierCode',
|
|
151
|
+
title: '供应商编码',
|
|
152
|
+
with: 150,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
field: 'supplierName',
|
|
156
|
+
fieldLabelI18nKey: 'i18n_title_supplierName',
|
|
157
|
+
title: '供应商名称',
|
|
158
|
+
with: 150,
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
modalUrl: '/supplier/supplierMaster/list',
|
|
162
|
+
modalParams: {},
|
|
163
|
+
beforeCheckedCallBack: function (parentRef, pageData, groupData, form) {
|
|
164
|
+
return new Promise((resolve, rejec) => {
|
|
165
|
+
let orderStatus = form.orderStatus || '';
|
|
166
|
+
console.log("orderStatus", orderStatus);
|
|
167
|
+
return orderStatus === '0' ? resolve('success') : rejec('只允许操作新建状态单据');
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
}`
|
|
171
|
+
|
|
172
|
+
// ############## 自定义校验方法: ####################
|
|
173
|
+
const fieldValidatorHead = `/* 增强表单校验,表单配置的校验除了必填和正则表达式,增加验证方法,应付复杂的表单验证
|
|
174
|
+
* 示列
|
|
175
|
+
*/
|
|
176
|
+
{
|
|
177
|
+
validateMethod: function (taht, form, currentField, rule, value, callback) {
|
|
178
|
+
let startTime = new Date(form.checkStartDate).getTime()
|
|
179
|
+
let endTime = new Date(form.checkEndDate).getTime()
|
|
180
|
+
if (startTime > endTime) {
|
|
181
|
+
callback(new Error('开始时间不能大于结束时间'))
|
|
182
|
+
} else {
|
|
183
|
+
callback()
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
trigger: 'change'
|
|
187
|
+
}`
|
|
188
|
+
|
|
189
|
+
// ############## 计算公式: ####################`
|
|
190
|
+
const formulaHead = '${ MaterialCost }+${ scrapRate } +${ ManufactExpenses }'
|
|
191
|
+
|
|
192
|
+
// ########### 表行 ###################
|
|
193
|
+
// ############## PC绑定函数: ####################
|
|
194
|
+
const bindFunctionRow = `// editlayout 字段类型:弹窗 示列
|
|
195
|
+
function callback(row, data, _self) {
|
|
196
|
+
row.orderProgressTemplateNumber = data[0].progressTemplateNumber
|
|
197
|
+
row.orderProgressTemplateName = data[0].progressTemplateName
|
|
198
|
+
row.orderProgressTemplateId = data[0].id
|
|
199
|
+
}`
|
|
200
|
+
|
|
201
|
+
// ############## M端绑定函数: ####################
|
|
202
|
+
const initFunctionRow = `/*
|
|
203
|
+
* @param {Object} Vue 整个实例
|
|
204
|
+
* @param {Object} _pageData 页面原所有数据,包括 分组 groups + formFields itemColumns
|
|
205
|
+
* @param {Object} _form 当前表单对象(表头状态时才有)
|
|
206
|
+
* @param {Object} _row 当前表格行所有对象(表行状态时才有)
|
|
207
|
+
* @param {String} _value 当前所选值
|
|
208
|
+
* @param {object} _cacheAllData 页面当前所有实时数据
|
|
209
|
+
* @param {Array} _data 弹窗选择行勾选数据
|
|
210
|
+
*/
|
|
211
|
+
function initFunction(Vue, { _pageData, _form, _row, _value, _cacheAllData, _data }) {
|
|
212
|
+
let { taxCode = '', taxRate = '' } = _data[0] || {};
|
|
213
|
+
_row.taxCode = taxCode;
|
|
214
|
+
_row.taxRate = taxRate;
|
|
215
|
+
}`
|
|
216
|
+
|
|
217
|
+
// ############## 拓展: ####################
|
|
218
|
+
const extendRow = `/* extend 原设计是对字段自定义配置,也是对绑定函数callback 的补充
|
|
219
|
+
* 以下是结合弹窗组件的示列
|
|
220
|
+
*/
|
|
221
|
+
{
|
|
222
|
+
modalColumns: [{
|
|
223
|
+
field: 'taxCode',
|
|
224
|
+
title: '税码',
|
|
225
|
+
fieldLabelI18nKey: 'i18n_field_taxCode',
|
|
226
|
+
with: 150,
|
|
227
|
+
}, {
|
|
228
|
+
field: 'taxRate',
|
|
229
|
+
title: '税率(%)',
|
|
230
|
+
fieldLabelI18nKey: 'i18n_field_taxRate',
|
|
231
|
+
with: 150,
|
|
232
|
+
}, {
|
|
233
|
+
field: 'taxName',
|
|
234
|
+
title: '税码名称',
|
|
235
|
+
fieldLabelI18nKey: 'i18n_field_taxName',
|
|
236
|
+
with: 150,
|
|
237
|
+
}, {
|
|
238
|
+
field: 'remark',
|
|
239
|
+
title: '备注',
|
|
240
|
+
fieldLabelI18nKey: 'i18n_field_remark',
|
|
241
|
+
with: 150,
|
|
242
|
+
}],
|
|
243
|
+
modalUrl: '/base/tax/list',
|
|
244
|
+
modalParams: {},
|
|
245
|
+
// 表行弹窗清除按钮回调
|
|
246
|
+
afterRowClearCallBack:function(Vue,row){
|
|
247
|
+
row.taxCode = ''
|
|
248
|
+
row.taxRate = ''
|
|
249
|
+
}
|
|
250
|
+
}`
|
|
251
|
+
|
|
252
|
+
// ############## 自定义校验方法: ####################
|
|
253
|
+
const fieldValidatorRow = `/* 增强表单校验,表单配置的校验除了必填和正则表达式,增加验证方法,应付复杂的表单验证
|
|
254
|
+
* 示列
|
|
255
|
+
*/
|
|
256
|
+
/**
|
|
257
|
+
* @param {*} _this
|
|
258
|
+
* @param {*} item
|
|
259
|
+
* @param {*} rule 规则
|
|
260
|
+
* @param {*} value 当前值
|
|
261
|
+
* @param {*} row 编辑态当前行
|
|
262
|
+
* @param {*} column 编辑列
|
|
263
|
+
*
|
|
264
|
+
**/
|
|
265
|
+
{
|
|
266
|
+
validateMethod: function (that, item, rule, value, row, column) {
|
|
267
|
+
//编辑态下,that可以获取当前页面所有值
|
|
268
|
+
debugger
|
|
269
|
+
if (row.effectiveDate && row.expiryDate) {
|
|
270
|
+
let effectiveDate = new Date(row.effectiveDate).getTime()
|
|
271
|
+
let expiryDate = new Date(row.expiryDate).getTime()
|
|
272
|
+
if (effectiveDate > expiryDate) {
|
|
273
|
+
return new Error('生效日期不能大于失效日期')
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
trigger: 'change'//blur,change,manual
|
|
278
|
+
}`
|
|
279
|
+
|
|
280
|
+
// ############## 计算公式: ####################
|
|
281
|
+
const formulaRow = '${MaterialCost}+${scrapRate}+${ManufactExpenses}'
|
|
282
|
+
|
|
283
|
+
export const EditSample = {
|
|
284
|
+
bindFunctionHead,
|
|
285
|
+
initFunctionHead,
|
|
286
|
+
extendHead,
|
|
287
|
+
fieldValidatorHead,
|
|
288
|
+
formulaHead,
|
|
289
|
+
bindFunctionRow,
|
|
290
|
+
initFunctionRow,
|
|
291
|
+
extendRow,
|
|
292
|
+
fieldValidatorRow,
|
|
293
|
+
formulaRow,
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export const url = {
|
|
297
|
+
add: '/template/templateHead/add',
|
|
298
|
+
edit: '/template/templateHead/edit',
|
|
299
|
+
detail: '/template/templateHead/queryById',
|
|
300
|
+
publish: '/template/templateHead/generateConfig',
|
|
301
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.page-container {
|
|
2
|
+
.ant-btn {
|
|
3
|
+
& + .ant-btn {
|
|
4
|
+
margin-left: 8px;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
:deep(.ant-select-selection) {
|
|
8
|
+
position: relative;
|
|
9
|
+
z-index: 1;
|
|
10
|
+
}
|
|
11
|
+
.business-tips {
|
|
12
|
+
width: 64.6%;
|
|
13
|
+
margin: 0 auto;
|
|
14
|
+
margin-bottom: 10px;
|
|
15
|
+
}
|
|
16
|
+
:deep(.ant-input-affix-wrapper .ant-input-suffix) {
|
|
17
|
+
z-index: 1;
|
|
18
|
+
}
|
|
19
|
+
.skeleton-wrap {
|
|
20
|
+
margin-top: 100px;
|
|
21
|
+
text-align: center;
|
|
22
|
+
line-height: 100px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.switch-config .switch-config-item {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
border-bottom: 1px dashed #eee;
|
|
29
|
+
padding: 10px 0;
|
|
30
|
+
}
|
|
31
|
+
.switch-config > div:first-child {
|
|
32
|
+
padding-top: 0;
|
|
33
|
+
}
|
|
34
|
+
.verify-config {
|
|
35
|
+
margin-bottom: 20px;
|
|
36
|
+
.tab-clo-left {
|
|
37
|
+
padding-right: 10px;
|
|
38
|
+
text-align: right;
|
|
39
|
+
line-height: 32px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vxe-modal title="导入数据" :width="720" v-model="visible" :confirmLoading="confirmLoading" show-footer @confirm="ok" @close="close">
|
|
3
|
+
<a-spin :spinning="confirmLoading">
|
|
4
|
+
<div class="steps-content">
|
|
5
|
+
<div v-if="current === 0" v-show="!isLoading" class="step-2">
|
|
6
|
+
<div class="import-desc">
|
|
7
|
+
<h3>导入说明:</h3>
|
|
8
|
+
<ul>
|
|
9
|
+
<li>请先导出业务模板配置的数据再进行导入</li>
|
|
10
|
+
<li>文件大小不能超过20M;</li>
|
|
11
|
+
<li>仅支持 *.json 格式文件;</li>
|
|
12
|
+
</ul>
|
|
13
|
+
</div>
|
|
14
|
+
<a-upload-dragger name="file" :headers="uploadHeader" :accept="accept" :action="importUrl" @change="imortChangeEvent" :showUploadList="false" :beforeUpload="beforeUpload">
|
|
15
|
+
<p class="ant-upload-drag-icon">
|
|
16
|
+
<a-icon type="inbox" />
|
|
17
|
+
</p>
|
|
18
|
+
<p class="ant-upload-text">点击或把文件拖拽到这个区域上传</p>
|
|
19
|
+
</a-upload-dragger>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="isLoading" class="step-3">
|
|
22
|
+
<a-result status="success" title="导入成功"></a-result>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</a-spin>
|
|
26
|
+
</vxe-modal>
|
|
27
|
+
</template>
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { defineComponent } from 'vue'
|
|
30
|
+
import { message } from '@qqt-product/ui'
|
|
31
|
+
//ts
|
|
32
|
+
import { MapObjectNoneType } from '../../../utils/global.types'
|
|
33
|
+
// import { Steps, Result } from 'ant-design-vue'
|
|
34
|
+
export default defineComponent({
|
|
35
|
+
name: 'ImportJsonCustomConfig',
|
|
36
|
+
emits: ['close'],
|
|
37
|
+
components: {
|
|
38
|
+
// ASteps: Steps,
|
|
39
|
+
// AStep: Steps.Step,
|
|
40
|
+
// AResult: Result,
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
userToken: {
|
|
44
|
+
type: String,
|
|
45
|
+
defalut: '',
|
|
46
|
+
},
|
|
47
|
+
isShow: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
defalut: false,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
visible: false,
|
|
56
|
+
current: 0,
|
|
57
|
+
confirmLoading: false,
|
|
58
|
+
accept: '.json',
|
|
59
|
+
uploadHeader: { 'X-Access-Token': this.userToken },
|
|
60
|
+
isPreview: 0,
|
|
61
|
+
tableColumns: [],
|
|
62
|
+
tableData: [],
|
|
63
|
+
dataKey: '',
|
|
64
|
+
isLoading: false,
|
|
65
|
+
percent: 0,
|
|
66
|
+
importUrl: '/els/template/templateHead/importJson',
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
lastStepIndex() {
|
|
71
|
+
let current = this.isPreview === 1 ? 2 : 1
|
|
72
|
+
return current
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
open() {
|
|
77
|
+
this.isLoading = false
|
|
78
|
+
this.visible = true
|
|
79
|
+
},
|
|
80
|
+
ok() {
|
|
81
|
+
this.visible = false
|
|
82
|
+
this.$emit('close')
|
|
83
|
+
},
|
|
84
|
+
close() {
|
|
85
|
+
this.visible = false
|
|
86
|
+
this.$emit('close')
|
|
87
|
+
if (this.isLoading) {
|
|
88
|
+
this.isLoading = false
|
|
89
|
+
// 刷新列表
|
|
90
|
+
// this.$parent.$refs.listPage.loadData()
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
onChange(current: number) {
|
|
94
|
+
this.current = current
|
|
95
|
+
},
|
|
96
|
+
// 导入响应事件(上传中、完成、失败都会调用这个函数)
|
|
97
|
+
imortChangeEvent(info: MapObjectNoneType) {
|
|
98
|
+
// 服务端响应返回信息
|
|
99
|
+
const res = info.file.response
|
|
100
|
+
if (res && res.success) {
|
|
101
|
+
this.isLoading = true
|
|
102
|
+
// this.$parent.$refs.listPage.loadData()
|
|
103
|
+
} else if (res && !res.success) {
|
|
104
|
+
message.error('文件导入失败' + ':' + res.message)
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
// 上传之前文件校验
|
|
108
|
+
beforeUpload(file: MapObjectNoneType) {
|
|
109
|
+
const suffix = file.name.substr(file.name.lastIndexOf('.'))
|
|
110
|
+
if (suffix !== '.json') {
|
|
111
|
+
message.warning('请上传Json文件')
|
|
112
|
+
return false
|
|
113
|
+
}
|
|
114
|
+
if (file.size > 20 * 1024 * 1024) {
|
|
115
|
+
message.warning('超过最大文件限制!')
|
|
116
|
+
return false
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
watch: {
|
|
121
|
+
isShow: function (nw) {
|
|
122
|
+
console.log('nw', nw)
|
|
123
|
+
if (nw) {
|
|
124
|
+
this.visible = nw
|
|
125
|
+
this.isLoading = false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
</script>
|
|
131
|
+
<style lang="less" scoped>
|
|
132
|
+
.progress {
|
|
133
|
+
text-align: center;
|
|
134
|
+
}
|
|
135
|
+
</style>
|