数据相关完善注释

dev_2022-03-03
yujialong 3 years ago
parent fbb64f6dcf
commit 37bf68f2e5
  1. 25
      src/views/data/Introduce.vue
  2. 27
      src/views/data/Product.vue

@ -44,7 +44,7 @@
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="addKeyword"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</el-card>
</el-col>
@ -120,6 +120,7 @@ export default {
this.getKeyword()
}).catch(res => {})
},
//
typeClick(data,node){
this.editing = false
this.categoryId = data.id
@ -129,6 +130,7 @@ export default {
this.dataSource = data.dataSource
this.getKeyword()
},
//
getKeyword(){
this.$get(this.api.getKeywordByCategoryId,{
categoryId: this.categoryId
@ -136,12 +138,14 @@ export default {
this.keywordList = res.keywords
}).catch(res => {})
},
//
edit(){
this.editing = true
this.introduce = this.introduceText
},
confirmEdit(){
const id = this.categoryId
//
saveType(){
const id = this.categoryId // id
this.$post(this.api.updateCategory,{
id,
introduce: this.introduce,
@ -154,26 +158,31 @@ export default {
this.getData()
}).catch(res => {})
},
//
delKeyword(item) {
this.$post(`${this.api.deleteKeyword}?categoryId=${this.categoryId}&keyword=${item.keyword}`).then(res => {
this.$message.success('删除成功')
this.getKeyword()
}).catch(res => {})
},
addKeyword() {
const keyword = this.newKeyword
//
confirmData() {
const keyword = this.newKeyword //
//
if (keyword) {
//
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
this.confirmEdit()
this.saveType()
//
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.newKeyword = '' //
this.getKeyword()
}).catch(res => {})
} else {
this.confirmEdit()
this.saveType()
}
}
}

@ -241,6 +241,7 @@ export default {
this.getData()
},
methods: {
//
getData() {
this.$post(this.api.listByEntity,{
createTime: this.startTime,
@ -254,17 +255,19 @@ export default {
this.totals = res.pageList.total
}).catch(res => {})
},
// 1
initData(){
this.page = 1
this.getData()
},
//
getTable(n,isConcat){
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=${n.typePage}&pageSize=${this.typeUnit}&updateTime=`).then(res => {
let list = res.pageList.records
list.map(n => {
n.label = n.showName
n.id = String(n.id)
n.disabled = true
n.disabled = true //
})
// ,
if(isConcat){
@ -293,7 +296,7 @@ export default {
})
}
handleId(res)
this.typeConfigList = JSON.parse(JSON.stringify(res))
this.typeConfigList = JSON.parse(JSON.stringify(res)) // 使
//
function getTable(data){
@ -301,8 +304,8 @@ export default {
if(n.children.length){
getTable(n.children)
}else{
n.typePage = 1
n.disabled = true
n.typePage = 1 //
n.disabled = true //
that.getTable(n)
}
})
@ -377,25 +380,29 @@ export default {
}
},50)
},
//
getDetail(){
this.$post(`${this.api.findById}?id=${this.id}`).then(res => {
const data = res.product
this.productName = data.productName
this.market = data.market
this.checkedIds = data.tableId.split(',')
this.$refs.type.setCheckedKeys(this.checkedIds)
this.$refs.type.setCheckedKeys(this.checkedIds) //
}).catch(res => {})
},
//
add(){
this.getType()
this.id = ''
this.checkedIds = []
},
//
edit(row){
this.getType(true)
this.id = row.id
this.userId = row.userId
},
//
switchOff(val,row) {
this.$post(this.api.updateProduct,{
id: row.id,
@ -413,11 +420,13 @@ export default {
this.$message.success(val ? '上架成功' : '下架成功')
}).catch(err => {})
},
//
preview(row){
this.getType(true)
this.isDetail = true
this.id = row.id
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
@ -452,6 +461,7 @@ export default {
this.page = val
this.getData()
},
//
closeProduct(){
this.productName = ''
this.market = ''
@ -485,6 +495,7 @@ export default {
this.configLoading = false
})
},
//
confirm(){
if(this.submited) return false
if(!this.productName) return this.$message.warning('请输入数据产品名称')
@ -527,6 +538,7 @@ export default {
})
}
},
//
configData(){
this.configVisible = true
this.getConfigType()
@ -537,11 +549,13 @@ export default {
this.$refs.typeConfig.setCheckedKeys(this.configIds)
}
},
//
typeConfigClick(data){
this.categoryId = data.id
this.categoryOriginId = data.originId
this.getConfigTable()
},
//
closeConfig(){
//
this.$refs.typeConfig.setCheckedNodes([])
@ -577,6 +591,7 @@ export default {
this.totalConfig = res.pageList.total
}).catch(res => {})
},
//
initConfigData(){
this.pageConfig = 1
this.getConfigTable()
@ -585,6 +600,7 @@ export default {
this.pageConfig = val
this.getConfigTable()
},
//
previewConfig(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
let comment = res.comment
@ -606,6 +622,7 @@ export default {
this.previewVisible = true
}).catch(res => {})
},
//
confirmConfig(){
const list = this.$refs.typeConfig.getCheckedNodes().map(e => e.originId) // id
this.getIds(list).then(() => {

Loading…
Cancel
Save