Commit 404b4a0f authored by obt's avatar obt

搜索修复

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