|
@@ -4,7 +4,11 @@
|
4
|
4
|
<div
|
5
|
5
|
slot="reference"
|
6
|
6
|
:style="width ? 'width:' + width : ''"
|
7
|
|
- :class="['common-screen-self-box', 'common-input-select', accountListResult.length ? 'common-input-select-hover' : '']"
|
|
7
|
+ :class="[
|
|
8
|
+ 'common-screen-self-box',
|
|
9
|
+ 'common-input-select',
|
|
10
|
+ accountListResult.length && clearable ? 'common-input-select-hover' : ''
|
|
11
|
+ ]"
|
8
|
12
|
@click="dialogVisible = true"
|
9
|
13
|
>
|
10
|
14
|
<div :class="['common-screen-self-con', accountListResult.length ? '' : 'common-screen-self-placeholder']">
|
|
@@ -12,6 +16,7 @@
|
12
|
16
|
<span v-if="accountListResult.length">{{ accountListResultName }}</span>
|
13
|
17
|
<span v-else>请选择</span>
|
14
|
18
|
</div>
|
|
19
|
+ <i class="el-icon-circle-close other-icon" @click.stop="onClickClearBtn"></i>
|
15
|
20
|
</div>
|
16
|
21
|
<div class="common-screen-self-icon"><i class="el-icon-arrow-down" /></div>
|
17
|
22
|
</div>
|
|
@@ -92,6 +97,10 @@ export default {
|
92
|
97
|
type: String,
|
93
|
98
|
default: () => ''
|
94
|
99
|
},
|
|
100
|
+ clearable: {
|
|
101
|
+ type: Boolean,
|
|
102
|
+ default: () => false
|
|
103
|
+ },
|
95
|
104
|
accountListResult: { // 最终确认选择的账号列表
|
96
|
105
|
type: Array,
|
97
|
106
|
default: () => []
|
|
@@ -165,22 +174,9 @@ export default {
|
165
|
174
|
this.loading = false
|
166
|
175
|
}
|
167
|
176
|
},
|
168
|
|
-
|
169
|
|
- // 根据关键字过滤"可选择的账号列表"
|
170
|
|
- handleFilterAccountList() {
|
171
|
|
- this.accountListFilter = this.accountList.filter(account => {
|
172
|
|
- const currentName = account.name.toLowerCase()
|
173
|
|
- const keyword = this.keyword.toLowerCase()
|
174
|
|
- return currentName.includes(keyword)
|
175
|
|
- })
|
176
|
|
- },
|
|
177
|
+ // 监听关键字变化
|
177
|
178
|
onChangeKeyword(val) {
|
178
|
|
- console.log('val => ', val)
|
179
|
179
|
this.keyword = val
|
180
|
|
- // this.handleGetAccountList()
|
181
|
|
- // if (this.keyword) {
|
182
|
|
- // this.handleFilterAccountList()
|
183
|
|
- // }
|
184
|
180
|
},
|
185
|
181
|
// 取消可选列表中所有的已选状态
|
186
|
182
|
handleCloseAllChatList() {
|
|
@@ -279,12 +275,17 @@ export default {
|
279
|
275
|
// 根据已选列表 判断当前是否全选
|
280
|
276
|
handleGetIsSelectAll() {
|
281
|
277
|
const currentSelectedLength = this.accountListSelected.length
|
282
|
|
- if (currentSelectedLength === this.accountList.length) {
|
|
278
|
+ if (this.accountList.length && (currentSelectedLength === this.accountList.length)) {
|
283
|
279
|
this.isSelectAll = true
|
284
|
280
|
} else {
|
285
|
281
|
this.isSelectAll = false
|
286
|
282
|
}
|
287
|
283
|
},
|
|
284
|
+ // 监听点击输入框“清空”按钮
|
|
285
|
+ onClickClearBtn() {
|
|
286
|
+ this.handleDelAllSelectedAccount()
|
|
287
|
+ this.onClickConfirm()
|
|
288
|
+ },
|
288
|
289
|
},
|
289
|
290
|
};
|
290
|
291
|
</script>
|