|
@@ -11,28 +11,59 @@
|
|
|
<template #bgMusic="{ bgMusic }">
|
|
|
<CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="bgMusic" />
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ // icon: 'ri:money-cny-circle-fill',
|
|
|
+ label: '充值',
|
|
|
+ onClick: handleOpenChargeModal.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // icon: 'icon-park-outline:devices',
|
|
|
+ label: '设备',
|
|
|
+ onClick: () => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // icon: 'mdi:account-group',
|
|
|
+ color: 'error',
|
|
|
+ label: '子账号',
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否确认删除',
|
|
|
+ confirm: () => {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</BasicTable>
|
|
|
+ <chargeModal @register="registerChargeModal" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent } from 'vue';
|
|
|
- import { BasicTable, useTable, BasicColumn, FormProps } from '/@/components/Table';
|
|
|
+ import { BasicTable, useTable, BasicColumn, FormProps, TableAction } 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';
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
+ import chargeModal from './chargeModal.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, CropperAvatar },
|
|
|
+ components: { BasicTable, CropperAvatar, TableAction, chargeModal },
|
|
|
setup() {
|
|
|
+ const [registerChargeModal, { openModal: openChargeModal }] = useModal();
|
|
|
+
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: 'ID',
|
|
|
dataIndex: 'id',
|
|
|
fixed: 'left',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: '企业账户',
|
|
@@ -48,39 +79,39 @@
|
|
|
title: '加载界面LOGO',
|
|
|
dataIndex: 'sceneLogo',
|
|
|
slots: { customRender: 'sceneLogo' },
|
|
|
- width: 180,
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '加载地面LOGO',
|
|
|
dataIndex: 'floorLogo',
|
|
|
slots: { customRender: 'floorLogo' },
|
|
|
- width: 180,
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '背景音乐',
|
|
|
dataIndex: 'bgMusic',
|
|
|
slots: { customRender: 'bgMusic' },
|
|
|
- width: 180,
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '设备数量',
|
|
|
dataIndex: 'cameraNum',
|
|
|
- width: 150,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: '子账号数量',
|
|
|
dataIndex: 'subNum',
|
|
|
- width: 120,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: '上传场景数',
|
|
|
dataIndex: 'sceneNum',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: '余额',
|
|
|
dataIndex: 'point',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: '到期时间',
|
|
@@ -123,11 +154,23 @@
|
|
|
tableSetting: { fullScreen: true },
|
|
|
showIndexColumn: false,
|
|
|
rowKey: 'id',
|
|
|
- pagination: { pageSize: 20 },
|
|
|
+ actionColumn: {
|
|
|
+ width: 160,
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ },
|
|
|
});
|
|
|
+ function handleOpenChargeModal(record: Recordable) {
|
|
|
+ openChargeModal(true, {
|
|
|
+ record,
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
registerTable,
|
|
|
+ registerChargeModal,
|
|
|
+ handleOpenChargeModal,
|
|
|
uploadApi: uploadApi as any,
|
|
|
};
|
|
|
},
|