新增隐藏属性
Showing
4 changed files
with
79 additions
and
6 deletions
| ... | @@ -34,3 +34,19 @@ export function delCourse(id) { | ... | @@ -34,3 +34,19 @@ export function delCourse(id) { |
| 34 | method: 'DELETE', | 34 | method: 'DELETE', |
| 35 | }) | 35 | }) |
| 36 | } | 36 | } |
| 37 | |||
| 38 | // 显示 | ||
| 39 | export function displayCourse(id) { | ||
| 40 | return request({ | ||
| 41 | url: `/core/course/display/${id}`, | ||
| 42 | method: 'put', | ||
| 43 | }) | ||
| 44 | } | ||
| 45 | |||
| 46 | // 隐藏 | ||
| 47 | export function hideCourse(id) { | ||
| 48 | return request({ | ||
| 49 | url: `/core/course/hide/${id}`, | ||
| 50 | method: 'put', | ||
| 51 | }) | ||
| 52 | } | ... | ... |
| ... | @@ -43,9 +43,13 @@ export default { | ... | @@ -43,9 +43,13 @@ export default { |
| 43 | sortName: '排序', | 43 | sortName: '排序', |
| 44 | unitName: '单元类别', | 44 | unitName: '单元类别', |
| 45 | dialogGroup: '系列', | 45 | dialogGroup: '系列', |
| 46 | visibleName: '状态', | ||
| 46 | tableControlsName: '操作', | 47 | tableControlsName: '操作', |
| 47 | controlsDelName: '删除', | ||
| 48 | controlsEditName: '编辑', | 48 | controlsEditName: '编辑', |
| 49 | controlsDelName: '删除', | ||
| 50 | controlsDisplayName: '显示', | ||
| 51 | controlsHideName: '隐藏', | ||
| 52 | |||
| 49 | // 新增 | 53 | // 新增 |
| 50 | dialogTitleAdd: '新增', | 54 | dialogTitleAdd: '新增', |
| 51 | dialogTitleEdit: '修改', | 55 | dialogTitleEdit: '修改', |
| ... | @@ -90,10 +94,13 @@ export default { | ... | @@ -90,10 +94,13 @@ export default { |
| 90 | buildName: '搭建', | 94 | buildName: '搭建', |
| 91 | caseName: '有无案例', | 95 | caseName: '有无案例', |
| 92 | packName: '是否打包', | 96 | packName: '是否打包', |
| 97 | visibleName: '状态', | ||
| 93 | tableSortName: '排序', | 98 | tableSortName: '排序', |
| 94 | tableControlsName: '操作', | 99 | tableControlsName: '操作', |
| 95 | controlsDelName: '删除', | ||
| 96 | controlsEditName: '编辑', | 100 | controlsEditName: '编辑', |
| 101 | controlsDelName: '删除', | ||
| 102 | controlsDisplayName: '显示', | ||
| 103 | controlsHideName: '隐藏', | ||
| 97 | controlsAddName: '新增课程', | 104 | controlsAddName: '新增课程', |
| 98 | placeholder: '课程、套件、系列名称搜索', | 105 | placeholder: '课程、套件、系列名称搜索', |
| 99 | // 新增 | 106 | // 新增 |
| ... | @@ -139,7 +146,7 @@ export default { | ... | @@ -139,7 +146,7 @@ export default { |
| 139 | dialogMovie: '视频', | 146 | dialogMovie: '视频', |
| 140 | dialogShow: '展示', | 147 | dialogShow: '展示', |
| 141 | dialogSort: '排序', | 148 | dialogSort: '排序', |
| 142 | dialogPack: '是否打包', | 149 | dialogPack: '是否打包', |
| 143 | dialogSubmit: '直接发布', | 150 | dialogSubmit: '直接发布', |
| 144 | dialogSave: '保存', | 151 | dialogSave: '保存', |
| 145 | dialogExit: '退出', | 152 | dialogExit: '退出', | ... | ... |
| ... | @@ -15,6 +15,12 @@ | ... | @@ -15,6 +15,12 @@ |
| 15 | /> | 15 | /> |
| 16 | </el-form-item> | 16 | </el-form-item> |
| 17 | <el-form-item label=""> | 17 | <el-form-item label=""> |
| 18 | <el-button type="success" icon="Edit" :disabled="multiple" @click="handleBatchDisplay">批量显示</el-button> | ||
| 19 | </el-form-item> | ||
| 20 | <el-form-item label=""> | ||
| 21 | <el-button type="success" icon="Edit" :disabled="multiple" @click="handleBatchHide">批量隐藏</el-button> | ||
| 22 | </el-form-item> | ||
| 23 | <el-form-item label=""> | ||
| 18 | <el-button type="primary" icon="Search" @click="btn_search">查询</el-button> | 24 | <el-button type="primary" icon="Search" @click="btn_search">查询</el-button> |
| 19 | </el-form-item> | 25 | </el-form-item> |
| 20 | </el-form> | 26 | </el-form> |
| ... | @@ -39,6 +45,9 @@ | ... | @@ -39,6 +45,9 @@ |
| 39 | :cell-style="{textAlign:'center'}" | 45 | :cell-style="{textAlign:'center'}" |
| 40 | border | 46 | border |
| 41 | > | 47 | > |
| 48 | <el-table-column type="selection" | ||
| 49 | width="50" | ||
| 50 | align="center" /> | ||
| 42 | <el-table-column :label="$t('course.indexName')" type="index" width="80" /> | 51 | <el-table-column :label="$t('course.indexName')" type="index" width="80" /> |
| 43 | <el-table-column :label="$t('course.courseName')" prop="name" /> | 52 | <el-table-column :label="$t('course.courseName')" prop="name" /> |
| 44 | <el-table-column :label="$t('course.entiretyName')" prop="entiretyName" /> | 53 | <el-table-column :label="$t('course.entiretyName')" prop="entiretyName" /> |
| ... | @@ -53,18 +62,31 @@ | ... | @@ -53,18 +62,31 @@ |
| 53 | ></dict-tag> | 62 | ></dict-tag> |
| 54 | </template> | 63 | </template> |
| 55 | </el-table-column> | 64 | </el-table-column> |
| 65 | <el-table-column :label="$t('course.visibleName')" prop="isVisible" /> | ||
| 56 | <el-table-column :label="$t('course.tableControlsName')" class-name="small-padding fixed-width"> | 66 | <el-table-column :label="$t('course.tableControlsName')" class-name="small-padding fixed-width"> |
| 57 | <template #default="{ row }"> | 67 | <template #default="{ row }"> |
| 58 | <el-button | 68 | <el-button |
| 59 | link | 69 | link |
| 60 | type="text" | 70 | type="text" |
| 71 | @click="handleEdit(row)" | ||
| 72 | >{{ $t('course.controlsEditName') }}</el-button> | ||
| 73 | <el-button | ||
| 74 | link | ||
| 75 | type="text" | ||
| 61 | @click="handleDel(row)" | 76 | @click="handleDel(row)" |
| 62 | >{{ $t('course.controlsDelName') }}</el-button> | 77 | >{{ $t('course.controlsDelName') }}</el-button> |
| 63 | <el-button | 78 | <el-button |
| 64 | link | 79 | link |
| 65 | type="text" | 80 | type="text" |
| 66 | @click="handleEdit(row)" | 81 | @click="handleDisplay(row)" |
| 67 | >{{ $t('course.controlsEditName') }}</el-button> | 82 | v-if="row.isVisible === 0" |
| 83 | >{{ $t('course.controlsDisplayName') }}</el-button> | ||
| 84 | <el-button | ||
| 85 | link | ||
| 86 | type="text" | ||
| 87 | @click="handleHide(row)" | ||
| 88 | v-if="row.isVisible === 1" | ||
| 89 | >{{ $t('course.controlsHideName') }}</el-button> | ||
| 68 | </template> | 90 | </template> |
| 69 | </el-table-column> | 91 | </el-table-column> |
| 70 | </el-table> | 92 | </el-table> |
| ... | @@ -174,7 +196,7 @@ | ... | @@ -174,7 +196,7 @@ |
| 174 | <script setup name="ruleManager"> | 196 | <script setup name="ruleManager"> |
| 175 | import { useTableHeight } from '@/hooks/useTableHeight' | 197 | import { useTableHeight } from '@/hooks/useTableHeight' |
| 176 | // 导入api接口 | 198 | // 导入api接口 |
| 177 | import { getCourseList, addCourse, editCourse, delCourse } from '@/api/legao/course' | 199 | import { getCourseList, addCourse, editCourse, delCourse, displayCourse, hideCourse} from '@/api/legao/course' |
| 178 | import { getEntiretyists } from '@/api/legao/kit' | 200 | import { getEntiretyists } from '@/api/legao/kit' |
| 179 | import { reactive, toRefs } from 'vue'; | 201 | import { reactive, toRefs } from 'vue'; |
| 180 | const { windowSize } = useTableHeight('max-height') | 202 | const { windowSize } = useTableHeight('max-height') |
| ... | @@ -299,6 +321,28 @@ function handleDel(row) { | ... | @@ -299,6 +321,28 @@ function handleDel(row) { |
| 299 | }); | 321 | }); |
| 300 | } | 322 | } |
| 301 | 323 | ||
| 324 | function handleDisplay(row) { | ||
| 325 | proxy.$modal.confirm(`确认显示该课程吗?`).then(() => { | ||
| 326 | return displayCourse(row.id); | ||
| 327 | }).then(() => { | ||
| 328 | getList(); | ||
| 329 | proxy.$modal.msgSuccess(res.msg); | ||
| 330 | }).finally(() => { | ||
| 331 | |||
| 332 | }); | ||
| 333 | } | ||
| 334 | |||
| 335 | function handleHide(row) { | ||
| 336 | proxy.$modal.confirm(`确认隐藏该课程吗?隐藏后APP端将不可见。`).then(() => { | ||
| 337 | return hideCourse(row.id); | ||
| 338 | }).then(() => { | ||
| 339 | getList(); | ||
| 340 | proxy.$modal.msgSuccess(res.msg); | ||
| 341 | }).finally(() => { | ||
| 342 | |||
| 343 | }); | ||
| 344 | } | ||
| 345 | |||
| 302 | function submitForm(type) { | 346 | function submitForm(type) { |
| 303 | const data = { | 347 | const data = { |
| 304 | ...showForm.value.form, | 348 | ...showForm.value.form, | ... | ... |
| ... | @@ -29,6 +29,7 @@ | ... | @@ -29,6 +29,7 @@ |
| 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.buildingBlockName')" prop="buildingBlockName" /> |
| 31 | <el-table-column :label="$t('kit.sortName')" prop="sort" /> | 31 | <el-table-column :label="$t('kit.sortName')" prop="sort" /> |
| 32 | <el-table-column :label="$t('kit.visibleName')" prop="isVisible" /> | ||
| 32 | <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width"> | 33 | <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width"> |
| 33 | <template #default="{ row }"> | 34 | <template #default="{ row }"> |
| 34 | <el-button | 35 | <el-button |
| ... | @@ -41,6 +42,11 @@ | ... | @@ -41,6 +42,11 @@ |
| 41 | type="text" | 42 | type="text" |
| 42 | @click="handleEdit(row)" | 43 | @click="handleEdit(row)" |
| 43 | >{{ $t('kit.controlsEditName') }}</el-button> | 44 | >{{ $t('kit.controlsEditName') }}</el-button> |
| 45 | <el-button | ||
| 46 | link | ||
| 47 | type="text" | ||
| 48 | @click="handleEdit(row)" | ||
| 49 | >{{ $t('kit.controlsVisibleName') }}</el-button> | ||
| 44 | </template> | 50 | </template> |
| 45 | </el-table-column> | 51 | </el-table-column> |
| 46 | </el-table> | 52 | </el-table> | ... | ... |
-
Please register or sign in to post a comment