Merge remote-tracking branch 'origin/master'

dev
e 3 years ago
commit 5c5f18baf2
  1. 43
      src/views/data/Framework.vue
  2. 15
      src/views/data/Introduce.vue
  3. 1
      src/views/data/Product.vue

@ -36,9 +36,9 @@
<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"></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 label="起止日期" align="center"> <el-table-column label="起止日期" width="160" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.startTime + ' ~ ' + scope.row.endTime}} {{scope.row.startTime.substr(0, 10) + ' ~ ' + scope.row.endTime.substr(0, 10)}}
</template> </template>
</el-table-column> </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>
@ -130,11 +130,18 @@
<el-dialog title="自定义表头" :visible.sync="headVisible" width="60%" center :close-on-click-modal="false"> <el-dialog title="自定义表头" :visible.sync="headVisible" width="60%" center :close-on-click-modal="false">
<el-table :data="previewData" class="table" stripe header-align="center" row-key="id" :key="editIndex"> <el-table :data="previewData" class="table" stripe header-align="center" row-key="id" :key="editIndex">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
<template v-if="scope.row.custom">
<el-input placeholder="请输入" size="medium" v-model="curComment[0].comment"></el-input>
</template>
<template v-else>{{ scope.$index }}</template>
</template>
</el-table-column>
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.oldComment" align="center"> <el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.oldComment" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.custom"> <template v-if="scope.row.custom">
<el-input placeholder="请输入" v-model="item.comment"></el-input> <el-input placeholder="请输入" size="medium" v-model="item.comment"></el-input>
</template> </template>
<template v-else>{{scope.row[item.field]}}</template> <template v-else>{{scope.row[item.field]}}</template>
</template> </template>
@ -157,6 +164,7 @@ export default {
label: 'label' label: 'label'
}, },
defaultActive: [], defaultActive: [],
added: false,
typeVisible: false, typeVisible: false,
categoryName: '', categoryName: '',
categoryId: '', categoryId: '',
@ -224,17 +232,20 @@ export default {
handleId(res) handleId(res)
this.typeList = res this.typeList = res
if(res[0].children.length){ if (!this.added) {
this.categoryId = res[0].children[0].id if(res[0].children.length){
this.defaultActive = [res[0].children[0].id] this.categoryId = res[0].children[0].id
}else{ this.defaultActive = [res[0].children[0].id]
this.categoryId = res[0].id }else{
this.defaultActive = [res[0].id] this.categoryId = res[0].id
this.defaultActive = [res[0].id]
}
// id
this.$nextTick(() => {
this.$refs.type.setCurrentKey(res[0].children[0].id)
})
} }
// id this.added = false
this.$nextTick(() => {
this.$refs.type.setCurrentKey(res[0].children[0].id)
})
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}, },
@ -253,6 +264,7 @@ export default {
this.getData() this.getData()
}, },
addType(row){ addType(row){
if (row) this.defaultActive = [row.data.id]
this.typeVisible = true this.typeVisible = true
this.levelId = row ? row.data.id : 0 this.levelId = row ? row.data.id : 0
}, },
@ -266,6 +278,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.added = true
this.$post(`${this.api.deleteCategory}?categoryId=${row.data.id}`).then(res => { this.$post(`${this.api.deleteCategory}?categoryId=${row.data.id}`).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getType() this.getType()
@ -275,6 +288,7 @@ export default {
confirmType(){ confirmType(){
if(this.submited) return false if(this.submited) return false
this.submited = true this.submited = true
this.added = true
if(this.id){ if(this.id){
this.$post(this.api.updateCategory,{ this.$post(this.api.updateCategory,{
id: this.id, id: this.id,
@ -330,7 +344,6 @@ export default {
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i]))
} }
}) })
console.log(11, data)
this.previewData = data this.previewData = data
if (!isEdit) this.previewVisible = true if (!isEdit) this.previewVisible = true
}).catch(res => {}) }).catch(res => {})

@ -25,27 +25,27 @@
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input> <el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div> </div>
</template> </template>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmEdit"> </el-button>
</div>
<div class="field"> <div class="field">
<p class="label">关键字</p> <p class="label">关键字</p>
<div class="tag-add"> <div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input> <el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<el-button size="small" type="primary" @click="addKeyword">添加</el-button>
</div> </div>
<div class="tag-wrap"> <div class="tag-wrap">
<el-tag <el-tag
:key="tag.id" :key="tag.id"
:type="editing ? '' : 'info'"
v-for="tag in keywordList" v-for="tag in keywordList"
closable :closable="editing"
:disable-transitions="false" :disable-transitions="false"
@close="delKeyword(tag)"> @close="delKeyword(tag)">
{{tag.keyword}} {{tag.keyword}}
</el-tag> </el-tag>
</div> </div>
</div> </div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="addKeyword"> </el-button>
</div>
</el-card> </el-card>
</el-col> </el-col>
</el-main> </el-main>
@ -160,6 +160,7 @@ export default {
}).then(res => { }).then(res => {
this.newKeyword = '' this.newKeyword = ''
this.getKeyword() this.getKeyword()
this.confirmEdit()
}).catch(res => {}) }).catch(res => {})
} else { } else {
this.$message.error('请输入关键字!') this.$message.error('请输入关键字!')

@ -310,7 +310,6 @@ export default {
getTable(res) getTable(res)
setTimeout(() => { setTimeout(() => {
console.log(11, res)
this.typeList = res this.typeList = res
},500) },500)
this.importVisible = true this.importVisible = true

Loading…
Cancel
Save