Commit 30f42908 authored by obt's avatar obt

代码更新

parent 01e06712
<!--
* @Author: your name
* @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-11 15:44:37
* @LastEditTime: 2020-12-11 17:15:00
* @LastEditors: Please set LastEditors
* @Description: 类别管理
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
......@@ -27,7 +27,7 @@
<el-col :span="16">
<el-input
v-model="currentTypeName"
placeholder="请输入类别名称"
placeholder="请输入类别"
size="100px"
></el-input>
</el-col>
......@@ -313,7 +313,7 @@ export default {
},
mounted() {
// 获取所有类型用于下拉框
// this.pullAllApplicationType()
this.pullAllApplicationType()
// 分页获取类型用于表格
this.pullListApplicationType()
},
......@@ -323,6 +323,7 @@ export default {
this.$bus.$emit('upload-clearFiles')
},
getFatherTypeName(pid){
console.log("typesState",this.typesState)
let father = this.typesState.find(ele => ele.id == pid)
return father ? father.title : ""
},
......@@ -330,10 +331,10 @@ export default {
console.log("index=>",index)
if(index==1){
this.currentStatus = ''
this.currentType = ''
this.currentTypeName = ''
this.currentSort = ''
}
this.screenTableData()
this.pullListApplicationType()
},
// 添加类别
addCate(){
......@@ -360,7 +361,7 @@ export default {
this.types = []
getAllApplicationType().then(res => {
if(res.status == 200){
console.log("获取所有的应用类型=>",res)
// console.log("获取所有的应用类型=>",res)
res.data.forEach(element => {
this.typesState.push(element)
if(element.isDel==0&&element.pid==0){
......@@ -416,7 +417,7 @@ export default {
},
// 为表格数据添加过滤条件
screenTableData(){
// console.log("分页数据的缓存=>",this.tableDataCache)
console.log("分页数据的缓存=>",this.tableDataCache)
this.tableData = []
let index = 0
this.tableDataCache.forEach(element => {
......@@ -444,11 +445,13 @@ export default {
if(this.currentStatus!=''){
this.tableData = this.tableData.filter(element => element.status == this.currentStatus)
}
// if(this.currentType!=''){
// this.tableData = this.tableData.filter(element => element.id == this.currentType)
// }
if(this.currentTypeName!=''){
this.tableData = this.tableData.filter(element => element.title == this.currentTypeName)
// this.tableData = this.tableData.filter(element => element.type == this.currentTypeName)
this.tableData = this.tableData.filter(element => {
//正则表达式
let reg = new RegExp(this.currentTypeName);
return element.type.match(reg)
})
}
if(this.currentSort!=''){
// 1是降序,2是升序
......
<!--
* @Author: your name
* @Date: 2020-12-04 09:09:37
* @LastEditTime: 2020-12-10 09:49:03
* @LastEditTime: 2020-12-11 16:52:41
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\addApp\index.vue
......@@ -20,6 +20,26 @@
<div class="item">
<div class="title">基本信息</div>
<div class="form">
<el-form-item label="应用类别" prop="type" v-show="firstTypes.length>0">
<el-select v-model="currentFirstType" placeholder="全部">
<el-option
v-for="item in firstTypes"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select v-model="currentSecondType" placeholder="全部">
<el-option
v-for="item in secondTypes"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="应用名称" prop="title">
<el-col :span="12">
<el-input v-model="form.title" placeholder="请输入应用名称"></el-input>
......@@ -38,7 +58,7 @@
<div class="form">
<el-form-item label="行业" prop="industry">
<el-col :span="12">
<el-input v-model="form.industry" placeholder="请输入行业(即行业类别值)"></el-input>
<el-input v-model="form.industry" placeholder="请输入行业"></el-input>
</el-col>
</el-form-item>
<el-form-item label="地区" prop="region">
......@@ -120,7 +140,8 @@ import { uploadFile } from "@/api/website/newsCategory/index";
import singleImageX from '@/components/Upload/singleImageX';
import KindEditor from "@/components/Kindeditor";
import {
addUpdateApplicationInfo
getAllApplicationType,
addUpdateApplicationInfo,
} from "api/website/industryApplication/index";
export default {
name: 'addApp',
......@@ -132,6 +153,7 @@ export default {
data(){
return {
rules:{
type: [{ required: true, message: '请选择应用类别', trigger: 'blur' }],
title: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
coverImg: [{ required: true, message: '请上传封面图', trigger: 'blur' }],
detailImg: [{ required: true, message: '请上传详情图', trigger: 'blur' }],
......@@ -165,6 +187,10 @@ export default {
showPreview: false,
url: []
},
firstTypes: [],
currentFirstType: '',
secondTypes: [],
currentSecondType: '',
}
},
watch:{
......@@ -176,6 +202,7 @@ export default {
}
},
mounted() {
this.pullAllApplicationType()
if(!!this.$parent.info){
let info = this.$parent.info
let attribute = eval("(" + info.attribute + ")")
......@@ -216,6 +243,35 @@ export default {
this.$bus.$emit('hideThreeRoute',true)
},
methods: {
// 获取所有应用类型
pullAllApplicationType(){
this.firstTypes = []
getAllApplicationType().then(res => {
if(res.status == 200){
res.data.forEach(element => {
if(element.isDel==0){
if(element.pid==0){
this.firstTypes.push({
value: element.id,
label: element.title
});
}else{
this.secondTypes.push({
value: element.id,
label: element.title
})
}
}
});
if(this.firstTypes.length>0){
this.currentFirstType = this.firstTypes[0].value
}
if(this.secondTypes.length>0){
this.currentSecondType = this.secondTypes[0].value
}
}
})
},
// 关闭图片查看器
closePreview() {
this.currentIcon.showPreview = false;
......@@ -367,10 +423,10 @@ export default {
isDel: 0,
status: 1,
rank: 0,
firstTypeId: 0,
firstTitle: "",
secondTypeId: 0,
secondTitle: "",
firstTypeId: this.currentFirstType,
firstTitle: this.firstTypes.find(ele => ele.value == this.currentFirstType).label,
secondTypeId: this.currentSecondType,
secondTitle: this.secondTypes.find(ele => ele.value == this.currentSecondType).label,
customized: this.form.isCustomized=="是" ? 1 : 2
}
message = "添加成功!!!"
......
<!--
* @Author: your name
* @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-11 11:02:51
* @LastEditTime: 2020-12-11 17:25:15
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
......@@ -20,23 +20,30 @@
></el-input>
</el-col>
</div>
<div class="status">
<span>所有状态</span>
<el-select v-model="currentStatus" placeholder="全部">
<div class="types">
<span>应用类别</span>
<el-col :span="16">
<el-input
v-model="currentType"
placeholder="请输入类别"
size="100px"
></el-input>
</el-col>
<!-- <el-select v-model="currentType" placeholder="全部">
<el-option
v-for="item in status"
v-for="item in types"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-select> -->
</div>
<div class="types">
<span>应用类别</span>
<el-select v-model="currentType" placeholder="全部">
<div class="status">
<span>所有状态</span>
<el-select v-model="currentStatus" placeholder="全部">
<el-option
v-for="item in types"
v-for="item in status"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -70,7 +77,7 @@
</el-table-column>
<el-table-column label="应用类别" width="200" align="center">
<template slot-scope="scope">
<span>{{ getAttributeIndustry(scope.row.attribute) }}</span>
<span>{{ scope.row.firstTitle ? scope.row.secondTitle ? scope.row.firstTitle+"-"+scope.row.secondTitle : scope.row.firstTitle : "" }}</span>
</template>
</el-table-column>
<el-table-column label="应用名称" align="center">
......@@ -216,9 +223,9 @@ export default {
this.pullListApplicationInfo()
},
methods: {
getAttributeIndustry(attribute){
return eval("("+attribute+")").industry
},
// getAttributeIndustry(attribute){
// return eval("("+attribute+")").industry
// },
editApp(info){
this.$parent.componentName = 'addApp'
this.$parent.info = info
......@@ -294,11 +301,21 @@ export default {
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)
// let type = this.types.find(element => element.value == this.currentType)
// this.tableData = this.tableData.filter(element => this.getAttributeIndustry(element.attribute) == type.label)
this.tableData = this.tableData.filter(element => {
let type = element.firstTitle ? element.secondTitle ? element.firstTitle+"-"+element.secondTitle : element.firstTitle : ""
//正则表达式
let reg = new RegExp(this.currentType);
return type.match(reg)
})
}
if(this.currentTypeName!=''){
this.tableData = this.tableData.filter(element => element.title == this.currentTypeName)
this.tableData = this.tableData.filter(element => {
//正则表达式
let reg = new RegExp(this.currentTypeName);
return element.title.match(reg)
})
}
},
// 分页获取应用详情数据
......
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