@zhijiancloud/bpm 0.0.5 → 0.0.7
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/components/api/batch-loader.js +61 -0
- package/components/api/index.js +108 -0
- package/components/css/bpmAudit.less +13 -0
- package/components/css/bpmMulFile.less +13 -5
- package/components/css/bpmSelectEntranceForm.less +62 -0
- package/components/css/bpmSelectHouseOwner.less +30 -0
- package/components/css/bpmSignature.less +40 -0
- package/components/css/bpmText.less +0 -10
- package/components/css/common.less +43 -0
- package/components/css/index.less +6 -1
- package/components/lib/bpmAudit/index.js +7 -0
- package/components/lib/bpmAudit/src/main.vue +117 -0
- package/components/lib/bpmAudit/src/part/auditor/audit-new.vue +534 -0
- package/components/lib/bpmAudit/src/part/auditor/audit-select.vue +127 -0
- package/components/lib/bpmAudit/src/part/auditor/audit-with-others.vue +634 -0
- package/components/lib/bpmAudit/src/part/auditor.vue +54 -0
- package/components/lib/bpmAudit/src/part/editor.vue +318 -0
- package/components/lib/bpmAudit/src/part/reader.vue +218 -0
- package/components/lib/bpmDateTime/src/part/editor.vue +3 -1
- package/components/lib/bpmField/src/main.vue +5 -147
- package/components/lib/bpmFieldsFilter/index.js +7 -0
- package/components/lib/bpmFieldsFilter/src/main.vue +324 -0
- package/components/lib/bpmFormField/index.js +7 -0
- package/components/lib/bpmFormField/src/lib/form_mixin.js +818 -0
- package/components/lib/bpmFormField/src/lib/mixin.js +245 -0
- package/components/lib/bpmFormField/src/main.vue +35 -0
- package/components/lib/bpmMulFile/src/main.vue +0 -1
- package/components/lib/bpmMulFile/src/part/editor.vue +1 -1
- package/components/lib/bpmMulFile/src/part/reader.vue +12 -33
- package/components/lib/bpmMulImage/src/main.vue +1 -2
- package/components/lib/bpmMulImage/src/part/editor.vue +10 -6
- package/components/lib/bpmMulImage/src/part/reader.vue +14 -4
- package/components/lib/bpmNumber/src/part/editor.vue +8 -9
- package/components/lib/bpmSelect/src/part/reader.vue +11 -2
- package/components/lib/bpmSelectCheckItem/src/part/editor.vue +3 -7
- package/components/lib/bpmSelectEntranceForm/index.js +7 -0
- package/components/lib/bpmSelectEntranceForm/src/main.vue +529 -0
- package/components/lib/bpmSelectFromField/src/main.vue +1 -0
- package/components/lib/bpmSelectFromField/src/part/editor.vue +27 -13
- package/components/lib/bpmSelectFromForm/src/part/editor.vue +2 -5
- package/components/lib/bpmSelectHouseOwner/index.js +7 -0
- package/components/lib/bpmSelectHouseOwner/src/main.vue +102 -0
- package/components/lib/bpmSelectHouseOwner/src/part/editor.vue +101 -0
- package/components/lib/bpmSelectHouseOwner/src/part/reader.vue +17 -0
- package/components/lib/bpmSelectIssue/index.js +7 -0
- package/components/lib/bpmSelectIssue/src/main.vue +180 -0
- package/components/lib/bpmSignature/index.js +7 -0
- package/components/lib/bpmSignature/src/main.vue +248 -0
- package/components/lib/bpmSubForm/src/main.vue +25 -3
- package/components/lib/bpmTime/src/part/editor.vue +3 -2
- package/components/lib/field-const.js +6 -2
- package/components/lib/index.ts +57 -7
- package/components/mixins/field_base_mixin.vue +188 -0
- package/components/vendor/draw.js +240 -0
- package/dist/bpmAudit.umd.js +2 -0
- package/dist/bpmAudit.umd.js.LICENSE.txt +9 -0
- package/dist/bpmDateTime.umd.js +1 -1
- package/dist/bpmField.umd.js +7 -1
- package/dist/bpmField.umd.js.LICENSE.txt +2 -0
- package/dist/bpmFieldsFilter.umd.js +8 -0
- package/dist/bpmFieldsFilter.umd.js.LICENSE.txt +1 -0
- package/dist/bpmFormField.umd.js +8 -0
- package/dist/bpmFormField.umd.js.LICENSE.txt +11 -0
- package/dist/bpmMulFile.umd.js +1 -1
- package/dist/bpmMulImage.umd.js +1 -1
- package/dist/bpmNumber.umd.js +1 -1
- package/dist/bpmSelect.umd.js +1 -1
- package/dist/bpmSelectCheckItem.umd.js +1 -1
- package/dist/bpmSelectEntranceForm.umd.js +8 -0
- package/dist/bpmSelectEntranceForm.umd.js.LICENSE.txt +1 -0
- package/dist/bpmSelectFromField.umd.js +1 -1
- package/dist/bpmSelectFromForm.umd.js +1 -1
- package/dist/bpmSelectHouseOwner.umd.js +1 -0
- package/dist/bpmSelectIssue.umd.js +1 -0
- package/dist/bpmSignature.umd.js +2 -0
- package/dist/bpmSignature.umd.js.LICENSE.txt +9 -0
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmText.umd.js +1 -1
- package/dist/bpmTime.umd.js +1 -1
- package/dist/css/bpmAudit.css +1 -0
- package/dist/css/bpmMulFile.css +1 -1
- package/dist/css/bpmSelectEntranceForm.css +1 -0
- package/dist/css/bpmSelectHouseOwner.css +1 -0
- package/dist/css/bpmSignature.css +1 -0
- package/dist/css/bpmText.css +1 -1
- package/dist/css/common.css +1 -0
- package/dist/css/index.css +1 -1
- package/dist/demo.umd.js +1 -1
- package/dist/demo2.umd.js +1 -1
- package/dist/index.umd.js +7 -1
- package/dist/index.umd.js.LICENSE.txt +2 -0
- package/package.json +26 -18
- package/CHANGELOG.md +0 -23
- package/dist/bpmDateTime.umd.js.LICENSE.txt +0 -38
- package/dist/bpmNumber.umd.js.LICENSE.txt +0 -38
- package/dist/bpmSelect.umd.js.LICENSE.txt +0 -38
- package/dist/bpmSelectUser.umd.js +0 -1
- package/dist/bpmText.umd.js.LICENSE.txt +0 -38
- package/dist/bpmTime.umd.js.LICENSE.txt +0 -38
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
<component
|
|
3
3
|
v-if="curComponent"
|
|
4
4
|
class="bpm-field"
|
|
5
|
+
ref="inner-component"
|
|
5
6
|
v-model="curVal"
|
|
6
7
|
:is="curComponent"
|
|
7
8
|
:type="type"
|
|
8
9
|
:fieldConf="fieldConf"
|
|
9
10
|
:row="row"
|
|
10
|
-
:mode="
|
|
11
|
+
:mode="fieldMode"
|
|
11
12
|
:uiType="uiType"
|
|
12
13
|
:formDefId="formDefId"
|
|
13
14
|
:orgInfo="orgInfo"
|
|
14
15
|
:clearable="clearable"
|
|
15
|
-
:disabled="
|
|
16
|
+
:disabled="fieldDisabled"
|
|
16
17
|
:isMultiple="isMul"
|
|
17
18
|
v-bind="$attrs"
|
|
18
19
|
v-on="$listeners"
|
|
@@ -20,154 +21,11 @@
|
|
|
20
21
|
</component>
|
|
21
22
|
</template>
|
|
22
23
|
<script>
|
|
23
|
-
import _ from "lodash";
|
|
24
|
-
import BpmText from "../../bpmText";
|
|
25
|
-
import BpmSelect from "../../bpmSelect";
|
|
26
|
-
import BpmTime from "../../bpmTime";
|
|
27
|
-
import BpmNumber from "../../bpmNumber";
|
|
28
|
-
import BpmDateTime from "../../bpmDateTime";
|
|
29
|
-
import BpmMulFile from "../../bpmMulFile";
|
|
30
|
-
import BpmSelectCheckItem from "../../bpmSelectCheckItem";
|
|
31
|
-
import BpmSelectFromField from "../../bpmSelectFromField";
|
|
32
|
-
import BpmMulImage from "../../bpmMulImage";
|
|
33
|
-
import BpmSelectFromForm from "../../bpmSelectFromForm";
|
|
34
|
-
import BpmSelectFromId from "../../bpmSelectFromId";
|
|
35
|
-
import BpmSubForm from '../../bpmSubForm';
|
|
36
24
|
|
|
37
|
-
|
|
38
|
-
BpmText,
|
|
39
|
-
BpmSelect,
|
|
40
|
-
BpmTime,
|
|
41
|
-
BpmNumber,
|
|
42
|
-
BpmDateTime,
|
|
43
|
-
BpmMulFile,
|
|
44
|
-
BpmSelectCheckItem,
|
|
45
|
-
BpmSelectFromField,
|
|
46
|
-
BpmMulImage,
|
|
47
|
-
BpmSelectFromForm,
|
|
48
|
-
BpmSelectFromId,
|
|
49
|
-
BpmSubForm,
|
|
50
|
-
'BpmSignature': BpmMulImage,
|
|
51
|
-
'BpmSerialNumber': BpmText,
|
|
52
|
-
'BpmDate': BpmDateTime,
|
|
53
|
-
'BpmTextArea': BpmText,
|
|
54
|
-
'BpmMulSelect': BpmSelect,
|
|
55
|
-
'BpmStatus': BpmSelect,
|
|
56
|
-
'BpmMulImg': BpmMulFile,
|
|
57
|
-
'BpmMulSelectCheckItem': BpmSelectCheckItem,
|
|
58
|
-
'BpmMulSelectFromField': BpmSelectFromField,
|
|
59
|
-
'BpmSelectUser': BpmSelectFromField,
|
|
60
|
-
'BpmMulSelectUser': BpmSelectFromField,
|
|
61
|
-
'BpmSelectPartner': BpmSelectFromField,
|
|
62
|
-
'BpmMulSelectPartner': BpmSelectFromField,
|
|
63
|
-
'BpmSelectProject': BpmSelectFromField,
|
|
64
|
-
'BpmMulSelectProject': BpmSelectFromField,
|
|
65
|
-
'BpmSelectOrg': BpmSelectFromField,
|
|
66
|
-
'BpmMulSelectOrg': BpmSelectFromField,
|
|
67
|
-
'BpmMulSelectFromForm': BpmSelectFromForm,
|
|
68
|
-
'BpmMulSelectFromId': BpmSelectFromId,
|
|
69
|
-
'BpmMulSelectUrUser': BpmSelectFromField,
|
|
70
|
-
'BpmSelectUrUser': BpmSelectFromField,
|
|
71
|
-
'BpmSelectRootCategory': BpmSelectFromField,
|
|
72
|
-
'BpmMulSelectSort': BpmSelectCheckItem,
|
|
73
|
-
'BpmSelectSort': BpmSelectCheckItem,
|
|
74
|
-
'BpmXSubForm': BpmSubForm,
|
|
75
|
-
'BpmOrderSubform': BpmSubForm
|
|
76
|
-
};
|
|
25
|
+
import fieldBaseMixin from "../../../mixins/field_base_mixin.vue"
|
|
77
26
|
|
|
78
27
|
export default {
|
|
79
28
|
name: "BpmField",
|
|
80
|
-
|
|
81
|
-
props: {
|
|
82
|
-
value: {
|
|
83
|
-
type: [String, Array, Number, Object],
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
type: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: 'Text'
|
|
89
|
-
},
|
|
90
|
-
fieldConf: {
|
|
91
|
-
type: Object,
|
|
92
|
-
default() {
|
|
93
|
-
return {};
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
row: {
|
|
97
|
-
type: Object,
|
|
98
|
-
default() {
|
|
99
|
-
return {};
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
mode: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: 'view' // view, edit
|
|
105
|
-
},
|
|
106
|
-
uiType: {
|
|
107
|
-
type: String,
|
|
108
|
-
default: 'default' // default,table,form,search
|
|
109
|
-
},
|
|
110
|
-
formDefId: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: ''
|
|
113
|
-
},
|
|
114
|
-
orgInfo: {
|
|
115
|
-
type: Object,
|
|
116
|
-
default () {
|
|
117
|
-
return {
|
|
118
|
-
level: 'group', // group,team,project
|
|
119
|
-
level_id: 0,
|
|
120
|
-
group_id: 0
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
clearable: { // 仅对mode=edit有效
|
|
125
|
-
type: Boolean,
|
|
126
|
-
default: false
|
|
127
|
-
},
|
|
128
|
-
disabled: { // 仅对mode=edit有效
|
|
129
|
-
type: Boolean,
|
|
130
|
-
default: false
|
|
131
|
-
},
|
|
132
|
-
isMultiple: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
default() {
|
|
135
|
-
return false;
|
|
136
|
-
},
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
data () {
|
|
140
|
-
return {
|
|
141
|
-
curVal: ""
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
watch: {
|
|
145
|
-
curVal(val){
|
|
146
|
-
this.$emit("input", val)
|
|
147
|
-
this.$emit("change", val)
|
|
148
|
-
},
|
|
149
|
-
value(){
|
|
150
|
-
this.curVal = this.value
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
computed: {
|
|
154
|
-
curComponent() {
|
|
155
|
-
let componentType = _.get(this.fieldConf, "type");
|
|
156
|
-
if (!bpmComponents[`Bpm${componentType}`]) return
|
|
157
|
-
return `Bpm${componentType}`;
|
|
158
|
-
},
|
|
159
|
-
componentType(){
|
|
160
|
-
return _.get(this.fieldConf, "type")
|
|
161
|
-
},
|
|
162
|
-
isMul() {
|
|
163
|
-
let type = this.componentType
|
|
164
|
-
let isContainMul = type && type.indexOf("Mul") > -1;
|
|
165
|
-
return this.isMultiple || isContainMul
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
mounted () {
|
|
169
|
-
this.curVal = this.value
|
|
170
|
-
this.$bpm.orgInfo = this.orgInfo
|
|
171
|
-
}
|
|
29
|
+
mixins:[fieldBaseMixin]
|
|
172
30
|
};
|
|
173
31
|
</script>
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="search-board">
|
|
3
|
+
<el-form ref="form" label-width="150px" :inline="false">
|
|
4
|
+
<el-form-item v-for="searchField in pElements" :key="searchField.id" :label="searchField.name">
|
|
5
|
+
<bpm-field
|
|
6
|
+
v-model="formData[searchField.id]"
|
|
7
|
+
:type="searchField.type"
|
|
8
|
+
:field-conf="searchField"
|
|
9
|
+
:form-name="formDefId"
|
|
10
|
+
:form-def-id="formDefId"
|
|
11
|
+
:orgInfo="orgInfo"
|
|
12
|
+
mode="edit"
|
|
13
|
+
ui-type="search"
|
|
14
|
+
></bpm-field>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
<template v-for="searchField in gridElements">
|
|
17
|
+
<el-form-item v-show="showAllSearchItem || index < showDefaultCount" :key="searchField.id" :label="searchField.name">
|
|
18
|
+
<bpm-field
|
|
19
|
+
v-model="formData[searchField.id]"
|
|
20
|
+
:type="searchField.type"
|
|
21
|
+
:field-conf="searchField"
|
|
22
|
+
:form-name="formDefId"
|
|
23
|
+
:form-def-id="formDefId"
|
|
24
|
+
:orgInfo="orgInfo"
|
|
25
|
+
mode="edit"
|
|
26
|
+
ui-type="search"
|
|
27
|
+
></bpm-field>
|
|
28
|
+
</el-form-item>
|
|
29
|
+
</template>
|
|
30
|
+
</el-form>
|
|
31
|
+
|
|
32
|
+
<!-- 操作按钮区域 -->
|
|
33
|
+
<slot></slot>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { Algorithm } from "@antv/g6";
|
|
39
|
+
import Ajv from 'ajv'
|
|
40
|
+
|
|
41
|
+
const ajv = new Ajv({
|
|
42
|
+
useDefaults: true,
|
|
43
|
+
coerceTypes: true,
|
|
44
|
+
allErrors: true,
|
|
45
|
+
jsonPointers: true,
|
|
46
|
+
errorDataPath: true
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: 'BpmFieldsFilter',
|
|
51
|
+
props: {
|
|
52
|
+
searchSchema: { // 接口返回 definition.search
|
|
53
|
+
type: Object,
|
|
54
|
+
default () {
|
|
55
|
+
return {
|
|
56
|
+
elements: []
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
verifySchema: { // 接口返回 schema.search
|
|
61
|
+
type: Object,
|
|
62
|
+
default () {
|
|
63
|
+
return {}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
orgInfo: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default () {
|
|
69
|
+
return {}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
formDefId: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ''
|
|
75
|
+
},
|
|
76
|
+
//是否全部显示
|
|
77
|
+
showAll: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
//默认显示个数
|
|
82
|
+
showDefaultCount: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 6,
|
|
85
|
+
},
|
|
86
|
+
queryExclude: { // 是否排除全文搜索,有些场景要把搜索单独拿出来,筛选需要点开,如 MulSelectEntranceForm
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
formData: {},
|
|
94
|
+
formErrors: {},
|
|
95
|
+
elementIdList: [],
|
|
96
|
+
eleMap: {},
|
|
97
|
+
relyGraphData: {
|
|
98
|
+
nodes: [],
|
|
99
|
+
edges: [],
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
computed: {
|
|
104
|
+
formatedSchema () {
|
|
105
|
+
const searchSchema = this.searchSchema || {}
|
|
106
|
+
const verifySchemaDef = this.verifySchema
|
|
107
|
+
let searchVerifySchema = null
|
|
108
|
+
try {
|
|
109
|
+
searchVerifySchema = ajv.compile(verifySchemaDef)
|
|
110
|
+
} catch (err) {
|
|
111
|
+
console.error(`构建VerifySchema出错`, err)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
elements: searchSchema.elements || [],
|
|
116
|
+
verifySchema: searchVerifySchema
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
enableSearchText () {
|
|
120
|
+
const searchSchema = this.searchSchema || {}
|
|
121
|
+
const searchElm = searchSchema.elements ? _.find(searchSchema.elements, { id: 'q__contains' }) : false
|
|
122
|
+
return searchSchema.enable_search_text && searchElm
|
|
123
|
+
},
|
|
124
|
+
gridElements() {
|
|
125
|
+
const searchSchema = this.searchSchema || {}
|
|
126
|
+
if (!searchSchema.elements) return []
|
|
127
|
+
return searchSchema.elements.filter(element => {
|
|
128
|
+
return !(element.type === 'MulSelect' && element.style === 'button') &&
|
|
129
|
+
!(this.queryExclude && element.id === 'q__contains')
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
pElements () {
|
|
133
|
+
const searchSchema = this.searchSchema || {}
|
|
134
|
+
if (!searchSchema.elements) return []
|
|
135
|
+
return searchSchema.elements.filter(element => {
|
|
136
|
+
return element.type === 'MulSelect' && element.style === 'button'
|
|
137
|
+
})
|
|
138
|
+
},
|
|
139
|
+
showAllSearchItem: {
|
|
140
|
+
get () {
|
|
141
|
+
return this.showAll
|
|
142
|
+
},
|
|
143
|
+
set () {}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
mounted() {
|
|
147
|
+
this.$emit("beforeDataLoad");
|
|
148
|
+
this.penetrationZList = [];
|
|
149
|
+
this.relyArr = [];
|
|
150
|
+
this.addStackArr(this.searchSchema.elements);
|
|
151
|
+
this.createTopoGraph(this.searchSchema.elements);
|
|
152
|
+
_.each(this.penetrationZList, (penetrationZ) => {
|
|
153
|
+
this.relyGraphData.edges.push({
|
|
154
|
+
source: "bpmListSearch",
|
|
155
|
+
target: penetrationZ,
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
this.$emit("dataLoaded");
|
|
159
|
+
|
|
160
|
+
let { relyHandleList, firstId } = this.getRelyHandleList("bpmListSearch");
|
|
161
|
+
this.relyHandleList = relyHandleList;
|
|
162
|
+
if (_.isEmpty(this.relyHandleList)) {
|
|
163
|
+
this.$bpm.$emit("initRelyComplete", this);
|
|
164
|
+
}
|
|
165
|
+
if (firstId) {
|
|
166
|
+
this.$bpm.$emit("handeInitRely", {
|
|
167
|
+
id: firstId,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
methods: {
|
|
172
|
+
reset() {
|
|
173
|
+
this.formData = {};
|
|
174
|
+
},
|
|
175
|
+
search() {
|
|
176
|
+
this.submit();
|
|
177
|
+
},
|
|
178
|
+
async submit() {
|
|
179
|
+
let errors = await this.$bpm.handleVerifySchema({
|
|
180
|
+
mode: "list",
|
|
181
|
+
data: this.formData,
|
|
182
|
+
verifySchema: this.formatedSchema.verifySchema,
|
|
183
|
+
});
|
|
184
|
+
this.formErrors = errors;
|
|
185
|
+
console.log("errors", errors);
|
|
186
|
+
if (errors) return;
|
|
187
|
+
|
|
188
|
+
let formData = this.formData;
|
|
189
|
+
formData = _.pickBy(formData, (val, key) => {
|
|
190
|
+
return val != "";
|
|
191
|
+
});
|
|
192
|
+
this.$emit("search", formData)
|
|
193
|
+
|
|
194
|
+
return formData
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
handleNextRely(rowIndex) {
|
|
198
|
+
this.relyHandleList.shift();
|
|
199
|
+
if (_.isEmpty(this.relyHandleList)) {
|
|
200
|
+
this.$bpm.$emit("initRelyComplete", this);
|
|
201
|
+
}
|
|
202
|
+
let id = _.head(this.relyHandleList);
|
|
203
|
+
if (id) {
|
|
204
|
+
this.$bpm.$emit("handeInitRely", {
|
|
205
|
+
id,
|
|
206
|
+
rowIndex,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
handleRelyById(id, rowIndex) {
|
|
211
|
+
let { relyHandleList, firstId } = this.getRelyHandleList(id);
|
|
212
|
+
this.relyHandleList = relyHandleList;
|
|
213
|
+
if (firstId) {
|
|
214
|
+
this.$bpm.$emit("handeRelyById", {
|
|
215
|
+
id: firstId,
|
|
216
|
+
rowIndex,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
handleNextRelyById(rowIndex) {
|
|
221
|
+
this.relyHandleList.shift();
|
|
222
|
+
if (_.isEmpty(this.relyHandleList)) {
|
|
223
|
+
this.$bpm.$emit("initRelyComplete", this);
|
|
224
|
+
}
|
|
225
|
+
let id = _.head(this.relyHandleList);
|
|
226
|
+
if (id) {
|
|
227
|
+
this.$bpm.$emit("handeRelyById", {
|
|
228
|
+
id,
|
|
229
|
+
rowIndex,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
getRelyHandleList(id) {
|
|
234
|
+
//根据拓扑图的顺序触发初始的默认值、联动、范围拉取
|
|
235
|
+
let relyHandleList = [];
|
|
236
|
+
const { breadthFirstSearch } = Algorithm;
|
|
237
|
+
let firstId = null;
|
|
238
|
+
breadthFirstSearch(this.relyGraphData, id, {
|
|
239
|
+
enter: ({ current, previous }) => {},
|
|
240
|
+
leave: ({ current, previous }) => {
|
|
241
|
+
if (!firstId && current != id) {
|
|
242
|
+
firstId = current;
|
|
243
|
+
}
|
|
244
|
+
if (current != id) {
|
|
245
|
+
relyHandleList.push(current);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
return {
|
|
250
|
+
relyHandleList,
|
|
251
|
+
firstId,
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
addStackArr(elements, parentId) {
|
|
255
|
+
_.each(elements, (elem) => {
|
|
256
|
+
if (parentId) _.set(elem, "parentId", parentId);
|
|
257
|
+
_.set(this.eleMap, elem.id, elem);
|
|
258
|
+
this.elementIdList.push(elem.id);
|
|
259
|
+
let valDependIds = _.get(elem, "linkage.depends", []);
|
|
260
|
+
let scopeDependIds = _.get(elem, "scope.depends", []);
|
|
261
|
+
let selectDependIds = _.get(elem, "range_remote.depends", []);
|
|
262
|
+
let dependIds = _.concat(valDependIds, scopeDependIds);
|
|
263
|
+
dependIds = _.concat(dependIds, selectDependIds);
|
|
264
|
+
if (!parentId)
|
|
265
|
+
this.penetrationZList = _.concat(this.penetrationZList, dependIds);
|
|
266
|
+
if (elem.elements) {
|
|
267
|
+
this.addStackArr(elem.elements, elem.id);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
createTopoGraph(elements) {
|
|
272
|
+
_.each(elements, (elem) => {
|
|
273
|
+
let valDependIds = _.get(elem, "linkage.depends", []);
|
|
274
|
+
let scopeDependIds = _.get(elem, "scope.depends", []);
|
|
275
|
+
let selectDependIds = _.get(elem, "range_remote.depends", []);
|
|
276
|
+
let dependIds = _.concat(valDependIds, scopeDependIds);
|
|
277
|
+
dependIds = _.concat(dependIds, selectDependIds);
|
|
278
|
+
let _dependIds = _.cloneDeep(dependIds);
|
|
279
|
+
let curElem = _.get(this.eleMap, elem.id);
|
|
280
|
+
_.each(_dependIds, (dependId) => {
|
|
281
|
+
let dependElem = _.get(this.eleMap, dependId);
|
|
282
|
+
|
|
283
|
+
if (!dependElem) {
|
|
284
|
+
_.pullAll(dependIds, [dependId]);
|
|
285
|
+
dependIds = _.cloneDeep(dependIds);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
if (dependIds.length || curElem.parentId) {
|
|
289
|
+
let result = _.pullAll(this.penetrationZList, [elem.id]);
|
|
290
|
+
this.penetrationZList = _.cloneDeep(result);
|
|
291
|
+
}
|
|
292
|
+
_.each(dependIds, (dependId) => {
|
|
293
|
+
if (dependId && elem.id && _.includes(this.elementIdList, dependId)) {
|
|
294
|
+
let dependElem = _.get(this.eleMap, dependId);
|
|
295
|
+
// if(!dependElem && !curElem) return
|
|
296
|
+
if (!dependElem) return;
|
|
297
|
+
if (dependElem.parentId && !curElem.parentId)
|
|
298
|
+
dependId = dependElem.parentId; //依赖的是子表单中的某个字段。则替换成依赖整个子表单
|
|
299
|
+
let target =
|
|
300
|
+
curElem.parentId && !dependElem.parentId
|
|
301
|
+
? curElem.parentId
|
|
302
|
+
: curElem.id;
|
|
303
|
+
if (dependElem.parentId && curElem.parentId) return;
|
|
304
|
+
this.relyArr.push([dependId, target]);
|
|
305
|
+
this.relyGraphData.nodes.push(elem);
|
|
306
|
+
this.relyGraphData.nodes.push(dependElem);
|
|
307
|
+
this.relyGraphData.edges.push({
|
|
308
|
+
source: dependId,
|
|
309
|
+
target: target,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
if (elem.elements) {
|
|
314
|
+
this.createTopoGraph(elem.elements);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
</script>
|
|
321
|
+
|
|
322
|
+
<style lang="less" scoped>
|
|
323
|
+
|
|
324
|
+
</style>
|