askbot-dragon 0.7.92 → 0.7.93
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/AiGuide.vue +2 -2
- package/src/components/ConversationContainer.vue +1537 -745
- package/src/components/formTemplate.vue +937 -416
- package/src/components/myPopup.vue +71 -0
- package/src/components/popup.vue +184 -0
- package/src/components/tree.vue +159 -0
- package/src/components/utils/format_date.js +9 -2
- package/vue.config.js +9 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="top-container">
|
|
4
|
+
<div class="close">取消</div>
|
|
5
|
+
<div class="sure">确定</div>
|
|
6
|
+
</div>
|
|
7
|
+
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" :offset="1" @load="onload" class="list-container">
|
|
8
|
+
<van-cell v-for="item in list" :key="item.id" :title="item.name" />
|
|
9
|
+
<!-- <van-cell title="123" />
|
|
10
|
+
<van-cell title="asdasd" />
|
|
11
|
+
<van-cell title="adszx" />
|
|
12
|
+
<van-cell title="zxc zc" />
|
|
13
|
+
<van-cell title="asdasd" />
|
|
14
|
+
<van-cell title="wqeqweqwe" />
|
|
15
|
+
<van-cell title="icvbncvbn" /> -->
|
|
16
|
+
</van-list>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
props: {
|
|
22
|
+
finished:{
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
list:{
|
|
27
|
+
type:Array,
|
|
28
|
+
default:() =>{
|
|
29
|
+
return []
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
show: false,
|
|
36
|
+
loading: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
onload() {
|
|
41
|
+
this.$emit('onload')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="less" scoped>
|
|
48
|
+
.container {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
.top-container {
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 50px;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
padding: 0 20px;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
.sure {
|
|
60
|
+
color: #366aff;
|
|
61
|
+
}
|
|
62
|
+
.close {
|
|
63
|
+
color: #cccccc;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.list-container {
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: calc(100% - 50px);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="popUp">
|
|
3
|
+
<div class="topBtn">
|
|
4
|
+
<span class="cancel" @click="closeBtn">取消</span>
|
|
5
|
+
<span class="sure" @click="sure">确定</span>
|
|
6
|
+
</div>
|
|
7
|
+
<slot name="popup-header" class="popup-header"></slot>
|
|
8
|
+
<div class="popup-content">
|
|
9
|
+
<div
|
|
10
|
+
class="filter-item"
|
|
11
|
+
v-for="(item,index) in options"
|
|
12
|
+
:key="index"
|
|
13
|
+
@click="checked(item,index)"
|
|
14
|
+
>
|
|
15
|
+
<div :class="[checkIdList.includes(item[props.value]) && 'setColor', 'label']">{{item[props.label]}}</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="popup-footer">
|
|
19
|
+
<slot name="popup-footer"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
checkOptions: [],
|
|
29
|
+
checkIdList:[],
|
|
30
|
+
visable:false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
props: {
|
|
34
|
+
options: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default:function() {
|
|
37
|
+
return []
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultValue: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default:function() {
|
|
43
|
+
return []
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default(){
|
|
49
|
+
return{
|
|
50
|
+
label: 'label',
|
|
51
|
+
value: 'value'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
multiple: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
checked(item) {
|
|
62
|
+
if(this.multiple) {
|
|
63
|
+
let count = this.checkIdList.findIndex(element => { return element == item[this.props.value] } )
|
|
64
|
+
if(count !== -1) {
|
|
65
|
+
this.checkIdList.splice(count,1)
|
|
66
|
+
this.checkOptions.splice(count,1)
|
|
67
|
+
} else {
|
|
68
|
+
this.checkIdList.push(item[this.props.value])
|
|
69
|
+
this.checkOptions.push(item)
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
this.checkIdList = []
|
|
73
|
+
this.checkOptions = []
|
|
74
|
+
this.checkIdList.push(item[this.props.value])
|
|
75
|
+
this.checkOptions.push(item)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
sure() {
|
|
79
|
+
if(this.checkOptions.length == 0 && this.checkIdList == 0){
|
|
80
|
+
this.$emit('onConfim',false,false)
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
let option = JSON.parse(JSON.stringify(this.checkOptions))
|
|
84
|
+
let list = JSON.parse(JSON.stringify(this.checkIdList))
|
|
85
|
+
if(this.multiple) {
|
|
86
|
+
this.$emit('onConfim',option, list)
|
|
87
|
+
} else {
|
|
88
|
+
this.$emit('onConfim',option[0], list[0])
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
closeBtn(){
|
|
92
|
+
this.$emit('onclose')
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
watch: {
|
|
96
|
+
defaultValue: {
|
|
97
|
+
handler(value) {
|
|
98
|
+
if (!value) {
|
|
99
|
+
// 定位当前位置
|
|
100
|
+
/* this.options.forEach(item => {})*/
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
deep: true,
|
|
104
|
+
immediate: true
|
|
105
|
+
},
|
|
106
|
+
visable(value) {
|
|
107
|
+
if(value) {
|
|
108
|
+
console.log(this.defaultValue,'=====');
|
|
109
|
+
this.checkOptions = []
|
|
110
|
+
if(Array.isArray(this.defaultValue)) {
|
|
111
|
+
this.checkIdList = [...this.defaultValue]
|
|
112
|
+
this.checkIdList.forEach(item =>{
|
|
113
|
+
this.options.forEach(res =>{
|
|
114
|
+
if(item == res[this.props.value]) {
|
|
115
|
+
this.checkOptions.push(res)
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
// else {
|
|
121
|
+
// this.checkIdList = this.defaultValue
|
|
122
|
+
// let obj = this.options.find(item =>{ return item[this.props.value] == this.defaultValue[0] })
|
|
123
|
+
// obj && this.checkOptions.push(obj)
|
|
124
|
+
// }
|
|
125
|
+
} else {
|
|
126
|
+
this.checkOptions = []
|
|
127
|
+
this.checkIdList = []
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<style lang="less" scoped>
|
|
136
|
+
.popup-content {
|
|
137
|
+
/*padding-top: 8px;*/
|
|
138
|
+
.filter-item {
|
|
139
|
+
width: 100%;
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
height: 48px;
|
|
144
|
+
.setColor {
|
|
145
|
+
color: #366aff;
|
|
146
|
+
}
|
|
147
|
+
.label {
|
|
148
|
+
display: block;
|
|
149
|
+
width: 80%;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
text-overflow: ellipsis;
|
|
152
|
+
white-space:nowrap;
|
|
153
|
+
text-align: center;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.topBtn {
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 40px;
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
padding: 0 20px;
|
|
165
|
+
.cancel {
|
|
166
|
+
color: #606266;
|
|
167
|
+
}
|
|
168
|
+
.sure {
|
|
169
|
+
color: #366aff;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
.popup-footer {
|
|
173
|
+
position: absolute;
|
|
174
|
+
max-height: 50px;
|
|
175
|
+
bottom: 0;
|
|
176
|
+
display: flex;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
align-items: center;
|
|
179
|
+
width: 100%;
|
|
180
|
+
color: #366aff;
|
|
181
|
+
background: #eff2f5;
|
|
182
|
+
/*border-radius: 28px;*/
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="tree">
|
|
3
|
+
<div class="tree-header">
|
|
4
|
+
<span class="cacel" @click="cancelBtn">取消</span>
|
|
5
|
+
<span class="primary" @click="saveData">确认</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="tree-container">
|
|
8
|
+
<el-tree :data="dataTree"
|
|
9
|
+
:props="defaultProps"
|
|
10
|
+
ref="dataTree"
|
|
11
|
+
node-key="value"
|
|
12
|
+
>
|
|
13
|
+
<span class="custom-tree-node" slot-scope="{ node,data}">
|
|
14
|
+
<span class="tree-label">{{ node.label }}</span>
|
|
15
|
+
<span>
|
|
16
|
+
<el-checkbox v-model="data.checked" v-if="dataOptions.extInfo.selectType ==='多选'"></el-checkbox>
|
|
17
|
+
<el-radio v-model="checked" v-else :label="data.value"></el-radio>
|
|
18
|
+
</span>
|
|
19
|
+
</span>
|
|
20
|
+
</el-tree>
|
|
21
|
+
</div>
|
|
22
|
+
<!-- <div class="footer">
|
|
23
|
+
<el-button>取 消</el-button>
|
|
24
|
+
<el-button type="primary" @click="saveData">确 认</el-button>
|
|
25
|
+
</div>-->
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: "tree",
|
|
32
|
+
data(){
|
|
33
|
+
return{
|
|
34
|
+
defaultProps:{},
|
|
35
|
+
checked:'',
|
|
36
|
+
dataTree:[],
|
|
37
|
+
checkList:[],
|
|
38
|
+
checkDatas:[]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
props:["dataOptions"],
|
|
42
|
+
methods:{
|
|
43
|
+
saveData(){
|
|
44
|
+
this.checkList = []
|
|
45
|
+
this.checkDatas = []
|
|
46
|
+
this.ergodicData(this.dataTree,this.checkList)
|
|
47
|
+
this.$emit('saveData',this.checkList,this.checkDatas)
|
|
48
|
+
},
|
|
49
|
+
cancelBtn(){
|
|
50
|
+
this.$emit('cancelBtn')
|
|
51
|
+
},
|
|
52
|
+
ergodicData(list){
|
|
53
|
+
list.forEach(item=>{
|
|
54
|
+
if (item.checked){
|
|
55
|
+
let data = this.$refs.dataTree.getNode(item)
|
|
56
|
+
let checkList = []
|
|
57
|
+
let arr = this.serchParent(data,checkList)
|
|
58
|
+
this.checkList.push(arr)
|
|
59
|
+
this.checkDatas.push(item)
|
|
60
|
+
}
|
|
61
|
+
if (item.value === this.checked){
|
|
62
|
+
let data = this.$refs.dataTree.getNode(item)
|
|
63
|
+
let checkList = []
|
|
64
|
+
let arr = this.serchParent(data,checkList)
|
|
65
|
+
this.checkList = arr
|
|
66
|
+
this.checkDatas = [item]
|
|
67
|
+
}
|
|
68
|
+
if (item.children){
|
|
69
|
+
this.ergodicData(item.children)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
serchParent(node,list) {
|
|
74
|
+
if(node) {
|
|
75
|
+
if(Object.prototype.toString.call(node.data) == '[object Object]') {
|
|
76
|
+
list.unshift(node.data.value)
|
|
77
|
+
}
|
|
78
|
+
if(node.parent) {
|
|
79
|
+
list = this.serchParent(node.parent,list)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return list
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
mounted() {
|
|
86
|
+
if (this.dataOptions.extInfo.cascadeDown.options){
|
|
87
|
+
this.dataTree = this.dataOptions.extInfo.cascadeDown.options
|
|
88
|
+
}
|
|
89
|
+
else if (this.dataOptions.extInfo.cascade){
|
|
90
|
+
this.dataTree = this.dataOptions.extInfo.cascade
|
|
91
|
+
}
|
|
92
|
+
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
93
|
+
this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style scoped lang="less">
|
|
100
|
+
#tree{
|
|
101
|
+
height: 100%;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
/deep/.el-tree-node__content{
|
|
104
|
+
height: 38px;
|
|
105
|
+
line-height: 38px;
|
|
106
|
+
}
|
|
107
|
+
.tree-header{
|
|
108
|
+
height: 30px;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
margin: 0 20px;
|
|
113
|
+
width: calc(100% - 40px);
|
|
114
|
+
/*font-size: 14px;*/
|
|
115
|
+
padding-bottom: 30px;
|
|
116
|
+
.primary{
|
|
117
|
+
color: #366aff;
|
|
118
|
+
}
|
|
119
|
+
.cacel{
|
|
120
|
+
color: #969799;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
.tree-container{
|
|
124
|
+
height:260px;
|
|
125
|
+
overflow-y: scroll;
|
|
126
|
+
overflow-x: hidden;
|
|
127
|
+
}
|
|
128
|
+
.custom-tree-node{
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
width: calc(100% - 40px);
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
.tree-label{
|
|
135
|
+
max-width: 160px;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
}
|
|
140
|
+
/deep/.el-radio__label{
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.footer{
|
|
145
|
+
position: absolute;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
height: 60px;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: space-between;
|
|
151
|
+
width: calc(100% - 40px);
|
|
152
|
+
margin: 0 20px;
|
|
153
|
+
.el-button{
|
|
154
|
+
flex: 1;
|
|
155
|
+
border-radius: 9px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
@@ -13,7 +13,14 @@ const formatDate = (fmt) => { //author: meizz
|
|
|
13
13
|
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
14
14
|
return fmt;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
function forMatTime(value){
|
|
17
|
+
let startTime = ''
|
|
18
|
+
let currentTime = new Date(), year = currentTime.getFullYear(),
|
|
19
|
+
month = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1,
|
|
20
|
+
day = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
|
|
21
|
+
startTime = year + "-" + month + "-" + day +' ' + value;
|
|
22
|
+
return new Date(startTime)
|
|
23
|
+
}
|
|
24
|
+
export { formatDate,forMatTime };
|
|
18
25
|
|
|
19
26
|
// new Date("2019-12-14T00:09:16.000+0000").Format("yyyy-MM-dd hh:mm:ss")
|
package/vue.config.js
CHANGED
|
@@ -23,6 +23,15 @@ module.exports = {
|
|
|
23
23
|
'^/open': '/'
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
+
'/order-api': {
|
|
27
|
+
target: 'http://master.test.askbot.cn:32022',
|
|
28
|
+
/*target:'http://new-test.guoranbot.com:30672',*/
|
|
29
|
+
changeOrigin: true,
|
|
30
|
+
ws: true,
|
|
31
|
+
pathRewrite: {
|
|
32
|
+
'^/order-api': '/'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
26
35
|
},
|
|
27
36
|
},
|
|
28
37
|
configureWebpack: {
|