askbot-dragon 1.7.44-beta → 1.7.48-beta
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/README.md +27 -27
- package/babel.config.js +6 -6
- package/dragon.iml +7 -7
- package/package.json +56 -56
- package/public/index.html +75 -73
- package/src/App.vue +31 -31
- package/src/api/index.js +1 -1
- package/src/api/mock.http +2 -2
- package/src/api/requestUrl.js +185 -185
- package/src/assets/js/AliyunlssUtil.js +117 -141
- package/src/assets/js/Base64Util.js +22 -22
- package/src/assets/js/common.js +252 -252
- package/src/assets/js/hammer.js +89 -100
- package/src/assets/js/script.js +36 -36
- package/src/assets/less/common.css +6773 -6773
- package/src/assets/less/converSationContainer/common.less +192 -199
- package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
- package/src/assets/less/iconfont.css +37 -37
- package/src/assets/less/ticketMessage.less +294 -294
- package/src/components/ActionAlertIframe.vue +154 -177
- package/src/components/AiGuide.vue +471 -438
- package/src/components/AnswerDocknowledge.vue +1088 -1091
- package/src/components/AnswerVoice.vue +285 -285
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +10873 -10766
- package/src/components/FileType.vue +86 -86
- package/src/components/Message.vue +27 -27
- package/src/components/MyEditor.vue +341 -342
- package/src/components/QwFeedback.vue +301 -301
- package/src/components/actionSatisfaction.vue +107 -107
- package/src/components/actionSendToBot.vue +62 -62
- package/src/components/answerDissatisfaction.vue +62 -62
- package/src/components/answerRadio.vue +211 -211
- package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
- package/src/components/ask-components/Msgloading.vue +37 -37
- package/src/components/ask-components/SatisfactionV2.vue +15 -15
- package/src/components/askVideo.vue +139 -162
- package/src/components/assetDetails.vue +378 -378
- package/src/components/assetMessage.vue +226 -228
- package/src/components/associationIntention.vue +374 -378
- package/src/components/attachmentPreview.vue +90 -90
- package/src/components/botActionSatisfactor.vue +68 -68
- package/src/components/chatContent.vue +513 -513
- package/src/components/feedBack.vue +136 -136
- package/src/components/fielListView.vue +351 -351
- package/src/components/file/AliyunOssComponents.vue +108 -108
- package/src/components/formTemplate.vue +3497 -3501
- package/src/components/imgView.vue +31 -31
- package/src/components/intelligentSummary.vue +229 -231
- package/src/components/kkview.vue +1138 -1138
- package/src/components/loadingProcess.vue +164 -164
- package/src/components/markDownText.vue +197 -197
- package/src/components/message/ActionAlertIframe.vue +112 -112
- package/src/components/message/ShopMessage.vue +164 -164
- package/src/components/message/TextMessage.vue +924 -928
- package/src/components/message/TicketMessage.vue +201 -201
- package/src/components/message/swiper/index.js +4 -4
- package/src/components/message/swiper/ticketSwiper.vue +503 -503
- package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
- package/src/components/msgLoading.vue +231 -231
- package/src/components/myPopup.vue +70 -70
- package/src/components/pdfPosition.vue +1342 -1514
- package/src/components/popup.vue +227 -227
- package/src/components/previewDoc.vue +247 -251
- package/src/components/previewPdf.vue +774 -1069
- package/src/components/receiverMessagePlatform.vue +66 -65
- package/src/components/recommend.vue +80 -80
- package/src/components/selector/hOption.vue +20 -20
- package/src/components/selector/hSelector.vue +199 -199
- package/src/components/selector/hWrapper.vue +216 -216
- package/src/components/senderMessagePlatform.vue +55 -50
- package/src/components/source/BotMessage.vue +24 -24
- package/src/components/source/CustomMessage.vue +24 -24
- package/src/components/test.vue +260 -260
- package/src/components/tree.vue +307 -307
- package/src/components/utils/AliyunIssUtil.js +103 -103
- package/src/components/utils/ckeditor.js +185 -185
- package/src/components/utils/format_date.js +25 -25
- package/src/components/utils/index.js +6 -6
- package/src/components/utils/math_utils.js +29 -29
- package/src/components/voiceComponent.vue +119 -119
- package/src/components/welcomeKnowledgeFile.vue +340 -344
- package/src/components/welcomeLlmCard.vue +140 -144
- package/src/components/welcomeSuggest.vue +97 -97
- package/src/locales/cn.json +61 -71
- package/src/locales/en.json +62 -73
- package/src/main.js +76 -75
- package/vue.config.js +54 -54
- package/src/components/newPdfPosition.vue +0 -878
- package/src/components/pagination.vue +0 -129
- package/src/components/preview/docView.vue +0 -107
- package/src/components/preview/excelView.vue +0 -177
- package/src/components/preview/newPositionPreview.vue +0 -351
- package/src/components/preview/pdfView.vue +0 -760
- package/src/locales/jp.json +0 -73
package/src/components/tree.vue
CHANGED
|
@@ -1,308 +1,308 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="tree">
|
|
3
|
-
<div class="tree-header">
|
|
4
|
-
<span class="cacel" @click="cancelBtn"
|
|
5
|
-
<span class="primary" @click="saveData"
|
|
6
|
-
</div>
|
|
7
|
-
<div class="tree-input" v-if="setCascadeOption && setCascadeOption.length > 0">
|
|
8
|
-
<el-input placeholder="请搜索" v-model="filterText">
|
|
9
|
-
</el-input>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="tree-container">
|
|
12
|
-
<el-tree :data="setCascadeOption" :props="defaultProps" ref="dataTree" node-key="value"
|
|
13
|
-
:expand-on-click-node="false" :filter-node-method="filterNode">
|
|
14
|
-
<span class="custom-tree-node" slot-scope="{ node,data}" @click="nodeClick(data)">
|
|
15
|
-
<span class="tree-label">{{ node.label }}</span>
|
|
16
|
-
<span>
|
|
17
|
-
<template v-if="webHookCascader">
|
|
18
|
-
<el-checkbox :disabled="data.children && data.children.length !== 0" v-model="data.checked"
|
|
19
|
-
v-if="dataOptions.extInfo.selectType === '多选'"></el-checkbox>
|
|
20
|
-
<el-radio :disabled="data.children && data.children.length !== 0" v-model="checked" v-else
|
|
21
|
-
:label="data.value"></el-radio>
|
|
22
|
-
</template>
|
|
23
|
-
<template v-else>
|
|
24
|
-
<el-checkbox v-model="data.checked" v-if="dataOptions.extInfo.selectType === '多选'"></el-checkbox>
|
|
25
|
-
<el-radio v-model="checked" v-else :label="data.value"></el-radio>
|
|
26
|
-
</template>
|
|
27
|
-
</span>
|
|
28
|
-
</span>
|
|
29
|
-
</el-tree>
|
|
30
|
-
</div>
|
|
31
|
-
<!-- <div class="footer">
|
|
32
|
-
<el-button>取 消</el-button>
|
|
33
|
-
<el-button type="primary" @click="saveData">确 认</el-button>
|
|
34
|
-
</div>-->
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
/* eslint-disable */
|
|
40
|
-
export default {
|
|
41
|
-
name: "tree",
|
|
42
|
-
data () {
|
|
43
|
-
return {
|
|
44
|
-
defaultProps: {
|
|
45
|
-
label: "label",
|
|
46
|
-
value: "value"
|
|
47
|
-
},
|
|
48
|
-
checked: '',
|
|
49
|
-
// dataTree:[],
|
|
50
|
-
checkList: [],
|
|
51
|
-
checkDatas: [],
|
|
52
|
-
filterText: ""
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
props: ["dataOptions", "fieldValue", "webHookCascader"],
|
|
56
|
-
methods: {
|
|
57
|
-
saveData () {
|
|
58
|
-
this.checkList = []
|
|
59
|
-
this.checkDatas = []
|
|
60
|
-
this.ergodicData(this.setCascadeOption, this.checkList)
|
|
61
|
-
this.$emit('saveData', this.checkList, this.checkDatas)
|
|
62
|
-
},
|
|
63
|
-
cancelBtn () {
|
|
64
|
-
this.$emit('cancelBtn')
|
|
65
|
-
},
|
|
66
|
-
ergodicData (list) {
|
|
67
|
-
list.forEach(item => {
|
|
68
|
-
if (this.dataOptions.extInfo.selectType === '多选') {
|
|
69
|
-
if (item.checked) {
|
|
70
|
-
let data = this.$refs.dataTree.getNode(item)
|
|
71
|
-
let checkList = []
|
|
72
|
-
let arr = this.serchParent(data, checkList)
|
|
73
|
-
this.checkList.push(arr)
|
|
74
|
-
this.checkDatas.push(item)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
if (item.value === this.checked) {
|
|
79
|
-
let data = this.$refs.dataTree.getNode(item)
|
|
80
|
-
let checkList = []
|
|
81
|
-
let arr = this.serchParent(data, checkList)
|
|
82
|
-
this.checkList = arr
|
|
83
|
-
this.checkDatas = [item]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (item.children) {
|
|
87
|
-
this.ergodicData(item.children)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
serchParent (node, list) {
|
|
92
|
-
if (node) {
|
|
93
|
-
if (Object.prototype.toString.call(node.data) == '[object Object]') {
|
|
94
|
-
list.unshift(node.data.value)
|
|
95
|
-
}
|
|
96
|
-
if (node.parent) {
|
|
97
|
-
list = this.serchParent(node.parent, list)
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return list
|
|
101
|
-
},
|
|
102
|
-
filterNode (value, data, node) {
|
|
103
|
-
if (!value) return true;
|
|
104
|
-
let upperCase = value.toUpperCase()
|
|
105
|
-
let lowerCase = value.toLowerCase()
|
|
106
|
-
let serchFlag = false
|
|
107
|
-
if (node.parent && Object.prototype.toString.call(node.parent.data) == '[object Object]') {
|
|
108
|
-
serchFlag = node.parent.data.label.indexOf(value) !== -1 || node.parent.data.label.indexOf(upperCase) !== -1 || node.parent.data.label.indexOf(lowerCase) !== -1
|
|
109
|
-
}
|
|
110
|
-
return data.label.indexOf(value) !== -1 || data.label.indexOf(upperCase) !== -1 || data.label.indexOf(lowerCase) !== -1 || serchFlag;
|
|
111
|
-
},
|
|
112
|
-
nodeClick (data, node) {
|
|
113
|
-
if(this.webHookCascader && data.children && data.children.length != 0) {
|
|
114
|
-
return
|
|
115
|
-
}
|
|
116
|
-
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
117
|
-
this.ergodicCascade(this.setCascadeOption)
|
|
118
|
-
} else {
|
|
119
|
-
this.$set(data, 'checked', !data.checked)
|
|
120
|
-
}
|
|
121
|
-
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
122
|
-
this.checked = data.value;
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
ergodicCascade (list) {
|
|
126
|
-
list.forEach(item => {
|
|
127
|
-
item.checked = false;
|
|
128
|
-
if (item.children) {
|
|
129
|
-
this.ergodicCascade(item.children)
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
computed: {
|
|
135
|
-
dataTree () {
|
|
136
|
-
let arr = []
|
|
137
|
-
if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options) {
|
|
138
|
-
arr = this.dataOptions.extInfo.cascadeDown.options
|
|
139
|
-
}
|
|
140
|
-
else if (this.dataOptions.extInfo.cascade) {
|
|
141
|
-
arr = this.dataOptions.extInfo.cascade
|
|
142
|
-
}
|
|
143
|
-
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]) {
|
|
144
|
-
arr = this.dataOptions.extInfo.cascadeDown[0].options
|
|
145
|
-
}
|
|
146
|
-
return arr
|
|
147
|
-
},
|
|
148
|
-
//规则中限制极限的选项
|
|
149
|
-
setCascadeOption () {
|
|
150
|
-
let options = [];
|
|
151
|
-
let arr = []
|
|
152
|
-
if (this.dataOptions.extInfo && (this.dataOptions.extInfo.cascadeDown || this.dataOptions.extInfo.cascade)) {
|
|
153
|
-
arr = this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options ? this.dataOptions.extInfo.cascadeDown.options :
|
|
154
|
-
(this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0] ? this.dataOptions.extInfo.cascadeDown[0].options :
|
|
155
|
-
(this.dataOptions.extInfo.cascade ? this.dataOptions.extInfo.cascade : []));
|
|
156
|
-
}
|
|
157
|
-
if (this.dataOptions.extInfo && this.dataOptions.extInfo.dependent && JSON.stringify(this.dataOptions.extInfo.dependent) !== '{}') {
|
|
158
|
-
for (let k in this.dataOptions.extInfo.dependent) {
|
|
159
|
-
if (Array.isArray(this.fieldValue[k]) && Array.isArray(this.fieldValue[k][0])) {
|
|
160
|
-
this.fieldValue[k].forEach(item => {
|
|
161
|
-
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter => {
|
|
162
|
-
if (filter.input === item || item[item.length - 1] == filter.input) {
|
|
163
|
-
if (!options) {
|
|
164
|
-
options = []
|
|
165
|
-
}
|
|
166
|
-
options = options.concat(filter.output)
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
console.log(this.dataOptions.extInfo.dependent[k].filterStruct);
|
|
173
|
-
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter => {
|
|
174
|
-
if (this.fieldValue[k] && (filter.input === this.fieldValue[k] || this.fieldValue[k][this.fieldValue[k].length - 1] == filter.input)) {
|
|
175
|
-
options = filter.output;
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
const initCascade = (arr, parent) => {
|
|
182
|
-
return JSON.parse(JSON.stringify(arr)).filter(item => {
|
|
183
|
-
if (item.children) {
|
|
184
|
-
item.children = initCascade(item.children, item)
|
|
185
|
-
}
|
|
186
|
-
let flag = null
|
|
187
|
-
for (let i = 0; i < options.length; i++) {
|
|
188
|
-
const optArr = options[i];
|
|
189
|
-
item.checked = false;
|
|
190
|
-
if (optArr.indexOf(item.value) !== -1) {
|
|
191
|
-
if (parent === null || item.children && item.children.length != 0) {
|
|
192
|
-
flag = true
|
|
193
|
-
} else if (parent && optArr.indexOf(parent.value) !== -1 &&
|
|
194
|
-
(Math.abs(optArr.indexOf(parent.value) - optArr.indexOf(item.value)) === 1)) {
|
|
195
|
-
flag = true
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return flag && item
|
|
200
|
-
})
|
|
201
|
-
}
|
|
202
|
-
arr = initCascade(arr, null)
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return arr
|
|
206
|
-
}
|
|
207
|
-
console.debug('options', arr)
|
|
208
|
-
return arr
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
watch: {
|
|
212
|
-
filterText (val) {
|
|
213
|
-
this.$refs.dataTree.filter(val);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
// mounted() {
|
|
217
|
-
// if (this.dataOptions.extInfo.cascadeDown.options){
|
|
218
|
-
// debugger
|
|
219
|
-
// this.dataTree = this.dataOptions.extInfo.cascadeDown.options
|
|
220
|
-
// }
|
|
221
|
-
// else if (this.dataOptions.extInfo.cascade){
|
|
222
|
-
// this.dataTree = this.dataOptions.extInfo.cascade
|
|
223
|
-
// }
|
|
224
|
-
// else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
225
|
-
// this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
226
|
-
// }
|
|
227
|
-
// console.debug('dataTree',this.dataOptions,this.dataTree)
|
|
228
|
-
// }
|
|
229
|
-
};
|
|
230
|
-
</script>
|
|
231
|
-
|
|
232
|
-
<style scoped lang="less">
|
|
233
|
-
#tree {
|
|
234
|
-
height: 100%;
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
|
|
237
|
-
/deep/.el-tree-node__content {
|
|
238
|
-
height: 38px;
|
|
239
|
-
line-height: 38px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.tree-header {
|
|
243
|
-
height: 30px;
|
|
244
|
-
display: flex;
|
|
245
|
-
align-items: center;
|
|
246
|
-
justify-content: space-between;
|
|
247
|
-
margin: 0 20px;
|
|
248
|
-
width: calc(100% - 40px);
|
|
249
|
-
/*font-size: 14px;*/
|
|
250
|
-
padding-bottom: 20px;
|
|
251
|
-
|
|
252
|
-
.primary {
|
|
253
|
-
color: #366aff;
|
|
254
|
-
cursor: pointer;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.cacel {
|
|
258
|
-
color: #969799;
|
|
259
|
-
cursor: pointer;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.tree-input {
|
|
264
|
-
width: calc(100% - 20px);
|
|
265
|
-
margin: 0 10px 10px 10px;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.tree-container {
|
|
269
|
-
height: 260px;
|
|
270
|
-
overflow-y: scroll;
|
|
271
|
-
overflow-x: hidden;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.custom-tree-node {
|
|
275
|
-
display: flex;
|
|
276
|
-
align-items: center;
|
|
277
|
-
justify-content: space-between;
|
|
278
|
-
width: calc(100% - 40px);
|
|
279
|
-
font-size: 14px;
|
|
280
|
-
|
|
281
|
-
.tree-label {
|
|
282
|
-
max-width: 100%;
|
|
283
|
-
overflow: hidden;
|
|
284
|
-
text-overflow: ellipsis;
|
|
285
|
-
white-space: nowrap;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/deep/.el-radio__label {
|
|
289
|
-
display: none;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.footer {
|
|
294
|
-
position: absolute;
|
|
295
|
-
bottom: 0;
|
|
296
|
-
height: 60px;
|
|
297
|
-
display: flex;
|
|
298
|
-
align-items: center;
|
|
299
|
-
justify-content: space-between;
|
|
300
|
-
width: calc(100% - 40px);
|
|
301
|
-
margin: 0 20px;
|
|
302
|
-
|
|
303
|
-
.el-button {
|
|
304
|
-
flex: 1;
|
|
305
|
-
border-radius: 9px;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div id="tree">
|
|
3
|
+
<div class="tree-header">
|
|
4
|
+
<span class="cacel" @click="cancelBtn">{{$t('dragonCommon.cancel')}}</span>
|
|
5
|
+
<span class="primary" @click="saveData">{{$t('dragonCommon.confirm')}}</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="tree-input" v-if="setCascadeOption && setCascadeOption.length > 0">
|
|
8
|
+
<el-input placeholder="请搜索" v-model="filterText">
|
|
9
|
+
</el-input>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="tree-container">
|
|
12
|
+
<el-tree :data="setCascadeOption" :props="defaultProps" ref="dataTree" node-key="value"
|
|
13
|
+
:expand-on-click-node="false" :filter-node-method="filterNode">
|
|
14
|
+
<span class="custom-tree-node" slot-scope="{ node,data}" @click="nodeClick(data)">
|
|
15
|
+
<span class="tree-label">{{ node.label }}</span>
|
|
16
|
+
<span>
|
|
17
|
+
<template v-if="webHookCascader">
|
|
18
|
+
<el-checkbox :disabled="data.children && data.children.length !== 0" v-model="data.checked"
|
|
19
|
+
v-if="dataOptions.extInfo.selectType === '多选'"></el-checkbox>
|
|
20
|
+
<el-radio :disabled="data.children && data.children.length !== 0" v-model="checked" v-else
|
|
21
|
+
:label="data.value"></el-radio>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-else>
|
|
24
|
+
<el-checkbox v-model="data.checked" v-if="dataOptions.extInfo.selectType === '多选'"></el-checkbox>
|
|
25
|
+
<el-radio v-model="checked" v-else :label="data.value"></el-radio>
|
|
26
|
+
</template>
|
|
27
|
+
</span>
|
|
28
|
+
</span>
|
|
29
|
+
</el-tree>
|
|
30
|
+
</div>
|
|
31
|
+
<!-- <div class="footer">
|
|
32
|
+
<el-button>取 消</el-button>
|
|
33
|
+
<el-button type="primary" @click="saveData">确 认</el-button>
|
|
34
|
+
</div>-->
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
/* eslint-disable */
|
|
40
|
+
export default {
|
|
41
|
+
name: "tree",
|
|
42
|
+
data () {
|
|
43
|
+
return {
|
|
44
|
+
defaultProps: {
|
|
45
|
+
label: "label",
|
|
46
|
+
value: "value"
|
|
47
|
+
},
|
|
48
|
+
checked: '',
|
|
49
|
+
// dataTree:[],
|
|
50
|
+
checkList: [],
|
|
51
|
+
checkDatas: [],
|
|
52
|
+
filterText: ""
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
props: ["dataOptions", "fieldValue", "webHookCascader"],
|
|
56
|
+
methods: {
|
|
57
|
+
saveData () {
|
|
58
|
+
this.checkList = []
|
|
59
|
+
this.checkDatas = []
|
|
60
|
+
this.ergodicData(this.setCascadeOption, this.checkList)
|
|
61
|
+
this.$emit('saveData', this.checkList, this.checkDatas)
|
|
62
|
+
},
|
|
63
|
+
cancelBtn () {
|
|
64
|
+
this.$emit('cancelBtn')
|
|
65
|
+
},
|
|
66
|
+
ergodicData (list) {
|
|
67
|
+
list.forEach(item => {
|
|
68
|
+
if (this.dataOptions.extInfo.selectType === '多选') {
|
|
69
|
+
if (item.checked) {
|
|
70
|
+
let data = this.$refs.dataTree.getNode(item)
|
|
71
|
+
let checkList = []
|
|
72
|
+
let arr = this.serchParent(data, checkList)
|
|
73
|
+
this.checkList.push(arr)
|
|
74
|
+
this.checkDatas.push(item)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
if (item.value === this.checked) {
|
|
79
|
+
let data = this.$refs.dataTree.getNode(item)
|
|
80
|
+
let checkList = []
|
|
81
|
+
let arr = this.serchParent(data, checkList)
|
|
82
|
+
this.checkList = arr
|
|
83
|
+
this.checkDatas = [item]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (item.children) {
|
|
87
|
+
this.ergodicData(item.children)
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
},
|
|
91
|
+
serchParent (node, list) {
|
|
92
|
+
if (node) {
|
|
93
|
+
if (Object.prototype.toString.call(node.data) == '[object Object]') {
|
|
94
|
+
list.unshift(node.data.value)
|
|
95
|
+
}
|
|
96
|
+
if (node.parent) {
|
|
97
|
+
list = this.serchParent(node.parent, list)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return list
|
|
101
|
+
},
|
|
102
|
+
filterNode (value, data, node) {
|
|
103
|
+
if (!value) return true;
|
|
104
|
+
let upperCase = value.toUpperCase()
|
|
105
|
+
let lowerCase = value.toLowerCase()
|
|
106
|
+
let serchFlag = false
|
|
107
|
+
if (node.parent && Object.prototype.toString.call(node.parent.data) == '[object Object]') {
|
|
108
|
+
serchFlag = node.parent.data.label.indexOf(value) !== -1 || node.parent.data.label.indexOf(upperCase) !== -1 || node.parent.data.label.indexOf(lowerCase) !== -1
|
|
109
|
+
}
|
|
110
|
+
return data.label.indexOf(value) !== -1 || data.label.indexOf(upperCase) !== -1 || data.label.indexOf(lowerCase) !== -1 || serchFlag;
|
|
111
|
+
},
|
|
112
|
+
nodeClick (data, node) {
|
|
113
|
+
if(this.webHookCascader && data.children && data.children.length != 0) {
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
117
|
+
this.ergodicCascade(this.setCascadeOption)
|
|
118
|
+
} else {
|
|
119
|
+
this.$set(data, 'checked', !data.checked)
|
|
120
|
+
}
|
|
121
|
+
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
122
|
+
this.checked = data.value;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
ergodicCascade (list) {
|
|
126
|
+
list.forEach(item => {
|
|
127
|
+
item.checked = false;
|
|
128
|
+
if (item.children) {
|
|
129
|
+
this.ergodicCascade(item.children)
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
computed: {
|
|
135
|
+
dataTree () {
|
|
136
|
+
let arr = []
|
|
137
|
+
if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options) {
|
|
138
|
+
arr = this.dataOptions.extInfo.cascadeDown.options
|
|
139
|
+
}
|
|
140
|
+
else if (this.dataOptions.extInfo.cascade) {
|
|
141
|
+
arr = this.dataOptions.extInfo.cascade
|
|
142
|
+
}
|
|
143
|
+
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]) {
|
|
144
|
+
arr = this.dataOptions.extInfo.cascadeDown[0].options
|
|
145
|
+
}
|
|
146
|
+
return arr
|
|
147
|
+
},
|
|
148
|
+
//规则中限制极限的选项
|
|
149
|
+
setCascadeOption () {
|
|
150
|
+
let options = [];
|
|
151
|
+
let arr = []
|
|
152
|
+
if (this.dataOptions.extInfo && (this.dataOptions.extInfo.cascadeDown || this.dataOptions.extInfo.cascade)) {
|
|
153
|
+
arr = this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options ? this.dataOptions.extInfo.cascadeDown.options :
|
|
154
|
+
(this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0] ? this.dataOptions.extInfo.cascadeDown[0].options :
|
|
155
|
+
(this.dataOptions.extInfo.cascade ? this.dataOptions.extInfo.cascade : []));
|
|
156
|
+
}
|
|
157
|
+
if (this.dataOptions.extInfo && this.dataOptions.extInfo.dependent && JSON.stringify(this.dataOptions.extInfo.dependent) !== '{}') {
|
|
158
|
+
for (let k in this.dataOptions.extInfo.dependent) {
|
|
159
|
+
if (Array.isArray(this.fieldValue[k]) && Array.isArray(this.fieldValue[k][0])) {
|
|
160
|
+
this.fieldValue[k].forEach(item => {
|
|
161
|
+
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter => {
|
|
162
|
+
if (filter.input === item || item[item.length - 1] == filter.input) {
|
|
163
|
+
if (!options) {
|
|
164
|
+
options = []
|
|
165
|
+
}
|
|
166
|
+
options = options.concat(filter.output)
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
console.log(this.dataOptions.extInfo.dependent[k].filterStruct);
|
|
173
|
+
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter => {
|
|
174
|
+
if (this.fieldValue[k] && (filter.input === this.fieldValue[k] || this.fieldValue[k][this.fieldValue[k].length - 1] == filter.input)) {
|
|
175
|
+
options = filter.output;
|
|
176
|
+
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const initCascade = (arr, parent) => {
|
|
182
|
+
return JSON.parse(JSON.stringify(arr)).filter(item => {
|
|
183
|
+
if (item.children) {
|
|
184
|
+
item.children = initCascade(item.children, item)
|
|
185
|
+
}
|
|
186
|
+
let flag = null
|
|
187
|
+
for (let i = 0; i < options.length; i++) {
|
|
188
|
+
const optArr = options[i];
|
|
189
|
+
item.checked = false;
|
|
190
|
+
if (optArr.indexOf(item.value) !== -1) {
|
|
191
|
+
if (parent === null || item.children && item.children.length != 0) {
|
|
192
|
+
flag = true
|
|
193
|
+
} else if (parent && optArr.indexOf(parent.value) !== -1 &&
|
|
194
|
+
(Math.abs(optArr.indexOf(parent.value) - optArr.indexOf(item.value)) === 1)) {
|
|
195
|
+
flag = true
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return flag && item
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
arr = initCascade(arr, null)
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
return arr
|
|
206
|
+
}
|
|
207
|
+
console.debug('options', arr)
|
|
208
|
+
return arr
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
watch: {
|
|
212
|
+
filterText (val) {
|
|
213
|
+
this.$refs.dataTree.filter(val);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// mounted() {
|
|
217
|
+
// if (this.dataOptions.extInfo.cascadeDown.options){
|
|
218
|
+
// debugger
|
|
219
|
+
// this.dataTree = this.dataOptions.extInfo.cascadeDown.options
|
|
220
|
+
// }
|
|
221
|
+
// else if (this.dataOptions.extInfo.cascade){
|
|
222
|
+
// this.dataTree = this.dataOptions.extInfo.cascade
|
|
223
|
+
// }
|
|
224
|
+
// else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
225
|
+
// this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
226
|
+
// }
|
|
227
|
+
// console.debug('dataTree',this.dataOptions,this.dataTree)
|
|
228
|
+
// }
|
|
229
|
+
};
|
|
230
|
+
</script>
|
|
231
|
+
|
|
232
|
+
<style scoped lang="less">
|
|
233
|
+
#tree {
|
|
234
|
+
height: 100%;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
|
|
237
|
+
/deep/.el-tree-node__content {
|
|
238
|
+
height: 38px;
|
|
239
|
+
line-height: 38px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.tree-header {
|
|
243
|
+
height: 30px;
|
|
244
|
+
display: flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: space-between;
|
|
247
|
+
margin: 0 20px;
|
|
248
|
+
width: calc(100% - 40px);
|
|
249
|
+
/*font-size: 14px;*/
|
|
250
|
+
padding-bottom: 20px;
|
|
251
|
+
|
|
252
|
+
.primary {
|
|
253
|
+
color: #366aff;
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.cacel {
|
|
258
|
+
color: #969799;
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.tree-input {
|
|
264
|
+
width: calc(100% - 20px);
|
|
265
|
+
margin: 0 10px 10px 10px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.tree-container {
|
|
269
|
+
height: 260px;
|
|
270
|
+
overflow-y: scroll;
|
|
271
|
+
overflow-x: hidden;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.custom-tree-node {
|
|
275
|
+
display: flex;
|
|
276
|
+
align-items: center;
|
|
277
|
+
justify-content: space-between;
|
|
278
|
+
width: calc(100% - 40px);
|
|
279
|
+
font-size: 14px;
|
|
280
|
+
|
|
281
|
+
.tree-label {
|
|
282
|
+
max-width: 100%;
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
text-overflow: ellipsis;
|
|
285
|
+
white-space: nowrap;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/deep/.el-radio__label {
|
|
289
|
+
display: none;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.footer {
|
|
294
|
+
position: absolute;
|
|
295
|
+
bottom: 0;
|
|
296
|
+
height: 60px;
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
justify-content: space-between;
|
|
300
|
+
width: calc(100% - 40px);
|
|
301
|
+
margin: 0 20px;
|
|
302
|
+
|
|
303
|
+
.el-button {
|
|
304
|
+
flex: 1;
|
|
305
|
+
border-radius: 9px;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
308
|
}</style>
|