cloud-web-corejs 1.0.54-dev.694 → 1.0.54-dev.696
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/package.json +1 -1
- package/src/components/jsonImport/exportUtil.js +102 -0
- package/src/components/jsonImport/index.js +89 -55
- package/src/components/wf/wf.js +4 -1
- package/src/components/wf/wfUtil.js +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +112 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +39 -0
- package/src/components/xform/form-render/indexMixin.js +17 -2
- package/src/components/xform/lang/zh-CN.js +1 -0
- package/src/components/xform/mixins/defaultHandle.js +41 -0
- package/src/views/bd/setting/form_script/mixins/list.js +3 -1
- package/src/views/bd/setting/form_script/mixins/list1.js +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
function isNull(val) {
|
|
2
|
+
return val == null || val === "" || val === undefined;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function formatJsonContent(content) {
|
|
6
|
+
if (isNull(content)) return "";
|
|
7
|
+
if (typeof content === "object") {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(content, null, 2);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return String(content);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const text = String(content).trim();
|
|
15
|
+
if (!text) return "";
|
|
16
|
+
try {
|
|
17
|
+
return JSON.stringify(JSON.parse(text), null, 2);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
return text;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function parseExportContent(content) {
|
|
24
|
+
if (!content) {
|
|
25
|
+
return { list: [], isArray: true };
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const parsed = JSON.parse(content);
|
|
29
|
+
if (Array.isArray(parsed)) {
|
|
30
|
+
return { list: parsed, isArray: true };
|
|
31
|
+
}
|
|
32
|
+
return { list: [parsed], isArray: false };
|
|
33
|
+
} catch (e) {
|
|
34
|
+
return { list: [], isArray: true, invalid: true };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getExportExtraConfig(url, options = {}) {
|
|
39
|
+
if (options.extraExport) {
|
|
40
|
+
return options.extraExport;
|
|
41
|
+
}
|
|
42
|
+
if (!url) return null;
|
|
43
|
+
if (url.includes("/form_develop/exportFormScript")) {
|
|
44
|
+
return {
|
|
45
|
+
field: "script",
|
|
46
|
+
getExtraFileName(item) {
|
|
47
|
+
const scriptCode = item.scriptCode || "script";
|
|
48
|
+
const formCode = item.formCode;
|
|
49
|
+
return formCode
|
|
50
|
+
? `${scriptCode} - ${formCode} - item(script)`
|
|
51
|
+
: `${scriptCode} - item(script)`;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (url.includes("/form_develop/exportFormTemplate")) {
|
|
56
|
+
return {
|
|
57
|
+
field: "formViewContent",
|
|
58
|
+
getExtraFileName(item) {
|
|
59
|
+
return `${item.formCode || "form"} - item(form)`;
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function processExportContent(content, extraConfig) {
|
|
67
|
+
if (!extraConfig) {
|
|
68
|
+
return { mainContent: content, extraFiles: [] };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const { field, getExtraFileName } = extraConfig;
|
|
72
|
+
const { list, isArray, invalid } = parseExportContent(content);
|
|
73
|
+
|
|
74
|
+
if (invalid || !list.length) {
|
|
75
|
+
return { mainContent: content, extraFiles: [] };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const extraFiles = [];
|
|
79
|
+
const usedNames = {};
|
|
80
|
+
|
|
81
|
+
list.forEach((item, index) => {
|
|
82
|
+
if (!item || isNull(item[field])) return;
|
|
83
|
+
|
|
84
|
+
const formatted = formatJsonContent(item[field]);
|
|
85
|
+
item[field] = formatted;
|
|
86
|
+
|
|
87
|
+
let fileName = getExtraFileName(item, index);
|
|
88
|
+
if (!fileName) return;
|
|
89
|
+
|
|
90
|
+
if (usedNames[fileName]) {
|
|
91
|
+
usedNames[fileName] += 1;
|
|
92
|
+
fileName = `${fileName}_${usedNames[fileName]}`;
|
|
93
|
+
} else {
|
|
94
|
+
usedNames[fileName] = 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
extraFiles.push({ fileName, content: formatted });
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const mainContent = JSON.stringify(isArray ? list : list[0], null, 2);
|
|
101
|
+
return { mainContent, extraFiles };
|
|
102
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
const moudule = {};
|
|
2
|
-
import vue from "vue"
|
|
3
|
-
import excelImport from
|
|
2
|
+
import vue from "vue";
|
|
3
|
+
import excelImport from "./index.vue";
|
|
4
4
|
import exportDialog from "./exportDialog.vue";
|
|
5
|
-
import {getBdEnv} from "@base/api/user";
|
|
6
|
-
import {encrypt, decrypt} from "@base/utils/aes";
|
|
7
|
-
|
|
5
|
+
import { getBdEnv } from "@base/api/user";
|
|
6
|
+
import { encrypt, decrypt } from "@base/utils/aes";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
getExportExtraConfig,
|
|
9
|
+
processExportContent,
|
|
10
|
+
} from "./exportUtil";
|
|
11
|
+
|
|
12
|
+
import { getToken } from "../../utils/auth";
|
|
11
13
|
|
|
12
14
|
let configUtil = {
|
|
13
15
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
14
|
-
getToken
|
|
16
|
+
getToken,
|
|
15
17
|
};
|
|
16
18
|
const ExcelImportInstance = vue.extend(excelImport);
|
|
17
19
|
const ExportDialogInstance = vue.extend(exportDialog);
|
|
@@ -19,9 +21,9 @@ const initInstance = function (containter, flag) {
|
|
|
19
21
|
// 实例化vue实例
|
|
20
22
|
let currentInstance;
|
|
21
23
|
if (flag == 1) {
|
|
22
|
-
currentInstance = new ExcelImportInstance({i18n: window.$vueRoot._i18n});
|
|
24
|
+
currentInstance = new ExcelImportInstance({ i18n: window.$vueRoot._i18n });
|
|
23
25
|
} else {
|
|
24
|
-
currentInstance = new ExportDialogInstance({i18n: window.$vueRoot._i18n});
|
|
26
|
+
currentInstance = new ExportDialogInstance({ i18n: window.$vueRoot._i18n });
|
|
25
27
|
}
|
|
26
28
|
let dom = currentInstance.$mount().$el;
|
|
27
29
|
containter.appendChild(dom);
|
|
@@ -34,9 +36,9 @@ function toDo(options) {
|
|
|
34
36
|
let vueTarget = this && this.$el ? this : window.$vueRoot;
|
|
35
37
|
let currentInstance = initInstance(containter, 1);
|
|
36
38
|
currentInstance.param = {};
|
|
37
|
-
Object.assign(currentInstance.param, {vue: vueTarget}, options);
|
|
39
|
+
Object.assign(currentInstance.param, { vue: vueTarget }, options);
|
|
38
40
|
return currentInstance.exc();
|
|
39
|
-
}
|
|
41
|
+
}
|
|
40
42
|
|
|
41
43
|
function openExportDialog(options, callback) {
|
|
42
44
|
// let containter = this && this.$el ? this.$el : document.body;
|
|
@@ -44,9 +46,11 @@ function openExportDialog(options, callback) {
|
|
|
44
46
|
let vueTarget = this && this.$el ? this : window.$vueRoot;
|
|
45
47
|
let currentInstance = initInstance(containter, 2);
|
|
46
48
|
currentInstance.param = {};
|
|
47
|
-
Object.assign(currentInstance.param, {vue: vueTarget}, options, {
|
|
49
|
+
Object.assign(currentInstance.param, { vue: vueTarget }, options, {
|
|
50
|
+
confirm: callback,
|
|
51
|
+
});
|
|
48
52
|
// return currentInstance.exc();
|
|
49
|
-
}
|
|
53
|
+
}
|
|
50
54
|
|
|
51
55
|
// 定义插件对象
|
|
52
56
|
// vue的install方法,用于定义vue插件
|
|
@@ -62,23 +66,23 @@ moudule.install = function (Vue) {
|
|
|
62
66
|
let selectTypeAuth = options.selectTypeAuth;
|
|
63
67
|
let that = this;
|
|
64
68
|
|
|
65
|
-
let ids = []
|
|
69
|
+
let ids = [];
|
|
66
70
|
if (options.data) {
|
|
67
|
-
ids = options.data
|
|
71
|
+
ids = options.data;
|
|
68
72
|
} else if (targetRef) {
|
|
69
|
-
let url = options
|
|
73
|
+
let url = options;
|
|
70
74
|
let checkRows = this.$refs[targetRef].getCheckboxRecords(true);
|
|
71
75
|
if (!checkRows.length) {
|
|
72
|
-
this.$baseAlert(this.$t1(
|
|
73
|
-
return
|
|
76
|
+
this.$baseAlert(this.$t1("请选择需要导出的数据"));
|
|
77
|
+
return;
|
|
74
78
|
}
|
|
75
|
-
ids = checkRows.map(item => item.id);
|
|
79
|
+
ids = checkRows.map((item) => item.id);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
let handle = function (abc) {
|
|
79
83
|
let reqData = {
|
|
80
|
-
ids
|
|
81
|
-
}
|
|
84
|
+
ids,
|
|
85
|
+
};
|
|
82
86
|
if (abc) {
|
|
83
87
|
reqData.abc = abc;
|
|
84
88
|
}
|
|
@@ -86,61 +90,69 @@ moudule.install = function (Vue) {
|
|
|
86
90
|
reqData.plaintext = options.plaintext;
|
|
87
91
|
}
|
|
88
92
|
let data = {
|
|
89
|
-
datas: encrypt(JSON.stringify(reqData))
|
|
90
|
-
}
|
|
93
|
+
datas: encrypt(JSON.stringify(reqData)),
|
|
94
|
+
};
|
|
91
95
|
|
|
92
96
|
that.$http({
|
|
93
97
|
url: options.url,
|
|
94
98
|
method: `post`,
|
|
95
99
|
data: data,
|
|
96
100
|
isLoading: true,
|
|
97
|
-
success: res => {
|
|
98
|
-
let content = res.objx
|
|
101
|
+
success: (res) => {
|
|
102
|
+
let content = res.objx;
|
|
99
103
|
if (content && content !== "[]") {
|
|
100
104
|
let fileName;
|
|
101
105
|
if (options.fileName) {
|
|
102
106
|
fileName = options.fileName;
|
|
103
107
|
} else {
|
|
104
|
-
let timeStr = res.time
|
|
105
|
-
|
|
108
|
+
let timeStr = res.time
|
|
109
|
+
.replaceAll(":", "")
|
|
110
|
+
.replaceAll("-", "")
|
|
111
|
+
.replaceAll(" ", "");
|
|
112
|
+
fileName = options.title + "(" + timeStr + ")";
|
|
106
113
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
const extraConfig = getExportExtraConfig(options.url, options);
|
|
115
|
+
if (extraConfig) {
|
|
116
|
+
const processed = processExportContent(content, extraConfig);
|
|
117
|
+
content = processed.mainContent;
|
|
118
|
+
const extraFiles = resolveExtraFileNames(
|
|
119
|
+
processed.extraFiles,
|
|
120
|
+
options.fileName
|
|
121
|
+
);
|
|
122
|
+
downloadTxt(fileName, content);
|
|
123
|
+
downloadExtraFiles(extraFiles);
|
|
124
|
+
} else {
|
|
125
|
+
downloadTxt(fileName, content);
|
|
113
126
|
}
|
|
114
|
-
downloadTxt(fileName, content)
|
|
115
127
|
} else {
|
|
116
|
-
this.$baseAlert(this.$t1(
|
|
128
|
+
this.$baseAlert(this.$t1("不存在需要导出的数据"));
|
|
117
129
|
}
|
|
118
|
-
}
|
|
130
|
+
},
|
|
119
131
|
});
|
|
120
|
-
}
|
|
132
|
+
};
|
|
121
133
|
let isDev = true;
|
|
122
134
|
if (abcEnabled) {
|
|
123
135
|
await getBdEnv({
|
|
124
136
|
isLoading: true,
|
|
125
|
-
success: res => {
|
|
126
|
-
isDev = res.objx == "dev"
|
|
127
|
-
}
|
|
137
|
+
success: (res) => {
|
|
138
|
+
isDev = res.objx == "dev";
|
|
139
|
+
},
|
|
128
140
|
});
|
|
129
141
|
}
|
|
130
142
|
if (isDev && abcEnabled && editAuth === 1 && selectTypeAuth == 1) {
|
|
131
143
|
openExportDialog(options, (abc) => {
|
|
132
|
-
handle(abc)
|
|
133
|
-
})
|
|
144
|
+
handle(abc);
|
|
145
|
+
});
|
|
134
146
|
} else {
|
|
135
|
-
this.$baseConfirm(this.$t1(
|
|
136
|
-
let abc = null
|
|
147
|
+
this.$baseConfirm(this.$t1("您确定要导出吗?")).then(() => {
|
|
148
|
+
let abc = null;
|
|
137
149
|
if (abcEnabled) {
|
|
138
150
|
if (isDev) {
|
|
139
151
|
if (!editAuth || !selectTypeAuth) {
|
|
140
|
-
abc = "B"
|
|
152
|
+
abc = "B";
|
|
141
153
|
}
|
|
142
154
|
} else {
|
|
143
|
-
abc = "A"
|
|
155
|
+
abc = "A";
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
158
|
handle(abc);
|
|
@@ -149,15 +161,37 @@ moudule.install = function (Vue) {
|
|
|
149
161
|
};
|
|
150
162
|
};
|
|
151
163
|
|
|
164
|
+
function resolveExtraFileNames(extraFiles, mainFileName) {
|
|
165
|
+
if (!extraFiles || !extraFiles.length) return [];
|
|
166
|
+
return extraFiles.map((file) => {
|
|
167
|
+
if (mainFileName && file.fileName === mainFileName) {
|
|
168
|
+
return {
|
|
169
|
+
...file,
|
|
170
|
+
fileName: `${file.fileName}-content`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return file;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function downloadExtraFiles(extraFiles) {
|
|
178
|
+
if (!extraFiles || !extraFiles.length) return;
|
|
179
|
+
extraFiles.forEach((file, index) => {
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
downloadTxt(file.fileName, file.content);
|
|
182
|
+
}, (index + 1) * 300);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
152
186
|
function downloadTxt(fileName, content) {
|
|
153
187
|
// 创建Blob对象
|
|
154
|
-
const blob = new Blob([content], {type:
|
|
188
|
+
const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
|
|
155
189
|
// 创建URL
|
|
156
190
|
const url = URL.createObjectURL(blob);
|
|
157
191
|
// 创建a标签
|
|
158
|
-
const link = document.createElement(
|
|
192
|
+
const link = document.createElement("a");
|
|
159
193
|
link.href = url;
|
|
160
|
-
link.setAttribute(
|
|
194
|
+
link.setAttribute("download", fileName + ".txt");
|
|
161
195
|
document.body.appendChild(link);
|
|
162
196
|
// 触发下载
|
|
163
197
|
link.click();
|
|
@@ -171,11 +205,11 @@ function download(ippaaapp, uuid) {
|
|
|
171
205
|
let params = {
|
|
172
206
|
// n: fileName
|
|
173
207
|
};
|
|
174
|
-
params[
|
|
208
|
+
params["access_token"] = getToken();
|
|
175
209
|
|
|
176
|
-
let form = document.createElement(
|
|
210
|
+
let form = document.createElement("form");
|
|
177
211
|
|
|
178
|
-
let randomNum =
|
|
212
|
+
let randomNum = new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
179
213
|
let formId = "formId-" + randomNum;
|
|
180
214
|
let formName = "formName-" + randomNum;
|
|
181
215
|
|
|
@@ -185,8 +219,8 @@ function download(ippaaapp, uuid) {
|
|
|
185
219
|
document.body.appendChild(form);
|
|
186
220
|
for (let obj in params) {
|
|
187
221
|
if (params.hasOwnProperty(obj)) {
|
|
188
|
-
let input = document.createElement(
|
|
189
|
-
input.tpye =
|
|
222
|
+
let input = document.createElement("input");
|
|
223
|
+
input.tpye = "hidden";
|
|
190
224
|
input.name = obj;
|
|
191
225
|
input.value = params[obj];
|
|
192
226
|
form.appendChild(input);
|
package/src/components/wf/wf.js
CHANGED
|
@@ -1743,7 +1743,10 @@ wfStartMixin = {
|
|
|
1743
1743
|
(this.wfDefItems = wfDefItems);
|
|
1744
1744
|
this.$set(this.wfStartForm, "modelId", wfDefItems[0].modelId);
|
|
1745
1745
|
if (wfDefItems.length == 1) {
|
|
1746
|
-
if (
|
|
1746
|
+
if (
|
|
1747
|
+
settingConfig.withoutConfrimByOneWf === true ||
|
|
1748
|
+
(this.option && this.option.skipStartConfirm)
|
|
1749
|
+
) {
|
|
1747
1750
|
this.startSubmit();
|
|
1748
1751
|
} else {
|
|
1749
1752
|
let wfStartOperateName =
|
package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<static-content-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:design-state="designState"
|
|
6
|
+
:display-style="field.options.displayStyle"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<el-button
|
|
15
|
+
v-show="isShow"
|
|
16
|
+
class="button-sty"
|
|
17
|
+
:type="field.options.type"
|
|
18
|
+
:size="field.options.size"
|
|
19
|
+
:plain="field.options.plain"
|
|
20
|
+
:round="field.options.round"
|
|
21
|
+
:circle="field.options.circle"
|
|
22
|
+
:icon="field.options.icon"
|
|
23
|
+
:disabled="!designState && field.options.disabled"
|
|
24
|
+
@click="clickHandle"
|
|
25
|
+
>
|
|
26
|
+
{{ getI18nLabel(field.options.label) }}
|
|
27
|
+
</el-button>
|
|
28
|
+
</static-content-wrapper>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import StaticContentWrapper from "./static-content-wrapper";
|
|
33
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
34
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
35
|
+
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "save_submit_wf_button-widget",
|
|
39
|
+
componentName: "FieldWidget",
|
|
40
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
41
|
+
props: {
|
|
42
|
+
field: Object,
|
|
43
|
+
parentWidget: Object,
|
|
44
|
+
parentList: Array,
|
|
45
|
+
indexOfParentList: Number,
|
|
46
|
+
designer: Object,
|
|
47
|
+
designState: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
subFormRowIndex: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: -1,
|
|
54
|
+
},
|
|
55
|
+
subFormColIndex: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: -1,
|
|
58
|
+
},
|
|
59
|
+
subFormRowId: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
components: {
|
|
65
|
+
StaticContentWrapper,
|
|
66
|
+
},
|
|
67
|
+
inject: {
|
|
68
|
+
getHasWf: {
|
|
69
|
+
default: () => () => false,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
isShow() {
|
|
74
|
+
if (this.designState) return true;
|
|
75
|
+
const formRef = this.getFormRef();
|
|
76
|
+
if (!formRef?.formConfig?.wfEnabled) return false;
|
|
77
|
+
if (this.isWfStarted(formRef)) return false;
|
|
78
|
+
return !this.field.options.hidden;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
created() {
|
|
82
|
+
this.registerToRefList();
|
|
83
|
+
this.initEventHandler();
|
|
84
|
+
this.handleOnCreated();
|
|
85
|
+
},
|
|
86
|
+
mounted() {
|
|
87
|
+
this.handleOnMounted();
|
|
88
|
+
},
|
|
89
|
+
beforeDestroy() {
|
|
90
|
+
this.unregisterFromRefList();
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
isWfStarted(formRef) {
|
|
94
|
+
const wfParam = formRef?.wfParam || {};
|
|
95
|
+
return !!(
|
|
96
|
+
wfParam.hasWf ||
|
|
97
|
+
formRef.hasWf ||
|
|
98
|
+
this.getHasWf() ||
|
|
99
|
+
wfParam.wfInfo?.procInstId
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
clickHandle() {
|
|
103
|
+
if (this.designState || this.field.options.disabled || !this.isShow) return;
|
|
104
|
+
this.saveAndSubmitWfHandle();
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style lang="scss" scoped>
|
|
111
|
+
@import "~@/styles/global.scss";
|
|
112
|
+
</style>
|
|
@@ -3976,6 +3976,45 @@ export const businessFields = [
|
|
|
3976
3976
|
tabDeleteEnabled: true,
|
|
3977
3977
|
},
|
|
3978
3978
|
},
|
|
3979
|
+
{
|
|
3980
|
+
type: "save_submit_wf_button",
|
|
3981
|
+
targetType: "button",
|
|
3982
|
+
icon: "button",
|
|
3983
|
+
commonFlag: !0,
|
|
3984
|
+
columnFlag: true,
|
|
3985
|
+
formItemFlag: !1,
|
|
3986
|
+
options: {
|
|
3987
|
+
name: "",
|
|
3988
|
+
label: "保存并提交流程",
|
|
3989
|
+
columnWidth: "200px",
|
|
3990
|
+
size: "",
|
|
3991
|
+
displayStyle: "block",
|
|
3992
|
+
disabled: !1,
|
|
3993
|
+
hidden: !1,
|
|
3994
|
+
type: "success",
|
|
3995
|
+
plain: !1,
|
|
3996
|
+
round: !1,
|
|
3997
|
+
circle: !1,
|
|
3998
|
+
icon: "el-icon-video-play",
|
|
3999
|
+
customClass: "",
|
|
4000
|
+
onCreated: "",
|
|
4001
|
+
onMounted: "",
|
|
4002
|
+
onClick: "this.saveAndSubmitWfHandle();",
|
|
4003
|
+
accessType: "1",
|
|
4004
|
+
saveSubmitWfButton: true,
|
|
4005
|
+
clickBindEvent: null,
|
|
4006
|
+
onBeforeClickButton: null,
|
|
4007
|
+
searchDialogConfig: {
|
|
4008
|
+
...defaultSearchDialogConfig,
|
|
4009
|
+
},
|
|
4010
|
+
...defaultWfConfig,
|
|
4011
|
+
...defaultWidgetShowRuleConfig,
|
|
4012
|
+
hiddenByWf: true,
|
|
4013
|
+
showRuleFlag: 1,
|
|
4014
|
+
showRuleEnabled: 1,
|
|
4015
|
+
showRules: [],
|
|
4016
|
+
},
|
|
4017
|
+
},
|
|
3979
4018
|
{
|
|
3980
4019
|
type: "copy_button",
|
|
3981
4020
|
icon: "button",
|
|
@@ -653,6 +653,10 @@ modules = {
|
|
|
653
653
|
|
|
654
654
|
//处理组件显隐规则
|
|
655
655
|
this.handleWidgetShowRule(widget);
|
|
656
|
+
if (wfParam.hasWf && widget?.options?.saveSubmitWfButton) {
|
|
657
|
+
widget.options.hidden = true;
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
656
660
|
if (wfParam.hasWf) {
|
|
657
661
|
if (!widgetEditOnWf) {
|
|
658
662
|
//有流程,且不匹配流程节点可编辑表单设置信息
|
|
@@ -697,6 +701,10 @@ modules = {
|
|
|
697
701
|
const processWidget = (widget) => {
|
|
698
702
|
if (!widget) return;
|
|
699
703
|
this.handleWidgetShowRule(widget);
|
|
704
|
+
if (wfParam.hasWf && widget?.options?.saveSubmitWfButton) {
|
|
705
|
+
widget.options.hidden = true;
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
700
708
|
if (!wfParam.hasWf || widgetEditOnWf) return;
|
|
701
709
|
this.hanldeWfWidgetNew1(widget);
|
|
702
710
|
if (wfInfo.taskStep === "9999") {
|
|
@@ -828,6 +836,13 @@ modules = {
|
|
|
828
836
|
},
|
|
829
837
|
hanldeWfWidgetNew1(widget) {
|
|
830
838
|
if (!widget) return;
|
|
839
|
+
if (widget?.options?.saveSubmitWfButton) {
|
|
840
|
+
let wfParam = this.wfParam || {};
|
|
841
|
+
if (wfParam.hasWf) {
|
|
842
|
+
widget.options.hidden = true;
|
|
843
|
+
}
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
831
846
|
let flag =
|
|
832
847
|
widget.columnType &&
|
|
833
848
|
["editDelete", "removeTreeRow"].includes(widget.columnType);
|
|
@@ -877,7 +892,7 @@ modules = {
|
|
|
877
892
|
|
|
878
893
|
let handleWfConfigData = (widget, columnOptions) => {
|
|
879
894
|
let options = widget?.options || columnOptions;
|
|
880
|
-
if (!options || !options.wfEdit) return;
|
|
895
|
+
if (!options || !options.wfEdit || options.saveSubmitWfButton) return;
|
|
881
896
|
let wfConfigData = options.wfConfigData || [];
|
|
882
897
|
let flag = false;
|
|
883
898
|
wfConfigData.forEach((item) => {
|
|
@@ -1154,7 +1169,7 @@ modules = {
|
|
|
1154
1169
|
|
|
1155
1170
|
let handleWfConfigData = (widget, columnOptions) => {
|
|
1156
1171
|
let options = widget?.options || columnOptions;
|
|
1157
|
-
if (!options || !options.wfEdit) return;
|
|
1172
|
+
if (!options || !options.wfEdit || options.saveSubmitWfButton) return;
|
|
1158
1173
|
let wfConfigData = options.wfConfigData || [];
|
|
1159
1174
|
let flag = false;
|
|
1160
1175
|
wfConfigData.forEach((item) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import moment from "moment";
|
|
2
2
|
import { saveUserLog } from "@base/api/user";
|
|
3
3
|
import settingConfig from "@/settings";
|
|
4
|
+
import { openStartWfDialog } from "../../../components/wf/wfUtil";
|
|
4
5
|
|
|
5
6
|
let modules = {};
|
|
6
7
|
modules = {
|
|
@@ -109,6 +110,46 @@ modules = {
|
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
},
|
|
113
|
+
saveAndSubmitWfHandle(option) {
|
|
114
|
+
let formRef = this.getFormRef ? this.getFormRef() : this;
|
|
115
|
+
let formConfig = formRef.formConfig;
|
|
116
|
+
let reportTemplate = formRef.reportTemplate;
|
|
117
|
+
let wfParam = formRef.wfParam || {};
|
|
118
|
+
|
|
119
|
+
if (!formConfig?.wfEnabled) return;
|
|
120
|
+
if (
|
|
121
|
+
formRef.hasWf ||
|
|
122
|
+
wfParam.hasWf ||
|
|
123
|
+
wfParam.wfInfo?.procInstId
|
|
124
|
+
) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let confirmText =
|
|
129
|
+
option?.confirmText ||
|
|
130
|
+
option?.config?.confirmText ||
|
|
131
|
+
this.$t1("您确定要保存并提交流程吗?");
|
|
132
|
+
|
|
133
|
+
this.saveDefaultHandle({
|
|
134
|
+
...option,
|
|
135
|
+
config: {
|
|
136
|
+
...option?.config,
|
|
137
|
+
successMsg: option?.config?.successMsg ?? true,
|
|
138
|
+
isConfirm: option?.config?.isConfirm ?? true,
|
|
139
|
+
confirmText: option?.config?.confirmText || confirmText,
|
|
140
|
+
success: (res) => {
|
|
141
|
+
openStartWfDialog(formRef, {
|
|
142
|
+
objId: res.objx,
|
|
143
|
+
wfCode: reportTemplate.objTypeCode,
|
|
144
|
+
formCode: reportTemplate.formCode,
|
|
145
|
+
serviceId: reportTemplate.serviceName,
|
|
146
|
+
skipStartConfirm: true,
|
|
147
|
+
});
|
|
148
|
+
option?.config?.success && option.config.success(res);
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
},
|
|
112
153
|
saveDefaultHandle(option) {
|
|
113
154
|
let formRef = this.getFormRef ? this.getFormRef() : this;
|
|
114
155
|
let formConfig = formRef.formConfig;
|
|
@@ -286,7 +286,9 @@ modules = {
|
|
|
286
286
|
data: [row.id],
|
|
287
287
|
url: USER_PREFIX + "/form_develop/exportFormScript",
|
|
288
288
|
plaintext: 1,
|
|
289
|
-
fileName: row.
|
|
289
|
+
fileName: row.formCode
|
|
290
|
+
? `${row.scriptCode} - ${row.formCode}(script)`
|
|
291
|
+
: `${row.scriptCode}(script)`,
|
|
290
292
|
abcEnabled: true,
|
|
291
293
|
});
|
|
292
294
|
},
|
|
@@ -487,7 +487,7 @@ modules = {
|
|
|
487
487
|
data: [row.id],
|
|
488
488
|
url: USER_PREFIX + "/form_develop/exportFormScript",
|
|
489
489
|
plaintext: 1,
|
|
490
|
-
fileName: row.scriptCode
|
|
490
|
+
fileName: `${row.scriptCode} - ${row.formCode}(script)`,
|
|
491
491
|
abcEnabled: true,
|
|
492
492
|
editAuth: this.currentFormType.editAuth,
|
|
493
493
|
selectTypeAuth: this.currentFormType.selectTypeAuth,
|