数据相关bug修复

dev
Jo 3 years ago
parent 1981bff09d
commit a65643bbb9
  1. 3
      src/views/data/Data.vue
  2. 6
      src/views/data/Framework.vue
  3. 9
      src/views/data/Introduce.vue

@ -23,7 +23,7 @@ import Introduce from './Introduce.vue';
export default { export default {
data() { data() {
return { return {
active: 'first', active: this.$route.query.tab ? this.$route.query.tab : 'first',
userId: this.$store.state.userId, userId: this.$store.state.userId,
tabs: { tabs: {
first: '产品管理', first: '产品管理',
@ -44,6 +44,7 @@ export default {
methods: { methods: {
tabChange(index){ tabChange(index){
this.active = index this.active = index
this.$router.push(`/data?tab=${index}`)
}, },
} }
}; };

@ -34,7 +34,11 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column> <el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="tableComment" label="数据表名称" align="center"></el-table-column> <el-table-column prop="tableComment" label="数据表名称" align="center">
<template slot-scope="scope">
{{scope.row.tableComment ? scope.row.tableComment : scope.row.showName}}
</template>
</el-table-column>
<el-table-column prop="showName" label="产品表名称" align="center"></el-table-column> <el-table-column prop="showName" label="产品表名称" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column> <el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></el-table-column>

@ -63,6 +63,7 @@ export default {
}, },
defaultActive: [], defaultActive: [],
editing: false, editing: false,
edited: false,
introduce: '', introduce: '',
dataSource: '', dataSource: '',
introduceText: '', introduceText: '',
@ -100,6 +101,7 @@ export default {
this.typeList = res this.typeList = res
// id // id
if (!this.edited) {
if(res[0].children.length){ if(res[0].children.length){
let item = res[0].children[0] let item = res[0].children[0]
this.categoryId = item.id this.categoryId = item.id
@ -114,12 +116,14 @@ export default {
this.introduceText = res[0].introduce this.introduceText = res[0].introduce
this.introduce = res[0].introduce this.introduce = res[0].introduce
} }
}
this.getKeyword() this.getKeyword()
}).catch(res => {}) }).catch(res => {})
}, },
typeClick(data,node){ typeClick(data,node){
this.editing = false this.editing = false
this.categoryId = data.id this.categoryId = data.id
this.defaultActive = [data.id]
this.introduceText = data.introduce this.introduceText = data.introduce
this.introduce = data.introduce this.introduce = data.introduce
this.dataSource = data.dataSource this.dataSource = data.dataSource
@ -137,14 +141,17 @@ export default {
this.introduce = this.introduceText this.introduce = this.introduceText
}, },
confirmEdit(){ confirmEdit(){
const id = this.categoryId
this.$post(this.api.updateCategory,{ this.$post(this.api.updateCategory,{
id: this.categoryId, id,
introduce: this.introduce, introduce: this.introduce,
dataSource: this.dataSource dataSource: this.dataSource
}).then(res => { }).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功') this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.introduceText = this.introduce this.introduceText = this.introduce
this.editing = false this.editing = false
this.edited = true
this.getData()
}).catch(res => {}) }).catch(res => {})
}, },
delKeyword(item) { delKeyword(item) {

Loading…
Cancel
Save