调整层级关系
Showing
6 changed files
with
84 additions
and
59 deletions
| ... | @@ -16,6 +16,14 @@ export function getEntiretyists(params) { | ... | @@ -16,6 +16,14 @@ export function getEntiretyists(params) { |
| 16 | }) | 16 | }) |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | // 查询系列数据(不分页) | ||
| 20 | export function getBuildingBlockLists(params) { | ||
| 21 | return request({ | ||
| 22 | url: '/core/buildingBlock/list', | ||
| 23 | method: 'get', | ||
| 24 | }) | ||
| 25 | } | ||
| 26 | |||
| 19 | // 新增 | 27 | // 新增 |
| 20 | export function addEntirety(data) { | 28 | export function addEntirety(data) { |
| 21 | return request({ | 29 | return request({ | ... | ... |
| ... | @@ -39,9 +39,10 @@ export default { | ... | @@ -39,9 +39,10 @@ export default { |
| 39 | title: '套件管理', | 39 | title: '套件管理', |
| 40 | indexName: '序号', | 40 | indexName: '序号', |
| 41 | groupName: '套件名称', | 41 | groupName: '套件名称', |
| 42 | buildingBlockName: '系列名称', | ||
| 42 | sortName: '排序', | 43 | sortName: '排序', |
| 43 | cateName: '类别', | ||
| 44 | unitName: '单元类别', | 44 | unitName: '单元类别', |
| 45 | dialogGroup: '系列', | ||
| 45 | tableControlsName: '操作', | 46 | tableControlsName: '操作', |
| 46 | controlsDelName: '删除', | 47 | controlsDelName: '删除', |
| 47 | controlsEditName: '编辑', | 48 | controlsEditName: '编辑', |
| ... | @@ -53,12 +54,14 @@ export default { | ... | @@ -53,12 +54,14 @@ export default { |
| 53 | dialogSort: '排序', | 54 | dialogSort: '排序', |
| 54 | dialogConfim: '确认', | 55 | dialogConfim: '确认', |
| 55 | dialogExit: '退出', | 56 | dialogExit: '退出', |
| 57 | dialogPhoto: '图片', | ||
| 56 | }, | 58 | }, |
| 57 | // 系列 | 59 | // 系列 |
| 58 | block: { | 60 | block: { |
| 59 | title: '系列管理', | 61 | title: '系列管理', |
| 60 | indexName: '序号', | 62 | indexName: '序号', |
| 61 | blockName: '系列名称', | 63 | blockName: '系列名称', |
| 64 | sortName: '排序', | ||
| 62 | groupName: '套件', | 65 | groupName: '套件', |
| 63 | tableControlsName: '操作', | 66 | tableControlsName: '操作', |
| 64 | controlsDelName: '删除', | 67 | controlsDelName: '删除', |
| ... | @@ -70,7 +73,6 @@ export default { | ... | @@ -70,7 +73,6 @@ export default { |
| 70 | dialogTitleEdit: '修改', | 73 | dialogTitleEdit: '修改', |
| 71 | dialogName: '系列名称', | 74 | dialogName: '系列名称', |
| 72 | tableSortName: '排序', | 75 | tableSortName: '排序', |
| 73 | dialogGroup: '套件', | ||
| 74 | dialogPhoto: '图片', | 76 | dialogPhoto: '图片', |
| 75 | dialogConfim: '确认', | 77 | dialogConfim: '确认', |
| 76 | dialogExit: '退出', | 78 | dialogExit: '退出', |
| ... | @@ -80,11 +82,11 @@ export default { | ... | @@ -80,11 +82,11 @@ export default { |
| 80 | title: '课程管理', | 82 | title: '课程管理', |
| 81 | indexName: '序号', | 83 | indexName: '序号', |
| 82 | courseName: '课程名称', | 84 | courseName: '课程名称', |
| 83 | blockName: '系列名称', | 85 | entiretyName: '套件名称', |
| 84 | buildName: '搭建', | 86 | buildName: '搭建', |
| 85 | caseName: '有无案例', | 87 | caseName: '有无案例', |
| 86 | packName: '是否打包', | 88 | packName: '是否打包', |
| 87 | tableSortName: '排序', | 89 | tableSortName: '排序', |
| 88 | tableControlsName: '操作', | 90 | tableControlsName: '操作', |
| 89 | controlsDelName: '删除', | 91 | controlsDelName: '删除', |
| 90 | controlsEditName: '编辑', | 92 | controlsEditName: '编辑', |
| ... | @@ -94,7 +96,7 @@ export default { | ... | @@ -94,7 +96,7 @@ export default { |
| 94 | dialogTitleAdd: '新增', | 96 | dialogTitleAdd: '新增', |
| 95 | dialogTitleEdit: '修改', | 97 | dialogTitleEdit: '修改', |
| 96 | dialogName: '课程名称', | 98 | dialogName: '课程名称', |
| 97 | dialogBlock: '系列', | 99 | dialogEntirety: '套件', |
| 98 | dialogPack: '是否打包', | 100 | dialogPack: '是否打包', |
| 99 | dialogTypes: '搭建类型', | 101 | dialogTypes: '搭建类型', |
| 100 | dialogTwoD: '2D', | 102 | dialogTwoD: '2D', |
| ... | @@ -112,6 +114,8 @@ export default { | ... | @@ -112,6 +114,8 @@ export default { |
| 112 | title: '常见问题', | 114 | title: '常见问题', |
| 113 | tableIndex: '序号', | 115 | tableIndex: '序号', |
| 114 | tableAnsName: '问题', | 116 | tableAnsName: '问题', |
| 117 | tableBuildingBlockName: '系列', | ||
| 118 | tableSortName: '排序', | ||
| 115 | tableShowName: '展示', | 119 | tableShowName: '展示', |
| 116 | tableStateName: '发布状态', | 120 | tableStateName: '发布状态', |
| 117 | tableControlsName: '操作', | 121 | tableControlsName: '操作', |
| ... | @@ -132,6 +136,7 @@ export default { | ... | @@ -132,6 +136,7 @@ export default { |
| 132 | dialogSubmit: '直接发布', | 136 | dialogSubmit: '直接发布', |
| 133 | dialogSave: '保存', | 137 | dialogSave: '保存', |
| 134 | dialogExit: '退出', | 138 | dialogExit: '退出', |
| 139 | dialogGroup: '系列', | ||
| 135 | }, | 140 | }, |
| 136 | // 升级管理 | 141 | // 升级管理 |
| 137 | upgradation: { | 142 | upgradation: { | ... | ... |
| ... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
| 42 | > | 42 | > |
| 43 | <el-table-column :label="$t('block.indexName')" type="index" width="80" /> | 43 | <el-table-column :label="$t('block.indexName')" type="index" width="80" /> |
| 44 | <el-table-column :label="$t('block.blockName')" prop="name" /> | 44 | <el-table-column :label="$t('block.blockName')" prop="name" /> |
| 45 | <el-table-column :label="$t('block.groupName')" prop="entiretyName" /> | 45 | <el-table-column :label="$t('block.sortName')" prop="sort" /> |
| 46 | <el-table-column :label="$t('block.tableControlsName')" class-name="small-padding fixed-width"> | 46 | <el-table-column :label="$t('block.tableControlsName')" class-name="small-padding fixed-width"> |
| 47 | <template #default="{ row }"> | 47 | <template #default="{ row }"> |
| 48 | <el-button | 48 | <el-button |
| ... | @@ -72,15 +72,6 @@ | ... | @@ -72,15 +72,6 @@ |
| 72 | <el-form-item :label="$t('block.dialogName')" prop="name" label-width="80"> | 72 | <el-form-item :label="$t('block.dialogName')" prop="name" label-width="80"> |
| 73 | <el-input v-model="showForm.form.name" placeholder="请输入系列名称" /> | 73 | <el-input v-model="showForm.form.name" placeholder="请输入系列名称" /> |
| 74 | </el-form-item> | 74 | </el-form-item> |
| 75 | <el-form-item :label="$t('block.dialogGroup')" prop="entiretyId" label-width="80"> | ||
| 76 | <el-select-v2 | ||
| 77 | v-model="showForm.form.entiretyId" | ||
| 78 | :options="kitLists" | ||
| 79 | :props="props" | ||
| 80 | placeholder="请选择套件" | ||
| 81 | style="width: 180px;" | ||
| 82 | /> | ||
| 83 | </el-form-item> | ||
| 84 | <el-form-item :label="$t('block.tableSortName')" label-width="80"> | 75 | <el-form-item :label="$t('block.tableSortName')" label-width="80"> |
| 85 | <el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" /> | 76 | <el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" /> |
| 86 | </el-form-item> | 77 | </el-form-item> |
| ... | @@ -103,8 +94,6 @@ | ... | @@ -103,8 +94,6 @@ |
| 103 | import { useTableHeight } from '@/hooks/useTableHeight' | 94 | import { useTableHeight } from '@/hooks/useTableHeight' |
| 104 | // 导入api接口 | 95 | // 导入api接口 |
| 105 | import { getBuildingBlockList, getBuildingBlockLists, addBuildingBlock, editBuildingBlock, delBuildingBlock } from '@/api/legao/block' | 96 | import { getBuildingBlockList, getBuildingBlockLists, addBuildingBlock, editBuildingBlock, delBuildingBlock } from '@/api/legao/block' |
| 106 | |||
| 107 | import { getEntiretyists } from '@/api/legao/kit' | ||
| 108 | import { reactive, toRefs } from 'vue'; | 97 | import { reactive, toRefs } from 'vue'; |
| 109 | const { windowSize } = useTableHeight('max-height') | 98 | const { windowSize } = useTableHeight('max-height') |
| 110 | 99 | ||
| ... | @@ -165,12 +154,6 @@ function getList () { | ... | @@ -165,12 +154,6 @@ function getList () { |
| 165 | }) | 154 | }) |
| 166 | } | 155 | } |
| 167 | 156 | ||
| 168 | function getKitLists() { | ||
| 169 | getEntiretyists().then(res => { | ||
| 170 | kitLists.value = res?.data || [] | ||
| 171 | }) | ||
| 172 | } | ||
| 173 | |||
| 174 | // 搜索 | 157 | // 搜索 |
| 175 | function btn_search () { | 158 | function btn_search () { |
| 176 | queryParams.value.pageNum = 1 | 159 | queryParams.value.pageNum = 1 |
| ... | @@ -179,7 +162,6 @@ function btn_search () { | ... | @@ -179,7 +162,6 @@ function btn_search () { |
| 179 | 162 | ||
| 180 | // 单条编辑 | 163 | // 单条编辑 |
| 181 | function handleEdit (row) { | 164 | function handleEdit (row) { |
| 182 | getKitLists() | ||
| 183 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') | 165 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') |
| 184 | showForm.value = { | 166 | showForm.value = { |
| 185 | ...showForm.value, | 167 | ...showForm.value, |
| ... | @@ -189,7 +171,6 @@ function handleEdit (row) { | ... | @@ -189,7 +171,6 @@ function handleEdit (row) { |
| 189 | } | 171 | } |
| 190 | 172 | ||
| 191 | function btn_add () { | 173 | function btn_add () { |
| 192 | getKitLists() | ||
| 193 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') | 174 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') |
| 194 | showForm.value = { | 175 | showForm.value = { |
| 195 | ...showForm.value, | 176 | ...showForm.value, |
| ... | @@ -202,7 +183,6 @@ function handleDel(row) { | ... | @@ -202,7 +183,6 @@ function handleDel(row) { |
| 202 | return delBuildingBlock(row.id); | 183 | return delBuildingBlock(row.id); |
| 203 | }).then(() => { | 184 | }).then(() => { |
| 204 | getList(); | 185 | getList(); |
| 205 | proxy.$modal.msgSuccess(res.msg); | ||
| 206 | }).finally(() => { | 186 | }).finally(() => { |
| 207 | 187 | ||
| 208 | }); | 188 | }); | ... | ... |
| ... | @@ -41,7 +41,8 @@ | ... | @@ -41,7 +41,8 @@ |
| 41 | > | 41 | > |
| 42 | <el-table-column :label="$t('course.indexName')" type="index" width="80" /> | 42 | <el-table-column :label="$t('course.indexName')" type="index" width="80" /> |
| 43 | <el-table-column :label="$t('course.courseName')" prop="name" /> | 43 | <el-table-column :label="$t('course.courseName')" prop="name" /> |
| 44 | <el-table-column :label="$t('course.blockName')" prop="buildingBlockName" /> | 44 | <el-table-column :label="$t('course.entiretyName')" prop="entiretyName" /> |
| 45 | <el-table-column :label="$t('course.tableSortName')" prop="sort" /> | ||
| 45 | <el-table-column :label="$t('course.buildName')" prop="type" /> | 46 | <el-table-column :label="$t('course.buildName')" prop="type" /> |
| 46 | <el-table-column :label="$t('course.caseName')" prop="caseName" /> | 47 | <el-table-column :label="$t('course.caseName')" prop="caseName" /> |
| 47 | <el-table-column :label="$t('course.packName')" prop="canPack"> | 48 | <el-table-column :label="$t('course.packName')" prop="canPack"> |
| ... | @@ -81,12 +82,12 @@ | ... | @@ -81,12 +82,12 @@ |
| 81 | <el-form-item :label="$t('course.dialogName')" prop="name" label-width="80"> | 82 | <el-form-item :label="$t('course.dialogName')" prop="name" label-width="80"> |
| 82 | <el-input v-model="showForm.form.name" placeholder="请输入课程名称" /> | 83 | <el-input v-model="showForm.form.name" placeholder="请输入课程名称" /> |
| 83 | </el-form-item> | 84 | </el-form-item> |
| 84 | <el-form-item :label="$t('course.dialogBlock')" prop="buildingBlockId" label-width="80"> | 85 | <el-form-item :label="$t('course.dialogEntirety')" prop="entiretyId" label-width="80"> |
| 85 | <el-select-v2 | 86 | <el-select-v2 |
| 86 | v-model="showForm.form.buildingBlockId" | 87 | v-model="showForm.form.entiretyId" |
| 87 | :options="blockLists" | 88 | :options="entiretyLists" |
| 88 | :props="props" | 89 | :props="props" |
| 89 | placeholder="请选择系列" | 90 | placeholder="请选择套件" |
| 90 | style="width: 180px;" | 91 | style="width: 180px;" |
| 91 | /> | 92 | /> |
| 92 | </el-form-item> | 93 | </el-form-item> |
| ... | @@ -164,7 +165,7 @@ | ... | @@ -164,7 +165,7 @@ |
| 164 | import { useTableHeight } from '@/hooks/useTableHeight' | 165 | import { useTableHeight } from '@/hooks/useTableHeight' |
| 165 | // 导入api接口 | 166 | // 导入api接口 |
| 166 | import { getCourseList, addCourse, editCourse, delCourse } from '@/api/legao/course' | 167 | import { getCourseList, addCourse, editCourse, delCourse } from '@/api/legao/course' |
| 167 | import { getBuildingBlockLists } from '@/api/legao/block' | 168 | import { getEntiretyists } from '@/api/legao/kit' |
| 168 | import { reactive, toRefs } from 'vue'; | 169 | import { reactive, toRefs } from 'vue'; |
| 169 | const { windowSize } = useTableHeight('max-height') | 170 | const { windowSize } = useTableHeight('max-height') |
| 170 | 171 | ||
| ... | @@ -189,7 +190,7 @@ const data = reactive({ | ... | @@ -189,7 +190,7 @@ const data = reactive({ |
| 189 | }, | 190 | }, |
| 190 | total: 0, | 191 | total: 0, |
| 191 | list: [], | 192 | list: [], |
| 192 | blockLists: [], | 193 | entiretyLists: [], |
| 193 | showForm: { | 194 | showForm: { |
| 194 | title: '', | 195 | title: '', |
| 195 | open: false, | 196 | open: false, |
| ... | @@ -205,7 +206,7 @@ const data = reactive({ | ... | @@ -205,7 +206,7 @@ const data = reactive({ |
| 205 | } | 206 | } |
| 206 | }) | 207 | }) |
| 207 | 208 | ||
| 208 | const { status, queryParams, total, list, showForm, rules, blockLists } = toRefs(data) | 209 | const { status, queryParams, total, list, showForm, rules, entiretyLists } = toRefs(data) |
| 209 | 210 | ||
| 210 | 211 | ||
| 211 | //#region 初始化 | 212 | //#region 初始化 |
| ... | @@ -237,8 +238,8 @@ function getList () { | ... | @@ -237,8 +238,8 @@ function getList () { |
| 237 | 238 | ||
| 238 | // 系列 | 239 | // 系列 |
| 239 | function getBlockLists () { | 240 | function getBlockLists () { |
| 240 | getBuildingBlockLists().then((res) => { | 241 | getEntiretyists().then((res) => { |
| 241 | blockLists.value = res.data | 242 | entiretyLists.value = res.data |
| 242 | }) | 243 | }) |
| 243 | } | 244 | } |
| 244 | 245 | ... | ... |
| ... | @@ -27,15 +27,8 @@ | ... | @@ -27,15 +27,8 @@ |
| 27 | > | 27 | > |
| 28 | <el-table-column :label="$t('kit.indexName')" type="index" width="80" /> | 28 | <el-table-column :label="$t('kit.indexName')" type="index" width="80" /> |
| 29 | <el-table-column :label="$t('kit.groupName')" prop="name" /> | 29 | <el-table-column :label="$t('kit.groupName')" prop="name" /> |
| 30 | <el-table-column :label="$t('kit.buildingBlockName')" prop="buildingBlockName" /> | ||
| 30 | <el-table-column :label="$t('kit.sortName')" prop="sort" /> | 31 | <el-table-column :label="$t('kit.sortName')" prop="sort" /> |
| 31 | <el-table-column :label="$t('kit.cateName')" prop="type"> | ||
| 32 | <template #default="{ row }"> | ||
| 33 | <dict-tag | ||
| 34 | :options="entirety_type" | ||
| 35 | :value="row.type" | ||
| 36 | ></dict-tag> | ||
| 37 | </template> | ||
| 38 | </el-table-column> | ||
| 39 | <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width"> | 32 | <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width"> |
| 40 | <template #default="{ row }"> | 33 | <template #default="{ row }"> |
| 41 | <el-button | 34 | <el-button |
| ... | @@ -65,19 +58,21 @@ | ... | @@ -65,19 +58,21 @@ |
| 65 | <el-form-item :label="$t('kit.dialogName')" prop="name" label-width="80"> | 58 | <el-form-item :label="$t('kit.dialogName')" prop="name" label-width="80"> |
| 66 | <el-input v-model="showForm.form.name" placeholder="请输入套件名称" /> | 59 | <el-input v-model="showForm.form.name" placeholder="请输入套件名称" /> |
| 67 | </el-form-item> | 60 | </el-form-item> |
| 68 | <el-form-item :label="$t('kit.dialogCate')" prop="type" label-width="80"> | 61 | <el-form-item :label="$t('kit.dialogGroup')" prop="buildingBlockId" label-width="80"> |
| 69 | <el-select v-model="showForm.form.type" placeholder="请选择类别" clearable> | 62 | <el-select-v2 |
| 70 | <el-option | 63 | v-model="showForm.form.buildingBlockId" |
| 71 | v-for="dict in entirety_type" | 64 | :options="kitLists" |
| 72 | :key="dict.value" | 65 | :props="props" |
| 73 | :label="dict.label" | 66 | placeholder="请选择系列" |
| 74 | :value="dict.value" | 67 | style="width: 180px;" |
| 75 | /> | 68 | /> |
| 76 | </el-select> | ||
| 77 | </el-form-item> | 69 | </el-form-item> |
| 78 | <el-form-item :label="$t('kit.dialogSort')" label-width="80"> | 70 | <el-form-item :label="$t('kit.dialogSort')" label-width="80"> |
| 79 | <el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" /> | 71 | <el-input-number v-model="showForm.form.sort" controls-position="right" :min="0" /> |
| 80 | </el-form-item> | 72 | </el-form-item> |
| 73 | <el-form-item :label="$t('kit.dialogPhoto')" prop="ossId" label-width="80"> | ||
| 74 | <imageUpload v-model="showForm.form.ossId" :fileType='["png", "jpg", "jpeg", "ico"]'/> | ||
| 75 | </el-form-item> | ||
| 81 | </el-form> | 76 | </el-form> |
| 82 | <template #footer> | 77 | <template #footer> |
| 83 | <div class="dialog-footer"> | 78 | <div class="dialog-footer"> |
| ... | @@ -93,10 +88,13 @@ | ... | @@ -93,10 +88,13 @@ |
| 93 | <script setup name="ruleManager"> | 88 | <script setup name="ruleManager"> |
| 94 | import { useTableHeight } from '@/hooks/useTableHeight' | 89 | import { useTableHeight } from '@/hooks/useTableHeight' |
| 95 | // 导入api接口 | 90 | // 导入api接口 |
| 96 | import { getEntiretyist, addEntirety, editEntirety, delEntirety } from '@/api/legao/kit' | 91 | import { getEntiretyist, addEntirety, editEntirety, delEntirety,getBuildingBlockLists } from '@/api/legao/kit' |
| 97 | import { reactive, toRefs } from 'vue'; | 92 | import { reactive, toRefs } from 'vue'; |
| 98 | const { windowSize } = useTableHeight('max-height') | 93 | const { windowSize } = useTableHeight('max-height') |
| 99 | 94 | const props = { | |
| 95 | label: 'name', | ||
| 96 | value: 'id', | ||
| 97 | } | ||
| 100 | // 导入字典 | 98 | // 导入字典 |
| 101 | const { proxy } = getCurrentInstance(); | 99 | const { proxy } = getCurrentInstance(); |
| 102 | const { entirety_type } = proxy.useDict("entirety_type"); | 100 | const { entirety_type } = proxy.useDict("entirety_type"); |
| ... | @@ -108,6 +106,7 @@ const data = reactive({ | ... | @@ -108,6 +106,7 @@ const data = reactive({ |
| 108 | showForm: false, | 106 | showForm: false, |
| 109 | showCodePart: false | 107 | showCodePart: false |
| 110 | }, | 108 | }, |
| 109 | kitLists: [], | ||
| 111 | queryParams: { | 110 | queryParams: { |
| 112 | pageNum: 1, | 111 | pageNum: 1, |
| 113 | pageSize: 10 | 112 | pageSize: 10 |
| ... | @@ -123,11 +122,11 @@ const data = reactive({ | ... | @@ -123,11 +122,11 @@ const data = reactive({ |
| 123 | }, | 122 | }, |
| 124 | rules: { | 123 | rules: { |
| 125 | name: [{ required: true, message: "套件名称不能为空", trigger: "blur" }], | 124 | name: [{ required: true, message: "套件名称不能为空", trigger: "blur" }], |
| 126 | type: [{ required: true, message: "类别不能为空", trigger: "blur" }] | 125 | buildingBlockId: [{ required: true, message: "系列不能为空", trigger: "blur" }] |
| 127 | } | 126 | } |
| 128 | }) | 127 | }) |
| 129 | 128 | ||
| 130 | const { status, queryParams, total, list, showForm, rules } = toRefs(data) | 129 | const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data) |
| 131 | 130 | ||
| 132 | 131 | ||
| 133 | //#region 初始化 | 132 | //#region 初始化 |
| ... | @@ -157,6 +156,7 @@ function btn_search () { | ... | @@ -157,6 +156,7 @@ function btn_search () { |
| 157 | 156 | ||
| 158 | // 单条编辑 | 157 | // 单条编辑 |
| 159 | function handleEdit (row) { | 158 | function handleEdit (row) { |
| 159 | getKitLists() | ||
| 160 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') | 160 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') |
| 161 | showForm.value = { | 161 | showForm.value = { |
| 162 | ...showForm.value, | 162 | ...showForm.value, |
| ... | @@ -166,6 +166,7 @@ function handleEdit (row) { | ... | @@ -166,6 +166,7 @@ function handleEdit (row) { |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | function btn_add () { | 168 | function btn_add () { |
| 169 | getKitLists() | ||
| 169 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') | 170 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') |
| 170 | showForm.value = { | 171 | showForm.value = { |
| 171 | ...showForm.value, | 172 | ...showForm.value, |
| ... | @@ -203,4 +204,10 @@ function closeDialog() { | ... | @@ -203,4 +204,10 @@ function closeDialog() { |
| 203 | form: {} | 204 | form: {} |
| 204 | } | 205 | } |
| 205 | } | 206 | } |
| 207 | |||
| 208 | function getKitLists() { | ||
| 209 | getBuildingBlockLists().then(res => { | ||
| 210 | kitLists.value = res?.data || [] | ||
| 211 | }) | ||
| 212 | } | ||
| 206 | </script> | 213 | </script> | ... | ... |
| ... | @@ -47,6 +47,8 @@ | ... | @@ -47,6 +47,8 @@ |
| 47 | > | 47 | > |
| 48 | <el-table-column :label="$t('problem.tableIndex')" type="index" width="80" /> | 48 | <el-table-column :label="$t('problem.tableIndex')" type="index" width="80" /> |
| 49 | <el-table-column :label="$t('problem.tableAnsName')" prop="title" /> | 49 | <el-table-column :label="$t('problem.tableAnsName')" prop="title" /> |
| 50 | <el-table-column :label="$t('problem.tableBuildingBlockName')" prop="buildingBlockName" /> | ||
| 51 | <el-table-column :label="$t('problem.tableSortName')" prop="sort" /> | ||
| 50 | <el-table-column :label="$t('problem.tableShowName')" prop="showStr" /> | 52 | <el-table-column :label="$t('problem.tableShowName')" prop="showStr" /> |
| 51 | <el-table-column :label="$t('problem.tableStateName')" prop="status"> | 53 | <el-table-column :label="$t('problem.tableStateName')" prop="status"> |
| 52 | <template #default="{ row }"> | 54 | <template #default="{ row }"> |
| ... | @@ -97,6 +99,15 @@ | ... | @@ -97,6 +99,15 @@ |
| 97 | <el-form-item :label="$t('problem.dialogName')" prop="title" label-width="80"> | 99 | <el-form-item :label="$t('problem.dialogName')" prop="title" label-width="80"> |
| 98 | <el-input v-model="showForm.form.title" placeholder="请输入问题" /> | 100 | <el-input v-model="showForm.form.title" placeholder="请输入问题" /> |
| 99 | </el-form-item> | 101 | </el-form-item> |
| 102 | <el-form-item :label="$t('problem.dialogGroup')" prop="buildingBlockId" label-width="80"> | ||
| 103 | <el-select-v2 | ||
| 104 | v-model="showForm.form.buildingBlockId" | ||
| 105 | :options="kitLists" | ||
| 106 | :props="props" | ||
| 107 | placeholder="请选择系列" | ||
| 108 | style="width: 180px;" | ||
| 109 | /> | ||
| 110 | </el-form-item> | ||
| 100 | <el-form-item :label="$t('problem.dialogPhote')" label-width="80"> | 111 | <el-form-item :label="$t('problem.dialogPhote')" label-width="80"> |
| 101 | <imageUpload v-model="showForm.form.coverOssId" :limit="1" :fileType='["png", "jpg", "jpeg", "ico"]'/> | 112 | <imageUpload v-model="showForm.form.coverOssId" :limit="1" :fileType='["png", "jpg", "jpeg", "ico"]'/> |
| 102 | </el-form-item> | 113 | </el-form-item> |
| ... | @@ -133,9 +144,13 @@ | ... | @@ -133,9 +144,13 @@ |
| 133 | import { useTableHeight } from '@/hooks/useTableHeight' | 144 | import { useTableHeight } from '@/hooks/useTableHeight' |
| 134 | // 导入api接口 | 145 | // 导入api接口 |
| 135 | import { getQuestionList, updateStatus, addQuestion, editQuestion, delQuestion } from '@/api/legao/problem' | 146 | import { getQuestionList, updateStatus, addQuestion, editQuestion, delQuestion } from '@/api/legao/problem' |
| 147 | import { getBuildingBlockLists } from '@/api/legao/kit' | ||
| 136 | import { reactive, toRefs } from 'vue'; | 148 | import { reactive, toRefs } from 'vue'; |
| 137 | const { windowSize } = useTableHeight('max-height') | 149 | const { windowSize } = useTableHeight('max-height') |
| 138 | 150 | const props = { | |
| 151 | label: 'name', | ||
| 152 | value: 'id', | ||
| 153 | } | ||
| 139 | // 导入字典 | 154 | // 导入字典 |
| 140 | const { proxy } = getCurrentInstance(); | 155 | const { proxy } = getCurrentInstance(); |
| 141 | const { advert_state } = proxy.useDict("advert_state"); | 156 | const { advert_state } = proxy.useDict("advert_state"); |
| ... | @@ -148,6 +163,7 @@ const data = reactive({ | ... | @@ -148,6 +163,7 @@ const data = reactive({ |
| 148 | showForm: false, | 163 | showForm: false, |
| 149 | showCodePart: false | 164 | showCodePart: false |
| 150 | }, | 165 | }, |
| 166 | kitLists: [], | ||
| 151 | queryParams: { | 167 | queryParams: { |
| 152 | pageNum: 1, | 168 | pageNum: 1, |
| 153 | pageSize: 10 | 169 | pageSize: 10 |
| ... | @@ -168,7 +184,7 @@ const data = reactive({ | ... | @@ -168,7 +184,7 @@ const data = reactive({ |
| 168 | 184 | ||
| 169 | const tableRefs = ref(null) | 185 | const tableRefs = ref(null) |
| 170 | 186 | ||
| 171 | const { status, queryParams, total, list, showForm, rules } = toRefs(data) | 187 | const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data) |
| 172 | 188 | ||
| 173 | 189 | ||
| 174 | //#region 初始化 | 190 | //#region 初始化 |
| ... | @@ -198,6 +214,7 @@ function btn_search () { | ... | @@ -198,6 +214,7 @@ function btn_search () { |
| 198 | 214 | ||
| 199 | // 单条编辑 | 215 | // 单条编辑 |
| 200 | function handleEdit (row) { | 216 | function handleEdit (row) { |
| 217 | getKitLists() | ||
| 201 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') | 218 | showForm.value.title = proxy.$t('advertisement.dialogTitleEdit') |
| 202 | showForm.value = { | 219 | showForm.value = { |
| 203 | ...showForm.value, | 220 | ...showForm.value, |
| ... | @@ -207,6 +224,7 @@ function handleEdit (row) { | ... | @@ -207,6 +224,7 @@ function handleEdit (row) { |
| 207 | } | 224 | } |
| 208 | 225 | ||
| 209 | function btn_add () { | 226 | function btn_add () { |
| 227 | getKitLists() | ||
| 210 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') | 228 | showForm.value.title = proxy.$t('advertisement.dialogTitleAdd') |
| 211 | showForm.value.open = true | 229 | showForm.value.open = true |
| 212 | showForm.value.form = { | 230 | showForm.value.form = { |
| ... | @@ -258,4 +276,10 @@ function closeDialog() { | ... | @@ -258,4 +276,10 @@ function closeDialog() { |
| 258 | form: {} | 276 | form: {} |
| 259 | } | 277 | } |
| 260 | } | 278 | } |
| 279 | |||
| 280 | function getKitLists() { | ||
| 281 | getBuildingBlockLists().then(res => { | ||
| 282 | kitLists.value = res?.data || [] | ||
| 283 | }) | ||
| 284 | } | ||
| 261 | </script> | 285 | </script> | ... | ... |
-
Please register or sign in to post a comment