Commit 404b4a0f authored by obt's avatar obt

搜索修复

parent 8763c83a
<!--
* @Author: your name
* @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-09 11:14:00
* @LastEditTime: 2020-12-09 14:17:29
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
......@@ -14,7 +14,7 @@
<span>应用名称</span>
<el-col :span="16">
<el-input
v-model="applyName"
v-model="currentTypeName"
placeholder="请输入类型名称"
size="100px"
></el-input>
......@@ -49,6 +49,7 @@
class="item"
v-for="(item, index) in operatorControls"
:key="index"
@click.stop="clickOperator(index)"
>
{{ item.name }}
</div>
......@@ -163,7 +164,7 @@ export default {
name: "清空搜索",
},
],
applyName: "",
currentTypeName: "",
//所有状态
status: [
{
......@@ -211,6 +212,7 @@ export default {
};
},
mounted() {
this.pullAllApplicationType()
this.pullListApplicationInfo()
},
methods: {
......@@ -225,6 +227,78 @@ export default {
this.$parent.componentName = 'addApp'
this.$parent.info = null
},
// 获取所有应用类型
pullAllApplicationType(){
this.types = [{
value: "",
label: "全部",
}]
getAllApplicationType().then(res => {
if(res.status == 200){
// console.log("获取所有的应用类型=>",res)
res.data.forEach(element => {
if(element.isDel==0){
this.types.push({
value: element.id,
label: element.title
});
}
});
}
})
},
clickOperator(index){
if(index == 1){
this.currentTypeName = ""
this.currentStatus = ""
this.currentType = ""
}
this.screenApplicationInfo()
},
// 筛选数据
screenApplicationInfo(){
this.tableData = []
this.tableDataCache.forEach(element => {
// 未被删除的
if(element.isDel==0){
this.tableData.push({
attribute:element.attribute,
examples:element.examples,
examplesJson: element.examplesJson,
id: element.id,
indexShow:element.indexShow,
introduction:element.introduction,
isDel:element.isDel,
protection:element.protection,
rank: element.rank,
firstTypeId:element.firstTypeId,
firstTitle: element.firstTitle,
secondTypeId:element.secondTypeId,
secondTitle:element.secondTitle,
title: element.title,
coverImg:element.coverImg,
icon: {
url: element.detailImg,
showPreview: false,
},
crtTime: element.crtTime,
status: element.status,
updTime: element.updTime,
customized: element.customized,
});
}
});
if(this.currentStatus!=''){
this.tableData = this.tableData.filter(element => element.status == this.currentStatus)
}
if(this.currentType!=''){
let type = this.types.find(element => element.value == this.currentType)
this.tableData = this.tableData.filter(element => this.getAttributeIndustry(element.attribute) == type.label)
}
if(this.currentTypeName!=''){
this.tableData = this.tableData.filter(element => element.title == this.currentTypeName)
}
},
// 分页获取应用详情数据
pullListApplicationInfo(){
getListApplicationInfo({
......@@ -239,36 +313,37 @@ export default {
res.data.data.forEach(element => {
this.tableDataCache.push(element)
});
this.tableDataCache.forEach(element => {
// 未被删除的
if(element.isDel==0){
this.tableData.push({
attribute:element.attribute,
examples:element.examples,
examplesJson: element.examplesJson,
id: element.id,
indexShow:element.indexShow,
introduction:element.introduction,
isDel:element.isDel,
protection:element.protection,
rank: element.rank,
firstTypeId:element.firstTypeId,
firstTitle: element.firstTitle,
secondTypeId:element.secondTypeId,
secondTitle:element.secondTitle,
title: element.title,
coverImg:element.coverImg,
icon: {
url: element.detailImg,
showPreview: false,
},
crtTime: element.crtTime,
status: element.status,
updTime: element.updTime,
customized: element.customized,
});
}
});
this.screenApplicationInfo()
// this.tableDataCache.forEach(element => {
// // 未被删除的
// if(element.isDel==0){
// this.tableData.push({
// attribute:element.attribute,
// examples:element.examples,
// examplesJson: element.examplesJson,
// id: element.id,
// indexShow:element.indexShow,
// introduction:element.introduction,
// isDel:element.isDel,
// protection:element.protection,
// rank: element.rank,
// firstTypeId:element.firstTypeId,
// firstTitle: element.firstTitle,
// secondTypeId:element.secondTypeId,
// secondTitle:element.secondTitle,
// title: element.title,
// coverImg:element.coverImg,
// icon: {
// url: element.detailImg,
// showPreview: false,
// },
// crtTime: element.crtTime,
// status: element.status,
// updTime: element.updTime,
// customized: element.customized,
// });
// }
// });
}
})
},
......
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