优化
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="资源类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择资源类型" @change="typeChange">
|
||||
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
<el-option v-for="item in typeList" :key="item.key" :label="item.name" :value="item.key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="团购卷" prop="group">
|
||||
@@ -84,7 +84,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbPlatformDictPostPut } from "@/api/setting";
|
||||
import { tbPlatformDictPostPut, tbPlatformDictType } from "@/api/setting";
|
||||
import uploadImg from '@/components/uploadImg'
|
||||
import enumData from '../enumData.js'
|
||||
import groupTypeList from '@/components/groupTypeList'
|
||||
@@ -140,14 +140,24 @@ export default {
|
||||
]
|
||||
},
|
||||
jumpTypeList: enumData.jumpTypeList,
|
||||
typeList: enumData.typeList,
|
||||
typeList: [],
|
||||
resetForm: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form };
|
||||
this.tbPlatformDictType()
|
||||
},
|
||||
methods: {
|
||||
// 获取资源类别
|
||||
async tbPlatformDictType() {
|
||||
try {
|
||||
const res = await tbPlatformDictType()
|
||||
this.typeList = res.content
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
groupSuccess(row) {
|
||||
this.productIds = [row]
|
||||
this.form.name = row.name
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select v-model="query.type" placeholder="请选择资源类型">
|
||||
<el-option v-for="item in enumData.typeList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
<el-option v-for="item in typeList" :key="item.key" :label="item.name"
|
||||
:value="item.key"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -106,7 +106,7 @@
|
||||
<script>
|
||||
import enumData from './enumData.js'
|
||||
import add from "./components/add";
|
||||
import { tbPlatformDictGet, tbPlatformDictPostPut } from "@/api/setting";
|
||||
import { tbPlatformDictGet, tbPlatformDictPostPut, tbPlatformDictType } from "@/api/setting";
|
||||
export default {
|
||||
components: {
|
||||
add
|
||||
@@ -114,6 +114,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
enumData,
|
||||
typeList: [],
|
||||
query: {
|
||||
name: "",
|
||||
type: ''
|
||||
@@ -128,18 +129,28 @@ export default {
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
typeFilter(t) {
|
||||
let e = t ? enumData.typeList.find(item => item.value == t).label : t
|
||||
return e ? e : t
|
||||
},
|
||||
jumpFilter(t) {
|
||||
return t ? enumData.jumpTypeList.find(item => item.value == t).label : ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
this.tbPlatformDictType()
|
||||
},
|
||||
methods: {
|
||||
typeFilter(t) {
|
||||
let e = t ? this.typeList.find(item => item.value == t).label : t
|
||||
return e ? e : t
|
||||
},
|
||||
// 获取资源类别
|
||||
async tbPlatformDictType() {
|
||||
try {
|
||||
const res = await tbPlatformDictType()
|
||||
this.typeList = res.content
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 切换状态
|
||||
async changeHot(e, row) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user