askbot-dragon 1.6.39 → 1.6.40
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/interruptComponents/imageSelectionAnswer.vue +161 -0
- package/src/components/interruptComponents/multipleChoiceAnswer.vue +129 -0
- package/src/components/interruptComponents/singleChoiceAnswer.vue +81 -0
- package/src/components/outputComponents/outputCom.vue +149 -0
package/package.json
CHANGED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="imageSelectionAnswer">
|
|
3
|
+
<div class="imageSelectionText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="imageList">
|
|
7
|
+
<div class="imageItem"
|
|
8
|
+
v-for="(item,index) in msg.content.options"
|
|
9
|
+
:key="index"
|
|
10
|
+
:class="disabled || isDisabled ? 'disabledItem' : ''"
|
|
11
|
+
>
|
|
12
|
+
<el-image
|
|
13
|
+
style="width: 120px!important; height: 120px!important;"
|
|
14
|
+
:src="item.url"
|
|
15
|
+
:preview-src-list="previewList(msg.content.options)"
|
|
16
|
+
fit="cover">
|
|
17
|
+
</el-image>
|
|
18
|
+
<div class="checkIcon"
|
|
19
|
+
:class="checkImage && checkImage.url === item.url ? 'activeCheckIcon' : 'noCheckIcon'"
|
|
20
|
+
@click="selectImage(item)"
|
|
21
|
+
>
|
|
22
|
+
<div class="centerIcon" v-if="checkImage && checkImage.url === item.url">
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="answerButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || !checkImage ? 'disabledButton' : ''">
|
|
28
|
+
<div class="buttonText"
|
|
29
|
+
v-for="(item,index) in msg.content.handleSettings"
|
|
30
|
+
:key="index"
|
|
31
|
+
@click="imageSelectionConfirm(item)"
|
|
32
|
+
>
|
|
33
|
+
{{ item }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: "imageSelectionAnswer",
|
|
42
|
+
data(){
|
|
43
|
+
return{
|
|
44
|
+
checkImage:"",
|
|
45
|
+
isDisabled:false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
props:{
|
|
49
|
+
answer:{
|
|
50
|
+
type:Object,
|
|
51
|
+
default(){
|
|
52
|
+
return{}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
disabled:{
|
|
56
|
+
type:Boolean,
|
|
57
|
+
default:false
|
|
58
|
+
},
|
|
59
|
+
msg:{
|
|
60
|
+
type:Object,
|
|
61
|
+
default(){
|
|
62
|
+
return{}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
methods:{
|
|
67
|
+
previewList(options){
|
|
68
|
+
let arr = [];
|
|
69
|
+
arr = options.map(item => item.url)
|
|
70
|
+
return arr
|
|
71
|
+
},
|
|
72
|
+
selectImage(item){
|
|
73
|
+
if (this.disabled || this.isDisabled){
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
this.checkImage = item;
|
|
77
|
+
},
|
|
78
|
+
imageSelectionConfirm(item){
|
|
79
|
+
if (this.disabled || this.isDisabled || !this.checkImage){
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
this.isDisabled = true;
|
|
83
|
+
this.$emit('imageSelectionConfirm',item,this.checkImage,this.msg)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style scoped lang="less">
|
|
90
|
+
.imageSelectionAnswer{
|
|
91
|
+
.imageSelectionText{
|
|
92
|
+
padding-bottom: 10px;
|
|
93
|
+
}
|
|
94
|
+
.imageList{
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: flex-start;
|
|
98
|
+
flex-wrap: wrap;
|
|
99
|
+
background-color: #ffffff;
|
|
100
|
+
.imageItem{
|
|
101
|
+
position: relative;
|
|
102
|
+
margin-right: 10px;
|
|
103
|
+
margin-bottom: 5px;
|
|
104
|
+
margin-top: 5px;
|
|
105
|
+
.checkIcon{
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 0;
|
|
108
|
+
right: 0;
|
|
109
|
+
width: 15px;
|
|
110
|
+
height: 15px;
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
flex: none;
|
|
116
|
+
}
|
|
117
|
+
.activeCheckIcon{
|
|
118
|
+
background: #366AFF;
|
|
119
|
+
border: 1px solid #366AFF;
|
|
120
|
+
.centerIcon{
|
|
121
|
+
width: 6px;
|
|
122
|
+
height: 6px;
|
|
123
|
+
background: #FFFFFF;
|
|
124
|
+
border-radius: 50%;
|
|
125
|
+
flex: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.noCheckIcon{
|
|
129
|
+
background: #FFFFFF;
|
|
130
|
+
border: 1px solid #EBEDF4;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
.answerButton{
|
|
135
|
+
padding-top: 10px;
|
|
136
|
+
width: 100%;
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
border-top: 1px solid #EEEEEE;
|
|
141
|
+
.buttonText{
|
|
142
|
+
padding: 0 4px;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
color: #366aff;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
.disabledItem{
|
|
148
|
+
.checkIcon{
|
|
149
|
+
background-color: #edf2fc!important;
|
|
150
|
+
}
|
|
151
|
+
.centerIcon{
|
|
152
|
+
background: #366aff!important;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
.disabledButton{
|
|
157
|
+
.buttonText{
|
|
158
|
+
color: #A9B3C6!important;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="multipleChoiceAnswer">
|
|
3
|
+
<div class="multipleText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="multipleList" :class="msg.content.options && msg.content.options.length == 0 ? 'disabledMultiple' : ''">
|
|
7
|
+
<el-checkbox-group v-model="checkList">
|
|
8
|
+
<el-checkbox
|
|
9
|
+
:label="item._metadata.id"
|
|
10
|
+
v-for="item in msg.content.options"
|
|
11
|
+
:key="item._metadata.id"
|
|
12
|
+
:disabled="disabled || isDisabled"
|
|
13
|
+
>
|
|
14
|
+
<el-image
|
|
15
|
+
style="width: 32px!important; height: 32px!important;margin-right: 4px;flex: none"
|
|
16
|
+
:src="item.url"
|
|
17
|
+
v-if="item.url"
|
|
18
|
+
:preview-src-list="previewList(msg.content.options)"
|
|
19
|
+
fit="cover"></el-image>
|
|
20
|
+
{{ item.text }}
|
|
21
|
+
</el-checkbox>
|
|
22
|
+
</el-checkbox-group>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="answerButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || checkList.length === 0 ? 'disabledButton' : ''">
|
|
25
|
+
<div class="buttonText"
|
|
26
|
+
v-for="(item,index) in msg.content.handleSettings"
|
|
27
|
+
:key="index"
|
|
28
|
+
@click="multipleChoiceConfirm(item)"
|
|
29
|
+
>
|
|
30
|
+
{{ item }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
export default {
|
|
38
|
+
name: "multipleChoiceAnswer",
|
|
39
|
+
data(){
|
|
40
|
+
return{
|
|
41
|
+
checkList:[],
|
|
42
|
+
isDisabled:false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
props:{
|
|
46
|
+
disabled:{
|
|
47
|
+
type:Boolean,
|
|
48
|
+
default:false
|
|
49
|
+
},
|
|
50
|
+
msg:{
|
|
51
|
+
type:Object,
|
|
52
|
+
default(){
|
|
53
|
+
return{}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
methods:{
|
|
58
|
+
previewList(options){
|
|
59
|
+
let arr = [];
|
|
60
|
+
arr = options.map(item => item.url)
|
|
61
|
+
return arr
|
|
62
|
+
},
|
|
63
|
+
multipleChoiceConfirm(item){
|
|
64
|
+
if (this.disabled || this.isDisabled || this.checkList.length === 0){
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
this.isDisabled = true;
|
|
68
|
+
this.$emit('multipleChoiceConfirm',item,this.checkList,this.msg)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style scoped lang="less">
|
|
75
|
+
.multipleChoiceAnswer{
|
|
76
|
+
.multipleText{
|
|
77
|
+
//margin-bottom: 10px;
|
|
78
|
+
}
|
|
79
|
+
.multipleList{
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-items: flex-start;
|
|
82
|
+
padding: 8px 0;
|
|
83
|
+
background-color: #ffffff;
|
|
84
|
+
/deep/.el-checkbox-group{
|
|
85
|
+
//display: flex;
|
|
86
|
+
//align-items: center;
|
|
87
|
+
//flex-direction: column;
|
|
88
|
+
.el-checkbox{
|
|
89
|
+
margin-right: 0!important;
|
|
90
|
+
margin-bottom: 10px;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
.el-checkbox__label{
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
color: #000000;
|
|
97
|
+
white-space: pre-line;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.answerButton{
|
|
103
|
+
padding-top: 10px;
|
|
104
|
+
width: 100%;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
border-top: 1px solid #EEEEEE;
|
|
109
|
+
.buttonText{
|
|
110
|
+
padding: 0 4px;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
color: #366aff;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.disabledMultiple{
|
|
117
|
+
/deep/.el-checkbox__input{
|
|
118
|
+
display: none;
|
|
119
|
+
}
|
|
120
|
+
/deep/.el-checkbox__label{
|
|
121
|
+
padding-left: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.disabledButton{
|
|
125
|
+
.buttonText{
|
|
126
|
+
color: #A9B3C6!important;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="singleChoiceAnswer">
|
|
3
|
+
<div class="singleChoiceText" v-if="msg.content.prompt">
|
|
4
|
+
{{msg.content.prompt}}
|
|
5
|
+
</div>
|
|
6
|
+
<div class="optionsList" :class="isDisabled || disabled ? 'disabledOption' : ''">
|
|
7
|
+
<div
|
|
8
|
+
v-for="(option, index) in msg.content.options"
|
|
9
|
+
class="optionsItem"
|
|
10
|
+
:key="index"
|
|
11
|
+
@click="handleClick(option)"
|
|
12
|
+
>
|
|
13
|
+
<span> {{ option.text }}</span>
|
|
14
|
+
<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: "singleChoiceAnswer",
|
|
23
|
+
data(){
|
|
24
|
+
return{
|
|
25
|
+
isDisabled:false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
props:{
|
|
29
|
+
msg:{
|
|
30
|
+
type:Object,
|
|
31
|
+
default(){
|
|
32
|
+
return{}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
disabled:{
|
|
36
|
+
type:Boolean,
|
|
37
|
+
default:false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
methods:{
|
|
41
|
+
handleClick(item){
|
|
42
|
+
if (this.disabled || this.isDisabled){
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
this.isDisabled = true;
|
|
46
|
+
this.$emit('singleChoice',item,this.msg)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style scoped lang="less">
|
|
53
|
+
.singleChoiceAnswer{
|
|
54
|
+
|
|
55
|
+
.singleChoiceText{
|
|
56
|
+
//padding-bottom: 10px;
|
|
57
|
+
}
|
|
58
|
+
.optionsList {
|
|
59
|
+
padding-top: 4px;
|
|
60
|
+
|
|
61
|
+
.optionsItem {
|
|
62
|
+
line-height: 25px;
|
|
63
|
+
background-color: #ffffff;
|
|
64
|
+
color: #366aff;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
padding: 8px 0;
|
|
70
|
+
i {
|
|
71
|
+
padding-left: 10px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.disabledOption{
|
|
76
|
+
.optionsItem{
|
|
77
|
+
color: #A9B3C6!important;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="outputComponents">
|
|
3
|
+
<div class="outputText" v-if="msg.content.prompt">
|
|
4
|
+
{{ msg.content.prompt }}
|
|
5
|
+
</div>
|
|
6
|
+
<el-table
|
|
7
|
+
:data="tableData"
|
|
8
|
+
style="width: 100%"
|
|
9
|
+
height="250"
|
|
10
|
+
@selection-change="handleSelectionChange"
|
|
11
|
+
v-if="msg.content.tableTemplate &&
|
|
12
|
+
(msg.content.tableTemplate == 1 || msg.content.tableTemplate == 2 || msg.content.tableTemplate == 3)"
|
|
13
|
+
:header-cell-style="{ backgroundColor: '#F6F8FD', height: '40px', color: '#000000', fontWeight: 400 }"
|
|
14
|
+
:row-style="{ height: '40px', color: '#000000' }"
|
|
15
|
+
>
|
|
16
|
+
<el-table-column
|
|
17
|
+
type="selection"
|
|
18
|
+
v-if="msg.content.tableTemplate == 2 || msg.content.tableTemplate == 3"
|
|
19
|
+
align="center"
|
|
20
|
+
:selectable="checkSelectable"
|
|
21
|
+
width="55">
|
|
22
|
+
</el-table-column>
|
|
23
|
+
<el-table-column
|
|
24
|
+
fixed
|
|
25
|
+
prop="name"
|
|
26
|
+
label="产品名称"
|
|
27
|
+
width="150">
|
|
28
|
+
</el-table-column>
|
|
29
|
+
<el-table-column
|
|
30
|
+
prop="number"
|
|
31
|
+
label="产品编号"
|
|
32
|
+
align="center"
|
|
33
|
+
width="120"
|
|
34
|
+
>
|
|
35
|
+
</el-table-column>
|
|
36
|
+
<el-table-column
|
|
37
|
+
prop="inventory"
|
|
38
|
+
label="产品库存"
|
|
39
|
+
align="center"
|
|
40
|
+
width="80">
|
|
41
|
+
</el-table-column>
|
|
42
|
+
<el-table-column
|
|
43
|
+
prop="consumption"
|
|
44
|
+
label="今日平均消耗量"
|
|
45
|
+
align="center"
|
|
46
|
+
width="120">
|
|
47
|
+
</el-table-column>
|
|
48
|
+
</el-table>
|
|
49
|
+
<div class="handleButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || selection.length === 0 ? 'disabledButton' : ''">
|
|
50
|
+
<div class="buttonText"
|
|
51
|
+
v-for="(item,index) in msg.content.handleSettings"
|
|
52
|
+
:key="index"
|
|
53
|
+
@click="confirmFun(item)"
|
|
54
|
+
>
|
|
55
|
+
{{ item }}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script>
|
|
62
|
+
export default {
|
|
63
|
+
name: "outputCom",
|
|
64
|
+
data(){
|
|
65
|
+
return{
|
|
66
|
+
isDisabled:false,
|
|
67
|
+
selection:[],
|
|
68
|
+
tableData:[
|
|
69
|
+
{
|
|
70
|
+
name:"正新香辣大鸡排",
|
|
71
|
+
number:"ZX78OIJ867",
|
|
72
|
+
inventory:"88",
|
|
73
|
+
consumption:"24"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name:"正新香辣大鸡排",
|
|
77
|
+
number:"ZX78OIJ867",
|
|
78
|
+
inventory:"88",
|
|
79
|
+
consumption:"24"
|
|
80
|
+
},{
|
|
81
|
+
name:"正新香辣大鸡排",
|
|
82
|
+
number:"ZX78OIJ867",
|
|
83
|
+
inventory:"88",
|
|
84
|
+
consumption:"24"
|
|
85
|
+
}
|
|
86
|
+
,{
|
|
87
|
+
name:"正新香辣大鸡排",
|
|
88
|
+
number:"ZX78OIJ867",
|
|
89
|
+
inventory:"88",
|
|
90
|
+
consumption:"24"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
props:{
|
|
96
|
+
msg:{
|
|
97
|
+
type:Object,
|
|
98
|
+
default(){
|
|
99
|
+
return {}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
disabled:{
|
|
103
|
+
type:Boolean,
|
|
104
|
+
default:false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
methods:{
|
|
108
|
+
checkSelectable(){
|
|
109
|
+
return !this.disabled && !this.isDisabled
|
|
110
|
+
},
|
|
111
|
+
handleSelectionChange(val){
|
|
112
|
+
this.selection = val;
|
|
113
|
+
},
|
|
114
|
+
confirmFun(item){
|
|
115
|
+
if (this.disabled || this.isDisabled || this.selection.length == 0){
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
this.isDisabled = true;
|
|
119
|
+
this.$emit('confirmFun',item,this.selection,this.msg)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style scoped lang="less">
|
|
126
|
+
.outputComponents{
|
|
127
|
+
.outputText{
|
|
128
|
+
padding-bottom: 10px;
|
|
129
|
+
}
|
|
130
|
+
.handleButton{
|
|
131
|
+
padding-top: 10px;
|
|
132
|
+
width: 100%;
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
border-top: 1px solid #EEEEEE;
|
|
137
|
+
.buttonText{
|
|
138
|
+
padding: 0 4px;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
color: #366aff;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.disabledButton {
|
|
144
|
+
.buttonText {
|
|
145
|
+
color: #A9B3C6 !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
</style>
|