|
@@ -0,0 +1,243 @@
|
|
|
+<template>
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar>
|
|
|
+ <!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
|
|
|
+ </template>
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.key === 'action'">
|
|
|
+ <TableAction
|
|
|
+ stopButtonPropagation
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ label: '删除',
|
|
|
+ icon: 'ic:outline-delete-outline',
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ :dropDownActions="[
|
|
|
+ {
|
|
|
+ label: '启用',
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否启用?',
|
|
|
+ confirm: handleOpen.bind(null, record),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+</template>
|
|
|
+<script lang="ts">
|
|
|
+ import { defineComponent, h } from 'vue';
|
|
|
+ import {
|
|
|
+ BasicTable,
|
|
|
+ useTable,
|
|
|
+ TableAction,
|
|
|
+ BasicColumn,
|
|
|
+ TableImg,
|
|
|
+ FormProps,
|
|
|
+ } from '/@/components/Table';
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
+ import { Time } from '/@/components/Time';
|
|
|
+ import { Descriptions } from 'ant-design-vue';
|
|
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+ import { Switch } from 'ant-design-vue';
|
|
|
+ import { DownList, DownExport } from '/@/api/order';
|
|
|
+
|
|
|
+ export default defineComponent({
|
|
|
+ components: {
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ PageWrapper,
|
|
|
+ TableImg,
|
|
|
+ [Descriptions.name]: Descriptions,
|
|
|
+ [Descriptions.Item.name]: Descriptions.Item,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const { t } = useI18n();
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
+ const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '场景标题',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ width: 150,
|
|
|
+ // customRender: ({ record }) => {
|
|
|
+ // return (
|
|
|
+ // record.createTime &&
|
|
|
+ // h(Time, {
|
|
|
+ // value: record.createTime,
|
|
|
+ // mode: 'datetime',
|
|
|
+ // })
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '场景码',
|
|
|
+ dataIndex: 'orderSn',
|
|
|
+ ellipsis: false,
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '拍摄时间',
|
|
|
+ dataIndex: 'userName',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return (
|
|
|
+ record.createTime &&
|
|
|
+ h(Time, {
|
|
|
+ value: record.createTime,
|
|
|
+ mode: 'datetime',
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '计算完成时间',
|
|
|
+ dataIndex: 'amount',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return (
|
|
|
+ record.createTime &&
|
|
|
+ h(Time, {
|
|
|
+ value: record.createTime,
|
|
|
+ mode: 'datetime',
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'sn码',
|
|
|
+ dataIndex: 'payType',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '场景大小',
|
|
|
+ dataIndex: 'sceneSize',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '是否复制',
|
|
|
+ dataIndex: 'isCopy',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '复制时间',
|
|
|
+ dataIndex: 'copyTime',
|
|
|
+ width: 180,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return (
|
|
|
+ record.createTime &&
|
|
|
+ h(Time, {
|
|
|
+ value: record.createTime,
|
|
|
+ mode: 'datetime',
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '绑定账号',
|
|
|
+ dataIndex: 'bindAccount',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '浏览量',
|
|
|
+ dataIndex: 'viewCount',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'actions',
|
|
|
+ key: 'actions',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ const searchForm: Partial<FormProps> = {
|
|
|
+ labelWidth: 100,
|
|
|
+ schemas: [
|
|
|
+ {
|
|
|
+ field: 'sceneName',
|
|
|
+ label: '场景标题',
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 100,
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ xl: 7,
|
|
|
+ xxl: 7,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'snCode',
|
|
|
+ label: 'sn码',
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 100,
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ xl: 7,
|
|
|
+ xxl: 7,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'bindAccount',
|
|
|
+ label: '绑定账号',
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 100,
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ xl: 6,
|
|
|
+ xxl: 6,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ const [registerTable] = useTable({
|
|
|
+ api: DownList,
|
|
|
+ title: '四维深时场景列表',
|
|
|
+ // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
+ columns: columns,
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ rowKey: 'id',
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
+ },
|
|
|
+ canResize: false,
|
|
|
+ });
|
|
|
+ function handleDelete(record: Recordable) {
|
|
|
+ console.log('点击了删除', record);
|
|
|
+ }
|
|
|
+ function handleOpen(record: Recordable) {
|
|
|
+ console.log('点击了启用', record);
|
|
|
+ }
|
|
|
+ function exportExcel() {
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: () => h('span', '温馨提示'),
|
|
|
+ content: () => h('span', '确定当前标签下的订单记录?'),
|
|
|
+ onOk: async () => {
|
|
|
+ await DownExport();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ registerTable,
|
|
|
+ handleDelete,
|
|
|
+ handleOpen,
|
|
|
+ exportExcel,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
+</script>
|