|
@@ -1,45 +1,145 @@
|
|
|
<template>
|
|
|
<div class="p-4">
|
|
|
- <BasicTable
|
|
|
- title="企业账号"
|
|
|
- :columns="columns"
|
|
|
- :dataSource="data"
|
|
|
- :canResize="canResize"
|
|
|
- :loading="loading"
|
|
|
- :striped="true"
|
|
|
- :bordered="border"
|
|
|
- showTableSetting
|
|
|
- :pagination="pagination"
|
|
|
- @columns-change="handleColumnChange"
|
|
|
- >
|
|
|
- <template #toolbar>
|
|
|
- <!-- <a-button type="primary" @click="toggleCanResize">
|
|
|
- {{ !canResize ? '自适应高度' : '取消自适应' }}
|
|
|
- </a-button>
|
|
|
- <a-button type="primary" @click="toggleBorder">
|
|
|
- {{ !border ? '显示边框' : '隐藏边框' }}
|
|
|
- </a-button>
|
|
|
- <a-button type="primary" @click="toggleLoading"> 开启loading </a-button>
|
|
|
- <a-button type="primary" @click="toggleStriped">
|
|
|
- {{ !striped ? '显示斑马纹' : '隐藏斑马纹' }}
|
|
|
- </a-button> -->
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar> </template>
|
|
|
+ <template #sceneLogo="{ sceneLogo }">
|
|
|
+ <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="sceneLogo" />
|
|
|
+ <!-- </CollapseContainer> -->
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #floorLogo="{ floorLogo }">
|
|
|
+ <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="floorLogo" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #bgMusic="{ bgMusic }">
|
|
|
+ <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="bgMusic" />
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, ref } from 'vue';
|
|
|
- import { BasicTable, ColumnChangeParam } from '/@/components/Table';
|
|
|
+ import {
|
|
|
+ BasicTable,
|
|
|
+ ColumnChangeParam,
|
|
|
+ useTable,
|
|
|
+ BasicColumn,
|
|
|
+ FormProps,
|
|
|
+ } from '/@/components/Table';
|
|
|
+ // import { CollapseContainer } from '/@/components/Container';
|
|
|
+ import { CropperAvatar } from '/@/components/Cropper';
|
|
|
+ import { uploadApi } from '/@/api/sys/upload';
|
|
|
+ // import { Avatar } from 'ant-design-vue';
|
|
|
+
|
|
|
import { getBasicColumns, getBasicData } from './tableData';
|
|
|
+ import { ListApi } from '/@/api/corporation/list';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable },
|
|
|
+ components: { BasicTable, CropperAvatar },
|
|
|
setup() {
|
|
|
const canResize = ref(false);
|
|
|
const loading = ref(false);
|
|
|
const striped = ref(true);
|
|
|
const border = ref(true);
|
|
|
const pagination = ref<any>(true);
|
|
|
+
|
|
|
+ const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: 'ID',
|
|
|
+ dataIndex: 'id',
|
|
|
+ fixed: 'left',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '企业账户',
|
|
|
+ dataIndex: 'userName',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '企业名称',
|
|
|
+ dataIndex: 'name',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '加载界面LOGO',
|
|
|
+ dataIndex: 'sceneLogo',
|
|
|
+ slots: { customRender: 'sceneLogo' },
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '加载地面LOGO',
|
|
|
+ dataIndex: 'floorLogo',
|
|
|
+ slots: { customRender: 'floorLogo' },
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '背景音乐',
|
|
|
+ dataIndex: 'bgMusic',
|
|
|
+ slots: { customRender: 'bgMusic' },
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备数量',
|
|
|
+ dataIndex: 'cameraNum',
|
|
|
+ width: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '子账号数量',
|
|
|
+ dataIndex: 'subNum',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上传场景数',
|
|
|
+ dataIndex: 'sceneNum',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '余额',
|
|
|
+ dataIndex: 'point',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '到期时间',
|
|
|
+ dataIndex: 'expirationTime',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ const searchForm: Partial<FormProps> = {
|
|
|
+ labelWidth: 100,
|
|
|
+ schemas: [
|
|
|
+ {
|
|
|
+ field: 'id',
|
|
|
+ label: 'id',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: {
|
|
|
+ xl: 3,
|
|
|
+ xxl: 3,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'userName',
|
|
|
+ label: '企业账号',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: {
|
|
|
+ xl: 12,
|
|
|
+ xxl: 8,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ // { getForm }
|
|
|
+ const [registerTable] = useTable({
|
|
|
+ title: '企业账号',
|
|
|
+ api: ListApi,
|
|
|
+ columns: columns,
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ tableSetting: { fullScreen: true },
|
|
|
+ showIndexColumn: false,
|
|
|
+ rowKey: 'id',
|
|
|
+ });
|
|
|
pagination.value = { pageSize: 20 };
|
|
|
|
|
|
function toggleCanResize() {
|
|
@@ -69,6 +169,8 @@
|
|
|
toggleBorder,
|
|
|
pagination,
|
|
|
handleColumnChange,
|
|
|
+ registerTable,
|
|
|
+ uploadApi: uploadApi as any,
|
|
|
};
|
|
|
},
|
|
|
});
|