cloud-web-corejs 1.0.54-dev.794 → 1.0.54-dev.796
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/formDialog/README.md +32 -6
- package/src/components/luckysheet/dialog.vue +1 -1
- package/src/components/wf/wfButtonName.js +60 -0
- package/src/components/xform/form-designer/designer.js +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +65 -29
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +3 -0
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +111 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +0 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js +253 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +49 -40
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +175 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +20 -5
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +2 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +3 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +5 -11
- package/src/components/xform/form-render/container-item/detail-item.vue +116 -3
- package/src/components/xform/form-render/index.vue +0 -7
- package/src/components/xform/form-render/indexMixin.js +65 -31
- package/src/components/xform/mixins/defaultHandle.js +50 -38
- package/src/components/xform/utils/util.js +7 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +2 -0
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -307
package/package.json
CHANGED
|
@@ -257,10 +257,13 @@ xform 整表模式下,底部按钮可在**表单设计器 → 表单设置 →
|
|
|
257
257
|
- **resolve 语义**:配置了自定义按钮后 resolve `{ action: code, data }`;默认按钮仍是 `data`;取消/关闭仍是 `null`(存量调用不受影响)。
|
|
258
258
|
- 调用方可传 `buttons: [...]`(同结构)覆盖模板配置;readonly 模式只显示"关闭"。
|
|
259
259
|
- 弹框/抽屉共用同一套配置与语义(见下节 $formDrawer)。
|
|
260
|
-
-
|
|
261
|
-
`openFormDialog
|
|
262
|
-
|
|
260
|
+
- **三个壳都吃这份配置**:全局 `$formDialog` / `$formDrawer`,以及表单脚本内部弹框通道
|
|
261
|
+
`openFormDialog`(`xform/form-designer/form-widget/dialog/formDialog.vue`)。
|
|
262
|
+
一份模板配置,三处生效。内部通道收口时回调 `option.onAction(payload, formRef, vm)`
|
|
263
263
|
(不传则仅按 `closeAfter` 关闭,不再走 `option.confirm`——按钮自身的 onClick 脚本即业务处理)。
|
|
264
|
+
> `openFormDrawer` 曾有一个同目录的内部抽屉壳,因零调用方且样式选择器写成 `.el-dialog__body`
|
|
265
|
+
> (el-drawer 下不匹配、内容区没高度)已删除;该方法现委托给全局 `$formDrawer`,
|
|
266
|
+
> 调用签名保持兼容,但 `bodyConfig` / `footerConfig` / `multiple` / `onAction` 四个字段不再生效。
|
|
264
267
|
|
|
265
268
|
## $formDrawer 表单抽屉
|
|
266
269
|
|
|
@@ -306,15 +309,38 @@ const result = await this.$formDrawer({
|
|
|
306
309
|
显式传 `showFooter: true` 才出;`plain` / `select` / `actionButtons` 在此模式下不生效——
|
|
307
310
|
抽屉只作视口,页内行为全部由宿主页负责。抽屉本身仍可 `await`,取消/关闭 resolve `null`。
|
|
308
311
|
|
|
309
|
-
|
|
310
|
-
`this.openFormDrawer({ formCode: "xxx", host: "list", param: {...} })`。
|
|
312
|
+
表单脚本内部弹框通道 `openFormDialog` 同样支持 `host: "list"`。
|
|
311
313
|
弹框形态嵌套层级更深(表单 → 弹框 → 列表页 → 详情),建议配 `dialogConfig: { fullscreen: true }`
|
|
312
|
-
或足够大的 width
|
|
314
|
+
或足够大的 width。抽屉形态直接调全局 `this.$formDrawer({ host: "list" })`
|
|
315
|
+
(`openFormDrawer` 也行,它就是这个方法的薄委托)。
|
|
313
316
|
- **详情必传 `dataId`**:xform 的 `loadDefaultEntityData` 要 `formConfig.entity && dataId && 脚本编码` 三者齐全才发请求加载单据数据;只传 `conditionParam` 不会加载,表单会是空的。
|
|
314
317
|
- **样式上下文**:抽屉内容区套了 `<div id="containt" class="designer-view">`,与 `views/user/form/vform/render.vue`、xform formDialog 一致。全站渲染态样式都挂在这两个钩子上(`style.scss` 的 `#containt .detail-wrap{...}` 与 `.preview-dialog,.designer-view{...}`),不套这层,详情场景会丢:头部右侧按钮的 inline-block(竖排换行)、`.d-item` 右侧 112px 的导航占位(模块导航压住数据表格)、`.detail-wrap` 的 `position:relative`(导航跑去锚 `.el-drawer`,被裁在抽屉外)、模块边框与内边距。
|
|
315
318
|
- **表格铺满高度**:查询表格的 vxe-grid 用 `height="auto"`,按父元素实测高度计算,父链没有确定高度就会塌成一小块。抽屉不在全局 `.dialog-style .el-dialog__body .data-table_height` 选择器下,故由抽屉自己补高度链:模板顶层只有一个查询表格(`data-table` + `isQueryTable`)时自动开启;模板结构特殊(表格嵌在 tab/栅格里,或表单+表格混排)时用 `fillHeight: true/false` 手工指定,`true` 时被撑满的是渲染器根节点与 `.render-form`,表格外层容器仍需自身有高度。
|
|
316
319
|
- 壳与 xform 渲染器均为懒加载(首次调用才加载),xform chunk 与 $formDialog 共享。
|
|
317
320
|
|
|
321
|
+
## 设计器入口:点击绑定事件
|
|
322
|
+
|
|
323
|
+
不写脚本也能打开这两个壳。设计器里选中按钮 / 链接 / 下拉项 / 搜索按钮 → 高级属性 →
|
|
324
|
+
**点击绑定事件** → 「打开表单弹框」或「打开表单抽屉」,下方展开「表单弹框/抽屉配置」
|
|
325
|
+
(存模板 JSON 的 `options.formHostConfig`,弹框与抽屉共用一份,互切不丢配置)。
|
|
326
|
+
|
|
327
|
+
| 配置项 | 说明 |
|
|
328
|
+
|---|---|
|
|
329
|
+
| 表单编码 / 表单编码脚本 | 脚本优先,参数 `(dataId, formCode, rowData)` |
|
|
330
|
+
| 以列表页承载 | 即 `host: "list"` |
|
|
331
|
+
| 打开方式 | 新增(不传 dataId)/ 详情 |
|
|
332
|
+
| 单据ID来源 | 当前控件值 / 指定表单字段 / 当前表格行字段 / 脚本。按钮类控件缺省用行字段(表格操作列场景) |
|
|
333
|
+
| 自定义参数 | 脚本返回对象 → 壳的 `param` |
|
|
334
|
+
| 只读 | 抽屉走 `readonly`(只读态、底部仅「关闭」);弹框走 `disabledMode`(整表禁用、底部按钮不变) |
|
|
335
|
+
| 形态 | 弹框:宽度 / 全屏;抽屉:素身详情 / 尺寸 / 弹出方向 |
|
|
336
|
+
| 关闭后事件 | 参数 `(formRef, result)`。`result` 即壳的收口值——默认按钮是表单数据、配置按钮是 `{action, data}`、取消/关闭是 `null`,脚本据此决定要不要刷新宿主表格。抽屉侧 `formRef` 为 `null` |
|
|
337
|
+
|
|
338
|
+
底部按钮不在这里配——由目标表单模板自己的 `formConfig.actionButtons` 决定(就是上一节那份配置)。
|
|
339
|
+
该动作**不做数据回填、不做选择模式**:要回填/选行请用「打开选择弹框」。
|
|
340
|
+
实现在 `xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js`
|
|
341
|
+
(纯 JS 动作注册表,运行时与设计器共用),方案见
|
|
342
|
+
`docs/点击绑定事件重构与表单弹框抽屉动作方案.md`。
|
|
343
|
+
|
|
318
344
|
## 与既有设施的分工
|
|
319
345
|
|
|
320
346
|
| 场景 | 用什么 |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 流程按钮名:由后台 wf_diy_attribute 的 param18 统一维护,全局拉取一次后缓存。
|
|
3
|
+
* 接口返回形如 {submitBtn: "提交流程", saveSubmitBtn: "保存并提交流程"},未配置时用下面的默认值。
|
|
4
|
+
*/
|
|
5
|
+
import Vue from "vue";
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_SUBMIT_BTN = "提交流程";
|
|
8
|
+
export const DEFAULT_SAVE_SUBMIT_BTN = "保存并提交流程";
|
|
9
|
+
|
|
10
|
+
/* 按钮通常先渲染、接口值后到,所以缓存必须是响应式的,读取方(computed)才能在值回来后自动重算。
|
|
11
|
+
初值留 null 是为了区分「后台没配」与「后台配的正好是默认值」——没配时才轮得到下游兜底。 */
|
|
12
|
+
const wfButtonNames = Vue.observable({
|
|
13
|
+
submitBtn: null,
|
|
14
|
+
saveSubmitBtn: null,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
let pending = null;
|
|
18
|
+
|
|
19
|
+
export function getWfButtonNames() {
|
|
20
|
+
return wfButtonNames;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 拉取按钮名。全局只发一次请求,重复调用复用同一个 promise。
|
|
25
|
+
* @param {Object} vm 任意 Vue 实例(取 $http),不传则退回 window.$vueRoot
|
|
26
|
+
*/
|
|
27
|
+
export function loadWfButtonNames(vm) {
|
|
28
|
+
if (pending) return pending;
|
|
29
|
+
let target = vm || window.$vueRoot;
|
|
30
|
+
if (!target || !target.$http) return Promise.resolve(wfButtonNames);
|
|
31
|
+
pending = new Promise((resolve) => {
|
|
32
|
+
target.$http({
|
|
33
|
+
url: USER_PREFIX + "/wf_diy_attribute/getValue",
|
|
34
|
+
method: "post",
|
|
35
|
+
data: { attributeKey: "param18" },
|
|
36
|
+
success: (res) => {
|
|
37
|
+
let val = res ? res.objx : null;
|
|
38
|
+
if (typeof val === "string") {
|
|
39
|
+
//后台可能存的是 JSON 文本,解析不出就当没配
|
|
40
|
+
try {
|
|
41
|
+
val = JSON.parse(val);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
val = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (val && typeof val === "object") {
|
|
47
|
+
wfButtonNames.submitBtn = val.submitBtn || null;
|
|
48
|
+
wfButtonNames.saveSubmitBtn = val.saveSubmitBtn || null;
|
|
49
|
+
}
|
|
50
|
+
resolve(wfButtonNames);
|
|
51
|
+
},
|
|
52
|
+
fail: () => resolve(wfButtonNames),
|
|
53
|
+
error: () => {
|
|
54
|
+
pending = null; //失败不锁死,下次进流程表单可重试
|
|
55
|
+
resolve(wfButtonNames);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
return pending;
|
|
60
|
+
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
createUUID,
|
|
15
15
|
columnFormatMap,
|
|
16
16
|
} from "../../../components/xform/utils/util";
|
|
17
|
+
import { CLICK_BIND } from "./setting-panel/property-editor/field-button/clickBindActions";
|
|
17
18
|
import {
|
|
18
19
|
containers,
|
|
19
20
|
advancedFields,
|
|
@@ -1471,7 +1472,7 @@ let chartContainers = [],
|
|
|
1471
1472
|
buttonCon3.options.label = "新增";
|
|
1472
1473
|
buttonCon3.options.icon = "el-icon-search";
|
|
1473
1474
|
// buttonCon3.options.onClick = "this.getWidgetRef('" + dataTableCon.options.name + "').addTableData();"
|
|
1474
|
-
buttonCon3.options.clickBindEvent =
|
|
1475
|
+
buttonCon3.options.clickBindEvent = CLICK_BIND.ADD_TABLE_DATA;
|
|
1475
1476
|
Object.assign(buttonCon3.options.addTableDataConfig, {
|
|
1476
1477
|
tableRef: dataTableCon.options.name,
|
|
1477
1478
|
});
|
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
import FormValidators, {
|
|
16
16
|
getRegExp,
|
|
17
17
|
} from "../../../../../components/xform/utils/validators";
|
|
18
|
+
import {
|
|
19
|
+
CLICK_BIND,
|
|
20
|
+
getClickBindAction,
|
|
21
|
+
} from "../../setting-panel/property-editor/field-button/clickBindActions";
|
|
18
22
|
import scriptHttpMixin from "../../../../../components/xform/mixins/scriptHttp";
|
|
19
23
|
import defaultHandleMixin from "../../../../../components/xform/mixins/defaultHandle";
|
|
20
24
|
|
|
@@ -1311,34 +1315,52 @@ modules = {
|
|
|
1311
1315
|
this.handleCustomClickEvent();
|
|
1312
1316
|
}
|
|
1313
1317
|
},
|
|
1318
|
+
/**
|
|
1319
|
+
* 点击绑定事件的上下文。链接模式(flag=true)下所有配置统一从
|
|
1320
|
+
* widgetTextLinkConfig.options 读,不再出现「动作取链接的、前置脚本取主控件的」分裂。
|
|
1321
|
+
*/
|
|
1322
|
+
getClickBindContext(flag) {
|
|
1323
|
+
let linkOptions = this.field.options.widgetTextLinkConfig?.options;
|
|
1324
|
+
let optionModel = flag ? linkOptions || {} : this.field.options;
|
|
1325
|
+
return {
|
|
1326
|
+
vm: this,
|
|
1327
|
+
flag: !!flag,
|
|
1328
|
+
field: this.field,
|
|
1329
|
+
widgetType: this.field.type,
|
|
1330
|
+
optionModel,
|
|
1331
|
+
tableParam: this.tableParam,
|
|
1332
|
+
rowData: this.tableParam?.row || null,
|
|
1333
|
+
formRef: this.getFormRef(),
|
|
1334
|
+
actionValue: optionModel.clickBindEvent,
|
|
1335
|
+
// 链接模式优先用自己的前置脚本,未配则回落主控件(保持存量行为)
|
|
1336
|
+
beforeScript:
|
|
1337
|
+
optionModel.onBeforeClickButton
|
|
1338
|
+
?? this.field.options.onBeforeClickButton,
|
|
1339
|
+
};
|
|
1340
|
+
},
|
|
1314
1341
|
handleCustomClickEvent: function (flag) {
|
|
1315
|
-
let
|
|
1316
|
-
let
|
|
1317
|
-
|
|
1318
|
-
: this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
|
|
1342
|
+
let ctx = this.getClickBindContext(flag);
|
|
1343
|
+
let action = getClickBindAction(ctx.actionValue);
|
|
1344
|
+
if (!action) return;
|
|
1319
1345
|
|
|
1346
|
+
// done 幂等:脚本里调了 done() 又没 return false,也只执行一次
|
|
1347
|
+
let fired = false;
|
|
1320
1348
|
const done = () => {
|
|
1321
|
-
if (
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
} else if (clickBindEvent === "2") {
|
|
1325
|
-
//列表插入数据
|
|
1326
|
-
this.handleAddTableDataEvent(flag);
|
|
1327
|
-
}
|
|
1349
|
+
if (fired) return;
|
|
1350
|
+
fired = true;
|
|
1351
|
+
action.run(ctx);
|
|
1328
1352
|
};
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
)
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
} else {
|
|
1340
|
-
done();
|
|
1353
|
+
|
|
1354
|
+
if (!ctx.beforeScript) return done();
|
|
1355
|
+
let ret = this.handleCustomEvent(ctx.beforeScript, ["done"], [done]);
|
|
1356
|
+
if (ret === false) return; // 脚本显式接管
|
|
1357
|
+
if (ret && typeof ret.then === "function") {
|
|
1358
|
+
ret.then((result) => {
|
|
1359
|
+
if (result !== false) done();
|
|
1360
|
+
});
|
|
1361
|
+
return;
|
|
1341
1362
|
}
|
|
1363
|
+
done();
|
|
1342
1364
|
},
|
|
1343
1365
|
handleAddTableDataEvent(flag) {
|
|
1344
1366
|
let optionModel = !flag
|
|
@@ -1403,7 +1425,7 @@ modules = {
|
|
|
1403
1425
|
|
|
1404
1426
|
let rows = [];
|
|
1405
1427
|
if (this.hasVabsearchFlag()) {
|
|
1406
|
-
if (this.
|
|
1428
|
+
if (this.getMultipleChoices(flag)) {
|
|
1407
1429
|
let fieldKeyName = this.fieldKeyName;
|
|
1408
1430
|
let valueField = trim(this.field.options.valueField || fieldKeyName);
|
|
1409
1431
|
let vabSearchName = trim(
|
|
@@ -1438,7 +1460,7 @@ modules = {
|
|
|
1438
1460
|
formCode: formCode,
|
|
1439
1461
|
rows,
|
|
1440
1462
|
queryParam,
|
|
1441
|
-
multiple:
|
|
1463
|
+
multiple: this.getMultipleChoices(flag),
|
|
1442
1464
|
confirm: (rows) => {
|
|
1443
1465
|
this.handleConfirmSearchDialog(rows, false, flag);
|
|
1444
1466
|
},
|
|
@@ -1448,14 +1470,28 @@ modules = {
|
|
|
1448
1470
|
this.getFormRef().openSearchDialog(dialogParam);
|
|
1449
1471
|
},
|
|
1450
1472
|
handleClearSearchDialog() {
|
|
1473
|
+
// 清除入口只存在于 vabsearch 主控件(onSearchClear),链接模式没有清除按钮
|
|
1451
1474
|
let clickBindEvent = this.field.options.clickBindEvent;
|
|
1452
|
-
if (clickBindEvent ===
|
|
1475
|
+
if (clickBindEvent === CLICK_BIND.SEARCH_DIALOG) {
|
|
1453
1476
|
this.handleConfirmSearchDialog(null, true);
|
|
1454
1477
|
}
|
|
1455
1478
|
},
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1479
|
+
/**
|
|
1480
|
+
* 「是否多选」唯一读取口径。
|
|
1481
|
+
* 搜索类控件(vabsearch/singerSearch/multiSearch)的 multipleChoices 是结构性的
|
|
1482
|
+
* ——它决定字段值是数组还是标量——所以以控件自身的为准;其它控件读选择弹框配置。
|
|
1483
|
+
* 此前开弹框读 searchDialogConfig、回填读 field.options,两个开关不一致时会出现
|
|
1484
|
+
* 「弹框能多选、回填只落一条」。
|
|
1485
|
+
*/
|
|
1486
|
+
getMultipleChoices(flag) {
|
|
1487
|
+
let optionModel = !flag
|
|
1488
|
+
? this.field.options
|
|
1489
|
+
: this.field.options.widgetTextLinkConfig?.options || {};
|
|
1490
|
+
return (
|
|
1491
|
+
this.field.options.multipleChoices
|
|
1492
|
+
?? optionModel.searchDialogConfig?.multipleChoices
|
|
1493
|
+
?? false
|
|
1494
|
+
);
|
|
1459
1495
|
},
|
|
1460
1496
|
hasVabsearchFlag() {
|
|
1461
1497
|
return (
|
package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue
CHANGED
|
@@ -74,6 +74,9 @@ export default {
|
|
|
74
74
|
if (this.designState) return true;
|
|
75
75
|
const formRef = this.getFormRef();
|
|
76
76
|
if (!formRef?.formConfig?.wfEnabled) return false;
|
|
77
|
+
// 配置优先:表单设置里已启用「保存并提交流程」内建按钮时,本遗留组件让位,
|
|
78
|
+
// 否则同一模板会出现两个按钮。组件本身保留,只为老模板兼容。
|
|
79
|
+
if (formRef.formConfig.saveSubmitEnabled === true) return false;
|
|
77
80
|
if (this.isWfStarted(formRef)) return false;
|
|
78
81
|
return !this.field.options.hidden;
|
|
79
82
|
},
|
|
@@ -148,7 +148,11 @@
|
|
|
148
148
|
class="draggable-box"
|
|
149
149
|
v-if="actionButtons.length"
|
|
150
150
|
:list="actionButtons"
|
|
151
|
-
v-bind="{
|
|
151
|
+
v-bind="{
|
|
152
|
+
group: 'actionBtnGroup',
|
|
153
|
+
ghostClass: 'ghost',
|
|
154
|
+
handle: '.drag-option',
|
|
155
|
+
}"
|
|
152
156
|
>
|
|
153
157
|
<li
|
|
154
158
|
v-for="(btn, btnIdx) in actionButtons"
|
|
@@ -189,6 +193,9 @@
|
|
|
189
193
|
</el-form-item>
|
|
190
194
|
</el-collapse-item>
|
|
191
195
|
<el-collapse-item name="3" title="流程信息">
|
|
196
|
+
<!-- 分组按单据的流程生命周期排:基础 → 提交入口 → 提交动作 → 审批过程 → 高级。
|
|
197
|
+
「提交动作」组内的顺序即真实执行顺序:前置脚本 → 确认提示 → 启动时自动保存。 -->
|
|
198
|
+
<div class="wf-group-title">基础</div>
|
|
192
199
|
<el-form-item :label="i18nt('启用流程')">
|
|
193
200
|
<el-switch
|
|
194
201
|
v-model="formConfig.wfEnabled"
|
|
@@ -219,8 +226,67 @@
|
|
|
219
226
|
clearable
|
|
220
227
|
></el-input>
|
|
221
228
|
</div>
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
|
|
230
|
+
<div class="wf-group-title">提交入口(按钮)</div>
|
|
231
|
+
<el-form-item v-if="formConfig.wfEnabled">
|
|
232
|
+
<span slot="label">
|
|
233
|
+
{{ i18nt("启用保存并提交流程") }}
|
|
234
|
+
<el-tooltip effect="light" placement="top">
|
|
235
|
+
<div slot="content" style="line-height: 1.6">
|
|
236
|
+
详情页标题栏内建「保存并提交流程」按钮<br />
|
|
237
|
+
只在新增页显示,编辑态、已启动流程的单据不显示<br />
|
|
238
|
+
按钮名由后台流程自定义属性(param18)统一下发,此处不配
|
|
239
|
+
</div>
|
|
240
|
+
<i class="el-icon-info"></i>
|
|
241
|
+
</el-tooltip>
|
|
242
|
+
</span>
|
|
243
|
+
<el-switch v-model="formConfig.saveSubmitEnabled"></el-switch>
|
|
244
|
+
</el-form-item>
|
|
245
|
+
<el-form-item>
|
|
246
|
+
<span slot="label">
|
|
247
|
+
{{ i18nt("提交流程按钮显隐控制脚本") }}
|
|
248
|
+
<el-tooltip effect="light" placement="top">
|
|
249
|
+
<div slot="content" style="line-height: 1.6">
|
|
250
|
+
控制详情页「提交流程」按钮显隐,return false
|
|
251
|
+
隐藏,不配则显示<br />
|
|
252
|
+
随表单数据实时求值,脚本内只读数据、返回布尔即可,切勿修改数据
|
|
253
|
+
</div>
|
|
254
|
+
<i class="el-icon-info"></i>
|
|
255
|
+
</el-tooltip>
|
|
256
|
+
</span>
|
|
257
|
+
<a
|
|
258
|
+
href="javascript:void(0);"
|
|
259
|
+
class="a-link link-oneLind"
|
|
260
|
+
@click="editFormEventHandler('wfStartBtnShow')"
|
|
261
|
+
>
|
|
262
|
+
<span>{{ formConfig.wfStartBtnShow }}</span>
|
|
263
|
+
<i class="el-icon-edit"></i>
|
|
264
|
+
</a>
|
|
265
|
+
</el-form-item>
|
|
266
|
+
|
|
267
|
+
<div class="wf-group-title">提交动作(按执行先后)</div>
|
|
268
|
+
<el-form-item>
|
|
269
|
+
<span slot="label">
|
|
270
|
+
{{ i18nt("提交前置处理脚本") }}
|
|
271
|
+
<el-tooltip effect="light" placement="top">
|
|
272
|
+
<div slot="content" style="line-height: 1.6">
|
|
273
|
+
「提交流程」「保存并提交流程」共用<br />
|
|
274
|
+
表单校验通过后、确认框之前执行<br />
|
|
275
|
+
return false 中止提交;返回 Promise 则等它 resolve(false 或
|
|
276
|
+
reject 同样中止)<br />
|
|
277
|
+
入参 source:saveSubmit=保存并提交流程,wfStart=提交流程
|
|
278
|
+
</div>
|
|
279
|
+
<i class="el-icon-info"></i>
|
|
280
|
+
</el-tooltip>
|
|
281
|
+
</span>
|
|
282
|
+
<a
|
|
283
|
+
href="javascript:void(0);"
|
|
284
|
+
class="a-link link-oneLind"
|
|
285
|
+
@click="editFormEventHandler('onBeforeSubmitWf')"
|
|
286
|
+
>
|
|
287
|
+
<span>{{ formConfig.onBeforeSubmitWf }}</span>
|
|
288
|
+
<i class="el-icon-edit"></i>
|
|
289
|
+
</a>
|
|
224
290
|
</el-form-item>
|
|
225
291
|
<el-form-item :label="i18nt('流程启动确认提示脚本')">
|
|
226
292
|
<a
|
|
@@ -232,7 +298,11 @@
|
|
|
232
298
|
<i class="el-icon-edit"></i>
|
|
233
299
|
</a>
|
|
234
300
|
</el-form-item>
|
|
301
|
+
<el-form-item :label="i18nt('流程启动时自动保存表单数据')">
|
|
302
|
+
<el-switch v-model="formConfig.wfStartBindSave"></el-switch>
|
|
303
|
+
</el-form-item>
|
|
235
304
|
|
|
305
|
+
<div class="wf-group-title">审批过程</div>
|
|
236
306
|
<el-form-item :label="i18nt('流程通过时自动保存表单数据')">
|
|
237
307
|
<el-switch v-model="formConfig.wfAgreenBindSave"></el-switch>
|
|
238
308
|
</el-form-item>
|
|
@@ -268,6 +338,8 @@
|
|
|
268
338
|
<i class="el-icon-edit"></i>
|
|
269
339
|
</a>
|
|
270
340
|
</el-form-item>
|
|
341
|
+
|
|
342
|
+
<div class="wf-group-title">高级</div>
|
|
271
343
|
<el-form-item :label="i18nt('引用流程的表单编码')">
|
|
272
344
|
<el-input
|
|
273
345
|
type="text"
|
|
@@ -285,7 +357,12 @@
|
|
|
285
357
|
</a>
|
|
286
358
|
</el-form-item>
|
|
287
359
|
</el-collapse-item>
|
|
288
|
-
<el-collapse-item name="4" title="
|
|
360
|
+
<el-collapse-item name="4" title="列表标签页信息(仅列表表单生效)">
|
|
361
|
+
<el-form-item label-width="0">
|
|
362
|
+
<span style="color: #999; font-size: 12px; line-height: 1.6">
|
|
363
|
+
本组配置只从「查询列表页」所用的表单读取,在详情/编辑表单里设置不会生效
|
|
364
|
+
</span>
|
|
365
|
+
</el-form-item>
|
|
289
366
|
<el-form-item :label="i18nt('列表启用详情多标签')">
|
|
290
367
|
<el-switch v-model="formConfig.multiTabEnabled"></el-switch>
|
|
291
368
|
</el-form-item>
|
|
@@ -309,6 +386,9 @@
|
|
|
309
386
|
<el-radio label="closeToList">关闭页签并回列表刷新</el-radio>
|
|
310
387
|
<el-radio label="refreshCurrent">刷新当前页签</el-radio>
|
|
311
388
|
</el-radio-group>
|
|
389
|
+
<div style="color: #999; font-size: 12px; line-height: 1.6">
|
|
390
|
+
详情页「保存并提交」「直接启动流程」成功后的行为,不填默认「刷新当前页签」
|
|
391
|
+
</div>
|
|
312
392
|
</el-form-item>
|
|
313
393
|
</el-collapse-item>
|
|
314
394
|
<el-collapse-item name="5" title="其他标签页信息">
|
|
@@ -1073,6 +1153,8 @@ export default {
|
|
|
1073
1153
|
eventDialogTitleMap: {
|
|
1074
1154
|
globalConfig: "全局参数配置",
|
|
1075
1155
|
wfStartConfirmText: "流程启动确认提示语配置",
|
|
1156
|
+
onBeforeSubmitWf: "提交前置处理脚本配置",
|
|
1157
|
+
wfStartBtnShow: "提交流程按钮显隐控制脚本配置",
|
|
1076
1158
|
wfConfig: "流程自定义配置",
|
|
1077
1159
|
onBeforeCreated: "表单创建前事件配置",
|
|
1078
1160
|
onFormCreated: "表单创建事件配置",
|
|
@@ -1089,9 +1171,13 @@ export default {
|
|
|
1089
1171
|
onFormMounted: "onFormMounted(dataId,formCode) {",
|
|
1090
1172
|
onFormDataChange:
|
|
1091
1173
|
"onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {",
|
|
1092
|
-
wfStartConfirmText:
|
|
1093
|
-
|
|
1094
|
-
|
|
1174
|
+
wfStartConfirmText: "wfStartConfirmText(dataId, formCode, formData) {",
|
|
1175
|
+
onBeforeSubmitWf:
|
|
1176
|
+
"onBeforeSubmitWf(dataId, formCode, formData, source) {",
|
|
1177
|
+
/* 顺序以 indexMixin 的 new Function("formCode","dataId","formData") 为准,
|
|
1178
|
+
不是其他脚本的 (dataId, formCode) 惯例——存量脚本按这个顺序写的,只改提示不动实参 */
|
|
1179
|
+
wfConfig: "wfConfig(formCode, dataId, formData) {",
|
|
1180
|
+
wfStartBtnShow: "wfStartBtnShow(dataId, formCode, formData) {",
|
|
1095
1181
|
globalConfig: "globalConfig(dataId, formCode) {",
|
|
1096
1182
|
//'onFormValidate': 'onFormValidate() {',
|
|
1097
1183
|
},
|
|
@@ -1216,7 +1302,9 @@ $\{wf.starterName\}提交的$\{pm_product_project.product_code\}$\{pm_product_pr
|
|
|
1216
1302
|
},
|
|
1217
1303
|
editActionButton(index) {
|
|
1218
1304
|
this.currentActionButtonIndex = index;
|
|
1219
|
-
this.currentActionButton = deepClone(
|
|
1305
|
+
this.currentActionButton = deepClone(
|
|
1306
|
+
this.formConfig.actionButtons[index]
|
|
1307
|
+
);
|
|
1220
1308
|
this.showActionButtonDialog = true;
|
|
1221
1309
|
},
|
|
1222
1310
|
removeActionButton(index) {
|
|
@@ -1658,6 +1746,21 @@ $\{wf.starterName\}提交的$\{pm_product_project.product_code\}$\{pm_product_pr
|
|
|
1658
1746
|
}
|
|
1659
1747
|
}
|
|
1660
1748
|
|
|
1749
|
+
/* 折叠组内部的二级分组标题,用于把长配置组切成几段(如「流程信息」) */
|
|
1750
|
+
.wf-group-title {
|
|
1751
|
+
margin: 14px 0 8px;
|
|
1752
|
+
padding-left: 8px;
|
|
1753
|
+
border-left: 3px solid #409eff;
|
|
1754
|
+
color: #606266;
|
|
1755
|
+
font-size: 13px;
|
|
1756
|
+
font-weight: 600;
|
|
1757
|
+
line-height: 1.3;
|
|
1758
|
+
|
|
1759
|
+
&:first-child {
|
|
1760
|
+
margin-top: 2px;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1661
1764
|
.small-padding-dialog {
|
|
1662
1765
|
::v-deep .el-dialog__body {
|
|
1663
1766
|
padding: 6px 15px 12px 15px;
|