cloud-web-corejs 1.1.0-dev.30 → 1.1.0-dev.32
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 +5 -5
- package/src/components/bizTab/bizBillDetailMixin.js +2 -0
- package/src/components/mobile/wf/content.vue +33 -28
- package/src/components/wf/content.vue +3 -2
- package/src/components/wf/content2.vue +1 -1
- package/src/components/wf/wf.js +7 -0
- package/src/components/wf/wfActionItems.js +3 -0
- package/src/components/wf/wfTransferEnabled.js +54 -0
- package/src/components/xform/form-designer/designer.js +52 -6
- package/src/components/xform/form-designer/form-widget/field-widget/row-col-select-widget.vue +64 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +13 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +2 -0
- package/src/components/xform/mixins/wfStart.js +2 -0
- package/src/views/user/bill_setting/mixins/wf.js +8 -0
- package/src/views/user/bill_setting/render.vue +1 -1
- package/src/views/demo/bizTab/bill/billConfig.js +0 -41
- package/src/views/demo/bizTab/bill/detail.vue +0 -436
- package/src/views/demo/bizTab/bill/list.vue +0 -288
- package/src/views/demo/bizTab/bill/productDialog.vue +0 -176
- package/src/views/demo/bizTab/simple/billApi.js +0 -123
- package/src/views/demo/bizTab/simple/detail.vue +0 -407
- package/src/views/demo/bizTab/simple/list.vue +0 -217
- package/src/views/demo/bizTab/standalone/index.vue +0 -121
- package/src/views/demo/bizTab/wf/billConfig.js +0 -44
- package/src/views/demo/bizTab/wf/detail.vue +0 -661
- package/src/views/demo/bizTab/wf/list.vue +0 -242
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloud-web-corejs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.32",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vue-cli-service serve",
|
|
7
7
|
"dev:micro": "vue-cli-service serve --port 17527",
|
|
8
|
+
"check:package-resources": "node build/check-package-resources.js",
|
|
9
|
+
"check:minimal-consumer": "node build/check-minimal-consumer-build.js",
|
|
8
10
|
"lint": "eslint --ext .js,.vue src",
|
|
9
11
|
"build:prod": "vue-cli-service build",
|
|
10
12
|
"build:stage": "vue-cli-service build --mode staging",
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
"new": "plop",
|
|
14
16
|
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
|
|
15
17
|
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
|
16
|
-
"test:ci": "npm run lint && npm run test:unit",
|
|
18
|
+
"test:ci": "npm run check:package-resources && npm run check:minimal-consumer && npm run lint && npm run test:unit",
|
|
17
19
|
"updateCorejs": "npm install cloud-web-corejs --registry https://registry.npmjs.org",
|
|
18
20
|
"publishDev": "npm publish --tag dev"
|
|
19
21
|
},
|
|
@@ -175,7 +177,6 @@
|
|
|
175
177
|
"src/components/bizTab",
|
|
176
178
|
"src/api",
|
|
177
179
|
"src/views/bd",
|
|
178
|
-
"src/views/demo",
|
|
179
180
|
"src/views/support",
|
|
180
181
|
"src/views/user",
|
|
181
182
|
"src/views/mobile/user",
|
|
@@ -183,10 +184,9 @@
|
|
|
183
184
|
"src/mixins",
|
|
184
185
|
"src/directive",
|
|
185
186
|
"src/store",
|
|
187
|
+
"src/core-resources",
|
|
186
188
|
"src/styles",
|
|
187
189
|
"src/icons",
|
|
188
|
-
"src/core-resources",
|
|
189
|
-
"src/resources/js",
|
|
190
190
|
"src/lang/index.js",
|
|
191
191
|
"src/lang/locale/en/login.js",
|
|
192
192
|
"src/lang/locale/zh/login.js",
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
isWfUserRangeEnabled,
|
|
44
44
|
loadWfUserRange,
|
|
45
45
|
} from "@base/components/wf/wfUserRange";
|
|
46
|
+
import { loadWfTransferEnabled } from "@base/components/wf/wfTransferEnabled";
|
|
46
47
|
|
|
47
48
|
// wf 组件回调 _handleCallback(flag) 的 flag → 页签行为类型
|
|
48
49
|
const WF_FLAG_KIND = {
|
|
@@ -185,6 +186,7 @@ export default {
|
|
|
185
186
|
//预热,点击路径上的 await 直接命中缓存
|
|
186
187
|
loadWfAutoConfirm(this);
|
|
187
188
|
loadWfUserRange(this);
|
|
189
|
+
loadWfTransferEnabled(this);
|
|
188
190
|
this.checkBillHooks();
|
|
189
191
|
// 登记到宿主:关页签确认要问详情脏没脏、翻单要按 tabName 找回实例
|
|
190
192
|
let host = this.bizTabHost;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
icon="iconfont icon-a-bohui1">{{ $t2('驳回', 'components.wf.reject') }}
|
|
43
43
|
</el-button>
|
|
44
44
|
<el-button type="primary" plain class="btn" @click="openChangeWfForm"
|
|
45
|
-
v-show="(wfInfo.toTransfer===null || wfInfo.toTransfer===undefined) ? wfInfo.toSubmit: wfInfo.toTransfer"
|
|
45
|
+
v-show="transferEnabled && ((wfInfo.toTransfer===null || wfInfo.toTransfer===undefined) ? wfInfo.toSubmit: wfInfo.toTransfer)"
|
|
46
46
|
icon="iconfont icon-zhuanban">{{ $t2('转办', 'components.wf.transfer') }}
|
|
47
47
|
</el-button>
|
|
48
48
|
<el-button type="primary" plain class="btn" @click="openUrgingDialog" v-show="wfInfo.toInterrupt"
|
|
@@ -93,12 +93,12 @@
|
|
|
93
93
|
<div class="tit"><span>{{
|
|
94
94
|
(wfInfo.createDate ? wfInfo.createDate.substring(0, 10) : '') + wfInfo.name
|
|
95
95
|
}}</span></div>
|
|
96
|
-
<iframe
|
|
97
|
-
ref="wfPreviewFrame"
|
|
98
|
-
style="width: 100%;flex:1"
|
|
99
|
-
:src="wfImage"
|
|
100
|
-
@load="fitWorkflowPreview"
|
|
101
|
-
></iframe>
|
|
96
|
+
<iframe
|
|
97
|
+
ref="wfPreviewFrame"
|
|
98
|
+
style="width: 100%;flex:1"
|
|
99
|
+
:src="wfImage"
|
|
100
|
+
@load="fitWorkflowPreview"
|
|
101
|
+
></iframe>
|
|
102
102
|
</el-form>
|
|
103
103
|
</div>
|
|
104
104
|
<span slot="footer" class="dialog-footer">
|
|
@@ -407,6 +407,7 @@ import Vue from "vue";
|
|
|
407
407
|
import settingConfig from "@/settings";
|
|
408
408
|
import commonMixin from "../../../mixins/mobile/common/index";
|
|
409
409
|
import {getToken} from "../../../utils/auth";
|
|
410
|
+
import {isWfTransferEnabled, loadWfTransferEnabled} from "../../wf/wfTransferEnabled";
|
|
410
411
|
|
|
411
412
|
let configUtil = {
|
|
412
413
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
@@ -464,6 +465,9 @@ export default {
|
|
|
464
465
|
let that = this.viewTarget;
|
|
465
466
|
let _hideWf = that._hideWf || that.$attrs._hideWf;
|
|
466
467
|
return _hideWf === true || _hideWf === 'true';
|
|
468
|
+
},
|
|
469
|
+
transferEnabled() {
|
|
470
|
+
return isWfTransferEnabled();
|
|
467
471
|
}
|
|
468
472
|
},
|
|
469
473
|
data() {
|
|
@@ -625,27 +629,27 @@ export default {
|
|
|
625
629
|
mounted() {
|
|
626
630
|
this.init();
|
|
627
631
|
},
|
|
628
|
-
methods: {
|
|
629
|
-
fitWorkflowPreview() {
|
|
630
|
-
/* warm-flow-ui 是独立 iframe,窄屏下默认画布宽于视口,左右节点会被
|
|
631
|
-
它自己的 overflow:hidden 裁掉。复用其「自适应」能力,在数据逐步
|
|
632
|
-
渲染的几个时点重新 fit;跨域部署时访问 document 会抛错,静默跳过。 */
|
|
633
|
-
[0, 300, 800, 1500].forEach((delay) => {
|
|
634
|
-
window.setTimeout(() => {
|
|
635
|
-
try {
|
|
636
|
-
const frame = this.$refs.wfPreviewFrame;
|
|
637
|
-
const buttons = frame?.contentDocument?.querySelectorAll("button") || [];
|
|
638
|
-
const fitButton = Array.from(buttons).find(
|
|
639
|
-
(button) => button.textContent.trim() === "自适应"
|
|
640
|
-
);
|
|
641
|
-
fitButton?.click();
|
|
642
|
-
} catch (e) {
|
|
643
|
-
// 跨域 iframe 无法读取内部 DOM,保留 warm-flow-ui 原有交互。
|
|
644
|
-
}
|
|
645
|
-
}, delay);
|
|
646
|
-
});
|
|
647
|
-
},
|
|
648
|
-
getWfStatusLabel() {
|
|
632
|
+
methods: {
|
|
633
|
+
fitWorkflowPreview() {
|
|
634
|
+
/* warm-flow-ui 是独立 iframe,窄屏下默认画布宽于视口,左右节点会被
|
|
635
|
+
它自己的 overflow:hidden 裁掉。复用其「自适应」能力,在数据逐步
|
|
636
|
+
渲染的几个时点重新 fit;跨域部署时访问 document 会抛错,静默跳过。 */
|
|
637
|
+
[0, 300, 800, 1500].forEach((delay) => {
|
|
638
|
+
window.setTimeout(() => {
|
|
639
|
+
try {
|
|
640
|
+
const frame = this.$refs.wfPreviewFrame;
|
|
641
|
+
const buttons = frame?.contentDocument?.querySelectorAll("button") || [];
|
|
642
|
+
const fitButton = Array.from(buttons).find(
|
|
643
|
+
(button) => button.textContent.trim() === "自适应"
|
|
644
|
+
);
|
|
645
|
+
fitButton?.click();
|
|
646
|
+
} catch (e) {
|
|
647
|
+
// 跨域 iframe 无法读取内部 DOM,保留 warm-flow-ui 原有交互。
|
|
648
|
+
}
|
|
649
|
+
}, delay);
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
getWfStatusLabel() {
|
|
649
653
|
return this.wfStatusMap[this.wfInfo.stat]?.label;
|
|
650
654
|
},
|
|
651
655
|
getWfStatusType() {
|
|
@@ -763,6 +767,7 @@ export default {
|
|
|
763
767
|
},
|
|
764
768
|
initForAll() {
|
|
765
769
|
let that = getTarget(this);
|
|
770
|
+
loadWfTransferEnabled(that);
|
|
766
771
|
this.initWf(() => {
|
|
767
772
|
if (this.wfInfo.procInstId) {
|
|
768
773
|
this.initCurrentTask(this.wfInfo.procInstId, () => {
|
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
class="button-sty"
|
|
46
46
|
@click="openChangeWfForm"
|
|
47
47
|
v-show="
|
|
48
|
-
|
|
48
|
+
transferEnabled &&
|
|
49
|
+
(wfInfo.toTransfer === null || wfInfo.toTransfer === undefined
|
|
49
50
|
? wfInfo.toSubmit
|
|
50
|
-
: wfInfo.toTransfer
|
|
51
|
+
: wfInfo.toTransfer)
|
|
51
52
|
"
|
|
52
53
|
icon="iconfont icon-zhuanban"
|
|
53
54
|
>{{ $t2("转办", "components.wf.transfer") }}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
@click="rejectWfTask('reject')" v-show="wfInfo.toReject">驳回
|
|
33
33
|
</el-button>
|
|
34
34
|
<el-button type="primary" class="btn" :class="{on:operateType == 'transfer'}"
|
|
35
|
-
@click="openChangeWfForm('transfer')" v-show="wfInfo.toSubmit">转办
|
|
35
|
+
@click="openChangeWfForm('transfer')" v-show="transferEnabled && wfInfo.toSubmit">转办
|
|
36
36
|
</el-button>
|
|
37
37
|
<el-button type="primary" class="btn" :class="{on:operateType == 'urging'}"
|
|
38
38
|
@click="openUrgingDialog(null)" v-show="wfInfo.toInterrupt">催办
|
package/src/components/wf/wf.js
CHANGED
|
@@ -5,6 +5,7 @@ import {selectDialogMixins} from "../../mixins/selectDialog";
|
|
|
5
5
|
import {requireViewAsync} from "@base/utils/resolveViewComponent";
|
|
6
6
|
import {getWfButtonNames, loadWfButtonNames} from "./wfButtonName";
|
|
7
7
|
import {isWfAutoConfirm, loadWfAutoConfirm} from "./wfAutoConfirm";
|
|
8
|
+
import {isWfTransferEnabled, loadWfTransferEnabled} from "./wfTransferEnabled";
|
|
8
9
|
|
|
9
10
|
let configUtil = {
|
|
10
11
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
@@ -237,6 +238,10 @@ wfContentMixin = {
|
|
|
237
238
|
let that = this.viewTarget;
|
|
238
239
|
let _hideWf = that._hideWf || that.$attrs._hideWf;
|
|
239
240
|
return _hideWf === true || _hideWf === 'true';
|
|
241
|
+
},
|
|
242
|
+
//转办:param20,未配置默认开启。读 observable,接口回来后按钮条会重算
|
|
243
|
+
transferEnabled() {
|
|
244
|
+
return isWfTransferEnabled();
|
|
240
245
|
}
|
|
241
246
|
},
|
|
242
247
|
data() {
|
|
@@ -555,6 +560,8 @@ wfContentMixin = {
|
|
|
555
560
|
},
|
|
556
561
|
initForAll() {
|
|
557
562
|
let that = getTarget(this);
|
|
563
|
+
//转办 param20:与 initWf 并行拉,未配置默认开
|
|
564
|
+
loadWfTransferEnabled(that);
|
|
558
565
|
this.initWf(() => {
|
|
559
566
|
if (this.wfInfo.procInstId) {
|
|
560
567
|
this.initCurrentTask(this.wfInfo.procInstId, () => {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* buttonType 只在「平铺成独立按钮」时用得上(见 HEADER_STANDALONE_KEYS),
|
|
8
8
|
* 取值与流程模块按钮条里同名按钮保持一致。
|
|
9
9
|
*/
|
|
10
|
+
import { isWfTransferEnabled } from "./wfTransferEnabled";
|
|
10
11
|
|
|
11
12
|
/* 详情标题栏里不收进下拉、直接平铺成独立按钮的操作。
|
|
12
13
|
顺序按 getWfActionItems 的定义序,不按这里的书写序。 */
|
|
@@ -18,6 +19,8 @@ export function getWfActionItems(vm) {
|
|
|
18
19
|
= wfInfo.toTransfer === null || wfInfo.toTransfer === undefined
|
|
19
20
|
? !!wfInfo.toSubmit
|
|
20
21
|
: !!wfInfo.toTransfer;
|
|
22
|
+
//param20 关掉时整项不出,哪怕节点本身允许转办
|
|
23
|
+
toTransfer = isWfTransferEnabled() && toTransfer;
|
|
21
24
|
|
|
22
25
|
return [
|
|
23
26
|
{
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 流程转办开关:后台 wf_diy_attribute 的 param20,全局拉取一次后缓存。
|
|
3
|
+
* 格式 true/false,未配置时默认开启。
|
|
4
|
+
*/
|
|
5
|
+
import Vue from "vue";
|
|
6
|
+
|
|
7
|
+
const wfTransfer = Vue.observable({
|
|
8
|
+
enabled: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
let pending = null;
|
|
12
|
+
|
|
13
|
+
function parseEnabled(val) {
|
|
14
|
+
//只认明确关掉;布尔 false 和字符串 "false" 都关,其余(含没配)一律开
|
|
15
|
+
if (val === false || val === "false") return false;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isWfTransferEnabled() {
|
|
20
|
+
return wfTransfer.enabled !== false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 拉取转办开关。全局只发一次请求,重复调用复用同一个 promise。
|
|
25
|
+
* @param {Object} vm 任意 Vue 实例(取 $http),不传则退回 window.$vueRoot
|
|
26
|
+
* @returns {Promise<Boolean>}
|
|
27
|
+
*/
|
|
28
|
+
export function loadWfTransferEnabled(vm) {
|
|
29
|
+
if (pending) return pending;
|
|
30
|
+
let target = vm || window.$vueRoot;
|
|
31
|
+
if (!target || !target.$http) return Promise.resolve(wfTransfer.enabled);
|
|
32
|
+
let errored = false;
|
|
33
|
+
let request = new Promise((resolve) => {
|
|
34
|
+
target.$http({
|
|
35
|
+
url: USER_PREFIX + "/wf_diy_attribute/getValue",
|
|
36
|
+
method: "post",
|
|
37
|
+
data: { attributeKey: "param20" },
|
|
38
|
+
success: (res) => {
|
|
39
|
+
let val = res ? res.objx : null;
|
|
40
|
+
wfTransfer.enabled = parseEnabled(val);
|
|
41
|
+
resolve(wfTransfer.enabled);
|
|
42
|
+
},
|
|
43
|
+
fail: () => resolve(wfTransfer.enabled),
|
|
44
|
+
error: () => {
|
|
45
|
+
errored = true;
|
|
46
|
+
pending = null; //失败不锁死,下次进流程表单可重试
|
|
47
|
+
resolve(wfTransfer.enabled);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//回调若是同步回来的(拦截器短路、单测桩),上面那句 pending = null 会被下面这句盖掉
|
|
52
|
+
pending = errored ? null : request;
|
|
53
|
+
return request;
|
|
54
|
+
}
|
|
@@ -1756,22 +1756,68 @@ let chartContainers = [],
|
|
|
1756
1756
|
newGridCol.id = "detail-pane-" + tmpId;
|
|
1757
1757
|
newGridCol.options.name = "detailPane" + tmpId;
|
|
1758
1758
|
newGridCol.options.label = "detailPane" + tmpId;
|
|
1759
|
-
// 默认添加一个栅格控件到新 pane 的 widgetList
|
|
1759
|
+
// 默认添加一个栅格控件到新 pane 的 widgetList 中,列数取模板模块配置的行列数
|
|
1760
|
+
let colCount = gridWidget.options.rowColCount || 3;
|
|
1761
|
+
let defaultGrid = this.createDefaultGridOfDetailTemp(colCount);
|
|
1762
|
+
newGridCol.widgetList.push(defaultGrid);
|
|
1763
|
+
gridWidget.panes.push(newGridCol);
|
|
1764
|
+
},
|
|
1765
|
+
|
|
1766
|
+
// 模板模块(detail-temp)自动生成的默认栅格:colCount 列平均分布(24 栏均分)。
|
|
1767
|
+
// autoLayout 标记用于行列数变更时识别并同步这些默认栅格,用户手动拖入的栅格不受影响。
|
|
1768
|
+
createDefaultGridOfDetailTemp(colCount) {
|
|
1760
1769
|
let defaultGrid = baseRefUtil.deepClone(
|
|
1761
1770
|
this.getContainerByType("grid")
|
|
1762
1771
|
);
|
|
1763
1772
|
defaultGrid.id = "grid-" + baseRefUtil.generateId();
|
|
1764
|
-
|
|
1765
|
-
|
|
1773
|
+
defaultGrid.options.autoLayout = true;
|
|
1774
|
+
let span = Math.floor(24 / colCount);
|
|
1775
|
+
for (let i = 0; i < colCount; i++) {
|
|
1766
1776
|
let col = baseRefUtil.deepClone(
|
|
1767
1777
|
this.getContainerByType("grid-col")
|
|
1768
1778
|
);
|
|
1769
1779
|
col.id = "grid-col-" + baseRefUtil.generateId();
|
|
1770
|
-
col.options.span =
|
|
1780
|
+
col.options.span = span;
|
|
1771
1781
|
defaultGrid.cols.push(col);
|
|
1772
1782
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1783
|
+
return defaultGrid;
|
|
1784
|
+
},
|
|
1785
|
+
|
|
1786
|
+
// 行列数下拉变化:写回配置,并同步所有模块里自动生成的默认栅格
|
|
1787
|
+
changeDetailTempRowCol(gridWidget, colCount) {
|
|
1788
|
+
if (!gridWidget || !gridWidget.options) return;
|
|
1789
|
+
gridWidget.options.rowColCount = colCount;
|
|
1790
|
+
let span = Math.floor(24 / colCount);
|
|
1791
|
+
(gridWidget.panes || []).forEach((paneWidget) => {
|
|
1792
|
+
(paneWidget.widgetList || []).forEach((subWidget) => {
|
|
1793
|
+
if (
|
|
1794
|
+
subWidget.type === "grid" &&
|
|
1795
|
+
subWidget.options &&
|
|
1796
|
+
subWidget.options.autoLayout
|
|
1797
|
+
) {
|
|
1798
|
+
let gridCols = subWidget.cols || (subWidget.cols = []);
|
|
1799
|
+
// 已有列统一为新的均分 span(列内已拖入的内容保留)
|
|
1800
|
+
gridCols.forEach((col) => {
|
|
1801
|
+
col.options.span = span;
|
|
1802
|
+
});
|
|
1803
|
+
// 列数不足:补齐新列
|
|
1804
|
+
while (gridCols.length < colCount) {
|
|
1805
|
+
let col = baseRefUtil.deepClone(
|
|
1806
|
+
this.getContainerByType("grid-col")
|
|
1807
|
+
);
|
|
1808
|
+
col.id = "grid-col-" + baseRefUtil.generateId();
|
|
1809
|
+
col.options.span = span;
|
|
1810
|
+
gridCols.push(col);
|
|
1811
|
+
}
|
|
1812
|
+
// 列数超出:仅移除尾部空列,非空列保留,避免丢失已拖入的组件
|
|
1813
|
+
while (gridCols.length > colCount) {
|
|
1814
|
+
let lastCol = gridCols[gridCols.length - 1];
|
|
1815
|
+
if (lastCol.widgetList && lastCol.widgetList.length > 0) break;
|
|
1816
|
+
gridCols.pop();
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
});
|
|
1775
1821
|
},
|
|
1776
1822
|
|
|
1777
1823
|
deleteColOfGrid(gridWidget, colIdx) {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* 行列数下拉控件
|
|
4
|
+
* 用于「模板模块(detail-temp)」属性面板,选择默认栅格的行列布局:
|
|
5
|
+
* 1 = 一行一列(span 24),2 = 一行两列(span 12),3 = 一行三列(span 8)
|
|
6
|
+
* 支持 v-model。
|
|
7
|
+
*/
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
:value="value"
|
|
12
|
+
class="row-col-select"
|
|
13
|
+
:placeholder="placeholder"
|
|
14
|
+
@input="handleInput"
|
|
15
|
+
@change="handleChange"
|
|
16
|
+
>
|
|
17
|
+
<el-option
|
|
18
|
+
v-for="item in rowColOptions"
|
|
19
|
+
:key="item.value"
|
|
20
|
+
:label="item.label"
|
|
21
|
+
:value="item.value"
|
|
22
|
+
></el-option>
|
|
23
|
+
</el-select>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
export default {
|
|
28
|
+
name: "row-col-select-widget",
|
|
29
|
+
props: {
|
|
30
|
+
// 当前行列数:1 / 2 / 3
|
|
31
|
+
value: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 3,
|
|
34
|
+
},
|
|
35
|
+
placeholder: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "请选择",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
rowColOptions: [
|
|
43
|
+
{ label: "一行一列", value: 1 },
|
|
44
|
+
{ label: "一行两列", value: 2 },
|
|
45
|
+
{ label: "一行三列", value: 3 },
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
handleInput(val) {
|
|
51
|
+
this.$emit("input", val)
|
|
52
|
+
},
|
|
53
|
+
handleChange(val) {
|
|
54
|
+
this.$emit("change", val)
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
.row-col-select {
|
|
62
|
+
width: 100%;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
<el-form-item label-width="0">
|
|
4
4
|
<el-divider class="custom-divider">{{ i18nt('designer.setting.columnSetting') }}</el-divider>
|
|
5
5
|
</el-form-item>
|
|
6
|
-
<el-form-item :label="i18nt('隐藏标题栏')">
|
|
6
|
+
<!-- <el-form-item :label="i18nt('隐藏标题栏')">
|
|
7
7
|
<el-switch v-model="optionModel.hideHeader"></el-switch>
|
|
8
|
+
</el-form-item> -->
|
|
9
|
+
<el-form-item :label="i18nt('行列数')">
|
|
10
|
+
<row-col-select-widget v-model="optionModel.rowColCount"
|
|
11
|
+
@change="onRowColChange"></row-col-select-widget>
|
|
8
12
|
</el-form-item>
|
|
9
13
|
<el-form-item :label="i18nt('designer.setting.colsOfGrid')"></el-form-item>
|
|
10
14
|
<el-form-item class="form-item-label-top" label-width="0">
|
|
@@ -36,12 +40,14 @@
|
|
|
36
40
|
<script>
|
|
37
41
|
import Draggable from 'vuedraggable';
|
|
38
42
|
import i18n from "../../../../../../components/xform/utils/i18n"
|
|
43
|
+
import RowColSelectWidget from "../../../form-widget/field-widget/row-col-select-widget"
|
|
39
44
|
|
|
40
45
|
export default {
|
|
41
46
|
name: "detail-temp-editor",
|
|
42
47
|
mixins: [i18n],
|
|
43
48
|
components: {
|
|
44
49
|
Draggable,
|
|
50
|
+
RowColSelectWidget,
|
|
45
51
|
},
|
|
46
52
|
props: {
|
|
47
53
|
designer: Object,
|
|
@@ -49,6 +55,12 @@ export default {
|
|
|
49
55
|
optionModel: Object,
|
|
50
56
|
},
|
|
51
57
|
methods: {
|
|
58
|
+
// 行列数变化:同步已有模块里自动生成的默认栅格列数,并记录历史
|
|
59
|
+
onRowColChange(colCount) {
|
|
60
|
+
this.designer.changeDetailTempRowCol(this.selectedWidget, colCount)
|
|
61
|
+
this.designer.emitHistoryChange()
|
|
62
|
+
},
|
|
63
|
+
|
|
52
64
|
deleteCol(curGrid, colItem) {
|
|
53
65
|
// 传 widget 引用而非下标:列表里混着内容模块和其它容器,下标语义不如引用直白
|
|
54
66
|
this.designer.deletePaneOfDetail(curGrid, colItem)
|
|
@@ -2,6 +2,7 @@ import { openStartWfDialog } from "@base/components/wf/wfUtil";
|
|
|
2
2
|
import { getWfButtonNames, loadWfButtonNames, DEFAULT_SUBMIT_BTN } from "@base/components/wf/wfButtonName";
|
|
3
3
|
import { loadWfAutoConfirm } from "@base/components/wf/wfAutoConfirm";
|
|
4
4
|
import { loadWfUserRange } from "@base/components/wf/wfUserRange";
|
|
5
|
+
import { loadWfTransferEnabled } from "@base/components/wf/wfTransferEnabled";
|
|
5
6
|
import settingConfig from "@/settings";
|
|
6
7
|
|
|
7
8
|
// PC 与 H5 共用启动规则、校验和回调;容器提供 wfStart() 获取各自的流程状态。
|
|
@@ -17,6 +18,7 @@ export default {
|
|
|
17
18
|
loadWfButtonNames(this);
|
|
18
19
|
loadWfAutoConfirm(this);
|
|
19
20
|
loadWfUserRange(this);
|
|
21
|
+
loadWfTransferEnabled(this);
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
// 流程启动按钮:有启动信息、需要按钮(showStartBtn 未显式关闭)、未启动、非预览态才显示。
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {isWfTransferEnabled, loadWfTransferEnabled} from "@base/components/wf/wfTransferEnabled";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
data() {
|
|
3
5
|
return {
|
|
@@ -34,6 +36,11 @@ export default {
|
|
|
34
36
|
|
|
35
37
|
}
|
|
36
38
|
},
|
|
39
|
+
computed: {
|
|
40
|
+
transferEnabled() {
|
|
41
|
+
return isWfTransferEnabled();
|
|
42
|
+
}
|
|
43
|
+
},
|
|
37
44
|
methods: {
|
|
38
45
|
initCurrentPrefix() {
|
|
39
46
|
let url = this.billJson.getUrl;
|
|
@@ -43,6 +50,7 @@ export default {
|
|
|
43
50
|
},
|
|
44
51
|
async initWf(option) {
|
|
45
52
|
this.wfOption = option;
|
|
53
|
+
loadWfTransferEnabled(this);
|
|
46
54
|
let hasWf = false;
|
|
47
55
|
let wfInfo, currentTask, taskParam = {};
|
|
48
56
|
await this.initWfInfo(option).then(res => {
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
icon="iconfont icon-a-bohui1">{{ $t1('驳回') }}
|
|
301
301
|
</el-button>
|
|
302
302
|
<el-button class="btn" type="primary" @click="openChangeWfForm"
|
|
303
|
-
v-if="wfEnabled && ((wfInfo.toTransfer===null || wfInfo.toTransfer===undefined) ? wfInfo.toSubmit: wfInfo.toTransfer)"
|
|
303
|
+
v-if="wfEnabled && transferEnabled && ((wfInfo.toTransfer===null || wfInfo.toTransfer===undefined) ? wfInfo.toSubmit: wfInfo.toTransfer)"
|
|
304
304
|
icon="iconfont icon-zhuanban">{{ $t1('转办') }}
|
|
305
305
|
</el-button>
|
|
306
306
|
<!--end-->
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import prefixConfig from "@/prefixConfig.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* demo B 接的是真实单据:PMD 的「产品变更申请」,走通用 bd_api(getPage / getOne / getList / saveUpdate)。
|
|
5
|
-
* 换成你自己的单据只改这里:表单编码、表名、流程编码、页签标题字段。
|
|
6
|
-
*
|
|
7
|
-
* 请求写法逐条对齐 stdxx 的真实页面 `views/pmd/product/product_change/{list,edit,productItemDialog}.vue`,
|
|
8
|
-
* 那边跑得通这边就跑得通(连 getOne/saveUpdate 不带 formVersion 都是照它来的)。
|
|
9
|
-
*
|
|
10
|
-
* ⚠️ 前置条件(跑不起来先核对这几条):
|
|
11
|
-
* 1. 表单模板 item_change(列表)/ item_change_edit(详情),且配了脚本
|
|
12
|
-
* getPage / getOne / getList / saveUpdate / findItemPage;
|
|
13
|
-
* 2. 表 pcp_item_change / pcp_item_change_item 存在;
|
|
14
|
-
* 3. 流程 product_change_edit 存在,且至少有一个允许改单据(toModify)的节点,
|
|
15
|
-
* 否则「通过自动保存」这条验不到。
|
|
16
|
-
* 真实页面还会写第三张表 pcp_product_properties_change(产品参数),demo 不带它——
|
|
17
|
-
* saveUpdate 只写 data 里出现的表,不传即不动,所以参数不会被清空。
|
|
18
|
-
* 不吃这些前置条件的版本看 ../simple/(前端 mock,不打后台)。
|
|
19
|
-
*
|
|
20
|
-
* ⚠️ 保存是整表提交:saveUpdate 的 data 里带哪几张表,后台就按哪几张表落库。
|
|
21
|
-
* 所以 detail.vue 把子表 pcp_item_change_item 一起读出来、原样带回,
|
|
22
|
-
* 不然拿真实单据试保存会把子表冲掉。你自己的单据有子表时照此办理。
|
|
23
|
-
*/
|
|
24
|
-
export const BILL = {
|
|
25
|
-
prefix: prefixConfig.PMD_PREFIX,
|
|
26
|
-
listFormCode: "item_change", // 列表分页用的表单编码
|
|
27
|
-
formCode: "item_change_edit", // 详情取数/保存用的表单编码
|
|
28
|
-
taBm: "pcp_item_change", // 主表表名
|
|
29
|
-
itemTaBm: "pcp_item_change_item", // 子表表名
|
|
30
|
-
wfCode: "div_form_item_change_edit", // 流程编码
|
|
31
|
-
titleField: "sn", // 页签标题字段(变更单号)
|
|
32
|
-
type: 0, // 业务过滤条件:0 产品变更 / 1 零件变更
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const STATUS_MAP = {
|
|
36
|
-
0: { label: "未审核", cls: "list-tag warning" },
|
|
37
|
-
1: { label: "审核中", cls: "list-tag" },
|
|
38
|
-
2: { label: "已审核", cls: "list-tag success" },
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default BILL;
|