资源分类
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
<el-table-column label="分类图标" slot="categoryIcon" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader :disabled="true" :instance="instance" v-model="row.categoryIconArr" :limit="1"></ai-uploader>
|
||||
<ai-uploader :disabled="true" valueIsUrl :instance="instance" v-model="row.categoryIcon" :limit="1"></ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input v-model.trim="form.categoryName" placeholder="请输入" type="text" maxlength="20"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类图标" prop="categoryIconArr">
|
||||
<ai-uploader :instance="instance" isShowTip v-model="form.categoryIconArr" :limit="1"></ai-uploader>
|
||||
<el-form-item label="分类图标" prop="categoryIcon">
|
||||
<ai-uploader :instance="instance" valueIsUrl isShowTip v-model="form.categoryIcon" :limit="1"></ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
@@ -68,7 +68,6 @@ export default {
|
||||
form: {
|
||||
categoryName: '',
|
||||
categoryIcon: '',
|
||||
categoryIconArr: []
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -84,7 +83,7 @@ export default {
|
||||
rules() {
|
||||
return {
|
||||
categoryName: [{required: true, message: "请输入分类名称"}],
|
||||
categoryIconArr: [{required: true, message: "请上传分类图标"}],
|
||||
categoryIcon: [{required: true, message: "请上传分类图标"}],
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -100,16 +99,7 @@ export default {
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
this.tableData = res.data.records.map(e=> {
|
||||
return {
|
||||
categoryName: e.categoryName,
|
||||
resourceNum: e.resourceNum,
|
||||
categoryIcon: e.categoryIcon,
|
||||
id: e.id,
|
||||
// categoryIconArr: [{ 0: e.categoryIcon}],
|
||||
categoryIconArr: [e.categoryIcon]
|
||||
}
|
||||
})
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
console.log(this.tableData);
|
||||
|
||||
@@ -120,9 +110,6 @@ export default {
|
||||
onConfirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if(valid) {
|
||||
if(this.form.categoryIconArr.length) {
|
||||
this.form.categoryIcon = this.form.categoryIconArr[0].url
|
||||
}
|
||||
this.instance.post(`/app/appresourcecategory/addOrUpdate`, {...this.form}).then(res=> {
|
||||
if(res.code == 0) {
|
||||
this.$message.success('新增成功')
|
||||
@@ -152,7 +139,6 @@ export default {
|
||||
if(res.data) {
|
||||
console.log(res.data);
|
||||
this.form = res.data
|
||||
this.form.categoryIconArr = [res.data.categoryIcon]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
</ai-search-bar>
|
||||
<ai-table :tableData="tableData" :total="total" :current.sync="search.current" :size.sync="search.size"
|
||||
@getList="getList()" :col-configs="colConfigs" :dict="dict">
|
||||
<!-- @sort-change="changeTableSort" -->
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
@@ -66,7 +65,7 @@ export default {
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.total
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user