askbot-dragon 1.6.21-beta → 1.6.21
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 +8 -11
- package/public/index.html +9 -8
- package/src/assets/image/default_avt_ui.png +0 -0
- package/src/assets/image/filtType/audio.png +0 -0
- package/src/assets/image/filtType/excel1.png +0 -0
- package/src/assets/image/filtType/general.png +0 -0
- package/src/assets/image/filtType/image1.png +0 -0
- package/src/assets/image/filtType/link.png +0 -0
- package/src/assets/image/filtType/md2.png +0 -0
- package/src/assets/image/filtType/mode.png +0 -0
- package/src/assets/image/filtType/news.png +0 -0
- package/src/assets/image/filtType/pdf1.png +0 -0
- package/src/assets/image/filtType/ppt1.png +0 -0
- package/src/assets/image/filtType/selfadd1.png +0 -0
- package/src/assets/image/filtType/txt1.png +0 -0
- package/src/assets/image/filtType/video.png +0 -0
- package/src/assets/image/filtType/wechat.png +0 -0
- package/src/assets/image/filtType/word1.png +0 -0
- package/src/assets/image/loading.gif +0 -0
- package/src/assets/js/AliyunlssUtil.js +35 -10
- package/src/assets/js/common.js +241 -0
- package/src/components/ActionAlertIframe.vue +1 -0
- package/src/components/AiGuide.vue +7 -4
- package/src/components/AnswerDocknowledge.vue +930 -389
- package/src/components/ConversationContainer.vue +7111 -1058
- package/src/components/MyEditor.vue +342 -0
- package/src/components/QwFeedback.vue +303 -0
- package/src/components/actionSatisfaction.vue +2 -2
- package/src/components/actionSendToBot.vue +2 -2
- package/src/components/answerRadio.vue +145 -64
- package/src/components/askVideo.vue +3 -6
- package/src/components/assetDetails.vue +14 -6
- package/src/components/assetMessage.vue +14 -13
- package/src/components/associationIntention.vue +31 -6
- package/src/components/fielListView.vue +1 -1
- package/src/components/file/AliyunOssComponents.vue +1 -1
- package/src/components/formTemplate.vue +1590 -1674
- package/src/components/imgView.vue +32 -0
- package/src/components/intelligentSummary.vue +231 -0
- package/src/components/markDownText.vue +198 -0
- package/src/components/myPopup.vue +14 -11
- package/src/components/pagination.vue +129 -0
- package/src/components/pdfPosition.vue +112 -90
- package/src/components/popup.vue +8 -7
- package/src/components/preview/docView.vue +114 -0
- package/src/components/preview/excelView.vue +187 -0
- package/src/components/preview/newPositionPreview.vue +370 -0
- package/src/components/preview/pdfView.vue +824 -0
- package/src/components/previewDoc.vue +6 -0
- package/src/components/previewPdf.vue +963 -200
- package/src/components/receiverMessagePlatform.vue +25 -21
- package/src/components/recommend.vue +2 -2
- package/src/components/senderMessagePlatform.vue +21 -13
- package/src/components/tree.vue +116 -103
- package/src/components/utils/AliyunIssUtil.js +35 -13
- package/src/components/utils/ckeditor.js +64 -56
- package/src/components/welcomeKnowledgeFile.vue +344 -0
- package/src/components/welcomeLlmCard.vue +141 -0
- package/src/components/welcomeSuggest.vue +98 -0
- package/src/locales/cn.json +62 -0
- package/src/locales/en.json +62 -0
- package/src/main.js +19 -3
- package/vue.config.js +0 -1
- package/src/assets/js/obsBrowser.js +0 -63
- package/src/components/utils/ckeditorImageUpload/command.js +0 -112
- package/src/components/utils/ckeditorImageUpload/editing.js +0 -12
- package/src/components/utils/ckeditorImageUpload/plugin-image.js +0 -12
- package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +0 -41
- package/src/components/utils/ckeditorfileUpload/common.js +0 -175
- package/src/components/utils/ckeditorfileUpload/editing.js +0 -12
- package/src/components/utils/ckeditorfileUpload/plugin_file.js +0 -12
- package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +0 -35
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</span>
|
|
8
|
-
建立对话
|
|
9
|
-
</span>
|
|
10
|
-
<span v-if="messagePlateform == 'BOT'">
|
|
11
|
-
与机器人【
|
|
12
|
-
<span class="text_color">{{payload.newSession.receiverDisplayInfo.name}}</span>
|
|
13
|
-
】建立对话
|
|
14
|
-
</span>
|
|
15
|
-
<span v-if="messagePlateform == 'oldTransfer'">
|
|
16
|
-
您将会话转接给 <span class="text_color">{{payload.newSession.receiverDisplayInfo.name}}</span>
|
|
17
|
-
</span>
|
|
18
|
-
<span v-if="messagePlateform == 'newTransfer'">
|
|
19
|
-
<span class="text_color">{{payload.oldSession.receiverDisplayInfo.name}}</span> 将会话转接给您
|
|
3
|
+
<span v-if="messagePlateform == 'IM'">
|
|
4
|
+
{{ $t('dragonCommon.establishConversationWith') }}
|
|
5
|
+
<span :class="payload.newSession.receiverId == userId ? '': 'text_color'">
|
|
6
|
+
{{ payload.newSession.receiverId == userId ? $t('dragonCommon.you') : payload.newSession.receiverDisplayInfo.name }}
|
|
20
7
|
</span>
|
|
8
|
+
{{ $t('dragonCommon.establishConversationWith') }}
|
|
9
|
+
</span>
|
|
10
|
+
<span v-if="messagePlateform == 'BOT'">
|
|
11
|
+
{{ $t('dragonCommon.establishConversationWith') }}
|
|
12
|
+
<span class="text_color">{{ $t('dragonCommon.bot') }}【{{ payload.newSession.receiverDisplayInfo.name }}】</span>
|
|
13
|
+
{{ $t('dragonCommon.establishConversationWith') }}
|
|
14
|
+
</span>
|
|
15
|
+
<span v-if="messagePlateform == 'oldTransfer' && (isShow == true || isShow === null)">
|
|
16
|
+
{{ $t('dragonCommon.transferTo') }}
|
|
17
|
+
<span class="text_color">{{ payload.newSession.receiverDisplayInfo.name }}</span>
|
|
18
|
+
</span>
|
|
19
|
+
<span v-if="messagePlateform == 'newTransfer' && (isShow == true || isShow === null)">
|
|
20
|
+
<span class="text_color">{{ payload.oldSession.receiverDisplayInfo.name }}</span>
|
|
21
|
+
{{ $t('dragonCommon.transferFrom') }}
|
|
22
|
+
</span>
|
|
21
23
|
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
+
</template>
|
|
24
25
|
<script>
|
|
25
26
|
// 客服 的接入消息展示
|
|
26
27
|
export default {
|
|
@@ -29,7 +30,7 @@ export default {
|
|
|
29
30
|
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
|
-
props:['source','payload','userId'],
|
|
33
|
+
props:['source','payload','userId', 'isShow'],
|
|
33
34
|
computed: {
|
|
34
35
|
messagePlateform() {
|
|
35
36
|
if(this.payload) {
|
|
@@ -55,7 +56,10 @@ export default {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
}
|
|
59
|
+
},
|
|
60
|
+
mounted() {
|
|
61
|
+
this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
|
|
62
|
+
},
|
|
59
63
|
}
|
|
60
64
|
</script>
|
|
61
65
|
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</span
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<span
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
<span v-if="messagePlateform == 'IM'">
|
|
4
|
+
{{ $t('dragonCommon.imService') }}
|
|
5
|
+
<span class="text_color">{{ payload.newSession.receiverDisplayInfo.name }}</span>
|
|
6
|
+
{{ $t('dragonCommon.willServeYou') }}
|
|
7
|
+
</span>
|
|
8
|
+
<span v-if="messagePlateform == 'BOT'">
|
|
9
|
+
<span class="text_color">{{ payload.newSession.receiverDisplayInfo.name }}</span>
|
|
10
|
+
{{ $t('dragonCommon.willServeYou') }}
|
|
11
|
+
</span>
|
|
12
|
+
<span v-if="messagePlateform == 'Transfer' && (isShow === true || isShow === null)">
|
|
13
|
+
<span class="text_color">{{ payload.oldSession.receiverDisplayInfo.name }}</span>
|
|
14
|
+
{{ $t('dragonCommon.transferTo') }}
|
|
15
|
+
<span class="text_color">{{ payload.newSession.receiverDisplayInfo.name }}</span>
|
|
16
|
+
</span>
|
|
12
17
|
</div>
|
|
13
|
-
</template>
|
|
18
|
+
</template>
|
|
14
19
|
|
|
15
20
|
<script>
|
|
16
21
|
// 咨询者的接入消息展示
|
|
17
22
|
export default {
|
|
18
23
|
data() {
|
|
19
24
|
return {
|
|
20
|
-
|
|
25
|
+
|
|
21
26
|
}
|
|
22
27
|
},
|
|
23
|
-
props:['source','payload'],
|
|
28
|
+
props:['source','payload', 'isShow'],
|
|
24
29
|
computed: {
|
|
25
30
|
messagePlateform() {
|
|
26
31
|
if(this.payload) {
|
|
@@ -40,7 +45,10 @@ export default {
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
}
|
|
48
|
+
},
|
|
49
|
+
mounted() {
|
|
50
|
+
this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
|
|
51
|
+
},
|
|
44
52
|
}
|
|
45
53
|
</script>
|
|
46
54
|
|
package/src/components/tree.vue
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="tree">
|
|
3
3
|
<div class="tree-header">
|
|
4
|
-
<span class="cacel" @click="cancelBtn"
|
|
5
|
-
<span class="primary" @click="saveData"
|
|
4
|
+
<span class="cacel" @click="cancelBtn">{{$t('dragonCommon.cancel')}}</span>
|
|
5
|
+
<span class="primary" @click="saveData">{{$t('dragonCommon.confirm')}}</span>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="tree-input" v-if="setCascadeOption && setCascadeOption.length > 0">
|
|
8
|
-
<el-input
|
|
9
|
-
placeholder="请搜索"
|
|
10
|
-
v-model="filterText"
|
|
11
|
-
>
|
|
8
|
+
<el-input placeholder="请搜索" v-model="filterText">
|
|
12
9
|
</el-input>
|
|
13
10
|
</div>
|
|
14
11
|
<div class="tree-container">
|
|
15
|
-
<el-tree :data="setCascadeOption"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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>
|
|
27
28
|
</span>
|
|
28
|
-
</span>
|
|
29
29
|
</el-tree>
|
|
30
30
|
</div>
|
|
31
|
-
<!-- <div class="footer">
|
|
31
|
+
<!-- <div class="footer">
|
|
32
32
|
<el-button>取 消</el-button>
|
|
33
33
|
<el-button type="primary" @click="saveData">确 认</el-button>
|
|
34
34
|
</div>-->
|
|
@@ -39,67 +39,67 @@
|
|
|
39
39
|
/* eslint-disable */
|
|
40
40
|
export default {
|
|
41
41
|
name: "tree",
|
|
42
|
-
data(){
|
|
43
|
-
return{
|
|
44
|
-
defaultProps:{
|
|
45
|
-
label:"label",
|
|
46
|
-
value:"value"
|
|
42
|
+
data () {
|
|
43
|
+
return {
|
|
44
|
+
defaultProps: {
|
|
45
|
+
label: "label",
|
|
46
|
+
value: "value"
|
|
47
47
|
},
|
|
48
|
-
checked:'',
|
|
48
|
+
checked: '',
|
|
49
49
|
// dataTree:[],
|
|
50
|
-
checkList:[],
|
|
51
|
-
checkDatas:[],
|
|
52
|
-
filterText:""
|
|
50
|
+
checkList: [],
|
|
51
|
+
checkDatas: [],
|
|
52
|
+
filterText: ""
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
props:["dataOptions","fieldValue"],
|
|
56
|
-
methods:{
|
|
57
|
-
saveData(){
|
|
55
|
+
props: ["dataOptions", "fieldValue", "webHookCascader"],
|
|
56
|
+
methods: {
|
|
57
|
+
saveData () {
|
|
58
58
|
this.checkList = []
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.$emit('saveData',this.checkList,this.checkDatas)
|
|
59
|
+
this.checkDatas = []
|
|
60
|
+
this.ergodicData(this.setCascadeOption, this.checkList)
|
|
61
|
+
this.$emit('saveData', this.checkList, this.checkDatas)
|
|
62
62
|
},
|
|
63
|
-
cancelBtn(){
|
|
64
|
-
|
|
63
|
+
cancelBtn () {
|
|
64
|
+
this.$emit('cancelBtn')
|
|
65
65
|
},
|
|
66
|
-
ergodicData(list){
|
|
67
|
-
list.forEach(item=>{
|
|
68
|
-
if (this.dataOptions.extInfo.selectType === '多选'){
|
|
69
|
-
if (item.checked){
|
|
66
|
+
ergodicData (list) {
|
|
67
|
+
list.forEach(item => {
|
|
68
|
+
if (this.dataOptions.extInfo.selectType === '多选') {
|
|
69
|
+
if (item.checked) {
|
|
70
70
|
let data = this.$refs.dataTree.getNode(item)
|
|
71
71
|
let checkList = []
|
|
72
|
-
let arr = this.serchParent(data,checkList)
|
|
72
|
+
let arr = this.serchParent(data, checkList)
|
|
73
73
|
this.checkList.push(arr)
|
|
74
74
|
this.checkDatas.push(item)
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
if (item.value === this.checked){
|
|
77
|
+
else {
|
|
78
|
+
if (item.value === this.checked) {
|
|
79
79
|
let data = this.$refs.dataTree.getNode(item)
|
|
80
80
|
let checkList = []
|
|
81
|
-
let arr = this.serchParent(data,checkList)
|
|
81
|
+
let arr = this.serchParent(data, checkList)
|
|
82
82
|
this.checkList = arr
|
|
83
83
|
this.checkDatas = [item]
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
if (item.children){
|
|
86
|
+
if (item.children) {
|
|
87
87
|
this.ergodicData(item.children)
|
|
88
88
|
}
|
|
89
89
|
})
|
|
90
90
|
},
|
|
91
|
-
serchParent(node,list) {
|
|
92
|
-
if(node) {
|
|
93
|
-
if(Object.prototype.toString.call(node.data) == '[object Object]') {
|
|
91
|
+
serchParent (node, list) {
|
|
92
|
+
if (node) {
|
|
93
|
+
if (Object.prototype.toString.call(node.data) == '[object Object]') {
|
|
94
94
|
list.unshift(node.data.value)
|
|
95
95
|
}
|
|
96
|
-
if(node.parent) {
|
|
97
|
-
list = this.serchParent(node.parent,list)
|
|
96
|
+
if (node.parent) {
|
|
97
|
+
list = this.serchParent(node.parent, list)
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
return list
|
|
101
101
|
},
|
|
102
|
-
filterNode(value, data, node) {
|
|
102
|
+
filterNode (value, data, node) {
|
|
103
103
|
if (!value) return true;
|
|
104
104
|
let upperCase = value.toUpperCase()
|
|
105
105
|
let lowerCase = value.toLowerCase()
|
|
@@ -109,55 +109,58 @@ export default {
|
|
|
109
109
|
}
|
|
110
110
|
return data.label.indexOf(value) !== -1 || data.label.indexOf(upperCase) !== -1 || data.label.indexOf(lowerCase) !== -1 || serchFlag;
|
|
111
111
|
},
|
|
112
|
-
nodeClick(data,node){
|
|
113
|
-
if
|
|
112
|
+
nodeClick (data, node) {
|
|
113
|
+
if(this.webHookCascader && data.children && data.children.length != 0) {
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
114
117
|
this.ergodicCascade(this.setCascadeOption)
|
|
115
118
|
} else {
|
|
116
|
-
this.$set(data,'checked'
|
|
119
|
+
this.$set(data, 'checked', !data.checked)
|
|
117
120
|
}
|
|
118
|
-
if (this.dataOptions.extInfo.selectType !== '多选'){
|
|
121
|
+
if (this.dataOptions.extInfo.selectType !== '多选') {
|
|
119
122
|
this.checked = data.value;
|
|
120
123
|
}
|
|
121
124
|
},
|
|
122
|
-
ergodicCascade(list){
|
|
123
|
-
list.forEach(item=>{
|
|
125
|
+
ergodicCascade (list) {
|
|
126
|
+
list.forEach(item => {
|
|
124
127
|
item.checked = false;
|
|
125
|
-
if (item.children){
|
|
128
|
+
if (item.children) {
|
|
126
129
|
this.ergodicCascade(item.children)
|
|
127
130
|
}
|
|
128
131
|
})
|
|
129
132
|
},
|
|
130
133
|
},
|
|
131
134
|
computed: {
|
|
132
|
-
dataTree() {
|
|
135
|
+
dataTree () {
|
|
133
136
|
let arr = []
|
|
134
|
-
if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options){
|
|
137
|
+
if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options) {
|
|
135
138
|
arr = this.dataOptions.extInfo.cascadeDown.options
|
|
136
139
|
}
|
|
137
|
-
else if (this.dataOptions.extInfo.cascade){
|
|
140
|
+
else if (this.dataOptions.extInfo.cascade) {
|
|
138
141
|
arr = this.dataOptions.extInfo.cascade
|
|
139
142
|
}
|
|
140
|
-
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
143
|
+
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]) {
|
|
141
144
|
arr = this.dataOptions.extInfo.cascadeDown[0].options
|
|
142
145
|
}
|
|
143
146
|
return arr
|
|
144
147
|
},
|
|
145
148
|
//规则中限制极限的选项
|
|
146
|
-
setCascadeOption(){
|
|
149
|
+
setCascadeOption () {
|
|
147
150
|
let options = [];
|
|
148
|
-
let
|
|
149
|
-
if (this.dataOptions.extInfo && (this.dataOptions.extInfo.cascadeDown || this.dataOptions.extInfo.cascade)){
|
|
151
|
+
let arr = []
|
|
152
|
+
if (this.dataOptions.extInfo && (this.dataOptions.extInfo.cascadeDown || this.dataOptions.extInfo.cascade)) {
|
|
150
153
|
arr = this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown.options ? this.dataOptions.extInfo.cascadeDown.options :
|
|
151
|
-
|
|
152
|
-
|
|
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 : []));
|
|
153
156
|
}
|
|
154
|
-
if (this.dataOptions.extInfo && this.dataOptions.extInfo.dependent && JSON.stringify(this.dataOptions.extInfo.dependent)!=='{}'){
|
|
155
|
-
for (let k in this.dataOptions.extInfo.dependent){
|
|
156
|
-
if (Array.isArray(this.fieldValue[k]) && Array.isArray(this.fieldValue[k][0])){
|
|
157
|
-
this.fieldValue[k].forEach(item=>{
|
|
158
|
-
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter=>{
|
|
159
|
-
if (filter.input === item || item[item.length - 1] == filter.input){
|
|
160
|
-
if (!options){
|
|
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) {
|
|
161
164
|
options = []
|
|
162
165
|
}
|
|
163
166
|
options = options.concat(filter.output)
|
|
@@ -167,28 +170,28 @@ export default {
|
|
|
167
170
|
}
|
|
168
171
|
else {
|
|
169
172
|
console.log(this.dataOptions.extInfo.dependent[k].filterStruct);
|
|
170
|
-
this.dataOptions.extInfo.dependent[k].filterStruct.forEach(filter=>{
|
|
171
|
-
if (this.fieldValue[k] && (filter.input === this.fieldValue[k] || this.fieldValue[k][this.fieldValue[k].length - 1] == filter.input)){
|
|
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)) {
|
|
172
175
|
options = filter.output;
|
|
173
176
|
|
|
174
177
|
}
|
|
175
178
|
})
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
|
-
const initCascade = (arr, parent)=>{
|
|
179
|
-
return JSON.parse(JSON.stringify(arr)).filter(item =>{
|
|
180
|
-
if (item.children){
|
|
181
|
+
const initCascade = (arr, parent) => {
|
|
182
|
+
return JSON.parse(JSON.stringify(arr)).filter(item => {
|
|
183
|
+
if (item.children) {
|
|
181
184
|
item.children = initCascade(item.children, item)
|
|
182
185
|
}
|
|
183
186
|
let flag = null
|
|
184
187
|
for (let i = 0; i < options.length; i++) {
|
|
185
188
|
const optArr = options[i];
|
|
186
189
|
item.checked = false;
|
|
187
|
-
if(optArr.indexOf(item.value) !== -1) {
|
|
188
|
-
if(parent === null || item.children && item.children.length != 0) {
|
|
190
|
+
if (optArr.indexOf(item.value) !== -1) {
|
|
191
|
+
if (parent === null || item.children && item.children.length != 0) {
|
|
189
192
|
flag = true
|
|
190
|
-
} else if(parent && optArr.indexOf(parent.value) !== -1 &&
|
|
191
|
-
|
|
193
|
+
} else if (parent && optArr.indexOf(parent.value) !== -1 &&
|
|
194
|
+
(Math.abs(optArr.indexOf(parent.value) - optArr.indexOf(item.value)) === 1)) {
|
|
192
195
|
flag = true
|
|
193
196
|
}
|
|
194
197
|
}
|
|
@@ -196,17 +199,17 @@ export default {
|
|
|
196
199
|
return flag && item
|
|
197
200
|
})
|
|
198
201
|
}
|
|
199
|
-
arr = initCascade(arr,null)
|
|
202
|
+
arr = initCascade(arr, null)
|
|
200
203
|
}
|
|
201
204
|
else {
|
|
202
205
|
return arr
|
|
203
206
|
}
|
|
204
|
-
console.debug('options',arr)
|
|
207
|
+
console.debug('options', arr)
|
|
205
208
|
return arr
|
|
206
209
|
},
|
|
207
210
|
},
|
|
208
|
-
watch:{
|
|
209
|
-
filterText(val) {
|
|
211
|
+
watch: {
|
|
212
|
+
filterText (val) {
|
|
210
213
|
this.$refs.dataTree.filter(val);
|
|
211
214
|
}
|
|
212
215
|
}
|
|
@@ -227,14 +230,16 @@ export default {
|
|
|
227
230
|
</script>
|
|
228
231
|
|
|
229
232
|
<style scoped lang="less">
|
|
230
|
-
#tree{
|
|
233
|
+
#tree {
|
|
231
234
|
height: 100%;
|
|
232
235
|
overflow: hidden;
|
|
233
|
-
|
|
236
|
+
|
|
237
|
+
/deep/.el-tree-node__content {
|
|
234
238
|
height: 38px;
|
|
235
239
|
line-height: 38px;
|
|
236
240
|
}
|
|
237
|
-
|
|
241
|
+
|
|
242
|
+
.tree-header {
|
|
238
243
|
height: 30px;
|
|
239
244
|
display: flex;
|
|
240
245
|
align-items: center;
|
|
@@ -243,41 +248,49 @@ export default {
|
|
|
243
248
|
width: calc(100% - 40px);
|
|
244
249
|
/*font-size: 14px;*/
|
|
245
250
|
padding-bottom: 20px;
|
|
246
|
-
|
|
251
|
+
|
|
252
|
+
.primary {
|
|
247
253
|
color: #366aff;
|
|
248
254
|
cursor: pointer;
|
|
249
255
|
}
|
|
250
|
-
|
|
256
|
+
|
|
257
|
+
.cacel {
|
|
251
258
|
color: #969799;
|
|
252
259
|
cursor: pointer;
|
|
253
260
|
}
|
|
254
261
|
}
|
|
255
|
-
|
|
262
|
+
|
|
263
|
+
.tree-input {
|
|
256
264
|
width: calc(100% - 20px);
|
|
257
265
|
margin: 0 10px 10px 10px;
|
|
258
266
|
}
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
|
|
268
|
+
.tree-container {
|
|
269
|
+
height: 260px;
|
|
261
270
|
overflow-y: scroll;
|
|
262
271
|
overflow-x: hidden;
|
|
263
272
|
}
|
|
264
|
-
|
|
273
|
+
|
|
274
|
+
.custom-tree-node {
|
|
265
275
|
display: flex;
|
|
266
276
|
align-items: center;
|
|
267
277
|
justify-content: space-between;
|
|
268
278
|
width: calc(100% - 40px);
|
|
269
279
|
font-size: 14px;
|
|
270
|
-
|
|
280
|
+
|
|
281
|
+
.tree-label {
|
|
271
282
|
max-width: 100%;
|
|
272
283
|
overflow: hidden;
|
|
273
284
|
text-overflow: ellipsis;
|
|
274
285
|
white-space: nowrap;
|
|
275
286
|
}
|
|
276
|
-
|
|
287
|
+
|
|
288
|
+
/deep/.el-radio__label {
|
|
277
289
|
display: none;
|
|
278
290
|
}
|
|
279
291
|
}
|
|
280
|
-
|
|
292
|
+
|
|
293
|
+
.footer {
|
|
281
294
|
position: absolute;
|
|
282
295
|
bottom: 0;
|
|
283
296
|
height: 60px;
|
|
@@ -286,10 +299,10 @@ export default {
|
|
|
286
299
|
justify-content: space-between;
|
|
287
300
|
width: calc(100% - 40px);
|
|
288
301
|
margin: 0 20px;
|
|
289
|
-
|
|
302
|
+
|
|
303
|
+
.el-button {
|
|
290
304
|
flex: 1;
|
|
291
305
|
border-radius: 9px;
|
|
292
306
|
}
|
|
293
307
|
}
|
|
294
|
-
}
|
|
295
|
-
</style>
|
|
308
|
+
}</style>
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
const OSS = require('ali-oss');
|
|
1
|
+
// const OSS = require('ali-oss');
|
|
2
|
+
const OSS = window.OSS
|
|
3
|
+
|
|
4
|
+
const getPrivateOssConfig = () => {
|
|
5
|
+
let mainSource = sessionStorage.getItem('_mainSource') ? sessionStorage.getItem('_mainSource') : "askbot";
|
|
6
|
+
switch (mainSource) {
|
|
7
|
+
case "askbot":
|
|
8
|
+
return {
|
|
9
|
+
region: "oss-cn-zhangjiakou",
|
|
10
|
+
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
11
|
+
accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
12
|
+
bucket: "guoranopen-zjk",
|
|
13
|
+
}
|
|
14
|
+
case "lishi":
|
|
15
|
+
return {
|
|
16
|
+
region: "oss-ap-southeast-1",
|
|
17
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
18
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
19
|
+
bucket: "askbotopen-ls",
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
2
23
|
|
|
3
24
|
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
4
25
|
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
@@ -35,12 +56,12 @@ function pathGenerate(filename) {
|
|
|
35
56
|
}
|
|
36
57
|
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
let ossClient = new OSS(
|
|
59
|
+
function upload(data) {
|
|
60
|
+
let ossClient = new OSS(getPrivateOssConfig());
|
|
40
61
|
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
41
62
|
let objectKey = pathGenerate(data.name);
|
|
42
|
-
let result =
|
|
43
|
-
headers:{
|
|
63
|
+
let result = ossClient.put(objectKey, data, {
|
|
64
|
+
headers: {
|
|
44
65
|
// 通过文件URL访问文件时,指定以附件形式下载文件,下载后的文件名称定义为example.jpg。
|
|
45
66
|
'Content-Disposition': `attachment; filename="${encodeURIComponent(data.name)}"`
|
|
46
67
|
},
|
|
@@ -49,13 +70,13 @@ function pathGenerate(filename) {
|
|
|
49
70
|
return result;
|
|
50
71
|
}
|
|
51
72
|
|
|
52
|
-
|
|
53
|
-
let ossClient = new OSS(
|
|
73
|
+
function multipartUpload(data, callback, extCallback) {
|
|
74
|
+
let ossClient = new OSS(getPrivateOssConfig());
|
|
54
75
|
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
55
76
|
let objectKey = pathGenerate(data.name);
|
|
56
77
|
|
|
57
|
-
let res =
|
|
58
|
-
headers:{
|
|
78
|
+
let res = ossClient.multipartUpload(objectKey, data, {
|
|
79
|
+
headers: {
|
|
59
80
|
// 通过文件URL访问文件时,指定以附件形式下载文件,下载后的文件名称定义为example.jpg。
|
|
60
81
|
'Content-Disposition': `attachment; filename="${encodeURIComponent(data.name)}"`
|
|
61
82
|
},
|
|
@@ -63,14 +84,15 @@ function pathGenerate(filename) {
|
|
|
63
84
|
console.debug('progress callback', p, checkpoint);
|
|
64
85
|
// 断点记录点。浏览器重启后无法直接继续上传,您需要手动触发上传操作。
|
|
65
86
|
if (callback && callback instanceof Function) {
|
|
66
|
-
callback(p, checkpoint,data,extCallback);
|
|
87
|
+
callback(p, checkpoint, data, extCallback);
|
|
67
88
|
}
|
|
68
89
|
}
|
|
69
90
|
})
|
|
70
|
-
|
|
91
|
+
return res;
|
|
71
92
|
}
|
|
72
93
|
|
|
73
|
-
function ossFileUrl(
|
|
94
|
+
function ossFileUrl(path, cname) {
|
|
95
|
+
let ossConfig = getPrivateOssConfig();
|
|
74
96
|
if (cname == null) {
|
|
75
97
|
return 'https://' + ossConfig.bucket + '.' + ossConfig.region + '.aliyuncs.com/' + path;
|
|
76
98
|
} else {
|
|
@@ -78,4 +100,4 @@ function ossFileUrl(ossConfig, path, cname) {
|
|
|
78
100
|
}
|
|
79
101
|
}
|
|
80
102
|
|
|
81
|
-
export {upload, multipartUpload, ossFileUrl}
|
|
103
|
+
export { upload, multipartUpload, ossFileUrl }
|