cloud-web-corejs 1.0.54-dev.734 → 1.0.54-dev.736
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/baseTabs/mixins.js +12 -1
- package/src/components/excelExport/exportFieldDialog.vue +40 -18
- package/src/components/excelExport/index.js +17 -3
- package/src/components/excelExport/index.vue +2 -1
- package/src/components/excelExport/mixins.js +113 -32
- package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +7 -22
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +38 -40
- package/src/components/table/vxeFilter/index.js +153 -2
- package/src/components/table/vxeFilter/mixin.js +305 -3
- package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +57 -0
- package/src/components/xform/docs/2026-07 /346/216/222/346/237/245/344/277/256/345/244/215/350/256/260/345/275/225.md" +73 -0
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +108 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +288 -6
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +3 -12
- package/src/components/xform/form-designer/form-widget/indexMixin.js +184 -2
- package/src/components/xform/form-designer/indexMixin.js +0 -1
- package/src/components/xform/form-designer/refMixinDesign.js +27 -1
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +357 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/showViewButton-editor.vue +29 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +639 -15
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +282 -1115
- package/src/components/xform/form-render/container-item/data-table-mixin.js +29 -7
- package/src/components/xform/form-render/dynamicDialogRender.js +238 -3
- package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
- package/src/components/xform/form-render/indexMixin.js +21 -431
- package/src/components/xform/form-render/refMixin.js +32 -1
- package/src/components/xform/mixins/defaultHandle.js +2 -2
- package/src/components/xform/utils/dynamicSchemaUtil.js +46 -0
- package/src/components/xform/utils/validators.js +186 -2
- package/src/utils/componentDialog.js +322 -0
- package/src/views/user/form/vform/render.vue +4 -21
- package/src/views/user/form/view/list.vue +13 -9
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +0 -971
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +0 -408
- package/src/components/xform/utils/formHttp.js +0 -162
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
title="单据列表"
|
|
4
|
-
:append-to-body="true"
|
|
5
|
-
:modal-append-to-body="true"
|
|
6
|
-
:close-on-click-modal="falseValue"
|
|
7
|
-
:visible.sync="showDialog"
|
|
8
|
-
:modal="falseValue"
|
|
9
|
-
custom-class="dialog-style list-dialog dialog-checkbox pd_0"
|
|
10
|
-
width="1200px"
|
|
11
|
-
@close="dialogClose"
|
|
12
|
-
v-el-drag-dialog
|
|
13
|
-
v-el-dialog-center
|
|
14
|
-
>
|
|
15
|
-
<div class="cont" style="height:450px">
|
|
16
|
-
<vxe-grid
|
|
17
|
-
class="is-pointer"
|
|
18
|
-
ref="table-m1"
|
|
19
|
-
v-bind="vxeOption"
|
|
20
|
-
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
|
21
|
-
@custom="$vxeTableUtil.customHandle"
|
|
22
|
-
@checkbox-change="addDataTable"
|
|
23
|
-
@checkbox-all="checkAll"
|
|
24
|
-
@cell-dblclick="checkWithSubmit"
|
|
25
|
-
>
|
|
26
|
-
<template #form>
|
|
27
|
-
<div class="clearfix screen-btns">
|
|
28
|
-
<div class="fr">
|
|
29
|
-
<vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
|
|
30
|
-
plain>重置
|
|
31
|
-
</vxe-button>
|
|
32
|
-
<vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">搜索</vxe-button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<template v-if="searchFields.length>0">
|
|
36
|
-
<vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
|
|
37
|
-
@submit="searchEvent" @reset="searchEvent">
|
|
38
|
-
<vxe-form-item v-for="(item,index) in searchFields"
|
|
39
|
-
:key="index" :title="item.label+':'">
|
|
40
|
-
<template v-slot>
|
|
41
|
-
<el-input v-model="formData[item.prop]" size="small" clearable/>
|
|
42
|
-
</template>
|
|
43
|
-
</vxe-form-item>
|
|
44
|
-
</vxe-form>
|
|
45
|
-
</template>
|
|
46
|
-
</template>
|
|
47
|
-
</vxe-grid>
|
|
48
|
-
</div>
|
|
49
|
-
<label id="labBtn" class="transverse">
|
|
50
|
-
<div class="icon">
|
|
51
|
-
<i class="el-icon-more"></i>
|
|
52
|
-
<i class="el-icon-more"></i>
|
|
53
|
-
</div>
|
|
54
|
-
</label>
|
|
55
|
-
<div class="multipleChoice">
|
|
56
|
-
<el-tooltip :enterable="false" effect="dark" :content="$t1('全部删除')" placement="top"><a class="allDel icon-quanbushanchu"
|
|
57
|
-
@click="clearChecked()"></a>
|
|
58
|
-
</el-tooltip>
|
|
59
|
-
<div class="list">
|
|
60
|
-
<div class="item" v-for="(checkRow, index) in checkRows" :key="'c'+index">
|
|
61
|
-
<p>{{ checkRow[showFormField] }}</p>
|
|
62
|
-
<a class="el-icon-close" @click="clearTable1Select(index)"></a>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
<span slot="footer" class="dialog-footer">
|
|
67
|
-
<span class="fl tips" v-if="!selectMulti">{{ $t1('注:双击确认选择(单选)') }}</span>
|
|
68
|
-
<el-button type="primary" plain class="button-sty" @click="dialogClose">
|
|
69
|
-
<i class="el-icon-close el-icon"></i>
|
|
70
|
-
{{ $t2('取 消', 'system.button.cancel2') }}
|
|
71
|
-
</el-button>
|
|
72
|
-
<el-button type="primary" @click="dialogPrimary" class="button-sty">
|
|
73
|
-
<i class="el-icon-check el-icon"></i>
|
|
74
|
-
{{ $t2('确 定', 'system.button.confirm2') }}
|
|
75
|
-
</el-button>
|
|
76
|
-
</span>
|
|
77
|
-
</el-dialog>
|
|
78
|
-
</template>
|
|
79
|
-
|
|
80
|
-
<script>
|
|
81
|
-
import {selectDialogMixins} from '../../../../../mixins/selectDialog/index.js';
|
|
82
|
-
|
|
83
|
-
export default {
|
|
84
|
-
name: "vabSearchDialog",
|
|
85
|
-
props: ['visiable', 'multi', 'rows', 'param', 'formCode', 'showFormField', 'widget'],
|
|
86
|
-
mixins: [selectDialogMixins],
|
|
87
|
-
inject: ['scriptHttp'],
|
|
88
|
-
created() {
|
|
89
|
-
this.initSetting();
|
|
90
|
-
this.checkField = this.showFormField;
|
|
91
|
-
},
|
|
92
|
-
mounted() {
|
|
93
|
-
this.initTableM1();
|
|
94
|
-
},
|
|
95
|
-
data() {
|
|
96
|
-
var that = this;
|
|
97
|
-
return {
|
|
98
|
-
showDialog: true,
|
|
99
|
-
falseValue: false,
|
|
100
|
-
selectMulti: true,
|
|
101
|
-
formData: {},
|
|
102
|
-
vxeOption: {},
|
|
103
|
-
formInsListField0DTOs: [],
|
|
104
|
-
formInsListField1DTOs: [],
|
|
105
|
-
targetFormTemplate: null,
|
|
106
|
-
formJson: null,
|
|
107
|
-
tableColumns: [],
|
|
108
|
-
searchFields: [],
|
|
109
|
-
tableConfig: {},
|
|
110
|
-
checkField: null,
|
|
111
|
-
filedKey: 'dialogConfig'
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
methods: {
|
|
115
|
-
searchEvent() {
|
|
116
|
-
this.$refs['table-m1'].commitProxy('reload');
|
|
117
|
-
},
|
|
118
|
-
resetEvent() {
|
|
119
|
-
this.formData = {};
|
|
120
|
-
this.$refs['table-m1'].commitProxy('reload');
|
|
121
|
-
},
|
|
122
|
-
async initTableM1() {
|
|
123
|
-
let that = this;
|
|
124
|
-
let tableRef = 'table-m1';
|
|
125
|
-
let syncColumns = [];
|
|
126
|
-
await this.createColumns().then(res => {
|
|
127
|
-
syncColumns = res;
|
|
128
|
-
});
|
|
129
|
-
this.checkField = this.tableConfig.showFormField || this.showFormField || 'id';
|
|
130
|
-
let defaultPath = USER_PREFIX + '/form_ins/listPage';
|
|
131
|
-
let path = this.tableConfig.url || defaultPath;
|
|
132
|
-
|
|
133
|
-
let optionModel = this.widget.options;
|
|
134
|
-
let targetFormConfig = this.targetFormConfig;
|
|
135
|
-
let isScriptEnabled = false;
|
|
136
|
-
let scriptUuid = null;
|
|
137
|
-
let scriptUuid2 = null;
|
|
138
|
-
let returnType = 0;
|
|
139
|
-
if (this.targetFormTemplate) {
|
|
140
|
-
let gridConfig = targetFormConfig[this.filedKey] || {};
|
|
141
|
-
isScriptEnabled = !!gridConfig.isLoadDataByAccess && !!gridConfig.scriptUuid;
|
|
142
|
-
scriptUuid = gridConfig.scriptUuid;
|
|
143
|
-
scriptUuid2 = gridConfig.scriptUuid2;
|
|
144
|
-
returnType = isScriptEnabled ? gridConfig.accessReturnType : 1;
|
|
145
|
-
} else {
|
|
146
|
-
isScriptEnabled = !!optionModel.isLoadDataByAccess && !!optionModel.scriptUuid;
|
|
147
|
-
scriptUuid = optionModel.scriptUuid;
|
|
148
|
-
scriptUuid2 = optionModel.scriptUuid2;
|
|
149
|
-
returnType = isScriptEnabled ? optionModel.accessReturnType : 1;
|
|
150
|
-
}
|
|
151
|
-
if(returnType===null || returnType===undefined){
|
|
152
|
-
returnType = 1;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
let tableOption = {
|
|
156
|
-
vue: that,
|
|
157
|
-
tableRef: tableRef,
|
|
158
|
-
tableName: 'user-form_form_ins_dialog-m1',
|
|
159
|
-
path: path,
|
|
160
|
-
param: () => {
|
|
161
|
-
let customParam = this.getCustomParam();
|
|
162
|
-
let condition = {
|
|
163
|
-
...this.formData,
|
|
164
|
-
...this.param,
|
|
165
|
-
...customParam
|
|
166
|
-
}
|
|
167
|
-
Object.keys(condition).forEach(key => {
|
|
168
|
-
if (condition[key] === "" || condition[key] === null) {
|
|
169
|
-
delete condition[key]
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
if (path == defaultPath) {
|
|
173
|
-
return {
|
|
174
|
-
formCode: this.formCode,
|
|
175
|
-
condition: condition
|
|
176
|
-
};
|
|
177
|
-
} else {
|
|
178
|
-
return {
|
|
179
|
-
...condition
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
columns: [
|
|
185
|
-
{type: 'checkbox', fixed: 'left', width: 48, resizable: false},
|
|
186
|
-
...syncColumns,
|
|
187
|
-
{
|
|
188
|
-
width: 47,
|
|
189
|
-
fixed: 'right',
|
|
190
|
-
title: '',
|
|
191
|
-
sortable: false
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
config: {
|
|
195
|
-
checkboxConfig: {
|
|
196
|
-
checkStrictly: true,
|
|
197
|
-
showHeader: this.selectMulti,
|
|
198
|
-
trigger: 'row'
|
|
199
|
-
},
|
|
200
|
-
proxyConfig: {
|
|
201
|
-
props: {
|
|
202
|
-
result: returnType === 1 ? 'objx.records' : 'objx', // 配置响应结果列表字段
|
|
203
|
-
total: returnType === 1 ? 'objx.total' : 'objx.length' // 配置响应结果总页数字段
|
|
204
|
-
},
|
|
205
|
-
ajax: {
|
|
206
|
-
// 接收 Promise 对象
|
|
207
|
-
query: ({page, sorts, filters, form}) => {
|
|
208
|
-
if (!path) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
let formData = tableOption.param ? tableOption.param() || {} : {};
|
|
213
|
-
const queryParams = Object.assign({}, formData);
|
|
214
|
-
if (isScriptEnabled) {
|
|
215
|
-
let condition = queryParams.condition
|
|
216
|
-
delete queryParams.condition;
|
|
217
|
-
delete queryParams.formCode;
|
|
218
|
-
Object.assign(queryParams, condition);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// 处理排序条件
|
|
222
|
-
const firstSort = sorts[0];
|
|
223
|
-
if (firstSort) {
|
|
224
|
-
queryParams.sort = firstSort.property;
|
|
225
|
-
queryParams.order = firstSort.order;
|
|
226
|
-
}
|
|
227
|
-
// 处理筛选条件
|
|
228
|
-
filters.forEach(({property, values}) => {
|
|
229
|
-
queryParams[property] = values.join(",");
|
|
230
|
-
});
|
|
231
|
-
if (page.pageSize !== undefined) {
|
|
232
|
-
queryParams["size"] = `${page.pageSize}`;
|
|
233
|
-
queryParams["current"] = `${page.currentPage}`;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
var $grid = this.$refs[tableRef];
|
|
237
|
-
let isQueryAllPage = $grid.isQueryAllPage;
|
|
238
|
-
let pathStr1 = "";
|
|
239
|
-
if (isQueryAllPage === false) {
|
|
240
|
-
queryParams.searchCount = false;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var reqPath = typeof path == "function" ? path() : path;
|
|
244
|
-
|
|
245
|
-
let toDo = (res) => {
|
|
246
|
-
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
247
|
-
if (tableOption.callback) {
|
|
248
|
-
that.$nextTick(() => {
|
|
249
|
-
setTimeout(function () {
|
|
250
|
-
tableOption.callback(rows);
|
|
251
|
-
}, 0);
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return new Promise((resolve, reject) => {
|
|
257
|
-
if (isScriptEnabled) {
|
|
258
|
-
let option1 = this.$baseLodash.cloneDeep(optionModel);
|
|
259
|
-
option1.scriptUuid = scriptUuid;
|
|
260
|
-
option1.scriptUuid2 = scriptUuid2;
|
|
261
|
-
this.scriptHttp({
|
|
262
|
-
options: option1,
|
|
263
|
-
params: queryParams,
|
|
264
|
-
targetFormTemplate: this.targetFormTemplate,
|
|
265
|
-
isLoading: false,
|
|
266
|
-
callback: (res) => {
|
|
267
|
-
resolve(res);
|
|
268
|
-
if (res.type == "success") {
|
|
269
|
-
toDo(res);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
} else {
|
|
274
|
-
that.$http({
|
|
275
|
-
url: reqPath,
|
|
276
|
-
method: "post",
|
|
277
|
-
data: queryParams,
|
|
278
|
-
callback: (res) => {
|
|
279
|
-
resolve(res);
|
|
280
|
-
if (res.type == "success") {
|
|
281
|
-
toDo(res);
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
error: (error) => {
|
|
285
|
-
reject(error);
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
|
296
|
-
that.vxeOption = opts;
|
|
297
|
-
});
|
|
298
|
-
},
|
|
299
|
-
async createColumns() {
|
|
300
|
-
await this.getFormTemplate();
|
|
301
|
-
await this.getListFields();
|
|
302
|
-
|
|
303
|
-
let formField = this.formField;
|
|
304
|
-
return this.tableColumns.map((row, index) => {
|
|
305
|
-
let column = {
|
|
306
|
-
title: row.label,
|
|
307
|
-
field: row.prop,
|
|
308
|
-
width: 150
|
|
309
|
-
}
|
|
310
|
-
if (index === 0) {
|
|
311
|
-
column.fixed = 'left';
|
|
312
|
-
}
|
|
313
|
-
return column;
|
|
314
|
-
})
|
|
315
|
-
},
|
|
316
|
-
async getListFields() {
|
|
317
|
-
if (!this.formCode) return;
|
|
318
|
-
return this.$http({
|
|
319
|
-
url: USER_PREFIX + '/form_ins/getListFields',
|
|
320
|
-
method: `post`,
|
|
321
|
-
data: {stringOne: this.formCode},
|
|
322
|
-
isLoading: true,
|
|
323
|
-
loadingTarget: document.body,
|
|
324
|
-
// modalStrictly: true,
|
|
325
|
-
success: res => {
|
|
326
|
-
let formInsListFieldDTOs = res.objx || [];
|
|
327
|
-
this.formInsListField0DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 0);
|
|
328
|
-
this.formInsListField1DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 1);
|
|
329
|
-
|
|
330
|
-
if (!this.tableColumns.length) {
|
|
331
|
-
this.tableColumns = this.formInsListField0DTOs.map(row => {
|
|
332
|
-
return {
|
|
333
|
-
label: row.fieldDesc,
|
|
334
|
-
prop: row.fieldName,
|
|
335
|
-
width: 150
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
if (!this.searchFields.length) {
|
|
340
|
-
this.searchFields = this.formInsListField1DTOs.map(row => {
|
|
341
|
-
return {
|
|
342
|
-
label: row.fieldDesc,
|
|
343
|
-
prop: row.fieldName
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
},
|
|
350
|
-
async getFormTemplate() {
|
|
351
|
-
let options = this.widget.options;
|
|
352
|
-
let customGridConfig = options[this.filedKey] || {};
|
|
353
|
-
this.customGridConfig = customGridConfig
|
|
354
|
-
let searchField0s = customGridConfig && customGridConfig.searchFields ? customGridConfig.searchFields : [];
|
|
355
|
-
let tableColumn0s = customGridConfig && customGridConfig.tableColumns ? customGridConfig.tableColumns : [];
|
|
356
|
-
if (!this.formCode) {
|
|
357
|
-
this.searchFields = searchField0s;
|
|
358
|
-
this.tableColumns = tableColumn0s;
|
|
359
|
-
this.tableConfig = customGridConfig;
|
|
360
|
-
this.targetFormTemplate = null
|
|
361
|
-
this.targetFormConfig = null;
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
return this.$http({
|
|
365
|
-
url: USER_PREFIX + `/formTemplate/getByFormCode`,
|
|
366
|
-
method: `post`,
|
|
367
|
-
data: {
|
|
368
|
-
stringOne: this.formCode
|
|
369
|
-
},
|
|
370
|
-
isLoading: true,
|
|
371
|
-
loadingTarget: document.body,
|
|
372
|
-
success: res => {
|
|
373
|
-
let targetFormTemplate = res.objx || {};
|
|
374
|
-
let formJson = targetFormTemplate.formViewContent ? JSON.parse(targetFormTemplate.formViewContent) : {};
|
|
375
|
-
let formConfig = formJson.formConfig;
|
|
376
|
-
this.targetFormTemplate = res.objx ? targetFormTemplate : null
|
|
377
|
-
this.targetFormConfig = formConfig;
|
|
378
|
-
|
|
379
|
-
let gridConfig = formConfig[this.filedKey] || {}
|
|
380
|
-
|
|
381
|
-
let searchFields = gridConfig.searchFields || []
|
|
382
|
-
let tableColumns = gridConfig.tableColumns || [];
|
|
383
|
-
searchFields = searchFields.filter(item => {
|
|
384
|
-
return !!item.prop && !!item.label;
|
|
385
|
-
});
|
|
386
|
-
this.tableColumns = tableColumns;
|
|
387
|
-
this.searchFields = searchFields;
|
|
388
|
-
|
|
389
|
-
let tableConfig = {};
|
|
390
|
-
Object.assign(tableConfig, gridConfig, customGridConfig)
|
|
391
|
-
this.tableConfig = tableConfig;
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
},
|
|
395
|
-
getCustomParam() {
|
|
396
|
-
let tableConfig = this.tableConfig
|
|
397
|
-
if (!!tableConfig.searchParams) {
|
|
398
|
-
var e = new Function(tableConfig.searchParams);
|
|
399
|
-
return e.call(this);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
</script>
|
|
405
|
-
|
|
406
|
-
<style scoped>
|
|
407
|
-
|
|
408
|
-
</style>
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
// import {initWf} from '../../../components/wf/wfUtil'
|
|
2
|
-
// import {getReportGlobalMap} from "../../../components/xform/utils/util";
|
|
3
|
-
import {decrypt} from "@base/utils/aes";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let modules = {};
|
|
7
|
-
modules = {
|
|
8
|
-
methods: {
|
|
9
|
-
/*formScriptHttp(opts){
|
|
10
|
-
return this.formHttp({
|
|
11
|
-
...opts
|
|
12
|
-
});
|
|
13
|
-
},*/
|
|
14
|
-
handleDecryptData(data) {
|
|
15
|
-
if (data) {
|
|
16
|
-
if (Array.isArray(data)) {
|
|
17
|
-
data.forEach(item => {
|
|
18
|
-
this.handleDecryptData(item)
|
|
19
|
-
})
|
|
20
|
-
} else if (Object.prototype.toString.call(data) === "[object Object]") {
|
|
21
|
-
Object.keys(data).forEach(key => {
|
|
22
|
-
|
|
23
|
-
let value = data[key];
|
|
24
|
-
if (value !== null && value !== undefined) {
|
|
25
|
-
if (Object.prototype.toString.call(data[key]) === "[object String]") {
|
|
26
|
-
let str = "ATEN*-";
|
|
27
|
-
if (value.startsWith(str)) {
|
|
28
|
-
data[key] = decrypt(value.slice(str.length));
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
this.handleDecryptData(data[key])
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
} else if (Object.prototype.toString.call(data) === "[object String]") {
|
|
36
|
-
let str = "ATEN*-";
|
|
37
|
-
if (data.startsWith(str)) {
|
|
38
|
-
data = decrypt(data.slice(str.length));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return data;
|
|
43
|
-
},
|
|
44
|
-
getHttpTarget() {
|
|
45
|
-
return this.getFormRef ? this.getFormRef() : this;
|
|
46
|
-
},
|
|
47
|
-
formHttp(opts) {
|
|
48
|
-
let data = opts.data;
|
|
49
|
-
let scriptCode = opts.scriptCode ? opts.scriptCode.trim() : null;
|
|
50
|
-
let formCode = opts.formCode ? opts.formCode.trim() : null;
|
|
51
|
-
let isLoading = opts.isLoading ?? true;
|
|
52
|
-
let success = opts.success;
|
|
53
|
-
let fail = opts.fail;
|
|
54
|
-
let error = opts.error;
|
|
55
|
-
|
|
56
|
-
let that = this;
|
|
57
|
-
// let reportTemplate = that.getFormRef ? that.getFormRef().reportTemplate : that.reportTemplate;
|
|
58
|
-
if (scriptCode && !formCode) {
|
|
59
|
-
let arr = scriptCode.split("/").filter(item => item)
|
|
60
|
-
if (arr.length > 1) {
|
|
61
|
-
formCode = arr[0];
|
|
62
|
-
scriptCode = arr[1];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
delete opts.data
|
|
68
|
-
delete opts.scriptCode
|
|
69
|
-
delete opts.formCode
|
|
70
|
-
delete opts.isLoading
|
|
71
|
-
delete opts.success
|
|
72
|
-
delete opts.fail
|
|
73
|
-
delete opts.error
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let getReqUrl = (callback) => {
|
|
77
|
-
|
|
78
|
-
if (!opts.url) {
|
|
79
|
-
this.getHttpTarget().$http({
|
|
80
|
-
aes: true,
|
|
81
|
-
url: USER_PREFIX + `/formScript/getServiceName`,
|
|
82
|
-
method: `post`,
|
|
83
|
-
data: {
|
|
84
|
-
formCode,
|
|
85
|
-
scriptCode
|
|
86
|
-
},
|
|
87
|
-
isLoading,
|
|
88
|
-
// loadingTarget: this.getLoadingTarget(),
|
|
89
|
-
// modalStrictly: true,
|
|
90
|
-
success: res => {
|
|
91
|
-
let serviceName = res.objx;
|
|
92
|
-
if (serviceName) {
|
|
93
|
-
let url = `/${searviceName}/bd_api/${formCode}/${scriptCode}`;
|
|
94
|
-
callback(url)
|
|
95
|
-
} else {
|
|
96
|
-
this.$baseAlert("服务名不存在")
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
callback(opts.url)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
let toDo = () => {
|
|
106
|
-
return new Promise((resolve, reject) => {
|
|
107
|
-
getReqUrl(url => {
|
|
108
|
-
let reqData;
|
|
109
|
-
reqData = data;
|
|
110
|
-
|
|
111
|
-
let reportGlobalMap = {};
|
|
112
|
-
// let url = `/${searviceName}/bd_api/${formCode}/${scriptCode}`;
|
|
113
|
-
// let opts.vue
|
|
114
|
-
return opts.vue.$http({
|
|
115
|
-
// aes: true,
|
|
116
|
-
url: url,
|
|
117
|
-
method: `post`,
|
|
118
|
-
// loadingTarget: this.getLoadingTarget(),
|
|
119
|
-
isLoading,
|
|
120
|
-
...opts,
|
|
121
|
-
data: {
|
|
122
|
-
// scriptCode: scriptCode,
|
|
123
|
-
fixeData: reportGlobalMap,
|
|
124
|
-
...reqData
|
|
125
|
-
},
|
|
126
|
-
success: res => {
|
|
127
|
-
if (res.objx) {
|
|
128
|
-
res.objx = this.handleDecryptData(res.objx);
|
|
129
|
-
}
|
|
130
|
-
if (opts.successMsg) {
|
|
131
|
-
this.$message({
|
|
132
|
-
message: res.content,
|
|
133
|
-
type: 'success',
|
|
134
|
-
duration: 1000
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
success && success(res);
|
|
138
|
-
resolve(res);
|
|
139
|
-
},
|
|
140
|
-
fail: res => {
|
|
141
|
-
fail && fail(res);
|
|
142
|
-
resolve(res);
|
|
143
|
-
},
|
|
144
|
-
error: e => {
|
|
145
|
-
error && error(e);
|
|
146
|
-
reject(e);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
}
|
|
152
|
-
if (opts.isConfirm) {
|
|
153
|
-
this.$baseConfirm(opts.confirmText).then(() => {
|
|
154
|
-
return toDo();
|
|
155
|
-
});
|
|
156
|
-
} else {
|
|
157
|
-
return toDo();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
export default modules;
|