Commit 30f42908 authored by obt's avatar obt

代码更新

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