xs-common-plugins 1.2.1 → 1.2.4
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 +298 -294
- package/common.js +110 -110
- package/index.js +1 -1
- package/package.json +16 -16
- package/src/common/common.js +548 -548
- package/src/components/CheckBox_Cmp/index.vue +62 -62
- package/src/components/FormItem/index.vue +92 -92
- package/src/components/ReportCmp/index.vue +76 -76
- package/src/components/Search/index.scss +219 -219
- package/src/components/Search/index.vue +410 -410
- package/src/components/Search/product_option/index.scss +1 -1
- package/src/components/Search_filter/index.scss +104 -104
- package/src/components/TableItem/TableItem.vue +55 -55
- package/src/components/TextOVer/index.vue +55 -55
- package/src/components/UploadImg/index.vue +177 -177
- package/src/components/im/index.vue +155 -155
- package/src/components/im/pages/chatList/index.vue +45 -45
- package/src/components/im/pages/chatRoom/index.vue +159 -159
- package/src/components/xsSelect/index.vue +125 -125
- package/src/mixin/keepAlive.js +53 -0
- package/src/plugins/im/components/chat/index.scss +163 -163
- package/src/plugins/im/components/chat/index.vue +144 -144
- package/src/plugins/im/components/chat/methods.js +149 -149
- package/src/plugins/im/components/msg-image/index.vue +40 -40
- package/src/plugins/im/components/send-msg/index.scss +164 -164
- package/src/plugins/im/components/send-msg/index.vue +107 -107
- package/src/plugins/im/components/send-msg/methods.js +125 -125
- package/src/plugins/im/components/template-message/index.vue +76 -76
- package/src/plugins/im/components/without.vue +19 -19
- package/src/plugins/im/index.js +31 -31
- package/src/plugins/im/utils/services.js +625 -625
- package/src/plugins/index.js +60 -60
- package/src/plugins/row-col-cmp/index.js +20 -20
- package/src/router/permission.js +126 -126
- package/src/store/modules/dic.js +74 -74
- package/src/store/modules/oss.js +40 -40
- package/src/styles/index.scss +91 -91
- package/src/styles/table.scss +90 -90
- package/src/utils/api.js +54 -54
- package/src/utils/auth.js +38 -38
- package/src/utils/concat_batch_btns.js +88 -88
- package/src/utils/enum.js +150 -150
- package/src/utils/filter.js +5 -5
- package/src/utils/filterRules.js +55 -55
- package/src/utils/getMenu.js +82 -82
- package/src/utils/global_directive.js +10 -0
- package/src/utils/ossService.js +55 -55
- package/src/utils/prototype.js +46 -46
- package/src/utils/search.js +33 -33
- package/src/utils/signalR.js +24 -24
- package/src/views/callback/index.vue +35 -35
- package/src/views/home/index.vue +25 -25
- package/src/views/layout/components/AppMain.vue +21 -5
- package/src/views/layout/components/Navbar.vue +20 -13
- package/src/views/layout/components/TagsView/index.vue +130 -91
- package/src/views/slienceAuth/index.vue +42 -42
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2021-01-15 15:38:04
|
|
4
|
-
* @LastEditTime: 2021-01-18 17:56:31
|
|
5
|
-
* @LastEditors: Please set LastEditors
|
|
6
|
-
* @Description: In User Settings Edit
|
|
7
|
-
* @FilePath: \dev\src\components\im\pages\chatList\index.vue
|
|
8
|
-
-->
|
|
9
|
-
<template>
|
|
10
|
-
<div class="rong-conversations">
|
|
11
|
-
<ConversationList :conversationList="conversationList" @chatroom="chatroom"></ConversationList>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
$$route: {
|
|
18
|
-
meta: {
|
|
19
|
-
title: "标题名称",
|
|
20
|
-
icon: "菜单图标",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
props: {
|
|
24
|
-
conversationList: [Array],
|
|
25
|
-
},
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
delivery: false,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
chatroom(item) {
|
|
33
|
-
this.$emit("chatroom", item);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
</script>
|
|
38
|
-
<style scoped lang="scss">
|
|
39
|
-
.rong-conversations {
|
|
40
|
-
height: 100vh;
|
|
41
|
-
color: #8e969f;
|
|
42
|
-
padding: 5px 20px;
|
|
43
|
-
font-size: 13px;
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: your name
|
|
3
|
+
* @Date: 2021-01-15 15:38:04
|
|
4
|
+
* @LastEditTime: 2021-01-18 17:56:31
|
|
5
|
+
* @LastEditors: Please set LastEditors
|
|
6
|
+
* @Description: In User Settings Edit
|
|
7
|
+
* @FilePath: \dev\src\components\im\pages\chatList\index.vue
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="rong-conversations">
|
|
11
|
+
<ConversationList :conversationList="conversationList" @chatroom="chatroom"></ConversationList>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
$$route: {
|
|
18
|
+
meta: {
|
|
19
|
+
title: "标题名称",
|
|
20
|
+
icon: "菜单图标",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
conversationList: [Array],
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
delivery: false,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
chatroom(item) {
|
|
33
|
+
this.$emit("chatroom", item);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
<style scoped lang="scss">
|
|
39
|
+
.rong-conversations {
|
|
40
|
+
height: 100vh;
|
|
41
|
+
color: #8e969f;
|
|
42
|
+
padding: 5px 20px;
|
|
43
|
+
font-size: 13px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
46
|
</style>
|
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2021-01-15 15:38:11
|
|
4
|
-
* @LastEditTime: 2021-01-16 15:06:42
|
|
5
|
-
* @LastEditors: Please set LastEditors
|
|
6
|
-
* @Description: In User Settings Edit
|
|
7
|
-
* @FilePath: \dev\src\components\im\pages\chatRoom\index.vue
|
|
8
|
-
-->
|
|
9
|
-
<template>
|
|
10
|
-
<div class="chatroom" id="chatroom">
|
|
11
|
-
<div class="goback" @click="goback">
|
|
12
|
-
<i class="el-icon-arrow-left" />
|
|
13
|
-
{{
|
|
14
|
-
currentItem.latestMessage.content.userInfo
|
|
15
|
-
? currentItem.latestMessage.content.userInfo.userName
|
|
16
|
-
: ""
|
|
17
|
-
}}
|
|
18
|
-
</div>
|
|
19
|
-
<chatCom
|
|
20
|
-
:targetId="currentItem.targetId"
|
|
21
|
-
:type="currentItem.type"
|
|
22
|
-
:targetName="
|
|
23
|
-
currentItem.content.userInfo
|
|
24
|
-
? currentItem.content.userInfo.targetName
|
|
25
|
-
: '客服'
|
|
26
|
-
"
|
|
27
|
-
:chatObj="currentItem"
|
|
28
|
-
>
|
|
29
|
-
<div slot="message" slot-scope="props">
|
|
30
|
-
<ImageMessage
|
|
31
|
-
v-if="props.message.name == 'RC:ImgMsg'"
|
|
32
|
-
:message="props.message"
|
|
33
|
-
/>
|
|
34
|
-
<TextMessage
|
|
35
|
-
v-if="props.message.name == 'RC:TxtMsg'"
|
|
36
|
-
:message="props.message"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
<template slot="slot-top" slot-scope="row">
|
|
40
|
-
<div class="fixedMessage" v-if="showFixed(row.list)">
|
|
41
|
-
<div class="image">
|
|
42
|
-
<img :src="goodInfo.url" />
|
|
43
|
-
</div>
|
|
44
|
-
<div class="info">
|
|
45
|
-
<p class="title">{{ goodInfo.title }}</p>
|
|
46
|
-
<p class="content"><span class="price"> ¥{{ goodInfo.price }} </span> <span>选货价:¥{{ goodInfo.costPrice }} </span></p>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
</chatCom>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
<script>
|
|
54
|
-
export default {
|
|
55
|
-
props: {
|
|
56
|
-
currentItem: [Object]
|
|
57
|
-
},
|
|
58
|
-
data () {
|
|
59
|
-
return {
|
|
60
|
-
goodInfo: {
|
|
61
|
-
title: '',
|
|
62
|
-
price: '',
|
|
63
|
-
costPrice: '',
|
|
64
|
-
url: ''
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
goback() {
|
|
70
|
-
this.$emit("goback");
|
|
71
|
-
},
|
|
72
|
-
showFixed(list) {
|
|
73
|
-
const goodsList = list.filter(item => item.content && item.content.OutGoodsId)
|
|
74
|
-
if (goodsList.length > 0) {
|
|
75
|
-
this.getGoodInfo(goodsList[goodsList.length - 1])
|
|
76
|
-
}
|
|
77
|
-
return goodsList.length > 0 ? true : false;
|
|
78
|
-
},
|
|
79
|
-
getGoodInfo(row) {
|
|
80
|
-
this.$http.post('api.Product.GetById', { productId: row.content.OutGoodsId }).then(res => {
|
|
81
|
-
const data = res.data
|
|
82
|
-
this.goodInfo.title = data.baseInfo.title
|
|
83
|
-
this.goodInfo.price = data.baseInfo.superPrice
|
|
84
|
-
this.goodInfo.costPrice = data.baseInfo.costPrice
|
|
85
|
-
this.goodInfo.url = data.baseInfo.listWapDescImg[0]
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
</script>
|
|
91
|
-
<style lang="scss" scoped>
|
|
92
|
-
.chatroom {
|
|
93
|
-
width: 100%;
|
|
94
|
-
height: 100vh;
|
|
95
|
-
background: #dfdfe2;
|
|
96
|
-
}
|
|
97
|
-
.goback {
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
background-color: #f4f4f5;
|
|
100
|
-
color: #909399;
|
|
101
|
-
width: 100%;
|
|
102
|
-
padding: 12px 16px;
|
|
103
|
-
margin: 0;
|
|
104
|
-
-webkit-box-sizing: border-box;
|
|
105
|
-
box-sizing: border-box;
|
|
106
|
-
font-size: 13px;
|
|
107
|
-
margin-bottom: 15px;
|
|
108
|
-
position: absolute;
|
|
109
|
-
left: 0;
|
|
110
|
-
top: 0;
|
|
111
|
-
z-index: 999;
|
|
112
|
-
}
|
|
113
|
-
.fixedMessage {
|
|
114
|
-
width: 400px;
|
|
115
|
-
float: right;
|
|
116
|
-
height: 80px;
|
|
117
|
-
line-height: 80px;
|
|
118
|
-
display: flex;
|
|
119
|
-
z-index: 99;
|
|
120
|
-
position: relative;
|
|
121
|
-
background-color: #fff;
|
|
122
|
-
margin-top: 18px;
|
|
123
|
-
padding: 0 10px;
|
|
124
|
-
&>div{
|
|
125
|
-
height: 100%;
|
|
126
|
-
}
|
|
127
|
-
p {
|
|
128
|
-
padding: 0px;
|
|
129
|
-
margin: 0px;
|
|
130
|
-
line-height: 30px;
|
|
131
|
-
}
|
|
132
|
-
.image {
|
|
133
|
-
width: 60px;
|
|
134
|
-
height: 60px;
|
|
135
|
-
margin-right: 5px;
|
|
136
|
-
margin-top: 10px;
|
|
137
|
-
border-radius: 5px;
|
|
138
|
-
overflow: hidden;
|
|
139
|
-
img {
|
|
140
|
-
width: 100%;
|
|
141
|
-
border-radius: 5px;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
.info {
|
|
145
|
-
padding: 10px 0 10px 10px;
|
|
146
|
-
.title {
|
|
147
|
-
font-size: 15px;
|
|
148
|
-
color: #666;
|
|
149
|
-
}
|
|
150
|
-
.price {
|
|
151
|
-
color: #ff455b;
|
|
152
|
-
font-size: 18px;
|
|
153
|
-
}
|
|
154
|
-
.content {
|
|
155
|
-
font-size: 13px;
|
|
156
|
-
color: #999;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: your name
|
|
3
|
+
* @Date: 2021-01-15 15:38:11
|
|
4
|
+
* @LastEditTime: 2021-01-16 15:06:42
|
|
5
|
+
* @LastEditors: Please set LastEditors
|
|
6
|
+
* @Description: In User Settings Edit
|
|
7
|
+
* @FilePath: \dev\src\components\im\pages\chatRoom\index.vue
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="chatroom" id="chatroom">
|
|
11
|
+
<div class="goback" @click="goback">
|
|
12
|
+
<i class="el-icon-arrow-left" />
|
|
13
|
+
{{
|
|
14
|
+
currentItem.latestMessage.content.userInfo
|
|
15
|
+
? currentItem.latestMessage.content.userInfo.userName
|
|
16
|
+
: ""
|
|
17
|
+
}}
|
|
18
|
+
</div>
|
|
19
|
+
<chatCom
|
|
20
|
+
:targetId="currentItem.targetId"
|
|
21
|
+
:type="currentItem.type"
|
|
22
|
+
:targetName="
|
|
23
|
+
currentItem.content.userInfo
|
|
24
|
+
? currentItem.content.userInfo.targetName
|
|
25
|
+
: '客服'
|
|
26
|
+
"
|
|
27
|
+
:chatObj="currentItem"
|
|
28
|
+
>
|
|
29
|
+
<div slot="message" slot-scope="props">
|
|
30
|
+
<ImageMessage
|
|
31
|
+
v-if="props.message.name == 'RC:ImgMsg'"
|
|
32
|
+
:message="props.message"
|
|
33
|
+
/>
|
|
34
|
+
<TextMessage
|
|
35
|
+
v-if="props.message.name == 'RC:TxtMsg'"
|
|
36
|
+
:message="props.message"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
<template slot="slot-top" slot-scope="row">
|
|
40
|
+
<div class="fixedMessage" v-if="showFixed(row.list)">
|
|
41
|
+
<div class="image">
|
|
42
|
+
<img :src="goodInfo.url" />
|
|
43
|
+
</div>
|
|
44
|
+
<div class="info">
|
|
45
|
+
<p class="title">{{ goodInfo.title }}</p>
|
|
46
|
+
<p class="content"><span class="price"> ¥{{ goodInfo.price }} </span> <span>选货价:¥{{ goodInfo.costPrice }} </span></p>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
</chatCom>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
<script>
|
|
54
|
+
export default {
|
|
55
|
+
props: {
|
|
56
|
+
currentItem: [Object]
|
|
57
|
+
},
|
|
58
|
+
data () {
|
|
59
|
+
return {
|
|
60
|
+
goodInfo: {
|
|
61
|
+
title: '',
|
|
62
|
+
price: '',
|
|
63
|
+
costPrice: '',
|
|
64
|
+
url: ''
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
goback() {
|
|
70
|
+
this.$emit("goback");
|
|
71
|
+
},
|
|
72
|
+
showFixed(list) {
|
|
73
|
+
const goodsList = list.filter(item => item.content && item.content.OutGoodsId)
|
|
74
|
+
if (goodsList.length > 0) {
|
|
75
|
+
this.getGoodInfo(goodsList[goodsList.length - 1])
|
|
76
|
+
}
|
|
77
|
+
return goodsList.length > 0 ? true : false;
|
|
78
|
+
},
|
|
79
|
+
getGoodInfo(row) {
|
|
80
|
+
this.$http.post('api.Product.GetById', { productId: row.content.OutGoodsId }).then(res => {
|
|
81
|
+
const data = res.data
|
|
82
|
+
this.goodInfo.title = data.baseInfo.title
|
|
83
|
+
this.goodInfo.price = data.baseInfo.superPrice
|
|
84
|
+
this.goodInfo.costPrice = data.baseInfo.costPrice
|
|
85
|
+
this.goodInfo.url = data.baseInfo.listWapDescImg[0]
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
<style lang="scss" scoped>
|
|
92
|
+
.chatroom {
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100vh;
|
|
95
|
+
background: #dfdfe2;
|
|
96
|
+
}
|
|
97
|
+
.goback {
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
background-color: #f4f4f5;
|
|
100
|
+
color: #909399;
|
|
101
|
+
width: 100%;
|
|
102
|
+
padding: 12px 16px;
|
|
103
|
+
margin: 0;
|
|
104
|
+
-webkit-box-sizing: border-box;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
font-size: 13px;
|
|
107
|
+
margin-bottom: 15px;
|
|
108
|
+
position: absolute;
|
|
109
|
+
left: 0;
|
|
110
|
+
top: 0;
|
|
111
|
+
z-index: 999;
|
|
112
|
+
}
|
|
113
|
+
.fixedMessage {
|
|
114
|
+
width: 400px;
|
|
115
|
+
float: right;
|
|
116
|
+
height: 80px;
|
|
117
|
+
line-height: 80px;
|
|
118
|
+
display: flex;
|
|
119
|
+
z-index: 99;
|
|
120
|
+
position: relative;
|
|
121
|
+
background-color: #fff;
|
|
122
|
+
margin-top: 18px;
|
|
123
|
+
padding: 0 10px;
|
|
124
|
+
&>div{
|
|
125
|
+
height: 100%;
|
|
126
|
+
}
|
|
127
|
+
p {
|
|
128
|
+
padding: 0px;
|
|
129
|
+
margin: 0px;
|
|
130
|
+
line-height: 30px;
|
|
131
|
+
}
|
|
132
|
+
.image {
|
|
133
|
+
width: 60px;
|
|
134
|
+
height: 60px;
|
|
135
|
+
margin-right: 5px;
|
|
136
|
+
margin-top: 10px;
|
|
137
|
+
border-radius: 5px;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
img {
|
|
140
|
+
width: 100%;
|
|
141
|
+
border-radius: 5px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.info {
|
|
145
|
+
padding: 10px 0 10px 10px;
|
|
146
|
+
.title {
|
|
147
|
+
font-size: 15px;
|
|
148
|
+
color: #666;
|
|
149
|
+
}
|
|
150
|
+
.price {
|
|
151
|
+
color: #ff455b;
|
|
152
|
+
font-size: 18px;
|
|
153
|
+
}
|
|
154
|
+
.content {
|
|
155
|
+
font-size: 13px;
|
|
156
|
+
color: #999;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
160
|
</style>
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="XSSelect">
|
|
3
|
-
<el-select
|
|
4
|
-
v-model="selectVal"
|
|
5
|
-
default-first-option
|
|
6
|
-
:placeholder="placeholder"
|
|
7
|
-
:disabled="disabled"
|
|
8
|
-
:clearable="clearable"
|
|
9
|
-
:multiple="multiple"
|
|
10
|
-
:collapse-tags="collapseTags"
|
|
11
|
-
:filterable="filterable"
|
|
12
|
-
:remote="remote"
|
|
13
|
-
:remote-method="remoteMethod"
|
|
14
|
-
@change="changeMethod"
|
|
15
|
-
@remove-tag="removeTag"
|
|
16
|
-
@clear="clear"
|
|
17
|
-
@blur="blur"
|
|
18
|
-
@focus="focus"
|
|
19
|
-
>
|
|
20
|
-
<el-option
|
|
21
|
-
v-for="(item, index) in options"
|
|
22
|
-
:key="index"
|
|
23
|
-
:label="item[label]"
|
|
24
|
-
:value="item[code]"
|
|
25
|
-
>
|
|
26
|
-
<template v-if="label2">
|
|
27
|
-
<span style="float: left">{{ item[label] }}</span>
|
|
28
|
-
<span style="float: right; color: #8492a6; font-size: 13px">{{ item[label2] }}</span>
|
|
29
|
-
</template>
|
|
30
|
-
</el-option>
|
|
31
|
-
</el-select>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
export default {
|
|
37
|
-
name: 'XSSelect',
|
|
38
|
-
props: {
|
|
39
|
-
placeholder: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: '请选择'
|
|
42
|
-
},
|
|
43
|
-
value: {
|
|
44
|
-
type: [String, Number, Array]
|
|
45
|
-
},
|
|
46
|
-
options: { // 下拉列表
|
|
47
|
-
type: [Array, String],
|
|
48
|
-
},
|
|
49
|
-
label: { // 下拉显示的值
|
|
50
|
-
type: String,
|
|
51
|
-
default: 'name'
|
|
52
|
-
},
|
|
53
|
-
label2: { // 下拉要显示两栏, 第二栏显示的值
|
|
54
|
-
type: String,
|
|
55
|
-
},
|
|
56
|
-
code: { // 下拉选项绑定value 的字段
|
|
57
|
-
type: String,
|
|
58
|
-
default: 'id'
|
|
59
|
-
},
|
|
60
|
-
disabled: { // 禁用
|
|
61
|
-
type: [Boolean, String],
|
|
62
|
-
default: false
|
|
63
|
-
},
|
|
64
|
-
clearable:{ // 可删除
|
|
65
|
-
type: [Boolean, String],
|
|
66
|
-
default: true
|
|
67
|
-
},
|
|
68
|
-
multiple: { // 多选
|
|
69
|
-
type: [Boolean, String],
|
|
70
|
-
default: false
|
|
71
|
-
},
|
|
72
|
-
collapseTags: { // 多选超过一条显示+号
|
|
73
|
-
type: [Boolean, String],
|
|
74
|
-
default: false
|
|
75
|
-
},
|
|
76
|
-
filterable: { // 可搜索
|
|
77
|
-
type: [Boolean, String],
|
|
78
|
-
default: true
|
|
79
|
-
},
|
|
80
|
-
remote: { // 远程搜索
|
|
81
|
-
type: [Boolean, String],
|
|
82
|
-
default: false
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
data() {
|
|
86
|
-
return {
|
|
87
|
-
selectVal: this.value,
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
watch: {
|
|
91
|
-
value: {
|
|
92
|
-
handler (newVal) {
|
|
93
|
-
this.selectVal = newVal
|
|
94
|
-
},
|
|
95
|
-
deep: true,
|
|
96
|
-
immediate: true
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
methods: {
|
|
100
|
-
remoteMethod (val) {
|
|
101
|
-
this.$emit("remoteMethod", val)
|
|
102
|
-
},
|
|
103
|
-
changeMethod (val){
|
|
104
|
-
let row = this.options.find(item => item[this.code] == val)
|
|
105
|
-
this.$emit('input', val)
|
|
106
|
-
this.$emit('change', row?row:[])
|
|
107
|
-
},
|
|
108
|
-
removeTag (val) {
|
|
109
|
-
this.$emit('removeTag', val)
|
|
110
|
-
},
|
|
111
|
-
clear () {
|
|
112
|
-
this.$emit('clear')
|
|
113
|
-
},
|
|
114
|
-
blur (e) {
|
|
115
|
-
this.$emit('blur', e)
|
|
116
|
-
},
|
|
117
|
-
focus (e) {
|
|
118
|
-
this.$emit('blur', e)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
</script>
|
|
123
|
-
|
|
124
|
-
<style lang="scss" scoped>
|
|
125
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="XSSelect">
|
|
3
|
+
<el-select
|
|
4
|
+
v-model="selectVal"
|
|
5
|
+
default-first-option
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:clearable="clearable"
|
|
9
|
+
:multiple="multiple"
|
|
10
|
+
:collapse-tags="collapseTags"
|
|
11
|
+
:filterable="filterable"
|
|
12
|
+
:remote="remote"
|
|
13
|
+
:remote-method="remoteMethod"
|
|
14
|
+
@change="changeMethod"
|
|
15
|
+
@remove-tag="removeTag"
|
|
16
|
+
@clear="clear"
|
|
17
|
+
@blur="blur"
|
|
18
|
+
@focus="focus"
|
|
19
|
+
>
|
|
20
|
+
<el-option
|
|
21
|
+
v-for="(item, index) in options"
|
|
22
|
+
:key="index"
|
|
23
|
+
:label="item[label]"
|
|
24
|
+
:value="item[code]"
|
|
25
|
+
>
|
|
26
|
+
<template v-if="label2">
|
|
27
|
+
<span style="float: left">{{ item[label] }}</span>
|
|
28
|
+
<span style="float: right; color: #8492a6; font-size: 13px">{{ item[label2] }}</span>
|
|
29
|
+
</template>
|
|
30
|
+
</el-option>
|
|
31
|
+
</el-select>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
name: 'XSSelect',
|
|
38
|
+
props: {
|
|
39
|
+
placeholder: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: '请选择'
|
|
42
|
+
},
|
|
43
|
+
value: {
|
|
44
|
+
type: [String, Number, Array]
|
|
45
|
+
},
|
|
46
|
+
options: { // 下拉列表
|
|
47
|
+
type: [Array, String],
|
|
48
|
+
},
|
|
49
|
+
label: { // 下拉显示的值
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'name'
|
|
52
|
+
},
|
|
53
|
+
label2: { // 下拉要显示两栏, 第二栏显示的值
|
|
54
|
+
type: String,
|
|
55
|
+
},
|
|
56
|
+
code: { // 下拉选项绑定value 的字段
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'id'
|
|
59
|
+
},
|
|
60
|
+
disabled: { // 禁用
|
|
61
|
+
type: [Boolean, String],
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
clearable:{ // 可删除
|
|
65
|
+
type: [Boolean, String],
|
|
66
|
+
default: true
|
|
67
|
+
},
|
|
68
|
+
multiple: { // 多选
|
|
69
|
+
type: [Boolean, String],
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
collapseTags: { // 多选超过一条显示+号
|
|
73
|
+
type: [Boolean, String],
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
filterable: { // 可搜索
|
|
77
|
+
type: [Boolean, String],
|
|
78
|
+
default: true
|
|
79
|
+
},
|
|
80
|
+
remote: { // 远程搜索
|
|
81
|
+
type: [Boolean, String],
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
selectVal: this.value,
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
watch: {
|
|
91
|
+
value: {
|
|
92
|
+
handler (newVal) {
|
|
93
|
+
this.selectVal = newVal
|
|
94
|
+
},
|
|
95
|
+
deep: true,
|
|
96
|
+
immediate: true
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
remoteMethod (val) {
|
|
101
|
+
this.$emit("remoteMethod", val)
|
|
102
|
+
},
|
|
103
|
+
changeMethod (val){
|
|
104
|
+
let row = this.options.find(item => item[this.code] == val)
|
|
105
|
+
this.$emit('input', val)
|
|
106
|
+
this.$emit('change', row?row:[])
|
|
107
|
+
},
|
|
108
|
+
removeTag (val) {
|
|
109
|
+
this.$emit('removeTag', val)
|
|
110
|
+
},
|
|
111
|
+
clear () {
|
|
112
|
+
this.$emit('clear')
|
|
113
|
+
},
|
|
114
|
+
blur (e) {
|
|
115
|
+
this.$emit('blur', e)
|
|
116
|
+
},
|
|
117
|
+
focus (e) {
|
|
118
|
+
this.$emit('blur', e)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style lang="scss" scoped>
|
|
125
|
+
|
|
126
126
|
</style>
|