830f61f7 by chentao

no message

1 parent 069379e4
...@@ -49,3 +49,35 @@ export function delEntirety(id) { ...@@ -49,3 +49,35 @@ export function delEntirety(id) {
49 method: 'DELETE', 49 method: 'DELETE',
50 }) 50 })
51 } 51 }
52
53 // 显示
54 export function displayEntirety(id) {
55 return request({
56 url: `/core/entirety/display/${id}`,
57 method: 'put',
58 })
59 }
60
61 // 批量显示
62 export function batchDisplayEntirety(ids) {
63 return request({
64 url: `/core/entirety/batch/display/${ids}`,
65 method: 'put',
66 })
67 }
68
69 // 隐藏
70 export function hideEntirety(id) {
71 return request({
72 url: `/core/entirety/hide/${id}`,
73 method: 'put',
74 })
75 }
76
77 // 批量隐藏
78 export function batchHideEntirety(ids) {
79 return request({
80 url: `/core/entirety/batch/hide/${ids}`,
81 method: 'put',
82 })
83 }
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
15 /> 15 />
16 </el-form-item> 16 </el-form-item>
17 <el-form-item label=""> 17 <el-form-item label="">
18 <el-button type="primary" icon="Plus" :disabled="multiple" @click="handleBatchDisplay">批量显示</el-button> 18 <el-button type="success" icon="Edit" :disabled="multiple" @click="handleBatchHide">批量隐藏</el-button>
19 </el-form-item> 19 </el-form-item>
20 <el-form-item label=""> 20 <el-form-item label="">
21 <el-button type="success" icon="Edit" :disabled="multiple" @click="handleBatchHide">批量隐藏</el-button> 21 <el-button type="primary" icon="Plus" :disabled="multiple" @click="handleBatchDisplay">批量显示</el-button>
22 </el-form-item> 22 </el-form-item>
23 <el-form-item label=""> 23 <el-form-item label="">
24 <el-button type="primary" icon="Search" @click="btn_search">查询</el-button> 24 <el-button type="primary" icon="Search" @click="btn_search">查询</el-button>
...@@ -80,12 +80,14 @@ ...@@ -80,12 +80,14 @@
80 link 80 link
81 type="text" 81 type="text"
82 @click="handleDisplay(row)" 82 @click="handleDisplay(row)"
83 :style="{ color:'#00FF00' }"
83 v-if="!row.visible" 84 v-if="!row.visible"
84 >{{ $t('course.controlsDisplayName') }}</el-button> 85 >{{ $t('course.controlsDisplayName') }}</el-button>
85 <el-button 86 <el-button
86 link 87 link
87 type="text" 88 type="text"
88 @click="handleHide(row)" 89 @click="handleHide(row)"
90 :style="{ color:'#FF0000' }"
89 v-if="row.visible" 91 v-if="row.visible"
90 >{{ $t('course.controlsHideName') }}</el-button> 92 >{{ $t('course.controlsHideName') }}</el-button>
91 </template> 93 </template>
...@@ -344,7 +346,7 @@ function handleDisplay(row) { ...@@ -344,7 +346,7 @@ function handleDisplay(row) {
344 346
345 function handleBatchDisplay(row) { 347 function handleBatchDisplay(row) {
346 const courseIds = row.id || ids.value; 348 const courseIds = row.id || ids.value;
347 proxy.$modal.confirm(`确认显示这些课程吗?`).then(() => { 349 proxy.$modal.confirm(`您已选择`+courseIds.length+`项内容,确认执行批量显示操作吗?`).then(() => {
348 return batchDisplayCourse(courseIds); 350 return batchDisplayCourse(courseIds);
349 }).then(() => { 351 }).then(() => {
350 getList(); 352 getList();
...@@ -367,7 +369,7 @@ function handleHide(row) { ...@@ -367,7 +369,7 @@ function handleHide(row) {
367 369
368 function handleBatchHide(row) { 370 function handleBatchHide(row) {
369 const courseIds = row.id || ids.value; 371 const courseIds = row.id || ids.value;
370 proxy.$modal.confirm(`确认隐藏这些课程吗?隐藏后APP端将不可见。`).then(() => { 372 proxy.$modal.confirm(`您已选择`+courseIds.length+`项内容,确认执行批量隐藏操作吗?`).then(() => {
371 return batchHideCourse(courseIds); 373 return batchHideCourse(courseIds);
372 }).then(() => { 374 }).then(() => {
373 getList(); 375 getList();
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
6 <!-- 列表操作 --> 6 <!-- 列表操作 -->
7 <el-row :gutter="10" class="mb8" justify="end"> 7 <el-row :gutter="10" class="mb8" justify="end">
8 <el-col :span="1.5"> 8 <el-col :span="1.5">
9 <el-button type="success" icon="Edit" :disabled="multiple" @click="handleBatchHide">批量隐藏</el-button>
10 </el-col>
11 <el-col :span="1.5">
12 <el-button type="primary" icon="Plus" :disabled="multiple" @click="handleBatchDisplay">批量显示</el-button>
13 </el-col>
14 <el-col :span="1.5">
9 <el-button 15 <el-button
10 type="primary" 16 type="primary"
11 plain 17 plain
...@@ -24,12 +30,16 @@ ...@@ -24,12 +30,16 @@
24 :header-cell-style="{textAlign:'center'}" 30 :header-cell-style="{textAlign:'center'}"
25 :cell-style="{textAlign:'center'}" 31 :cell-style="{textAlign:'center'}"
26 border 32 border
33 @selection-change="handleSelectionChange"
27 > 34 >
35 <el-table-column type="selection"
36 width="50"
37 align="center" />
28 <el-table-column :label="$t('kit.indexName')" type="index" width="80" /> 38 <el-table-column :label="$t('kit.indexName')" type="index" width="80" />
29 <el-table-column :label="$t('kit.groupName')" prop="name" /> 39 <el-table-column :label="$t('kit.groupName')" prop="name" />
30 <el-table-column :label="$t('kit.buildingBlockName')" prop="buildingBlockName" /> 40 <el-table-column :label="$t('kit.buildingBlockName')" prop="buildingBlockName" />
31 <el-table-column :label="$t('kit.sortName')" prop="sort" /> 41 <el-table-column :label="$t('kit.sortName')" prop="sort" />
32 <el-table-column :label="$t('kit.visibleName')" prop="isVisible" /> 42 <el-table-column :label="$t('kit.visibleName')" prop="display" />
33 <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width"> 43 <el-table-column :label="$t('kit.tableControlsName')" class-name="small-padding fixed-width">
34 <template #default="{ row }"> 44 <template #default="{ row }">
35 <el-button 45 <el-button
...@@ -45,8 +55,17 @@ ...@@ -45,8 +55,17 @@
45 <el-button 55 <el-button
46 link 56 link
47 type="text" 57 type="text"
48 @click="handleEdit(row)" 58 @click="handleDisplay(row)"
49 >{{ $t('kit.controlsVisibleName') }}</el-button> 59 :style="{ color:'#00FF00' }"
60 v-if="!row.visible"
61 >{{ $t('kit.controlsDisplayName') }}</el-button>
62 <el-button
63 link
64 type="text"
65 @click="handleHide(row)"
66 :style="{ color:'#FF0000' }"
67 v-if="row.visible"
68 >{{ $t('kit.controlsHideName') }}</el-button>
50 </template> 69 </template>
51 </el-table-column> 70 </el-table-column>
52 </el-table> 71 </el-table>
...@@ -94,7 +113,7 @@ ...@@ -94,7 +113,7 @@
94 <script setup name="ruleManager"> 113 <script setup name="ruleManager">
95 import { useTableHeight } from '@/hooks/useTableHeight' 114 import { useTableHeight } from '@/hooks/useTableHeight'
96 // 导入api接口 115 // 导入api接口
97 import { getEntiretyist, addEntirety, editEntirety, delEntirety,getBuildingBlockLists } from '@/api/legao/kit' 116 import { getEntiretyist, addEntirety, editEntirety, delEntirety, getBuildingBlockLists, displayEntirety, batchDisplayEntirety, hideEntirety, batchHideEntirety } from '@/api/legao/kit'
98 import { reactive, toRefs } from 'vue'; 117 import { reactive, toRefs } from 'vue';
99 const { windowSize } = useTableHeight('max-height') 118 const { windowSize } = useTableHeight('max-height')
100 const props = { 119 const props = {
...@@ -131,7 +150,9 @@ const data = reactive({ ...@@ -131,7 +150,9 @@ const data = reactive({
131 buildingBlockId: [{ required: true, message: "系列不能为空", trigger: "blur" }] 150 buildingBlockId: [{ required: true, message: "系列不能为空", trigger: "blur" }]
132 } 151 }
133 }) 152 })
134 153 const ids = ref([]);
154 const single = ref(true);
155 const multiple = ref(true);
135 const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data) 156 const { status, queryParams, total, list, showForm, rules, kitLists } = toRefs(data)
136 157
137 158
...@@ -216,4 +237,58 @@ function getKitLists() { ...@@ -216,4 +237,58 @@ function getKitLists() {
216 kitLists.value = res?.data || [] 237 kitLists.value = res?.data || []
217 }) 238 })
218 } 239 }
240
241
242 /** 选择条数 */
243 function handleSelectionChange (selection) {
244 ids.value = selection.map(item => item.id);
245 single.value = selection.length != 1;
246 multiple.value = !selection.length;
247 }
248
249 function handleDisplay(row) {
250 proxy.$modal.confirm(`确认显示该套件吗?`).then(() => {
251 return displayEntirety(row.id);
252 }).then(() => {
253 getList();
254 proxy.$modal.msgSuccess(res.msg);
255 }).finally(() => {
256
257 });
258 }
259
260 function handleBatchDisplay(row) {
261 const entiretyIds = row.id || ids.value;
262 proxy.$modal.confirm(`您已选择`+entiretyIds.length+`项内容,确认执行批量显示操作吗?`).then(() => {
263 return batchDisplayEntirety(entiretyIds);
264 }).then(() => {
265 getList();
266 proxy.$modal.msgSuccess(res.msg);
267 }).finally(() => {
268
269 });
270 }
271
272 function handleHide(row) {
273 proxy.$modal.confirm(`确认隐藏该套件吗?隐藏后APP端将不可见。`).then(() => {
274 return hideEntirety(row.id);
275 }).then(() => {
276 getList();
277 proxy.$modal.msgSuccess(res.msg);
278 }).finally(() => {
279
280 });
281 }
282
283 function handleBatchHide(row) {
284 const entiretyIds = row.id || ids.value;
285 proxy.$modal.confirm(`您已选择`+entiretyIds.length+`项内容,确认执行批量隐藏操作吗?`).then(() => {
286 return batchHideEntirety(entiretyIds);
287 }).then(() => {
288 getList();
289 proxy.$modal.msgSuccess(res.msg);
290 }).finally(() => {
291
292 });
293 }
219 </script> 294 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!