|
|
@@ -4,10 +4,54 @@
|
|
|
<template #toolbar>
|
|
|
<a-button type="primary" @click="handleCreate">新增项目</a-button>
|
|
|
</template>
|
|
|
+ <template #isShow="{ record }">
|
|
|
+ <Switch :checked="record.isShow" :checkedValue="1" :unCheckedValue="0" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #createTime="{ record }">
|
|
|
+ <Time :value="record.createTime" mode="date" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #action="{ record }">
|
|
|
+ {{ record }}
|
|
|
+ <TableAction
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ // color: 'warning',
|
|
|
+ // icon: 'mage:edit-fill',
|
|
|
+ label: '项目信息',
|
|
|
+ tooltip: '项目信息',
|
|
|
+ onClick: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // color: 'warning',
|
|
|
+ // icon: 'mage:edit-fill',
|
|
|
+ label: '场景管理',
|
|
|
+ tooltip: '场景管理',
|
|
|
+ onClick: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // color: 'warning',
|
|
|
+ // icon: 'mage:edit-fill',
|
|
|
+ label: '地图模式',
|
|
|
+ tooltip: '地图模式',
|
|
|
+ onClick: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ color: 'error',
|
|
|
+ // icon: 'mage:edit-fill',
|
|
|
+ label: '删除',
|
|
|
+ tooltip: '地图模式',
|
|
|
+ onClick: () => {},
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</BasicTable>
|
|
|
<AddProjectModal
|
|
|
@register="registerAddProjectModal"
|
|
|
@open-map="handleSelectMap"
|
|
|
+ @reload="reload"
|
|
|
:currentLatLng="currentLatLng"
|
|
|
/>
|
|
|
<MapSelectModal @register="registerMapSelectModal" @update="handleMapChose" />
|
|
|
@@ -15,9 +59,10 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, computed, ref } from 'vue';
|
|
|
- import { BasicTable, useTable, BasicColumn, FormProps } from '/@/components/Table';
|
|
|
+ import { BasicTable, useTable, TableAction, BasicColumn, FormProps } from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
-
|
|
|
+ import { Switch } from 'ant-design-vue';
|
|
|
+ import { Time } from '/@/components/Time';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
|
|
|
import { ListApi } from '/@/api/mapOpt/list';
|
|
|
@@ -32,7 +77,7 @@
|
|
|
const isJA = computed(() => localeStore.getLocale === 'ja');
|
|
|
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, AddProjectModal, MapSelectModal },
|
|
|
+ components: { BasicTable, AddProjectModal, MapSelectModal, Switch, Time, TableAction },
|
|
|
setup() {
|
|
|
const [registerAddProjectModal, { openModal: openAddProjectModal }] = useModal();
|
|
|
const [registerMapSelectModal, { openModal: openMapModal }] = useModal();
|
|
|
@@ -49,18 +94,25 @@
|
|
|
},
|
|
|
{
|
|
|
title: '项目名称',
|
|
|
- dataIndex: 'companyName',
|
|
|
+ dataIndex: 'projectName',
|
|
|
width: 100,
|
|
|
},
|
|
|
{
|
|
|
- title: '创建时间',
|
|
|
- dataIndex: 'userName',
|
|
|
+ title: '项目编号',
|
|
|
+ dataIndex: 'projectSn',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('routes.staff.createTime'),
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ slots: { customRender: 'createTime' },
|
|
|
width: 200,
|
|
|
},
|
|
|
{
|
|
|
title: '首页显示',
|
|
|
- dataIndex: 'nickName',
|
|
|
- width: 200,
|
|
|
+ dataIndex: 'isShow',
|
|
|
+ slots: { customRender: 'isShow' },
|
|
|
+ width: 100,
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -69,7 +121,7 @@
|
|
|
slots: { customRender: 'action' },
|
|
|
fixed: 'right',
|
|
|
align: 'center',
|
|
|
- width: isJA.value ? 160 : 80,
|
|
|
+ width: isJA.value ? 200 : 200,
|
|
|
},
|
|
|
];
|
|
|
const currentLatLng = ref();
|
|
|
@@ -88,7 +140,7 @@
|
|
|
],
|
|
|
};
|
|
|
|
|
|
- const [registerTable] = useTable({
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
title: t('layout.mapOpt.title'),
|
|
|
api: ListApi,
|
|
|
columns: columns,
|
|
|
@@ -125,6 +177,7 @@
|
|
|
handleSelectMap,
|
|
|
handleMapChose,
|
|
|
currentLatLng,
|
|
|
+ reload,
|
|
|
};
|
|
|
},
|
|
|
});
|