cloud-web-corejs 1.1.0-dev.31 → 1.1.0-dev.33
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/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/widget-panel/widgetsConfig.js +8 -8
- 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/user/wf/wf_diy_attribute/edit.vue +1 -1
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -123,7 +123,7 @@ export const containers = [
|
|
|
123
123
|
}, {
|
|
124
124
|
type: "grid-sub-form",
|
|
125
125
|
category: "container",
|
|
126
|
-
icon: "sub-form",
|
|
126
|
+
icon: "sub-form",
|
|
127
127
|
widgetList: [],
|
|
128
128
|
options: {
|
|
129
129
|
name: "",
|
|
@@ -141,7 +141,7 @@ export const containers = [
|
|
|
141
141
|
{
|
|
142
142
|
type: "grid-col",
|
|
143
143
|
category: "container",
|
|
144
|
-
icon: "grid",
|
|
144
|
+
icon: "grid",
|
|
145
145
|
internal: !0,
|
|
146
146
|
widgetList: [],
|
|
147
147
|
options: {
|
|
@@ -163,7 +163,7 @@ export const containers = [
|
|
|
163
163
|
{
|
|
164
164
|
type: "table-cell",
|
|
165
165
|
category: "container",
|
|
166
|
-
icon: "table",
|
|
166
|
+
icon: "table",
|
|
167
167
|
internal: !0,
|
|
168
168
|
widgetList: [],
|
|
169
169
|
merged: !1,
|
|
@@ -179,7 +179,7 @@ export const containers = [
|
|
|
179
179
|
{
|
|
180
180
|
type: "tab-pane",
|
|
181
181
|
category: "container",
|
|
182
|
-
icon: "tab",
|
|
182
|
+
icon: "tab",
|
|
183
183
|
internal: !0,
|
|
184
184
|
widgetList: [],
|
|
185
185
|
options: {
|
|
@@ -590,7 +590,7 @@ export const containers = [
|
|
|
590
590
|
* 直接拖进 tab-pane(见 docs/详情模块标签承载方案.md) */
|
|
591
591
|
type: "detail-pane",
|
|
592
592
|
category: "container",
|
|
593
|
-
icon: "grid",
|
|
593
|
+
icon: "grid",
|
|
594
594
|
buttonWidgetList: [],
|
|
595
595
|
widgetList: [],
|
|
596
596
|
options: {
|
|
@@ -800,7 +800,7 @@ export const containers = [
|
|
|
800
800
|
{
|
|
801
801
|
type: "h5-card-pane",
|
|
802
802
|
category: "container",
|
|
803
|
-
icon: "tab",
|
|
803
|
+
icon: "tab",
|
|
804
804
|
internal: !0,
|
|
805
805
|
buttonWidgetList: [],
|
|
806
806
|
widgetList: [],
|
|
@@ -830,7 +830,7 @@ export const containers = [
|
|
|
830
830
|
{
|
|
831
831
|
type: "h5-table-cell",
|
|
832
832
|
category: "container",
|
|
833
|
-
icon: "table",
|
|
833
|
+
icon: "table",
|
|
834
834
|
internal: !0,
|
|
835
835
|
widgetList: [],
|
|
836
836
|
merged: !1,
|
|
@@ -3863,7 +3863,7 @@ export const advancedFields = [
|
|
|
3863
3863
|
},
|
|
3864
3864
|
{
|
|
3865
3865
|
type: "dropdown-item",
|
|
3866
|
-
icon: "tab",
|
|
3866
|
+
icon: "tab",
|
|
3867
3867
|
internal: !0,
|
|
3868
3868
|
options: {
|
|
3869
3869
|
name: "",
|
|
@@ -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-->
|