|
@@ -3,31 +3,50 @@
|
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
|
<!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
|
|
<!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
|
|
|
</template>
|
|
</template>
|
|
|
- <template #action="{ column, record }">
|
|
|
|
|
- <TableAction
|
|
|
|
|
- stopButtonPropagation
|
|
|
|
|
- :actions="[
|
|
|
|
|
- {
|
|
|
|
|
- label: '删除',
|
|
|
|
|
- icon: 'ic:outline-delete-outline',
|
|
|
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
|
+ <TableAction
|
|
|
|
|
+ stopButtonPropagation
|
|
|
|
|
+ :actions="[
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '迁移',
|
|
|
|
|
+ icon: 'bx:move-horizontal',
|
|
|
|
|
+ popConfirm: {
|
|
|
|
|
+ title: '是否迁移?',
|
|
|
|
|
+ confirm: handleMove.bind(null, record),
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '下载',
|
|
|
|
|
+ icon: 'carbon:download',
|
|
|
|
|
+ color: 'success',
|
|
|
|
|
+ onClick: handleDownload.bind(null, record),
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '重算',
|
|
|
|
|
+ icon: 'bx:reset',
|
|
|
|
|
+ color: 'warning',
|
|
|
|
|
+ popConfirm: {
|
|
|
|
|
+ title: '是否重算?',
|
|
|
|
|
+ confirm: handleReset.bind(null, record),
|
|
|
},
|
|
},
|
|
|
- ]"
|
|
|
|
|
- :dropDownActions="[
|
|
|
|
|
- {
|
|
|
|
|
- label: '启用',
|
|
|
|
|
- popConfirm: {
|
|
|
|
|
- title: '是否启用?',
|
|
|
|
|
- confirm: handleOpen.bind(null, record),
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '删除',
|
|
|
|
|
+ icon: 'ic:outline-delete-outline',
|
|
|
|
|
+ color: 'error',
|
|
|
|
|
+ popConfirm: {
|
|
|
|
|
+ title: '是否删除?',
|
|
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
|
|
+ placement: 'topLeft',
|
|
|
},
|
|
},
|
|
|
- ]"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ ]"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</BasicTable>
|
|
</BasicTable>
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
- import { defineComponent, h } from 'vue';
|
|
|
|
|
|
|
+ import { defineComponent, h, reactive, toRefs } from 'vue';
|
|
|
import {
|
|
import {
|
|
|
BasicTable,
|
|
BasicTable,
|
|
|
useTable,
|
|
useTable,
|
|
@@ -42,8 +61,15 @@
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { Switch } from 'ant-design-vue';
|
|
import { Switch } from 'ant-design-vue';
|
|
|
- import { operateSceneList } from '/@/api/operate';
|
|
|
|
|
-
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ operateSceneList,
|
|
|
|
|
+ sceneMove,
|
|
|
|
|
+ sceneDelete,
|
|
|
|
|
+ sceneReset,
|
|
|
|
|
+ sceneDownload,
|
|
|
|
|
+ sceneCopy,
|
|
|
|
|
+ } from '/@/api/operate';
|
|
|
|
|
+ import { message } from 'ant-design-vue';
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
components: {
|
|
components: {
|
|
|
BasicTable,
|
|
BasicTable,
|
|
@@ -56,6 +82,7 @@
|
|
|
setup() {
|
|
setup() {
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
|
|
|
+
|
|
|
const columns: BasicColumn[] = [
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
{
|
|
|
title: '场景标题',
|
|
title: '场景标题',
|
|
@@ -108,7 +135,7 @@
|
|
|
{
|
|
{
|
|
|
title: 'sn码',
|
|
title: 'sn码',
|
|
|
dataIndex: 'snCode',
|
|
dataIndex: 'snCode',
|
|
|
- width: 80,
|
|
|
|
|
|
|
+ width: 180,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '场景大小',
|
|
title: '场景大小',
|
|
@@ -162,9 +189,9 @@
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
dataIndex: 'action',
|
|
|
slots: { customRender: 'action' },
|
|
slots: { customRender: 'action' },
|
|
|
- ifShow:true,
|
|
|
|
|
|
|
+ ifShow: true,
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
- width: 80,
|
|
|
|
|
|
|
+ width: 280,
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
const searchForm: Partial<FormProps> = {
|
|
const searchForm: Partial<FormProps> = {
|
|
@@ -195,7 +222,7 @@
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- field: 'bindAccount',
|
|
|
|
|
|
|
+ field: 'userName',
|
|
|
label: '绑定账号',
|
|
label: '绑定账号',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
componentProps: {
|
|
@@ -208,17 +235,12 @@
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
- const [registerTable] = useTable({
|
|
|
|
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
api: operateSceneList,
|
|
api: operateSceneList,
|
|
|
title: '四维深时场景列表',
|
|
title: '四维深时场景列表',
|
|
|
// titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
// titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
columns: columns,
|
|
columns: columns,
|
|
|
- // actionColumn: {
|
|
|
|
|
- // width: 160,
|
|
|
|
|
- // title: 'Action',
|
|
|
|
|
- // dataIndex: 'action',
|
|
|
|
|
- // // slots: { customRender: 'action' },
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ searchInfo: { type: 1 },
|
|
|
useSearchForm: true,
|
|
useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
formConfig: searchForm,
|
|
|
showTableSetting: true,
|
|
showTableSetting: true,
|
|
@@ -231,27 +253,58 @@
|
|
|
},
|
|
},
|
|
|
canResize: false,
|
|
canResize: false,
|
|
|
});
|
|
});
|
|
|
- function handleDelete(record: Recordable) {
|
|
|
|
|
- console.log('点击了删除', record);
|
|
|
|
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
|
|
|
+ console.log('handleDelete', record);
|
|
|
|
|
+
|
|
|
|
|
+ sceneDelete({ num: record.num })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ message.success({
|
|
|
|
|
+ content: '删除成功',
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ reload();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ message.success({
|
|
|
|
|
+ content: '删除失败',
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- function handleOpen(record: Recordable) {
|
|
|
|
|
- console.log('点击了启用', record);
|
|
|
|
|
|
|
+ async function handleMove(record: Recordable) {
|
|
|
|
|
+ sceneMove({ snCode: record.snCode, num: record.num })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ message.success({
|
|
|
|
|
+ content: '迁移成功',
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ message.success({
|
|
|
|
|
+ content: '迁移失败',
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- function exportExcel() {
|
|
|
|
|
- createConfirm({
|
|
|
|
|
- iconType: 'warning',
|
|
|
|
|
- title: () => h('span', '温馨提示'),
|
|
|
|
|
- content: () => h('span', '确定当前标签下的订单记录?'),
|
|
|
|
|
- onOk: async () => {
|
|
|
|
|
- // await DownExport();
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ function handleDownload(record: Recordable) {
|
|
|
|
|
+ console.log('handleDownload', record);
|
|
|
|
|
+ }
|
|
|
|
|
+ function handleReset(record: Recordable) {
|
|
|
|
|
+ console.log('handleReset', record);
|
|
|
}
|
|
}
|
|
|
|
|
+ // function exportExcel() {
|
|
|
|
|
+ // createConfirm({
|
|
|
|
|
+ // iconType: 'warning',
|
|
|
|
|
+ // title: () => h('span', '温馨提示'),
|
|
|
|
|
+ // content: () => h('span', '确定当前标签下的订单记录?'),
|
|
|
|
|
+ // onOk: async () => {
|
|
|
|
|
+ // // await DownExport();
|
|
|
|
|
+ // },
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
return {
|
|
return {
|
|
|
registerTable,
|
|
registerTable,
|
|
|
handleDelete,
|
|
handleDelete,
|
|
|
- handleOpen,
|
|
|
|
|
- exportExcel,
|
|
|
|
|
|
|
+ handleMove,
|
|
|
|
|
+ handleDownload,
|
|
|
|
|
+ handleReset,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|