|
|
@@ -24,8 +24,13 @@
|
|
|
<!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
<a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
|
|
|
</template>
|
|
|
- <template #showMap="{ record }">
|
|
|
- <Switch v-model:checked="record.showMap" />
|
|
|
+ <template #mapShow="{ record }">
|
|
|
+ <Switch
|
|
|
+ v-model:checked="record.mapShow"
|
|
|
+ :checkedValue="1"
|
|
|
+ :unCheckedValue="0"
|
|
|
+ @click="handleUpdateSwitch(record)"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template #cover="{ record }">
|
|
|
<TableImg
|
|
|
@@ -159,6 +164,7 @@
|
|
|
sceneCopy,
|
|
|
patchcoldStorageApi,
|
|
|
generateObjFileAPI,
|
|
|
+ updateMapShowApi,
|
|
|
} from '/@/api/scene/list';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import {
|
|
|
@@ -276,8 +282,8 @@
|
|
|
},
|
|
|
{
|
|
|
title: t('routes.scenes.showMap'),
|
|
|
- dataIndex: 'showMap',
|
|
|
- slots: { customRender: 'showMap' },
|
|
|
+ dataIndex: 'mapShow',
|
|
|
+ slots: { customRender: 'mapShow' },
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
@@ -540,6 +546,16 @@
|
|
|
const handleMigrateCancel = () => {
|
|
|
reload();
|
|
|
};
|
|
|
+ async function handleUpdateSwitch(record: any) {
|
|
|
+ // const reveseValue = Math.abs(record.mapShow - 1);
|
|
|
+ // record.mapShow = record.mapShow;
|
|
|
+ console.log('reveseValue', record.mapShow);
|
|
|
+ await updateMapShowApi({
|
|
|
+ num: record.num,
|
|
|
+ mapShow: record.mapShow,
|
|
|
+ });
|
|
|
+ setTimeout(reload, 100);
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
reload,
|
|
|
@@ -568,6 +584,7 @@
|
|
|
handleMigrate,
|
|
|
handleMigrateSuccess,
|
|
|
handleMigrateCancel,
|
|
|
+ handleUpdateSwitch,
|
|
|
};
|
|
|
},
|
|
|
});
|