b5235a6c by chentao

调整层级关系

1 parent 9baf0281
......@@ -16,6 +16,14 @@ export function getEntiretyists(params) {
})
}
// 查询系列数据(不分页)
export function getBuildingBlockLists(params) {
return request({
url: '/core/buildingBlock/list',
method: 'get',
})
}
// 新增
export function addEntirety(data) {
return request({
......
......@@ -39,9 +39,10 @@ export default {
title: '套件管理',
indexName: '序号',
groupName: '套件名称',
buildingBlockName: '系列名称',
sortName: '排序',
cateName: '类别',
unitName: '单元类别',
dialogGroup: '系列',
tableControlsName: '操作',
controlsDelName: '删除',
controlsEditName: '编辑',
......@@ -53,12 +54,14 @@ export default {
dialogSort: '排序',
dialogConfim: '确认',
dialogExit: '退出',
dialogPhoto: '图片',
},
// 系列
block: {
title: '系列管理',
indexName: '序号',
blockName: '系列名称',
sortName: '排序',
groupName: '套件',
tableControlsName: '操作',
controlsDelName: '删除',
......@@ -70,7 +73,6 @@ export default {
dialogTitleEdit: '修改',
dialogName: '系列名称',
tableSortName: '排序',
dialogGroup: '套件',
dialogPhoto: '图片',
dialogConfim: '确认',
dialogExit: '退出',
......@@ -80,7 +82,7 @@ export default {
title: '课程管理',
indexName: '序号',
courseName: '课程名称',
blockName: '系列名称',
entiretyName: '套件名称',
buildName: '搭建',
caseName: '有无案例',
packName: '是否打包',
......@@ -94,7 +96,7 @@ export default {
dialogTitleAdd: '新增',
dialogTitleEdit: '修改',
dialogName: '课程名称',
dialogBlock: '系列',
dialogEntirety: '套件',
dialogPack: '是否打包',
dialogTypes: '搭建类型',
dialogTwoD: '2D',
......@@ -112,6 +114,8 @@ export default {
title: '常见问题',
tableIndex: '序号',
tableAnsName: '问题',
tableBuildingBlockName: '系列',
tableSortName: '排序',
tableShowName: '展示',
tableStateName: '发布状态',
tableControlsName: '操作',
......@@ -132,6 +136,7 @@ export default {
dialogSubmit: '直接发布',
dialogSave: '保存',
dialogExit: '退出',
dialogGroup: '系列',
},
// 升级管理
upgradation: {
......
......@@ -42,7 +42,7 @@
>
<el-table-column :label="$t('block.indexName')" type="index" width="80" />
<el-table-column :label="$t('block.blockName')" prop="name" />
<el-table-column :label="$t('block.groupName')" prop="entiretyName" />
<el-table-column :label="$t('block.sortName')" prop="sort" />
<el-table-column :label="$t('block.tableControlsName')" class-name="small-padding fixed-width">
<template #default="{ row }">
<el-button
......@@ -72,15 +72,6 @@
<el-form-item :label="$t('block.dialogName')" prop="name" label-width="80">
<el-input v-model="showForm.form.name" placeholder="请输入系列名称" />
</el-form-item>
<el-form-item :label="$t('block.dialogGroup')" prop="entiretyId" label-width="80">
<el-select-v2
v-model="showForm.form.entiretyId"
:options="kitLists"
:props="props"
placeholder="请选择套件"
style="width: 180px;"
/>
</el-form-item>
<el-form-item :label="$t('block.tableSortName')" label-width="80">
<el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" />
</el-form-item>
......@@ -103,8 +94,6 @@
import { useTableHeight } from '@/hooks/useTableHeight'
// 导入api接口
import { getBuildingBlockList, getBuildingBlockLists, addBuildingBlock, editBuildingBlock, delBuildingBlock } from '@/api/legao/block'
import { getEntiretyists } from '@/api/legao/kit'
import { reactive, toRefs } from 'vue';
const { windowSize } = useTableHeight('max-height')
......@@ -165,12 +154,6 @@ function getList () {
})
}
function getKitLists() {
getEntiretyists().then(res => {
kitLists.value = res?.data || []
})
}
// 搜索
function btn_search () {
queryParams.value.pageNum = 1
......@@ -179,7 +162,6 @@ function btn_search () {
// 单条编辑
function handleEdit (row) {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleEdit')
showForm.value = {
...showForm.value,
......@@ -189,7 +171,6 @@ function handleEdit (row) {
}
function btn_add () {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleAdd')
showForm.value = {
...showForm.value,
......@@ -202,7 +183,6 @@ function handleDel(row) {
return delBuildingBlock(row.id);
}).then(() => {
getList();
proxy.$modal.msgSuccess(res.msg);
}).finally(() => {
});
......
......@@ -41,7 +41,8 @@
>
<el-table-column :label="$t('course.indexName')" type="index" width="80" />
<el-table-column :label="$t('course.courseName')" prop="name" />
<el-table-column :label="$t('course.blockName')" prop="buildingBlockName" />
<el-table-column :label="$t('course.entiretyName')" prop="entiretyName" />
<el-table-column :label="$t('course.tableSortName')" prop="sort" />
<el-table-column :label="$t('course.buildName')" prop="type" />
<el-table-column :label="$t('course.caseName')" prop="caseName" />
<el-table-column :label="$t('course.packName')" prop="canPack">
......@@ -81,12 +82,12 @@
<el-form-item :label="$t('course.dialogName')" prop="name" label-width="80">
<el-input v-model="showForm.form.name" placeholder="请输入课程名称" />
</el-form-item>
<el-form-item :label="$t('course.dialogBlock')" prop="buildingBlockId" label-width="80">
<el-form-item :label="$t('course.dialogEntirety')" prop="entiretyId" label-width="80">
<el-select-v2
v-model="showForm.form.buildingBlockId"
:options="blockLists"
v-model="showForm.form.entiretyId"
:options="entiretyLists"
:props="props"
placeholder="请选择系列"
placeholder="请选择套件"
style="width: 180px;"
/>
</el-form-item>
......@@ -164,7 +165,7 @@
import { useTableHeight } from '@/hooks/useTableHeight'
// 导入api接口
import { getCourseList, addCourse, editCourse, delCourse } from '@/api/legao/course'
import { getBuildingBlockLists } from '@/api/legao/block'
import { getEntiretyists } from '@/api/legao/kit'
import { reactive, toRefs } from 'vue';
const { windowSize } = useTableHeight('max-height')
......@@ -189,7 +190,7 @@ const data = reactive({
},
total: 0,
list: [],
blockLists: [],
entiretyLists: [],
showForm: {
title: '',
open: false,
......@@ -205,7 +206,7 @@ const data = reactive({
}
})
const { status, queryParams, total, list, showForm, rules, blockLists } = toRefs(data)
const { status, queryParams, total, list, showForm, rules, entiretyLists } = toRefs(data)
//#region 初始化
......@@ -237,8 +238,8 @@ function getList () {
// 系列
function getBlockLists () {
getBuildingBlockLists().then((res) => {
blockLists.value = res.data
getEntiretyists().then((res) => {
entiretyLists.value = res.data
})
}
......
......@@ -27,15 +27,8 @@
>
<el-table-column :label="$t('kit.indexName')" type="index" width="80" />
<el-table-column :label="$t('kit.groupName')" prop="name" />
<el-table-column :label="$t('kit.buildingBlockName')" prop="buildingBlockName" />
<el-table-column :label="$t('kit.sortName')" prop="sort" />
<el-table-column :label="$t('kit.cateName')" prop="type">
<template #default="{ row }">
<dict-tag
:options="entirety_type"
:value="row.type"
></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width">
<template #default="{ row }">
<el-button
......@@ -65,19 +58,21 @@
<el-form-item :label="$t('kit.dialogName')" prop="name" label-width="80">
<el-input v-model="showForm.form.name" placeholder="请输入套件名称" />
</el-form-item>
<el-form-item :label="$t('kit.dialogCate')" prop="type" label-width="80">
<el-select v-model="showForm.form.type" placeholder="请选择类别" clearable>
<el-option
v-for="dict in entirety_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<el-form-item :label="$t('kit.dialogGroup')" prop="buildingBlockId" label-width="80">
<el-select-v2
v-model="showForm.form.buildingBlockId"
:options="kitLists"
:props="props"
placeholder="请选择系列"
style="width: 180px;"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('kit.dialogSort')" label-width="80">
<el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" />
</el-form-item>
<el-form-item :label="$t('kit.dialogPhoto')" prop="ossId" label-width="80">
<imageUpload v-model="showForm.form.ossId" :fileType='["png", "jpg", "jpeg", "ico"]'/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
......@@ -93,10 +88,13 @@
<script setup name="ruleManager">
import { useTableHeight } from '@/hooks/useTableHeight'
// 导入api接口
import { getEntiretyist, addEntirety, editEntirety, delEntirety } from '@/api/legao/kit'
import { getEntiretyist, addEntirety, editEntirety, delEntirety,getBuildingBlockLists } from '@/api/legao/kit'
import { reactive, toRefs } from 'vue';
const { windowSize } = useTableHeight('max-height')
const props = {
label: 'name',
value: 'id',
}
// 导入字典
const { proxy } = getCurrentInstance();
const { entirety_type } = proxy.useDict("entirety_type");
......@@ -108,6 +106,7 @@ const data = reactive({
showForm: false,
showCodePart: false
},
kitLists: [],
queryParams: {
pageNum: 1,
pageSize: 10
......@@ -123,11 +122,11 @@ const data = reactive({
},
rules: {
name: [{ required: true, message: "套件名称不能为空", trigger: "blur" }],
type: [{ required: true, message: "类别不能为空", trigger: "blur" }]
buildingBlockId: [{ required: true, message: "系列不能为空", trigger: "blur" }]
}
})
const { status, queryParams, total, list, showForm, rules } = toRefs(data)
const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data)
//#region 初始化
......@@ -157,6 +156,7 @@ function btn_search () {
// 单条编辑
function handleEdit (row) {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleEdit')
showForm.value = {
...showForm.value,
......@@ -166,6 +166,7 @@ function handleEdit (row) {
}
function btn_add () {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleAdd')
showForm.value = {
...showForm.value,
......@@ -203,4 +204,10 @@ function closeDialog() {
form: {}
}
}
function getKitLists() {
getBuildingBlockLists().then(res => {
kitLists.value = res?.data || []
})
}
</script>
......
......@@ -47,6 +47,8 @@
>
<el-table-column :label="$t('problem.tableIndex')" type="index" width="80" />
<el-table-column :label="$t('problem.tableAnsName')" prop="title" />
<el-table-column :label="$t('problem.tableBuildingBlockName')" prop="buildingBlockName" />
<el-table-column :label="$t('problem.tableSortName')" prop="sort" />
<el-table-column :label="$t('problem.tableShowName')" prop="showStr" />
<el-table-column :label="$t('problem.tableStateName')" prop="status">
<template #default="{ row }">
......@@ -97,6 +99,15 @@
<el-form-item :label="$t('problem.dialogName')" prop="title" label-width="80">
<el-input v-model="showForm.form.title" placeholder="请输入问题" />
</el-form-item>
<el-form-item :label="$t('problem.dialogGroup')" prop="buildingBlockId" label-width="80">
<el-select-v2
v-model="showForm.form.buildingBlockId"
:options="kitLists"
:props="props"
placeholder="请选择系列"
style="width: 180px;"
/>
</el-form-item>
<el-form-item :label="$t('problem.dialogPhote')" label-width="80">
<imageUpload v-model="showForm.form.coverOssId" :limit="1" :fileType='["png", "jpg", "jpeg", "ico"]'/>
</el-form-item>
......@@ -133,9 +144,13 @@
import { useTableHeight } from '@/hooks/useTableHeight'
// 导入api接口
import { getQuestionList, updateStatus, addQuestion, editQuestion, delQuestion } from '@/api/legao/problem'
import { getBuildingBlockLists } from '@/api/legao/kit'
import { reactive, toRefs } from 'vue';
const { windowSize } = useTableHeight('max-height')
const props = {
label: 'name',
value: 'id',
}
// 导入字典
const { proxy } = getCurrentInstance();
const { advert_state } = proxy.useDict("advert_state");
......@@ -148,6 +163,7 @@ const data = reactive({
showForm: false,
showCodePart: false
},
kitLists: [],
queryParams: {
pageNum: 1,
pageSize: 10
......@@ -168,7 +184,7 @@ const data = reactive({
const tableRefs = ref(null)
const { status, queryParams, total, list, showForm, rules } = toRefs(data)
const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data)
//#region 初始化
......@@ -198,6 +214,7 @@ function btn_search () {
// 单条编辑
function handleEdit (row) {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleEdit')
showForm.value = {
...showForm.value,
......@@ -207,6 +224,7 @@ function handleEdit (row) {
}
function btn_add () {
getKitLists()
showForm.value.title = proxy.$t('advertisement.dialogTitleAdd')
showForm.value.open = true
showForm.value.form = {
......@@ -258,4 +276,10 @@ function closeDialog() {
form: {}
}
}
function getKitLists() {
getBuildingBlockLists().then(res => {
kitLists.value = res?.data || []
})
}
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!