Commit 99e32f8e authored by 徐一鸣's avatar 徐一鸣

消息管理服务筛选fixed

parent 275d8f3d
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<div class="select_service"> <div class="select_service">
<screen-type <screen-type
class="service_fliter" class="service_fliter"
:data="filterList"
:top_data="serviceTypes" :top_data="serviceTypes"
:data="filterList"
:openflag="true"
@topselect="changeType" @topselect="changeType"
@getselect="getFilters" @getselect="getFilters"
></screen-type> ></screen-type>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</el-input> </el-input>
</div> </div>
<div class="type_select" v-show="openflag"> <div class="type_select" v-show="openflag">
<div class="line_data" style="overflow:hidden;"> <div class="line_data" style="overflow:hidden;" v-if="top_data">
<div class="select_name">{{ top_data.name }}</div> <div class="select_name">{{ top_data.name }}</div>
<div <div
ref="select_arr_box_top" ref="select_arr_box_top"
...@@ -107,12 +107,15 @@ export default { ...@@ -107,12 +107,15 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
openflag: {
type: Boolean,
default: false,
},
}, },
components: {}, components: {},
data() { data() {
return { return {
input2: "", input2: "",
openflag: false,
selected_arr: [], selected_arr: [],
show_selected: [], show_selected: [],
show_open: [], show_open: [],
...@@ -203,12 +206,23 @@ export default { ...@@ -203,12 +206,23 @@ export default {
}); });
}, },
set_select(index, id) { set_select(index, id) {
if (this.selected_arr[index].indexOf(id) == -1) { if (id === "") {
this.selected_arr[index].push(id); this.$set(this.selected_arr, index, [""]);
} else { } else {
this.selected_arr[index].splice( let selectIds = this.selected_arr[index];
this.selected_arr[index].indexOf(id),
1 selectIds = selectIds.filter((id) => id !== "");
if (selectIds.indexOf(id) == -1) {
selectIds.push(id);
} else {
selectIds.splice(selectIds.indexOf(id), 1);
}
this.$set(
this.selected_arr,
index,
selectIds.length > 0 ? selectIds : [""]
); );
} }
this.post_value(); this.post_value();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment