|
@@ -5,27 +5,25 @@
|
|
|
<template #cover="{ record }">
|
|
|
<TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
|
|
|
</template>
|
|
|
- <template #action>
|
|
|
+ <template #action="{ record }">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
- icon: 'clarity:note-edit-line',
|
|
|
- label: '编辑',
|
|
|
- onClick: () => {
|
|
|
- createMessage.info(`暂未接入`);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'ant-design:delete-outlined',
|
|
|
- color: 'error',
|
|
|
- label: '删除',
|
|
|
+ // icon: 'mdi:briefcase-download',
|
|
|
+ label: '下载场景',
|
|
|
popConfirm: {
|
|
|
- title: '是否确认删除',
|
|
|
+ title: '是否确认下载场景',
|
|
|
confirm: () => {
|
|
|
createMessage.info(`暂未接入`);
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ // icon: 'dashicons:editor-kitchensink',
|
|
|
+ color: 'error',
|
|
|
+ label: '打开编辑器',
|
|
|
+ onClick: openSceneEditor.bind(null, record),
|
|
|
+ },
|
|
|
]"
|
|
|
/>
|
|
|
</template>
|
|
@@ -44,9 +42,9 @@
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { uploadApi } from '/@/api/sys/upload';
|
|
|
- import { Switch } from 'ant-design-vue';
|
|
|
- import { h } from 'vue';
|
|
|
- import { ListApi } from '/@/api/scene/list';
|
|
|
+ // import { Switch } from 'ant-design-vue';
|
|
|
+ // import { h } from 'vue';
|
|
|
+ import { ListApi, generateSceneEditTokenApi } from '/@/api/scene/list';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
|
|
export default defineComponent({
|
|
@@ -54,69 +52,66 @@
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
const { t } = useI18n();
|
|
|
+
|
|
|
const columns: BasicColumn[] = [
|
|
|
- {
|
|
|
- title: 'ID',
|
|
|
- dataIndex: 'id',
|
|
|
- fixed: 'left',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: 'ID',
|
|
|
+ // dataIndex: 'id',
|
|
|
+ // fixed: 'left',
|
|
|
+ // width: 80,
|
|
|
+ // },
|
|
|
{
|
|
|
title: '场景名称',
|
|
|
- dataIndex: 'name',
|
|
|
- width: 230,
|
|
|
+ dataIndex: 'sceneName',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: '封面',
|
|
|
- dataIndex: 'cover',
|
|
|
- slots: { customRender: 'cover' },
|
|
|
+ title: '企业名称',
|
|
|
+ dataIndex: 'companyName',
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: '场景链接',
|
|
|
- dataIndex: 'link',
|
|
|
+ dataIndex: 'webSite',
|
|
|
slots: { customRender: 'link' },
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: '是否显示',
|
|
|
- dataIndex: 'isShow',
|
|
|
+ title: '拍摄设备ID',
|
|
|
+ dataIndex: 'childName',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '场景访问量',
|
|
|
+ dataIndex: 'viewCount',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '拍摄时间',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '场景码',
|
|
|
+ dataIndex: 'num',
|
|
|
width: 180,
|
|
|
- customRender: ({ record }) => {
|
|
|
- if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
- record.pendingStatus = false;
|
|
|
- }
|
|
|
- return h(Switch, {
|
|
|
- checked: record.isShow,
|
|
|
- checkedChildren: t('common.yes'),
|
|
|
- unCheckedChildren: t('common.no'),
|
|
|
- loading: false,
|
|
|
- onChange(checked: boolean) {
|
|
|
- record.pendingStatus = true;
|
|
|
- const newStatus = checked ? '1' : '0';
|
|
|
- const { createMessage } = useMessage();
|
|
|
- createMessage.info(`暂未接入` + newStatus);
|
|
|
- // setRoleStatus(record.id, newStatus)
|
|
|
- // .then(() => {
|
|
|
- // record.status = newStatus;
|
|
|
- // createMessage.success(`已成功修改角色状态`);
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // createMessage.error('修改角色状态失败');
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // record.pendingStatus = false;
|
|
|
- // });
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '下载进度',
|
|
|
+ dataIndex: '',
|
|
|
+ width: 180,
|
|
|
+ slots: { customRender: 'process' },
|
|
|
+ ifShow: false,
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: '',
|
|
|
slots: { customRender: 'action' },
|
|
|
- width: 120,
|
|
|
+ width: 140,
|
|
|
+ fixed: 'right',
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -124,21 +119,39 @@
|
|
|
labelWidth: 100,
|
|
|
schemas: [
|
|
|
{
|
|
|
- field: 'id',
|
|
|
- label: 'id',
|
|
|
+ field: 'companyName',
|
|
|
+ label: '企业名称',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: {
|
|
|
+ lg: 6,
|
|
|
+ xl: 6,
|
|
|
+ xxl: 6,
|
|
|
+ sm: 12,
|
|
|
+ xs: 24,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'sceneName',
|
|
|
+ label: '场景名称',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
|
- xl: 3,
|
|
|
- xxl: 3,
|
|
|
+ lg: 6,
|
|
|
+ xl: 6,
|
|
|
+ xxl: 6,
|
|
|
+ sm: 12,
|
|
|
+ xs: 24,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- field: 'userName',
|
|
|
- label: '企业账号',
|
|
|
+ field: 'childName',
|
|
|
+ label: '拍摄设备ID',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
|
- xl: 12,
|
|
|
- xxl: 8,
|
|
|
+ lg: 6,
|
|
|
+ xl: 6,
|
|
|
+ xxl: 6,
|
|
|
+ sm: 12,
|
|
|
+ xs: 24,
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -148,20 +161,34 @@
|
|
|
title: '场景列表',
|
|
|
api: ListApi,
|
|
|
columns: columns,
|
|
|
- useSearchForm: false,
|
|
|
+ useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
|
showTableSetting: true,
|
|
|
tableSetting: { fullScreen: true },
|
|
|
showIndexColumn: false,
|
|
|
rowKey: 'id',
|
|
|
- pagination: { pageSize: 20 },
|
|
|
+ //TODO
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
+ },
|
|
|
});
|
|
|
+ async function openSceneEditor(record: Recordable) {
|
|
|
+ const url = record.webSite.replace('smobile', 'epc') + '&menu=business&token=';
|
|
|
+ const data = await generateSceneEditTokenApi({
|
|
|
+ sceneNum: record.num,
|
|
|
+ userName: '17324327132',
|
|
|
+ });
|
|
|
+ window.open(url + data.message);
|
|
|
+ }
|
|
|
|
|
|
- // pagination.value = { pageSize: 20 };
|
|
|
return {
|
|
|
registerTable,
|
|
|
createMessage,
|
|
|
t,
|
|
|
+ openSceneEditor,
|
|
|
uploadApi: uploadApi as any,
|
|
|
};
|
|
|
},
|