提交 a2defcd4 authored 作者: 邓文彬's avatar 邓文彬

fix(pad): 搜索条件修改

上级 42800b79
......@@ -7,8 +7,9 @@
v-model="searchFrom.inspectionType"
:localdata="inspectArr"
@change="(e) => change(e, 'inspectionType')"
placeholder="全部巡检"
placeholder="巡检类型:全部"
:clear="true"
:key="new Date().getTime()"
></uni-data-select>
<uni-data-select
......@@ -16,9 +17,11 @@
class="uni-search-item"
v-model="searchFrom.synchronization"
:localdata="synchronization"
placeholder="全部"
placeholder="是否同步:全部"
@change="(e) => change(e, 'synchronization')"
:clear="true"
:key="new Date().getTime()"
></uni-data-select>
<uni-data-select
......@@ -26,9 +29,10 @@
class="uni-search-item"
v-model="searchFrom.isException"
:localdata="exceptionArr"
placeholder="有无异常"
placeholder="有无异常:全部"
@change="(e) => change(e, 'isException')"
:clear="true"
:key="new Date().getTime()"
></uni-data-select>
</view>
......@@ -67,17 +71,17 @@ export default {
},
inspectArr: [
{ value: "", text: "全部" },
{ value: "all", text: "全部" },
{ value: "1", text: "机房巡检" },
{ value: "2", text: "井道巡检" },
],
synchronization: [
{ value: "", text: "全部" },
{ value: "all", text: "全部" },
{ value: "0", text: "未同步" },
{ value: "1", text: "已同步" },
],
exceptionArr: [
{ value: "", text: "全部" },
{ value: "all", text: "全部" },
{ value: "1", text: "有异常" },
{ value: "0", text: "无异常" },
],
......
......@@ -26,7 +26,8 @@
v-model="searchFrom.type"
:localdata="typeList"
@change="change"
placeholder="全部"
placeholder="操作类型:全部"
:key="new Date().getTime()"
></uni-data-select>
<view class="search-com-right">
......@@ -94,7 +95,7 @@ export default {
total: 0,
loading: false,
typeList: [
{ value: "", text: "全部" },
{ value: "all", text: "全部" },
{ value: "1", text: "巡检" },
{ value: "2", text: "同步" },
......@@ -166,7 +167,7 @@ export default {
this.tableData = this.recordData.filter((item) => {
let matchType = true; // 类型筛选
let matchTime = true; // 时间筛选
if (type) {
if (type && type != "all") {
if (type == -1) {
// [其他]搜索项
matchType =
......
......@@ -148,11 +148,13 @@ export default {
synchronization = "",
} = this.searchForm;
return arr.filter((item) => {
return (
(!isException || item.isException == isException) &&
(!inspectionType || item.inspectionType == inspectionType) &&
(!synchronization || item.synchronization == synchronization)
( !isException || isException =="all" || item.isException == isException) &&
( !inspectionType || inspectionType =="all" || item.inspectionType == inspectionType) &&
( !synchronization || synchronization =="all" || item.synchronization == synchronization)
);
});
},
......
......@@ -168,9 +168,9 @@ export default {
return arr.filter((item) => {
return (
(!isException || item.isException == isException) &&
(!inspectionType || item.inspectionType == inspectionType) &&
(!synchronization || item.synchronization == synchronization)
( !isException || isException =="all" || item.isException == isException) &&
( !inspectionType || inspectionType =="all" || item.inspectionType == inspectionType) &&
( !synchronization || synchronization =="all" || item.synchronization == synchronization)
);
});
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论