|
@@ -1,179 +1,167 @@
|
|
<template>
|
|
<template>
|
|
- <BasicTable @register="registerTable">
|
|
|
|
- <template #toolbar>
|
|
|
|
- <a-button type="primary" @click="exportExcel"> 导出</a-button>
|
|
|
|
- </template>
|
|
|
|
- <template #action="{ record }">
|
|
|
|
|
|
+ <PageWrapper contentBackground>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <a-tabs v-model:activeKey="searchInfo.type" @change="tabChange">
|
|
|
|
+ <a-tab-pane key="1" :tab="t('routes.product.sdkType.1')" />
|
|
|
|
+ <a-tab-pane key="2" :tab="t('routes.product.sdkType.2')" />
|
|
|
|
+ </a-tabs>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="desc-wrap-BasicTable">
|
|
|
|
+ <BasicTable @register="registerTimeTable">
|
|
|
|
+ <template #toolbar>
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="
|
|
|
|
+ () => {
|
|
|
|
+ openAddModal(true, searchInfo.type);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ >{{ t('routes.product.addVstive') }}</a-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ <template #action="{ record }">
|
|
<TableAction
|
|
<TableAction
|
|
- stopButtonPropagation
|
|
|
|
:actions="[
|
|
:actions="[
|
|
{
|
|
{
|
|
label: '编辑',
|
|
label: '编辑',
|
|
- icon: 'ic:outline-delete-outline',
|
|
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
|
|
|
+ icon: 'ep:edit',
|
|
|
|
+ onClick: handleEdit.bind(null, record),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '删除',
|
|
label: '删除',
|
|
icon: 'ic:outline-delete-outline',
|
|
icon: 'ic:outline-delete-outline',
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
|
|
|
+ popConfirm: {
|
|
|
|
+ title: '是否确认删除',
|
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
|
+ },
|
|
},
|
|
},
|
|
]"
|
|
]"
|
|
/>
|
|
/>
|
|
- </template>
|
|
|
|
- </BasicTable>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ </div>
|
|
|
|
+ <AddModal @update="reload" @register="registerAddModal" />
|
|
|
|
+ <EditModal @register="registerEditModal" @update="reload" />
|
|
|
|
+ </PageWrapper>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<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 { InvoiceList,DownExport } from '/@/api/order'
|
|
|
|
- import { SpaceSdkList, DelAndUpload } from '/@/api/product';
|
|
|
|
-
|
|
|
|
- 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[] = [
|
|
|
|
|
|
+import { defineComponent, reactive, h } from 'vue';
|
|
|
|
+import { BasicTable, useTable, FormProps, TableAction, BasicColumn } from '/@/components/Table';
|
|
|
|
+import { PageWrapper } from '/@/components/Page';
|
|
|
|
+import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
|
|
|
|
+import { SpaceSdkList, DelAndUpload, EditAndUpload } from '/@/api/product';
|
|
|
|
+import { sdkTableSchema } from '../data';
|
|
|
|
+import { useModal } from '/@/components/Modal';
|
|
|
|
+import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
+import AddModal from './AddModal.vue';
|
|
|
|
+import EditModal from './EditModal.vue';
|
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
+export default defineComponent({
|
|
|
|
+ components: {
|
|
|
|
+ BasicTable,
|
|
|
|
+ AddModal,
|
|
|
|
+ EditModal,
|
|
|
|
+ TableAction,
|
|
|
|
+ PageWrapper,
|
|
|
|
+ [Divider.name]: Divider,
|
|
|
|
+ [Card.name]: Card,
|
|
|
|
+ Empty,
|
|
|
|
+ [Descriptions.name]: Descriptions,
|
|
|
|
+ [Descriptions.Item.name]: Descriptions.Item,
|
|
|
|
+ [Steps.name]: Steps,
|
|
|
|
+ [Steps.Step.name]: Steps.Step,
|
|
|
|
+ [Tabs.name]: Tabs,
|
|
|
|
+ [Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
|
+ },
|
|
|
|
+ setup() {
|
|
|
|
+ const { t } = useI18n();
|
|
|
|
+ const searchInfo = reactive<Recordable>({
|
|
|
|
+ type: '1',
|
|
|
|
+ });
|
|
|
|
+ const [registerAddModal, { openModal: openAddModal }] = useModal();
|
|
|
|
+ const [registerEditModal, { openModal: openEditModal }] = useModal();
|
|
|
|
+ const { createMessage } = useMessage();
|
|
|
|
+ const searchForm: Partial<FormProps> = {
|
|
|
|
+ labelWidth: 100,
|
|
|
|
+ schemas: [
|
|
{
|
|
{
|
|
- title: '时间',
|
|
|
|
- dataIndex: 'createTime',
|
|
|
|
- width: 150,
|
|
|
|
- customRender: ({ record }) => {
|
|
|
|
- return (
|
|
|
|
- record.createTime &&
|
|
|
|
- h(Time, {
|
|
|
|
- value: record.createTime,
|
|
|
|
- mode: 'datetime',
|
|
|
|
- })
|
|
|
|
- );
|
|
|
|
|
|
+ field: 'version',
|
|
|
|
+ label: '版本号',
|
|
|
|
+ component: 'Input',
|
|
|
|
+ componentProps: {
|
|
|
|
+ maxLength: 100,
|
|
},
|
|
},
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '订单号',
|
|
|
|
- dataIndex: 'orderSn',
|
|
|
|
- ellipsis: false,
|
|
|
|
- width: 180,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '用户名',
|
|
|
|
- dataIndex: 'userName',
|
|
|
|
- width: 80,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '订单金额',
|
|
|
|
- dataIndex: 'amount',
|
|
|
|
- width: 80,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '支付方式',
|
|
|
|
- dataIndex: 'payType',
|
|
|
|
- // slots: { customRender: 'orderType' },
|
|
|
|
- width: 80,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '订单状态',
|
|
|
|
- dataIndex: 'payStatus',
|
|
|
|
- // slots: { customRender: 'orderStatus' },
|
|
|
|
- width: 80,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- const searchForm: Partial<FormProps> = {
|
|
|
|
- labelWidth: 100,
|
|
|
|
- schemas: [
|
|
|
|
- {
|
|
|
|
- field: 'sceneName',
|
|
|
|
- label: '开票申请时间',
|
|
|
|
- component: 'RangePicker',
|
|
|
|
- componentProps: {
|
|
|
|
- maxLength: 100,
|
|
|
|
- },
|
|
|
|
- colProps: {
|
|
|
|
- xl: 7,
|
|
|
|
- xxl: 7,
|
|
|
|
- },
|
|
|
|
|
|
+ colProps: {
|
|
|
|
+ xl: 6,
|
|
|
|
+ xxl: 6,
|
|
},
|
|
},
|
|
- {
|
|
|
|
- field: 'sceneName',
|
|
|
|
- label: '支付时间',
|
|
|
|
- component: 'RangePicker',
|
|
|
|
- componentProps: {
|
|
|
|
- maxLength: 100,
|
|
|
|
- },
|
|
|
|
- colProps: {
|
|
|
|
- xl: 7,
|
|
|
|
- xxl: 7,
|
|
|
|
- },
|
|
|
|
- },{
|
|
|
|
- field: 'sceneName',
|
|
|
|
- label: '订单号',
|
|
|
|
- component: 'Input',
|
|
|
|
- componentProps: {
|
|
|
|
- maxLength: 100,
|
|
|
|
- },
|
|
|
|
- colProps: {
|
|
|
|
- xl: 6,
|
|
|
|
- xxl: 6,
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- };
|
|
|
|
- const [registerTable] = useTable({
|
|
|
|
- api: InvoiceList,
|
|
|
|
- title: '发票列表',
|
|
|
|
- // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
|
- columns: columns,
|
|
|
|
- useSearchForm: true,
|
|
|
|
- formConfig: searchForm,
|
|
|
|
- showTableSetting: true,
|
|
|
|
- rowKey: 'id',
|
|
|
|
- fetchSetting: {
|
|
|
|
- pageField: 'pageNum',
|
|
|
|
- sizeField: 'size',
|
|
|
|
- listField: 'records',
|
|
|
|
- totalField: 'total',
|
|
|
|
- },
|
|
|
|
- actionColumn: {
|
|
|
|
- width: 250,
|
|
|
|
- title: 'Action',
|
|
|
|
- dataIndex: 'action',
|
|
|
|
- slots: { customRender: 'action' },
|
|
|
|
},
|
|
},
|
|
- canResize: false,
|
|
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ const [registerTimeTable, { reload }] = useTable({
|
|
|
|
+ api: SpaceSdkList,
|
|
|
|
+ title: 'SDK列表',
|
|
|
|
+ columns: sdkTableSchema,
|
|
|
|
+ useSearchForm: true,
|
|
|
|
+ formConfig: searchForm,
|
|
|
|
+ showTableSetting: true,
|
|
|
|
+ showIndexColumn:false,
|
|
|
|
+ rowKey: 'id',
|
|
|
|
+ fetchSetting: {
|
|
|
|
+ pageField: 'pageNum',
|
|
|
|
+ sizeField: 'pageSize',
|
|
|
|
+ listField: 'list',
|
|
|
|
+ totalField: 'total',
|
|
|
|
+ },
|
|
|
|
+ searchInfo: searchInfo,
|
|
|
|
+ actionColumn: {
|
|
|
|
+ width: 180,
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
+ slots: { customRender: 'action' },
|
|
|
|
+ },
|
|
|
|
+ canResize: false,
|
|
|
|
+ });
|
|
|
|
+ function tabChange(val: string) {
|
|
|
|
+ console.log('tabChange', val);
|
|
|
|
+ reload();
|
|
|
|
+ }
|
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
|
|
+ console.log('点击了删除', record);
|
|
|
|
+ await DelAndUpload({ id: record.id });
|
|
|
|
+ createMessage.success(t('common.optSuccess'));
|
|
|
|
+ reload();
|
|
|
|
+ }
|
|
|
|
+ function handleOpen(record: Recordable) {
|
|
|
|
+ console.log('点击了启用', record);
|
|
|
|
+ }
|
|
|
|
+ function handleEdit(record: Recordable) {
|
|
|
|
+ console.log('record', record);
|
|
|
|
+ openEditModal(true, {
|
|
|
|
+ ...record,
|
|
});
|
|
});
|
|
- 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>
|
|
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ registerTimeTable,
|
|
|
|
+ handleDelete,
|
|
|
|
+ handleOpen,
|
|
|
|
+ tabChange,
|
|
|
|
+ reload,
|
|
|
|
+ registerAddModal,
|
|
|
|
+ registerEditModal,
|
|
|
|
+ openAddModal,
|
|
|
|
+ handleEdit,
|
|
|
|
+ t,
|
|
|
|
+ searchInfo,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+});
|
|
|
|
+</script>
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.desc-wrap-BasicTable {
|
|
|
|
+ background-color: #f0f2f5;
|
|
|
|
+ .vben-basic-table-form-container {
|
|
|
|
+ padding: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|