feat(显示发布内容字段替换):

This commit is contained in:
fuhao 2024-09-06 17:20:54 +08:00
parent 79997243f5
commit ed64e47598
No known key found for this signature in database
1 changed files with 29 additions and 14 deletions

View File

@ -50,16 +50,6 @@
v-hasPermi="['board:plan:remove']" v-hasPermi="['board:plan:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['board:plan:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
@ -69,7 +59,7 @@
<el-table-column label="等级" align="center" prop="level" /> <el-table-column label="等级" align="center" prop="level" />
<el-table-column label="最大值" align="center" prop="maxValue" /> <el-table-column label="最大值" align="center" prop="maxValue" />
<el-table-column label="最小值" align="center" prop="minValue" /> <el-table-column label="最小值" align="center" prop="minValue" />
<el-table-column label="显示内容" align="center" prop="displayContent" /> <el-table-column label="显示内容" align="center" prop="presetContentName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -115,7 +105,16 @@
<el-input-number :min="form.minValue" :precision="2" v-model="form.maxValue" placeholder="请输入最大值" /> <el-input-number :min="form.minValue" :precision="2" v-model="form.maxValue" placeholder="请输入最大值" />
</el-form-item> </el-form-item>
<el-form-item label="显示内容"> <el-form-item label="显示内容">
<el-input v-model="form.displayContent" :min-height="192"/> <el-select
v-model="form.presetContentId"
placeholder="请选择">
<el-option
v-for="dict in this.contentModelOptions"
:key="dict.id"
:label="dict.name"
:value="dict.id"
/>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -130,6 +129,7 @@
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/board/plan"; import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/board/plan";
import PlanTypeTree from "@/views/board/plan/planTypeTree.vue"; import PlanTypeTree from "@/views/board/plan/planTypeTree.vue";
import {planTypeTreeSelect} from "@/api/board/plantype"; import {planTypeTreeSelect} from "@/api/board/plantype";
import {listContent} from "@/api/board/content";
export default { export default {
name: "Plan", name: "Plan",
@ -152,6 +152,7 @@ export default {
total: 0, total: 0,
// //
planList: [], planList: [],
contentModelOptions: [],
// //
title: "", title: "",
// //
@ -186,7 +187,7 @@ export default {
minValue: [ minValue: [
{ required: true, message: "最小值不能为空", trigger: "blur" } { required: true, message: "最小值不能为空", trigger: "blur" }
], ],
displayContent: [ presetContentId: [
{ required: true, message: "显示内容不能为空", trigger: "blur" } { required: true, message: "显示内容不能为空", trigger: "blur" }
] ]
} }
@ -218,7 +219,7 @@ export default {
level: null, level: null,
maxValue: null, maxValue: null,
minValue: null, minValue: null,
displayContent: null presetContentId: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -295,12 +296,26 @@ export default {
this.clickNodeData = data; this.clickNodeData = data;
this.queryParams.type = data.id; this.queryParams.type = data.id;
this.handleQuery(); this.handleQuery();
this.getContentList();
}, },
getPlanTypeTree() { getPlanTypeTree() {
planTypeTreeSelect().then(response => { planTypeTreeSelect().then(response => {
this.clickNodeData = response.data[0].children[0]; this.clickNodeData = response.data[0].children[0];
this.queryParams.type = response.data[0].children[0].id; this.queryParams.type = response.data[0].children[0].id;
this.getList(); this.getList();
this.getContentList();
});
},
getContentList() {
this.contentModelOptions = [];
listContent({infoType: this.queryParams.type}).then(response => {
response.rows.forEach(row => {
let model = {
name: row.name + " - " + row.boardSizeTypeName + " - " + row.content,
id: row.id
}
this.contentModelOptions.push(model)
});
}); });
}, },
}, },