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,20 +227,37 @@ export default { ...@@ -225,20 +227,37 @@ export default {
this.$parent.componentName = 'addApp' this.$parent.componentName = 'addApp'
this.$parent.info = null this.$parent.info = null
}, },
// 分页获取应用详情数据 // 获取所有应用类型
pullListApplicationInfo(){ pullAllApplicationType(){
getListApplicationInfo({ this.types = [{
page: this.infoPagination.currentPage, value: "",
limit: this.infoPagination.pageSize label: "全部",
}).then(res => { }]
if(res.status==200){ getAllApplicationType().then(res => {
console.log("分页获取到的数据=>",res) if(res.status == 200){
this.tableDataCache = [] // console.log("获取所有的应用类型=>",res)
this.tableData = [] res.data.forEach(element => {
this.infoPagination.total = res.data.totalCount if(element.isDel==0){
res.data.data.forEach(element => { this.types.push({
this.tableDataCache.push(element) 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 => { this.tableDataCache.forEach(element => {
// 未被删除的 // 未被删除的
if(element.isDel==0){ if(element.isDel==0){
...@@ -269,6 +288,62 @@ export default { ...@@ -269,6 +288,62 @@ export default {
}); });
} }
}); });
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({
page: this.infoPagination.currentPage,
limit: this.infoPagination.pageSize
}).then(res => {
if(res.status==200){
console.log("分页获取到的数据=>",res)
this.tableDataCache = []
this.tableData = []
this.infoPagination.total = res.data.totalCount
res.data.data.forEach(element => {
this.tableDataCache.push(element)
});
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