|
|
@@ -9,107 +9,65 @@
|
|
|
<!-- <a-tab-pane :key="3" tab="四维双目Lite" :disabled="loading"/> -->
|
|
|
</a-tabs>
|
|
|
</template>
|
|
|
- <div class="desc-wrap-BasicTable">
|
|
|
- <BasicTable
|
|
|
- @register="registerTable"
|
|
|
- :rowSelection="{ type: 'checkbox', onChange: handleSelect }"
|
|
|
- >
|
|
|
- <template #toolbar>
|
|
|
- <!-- <a-button type="primary" @click="() => {}"> 新增</a-button> -->
|
|
|
- <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
+ <!-- :rowSelection="{ type: 'checkbox', onChange: handleSelect }" -->
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar>
|
|
|
+ <!-- <a-button type="primary" @click="handleCreate"> 新增</a-button> -->
|
|
|
+ <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
<a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #cover="{ record }">
|
|
|
- <TableImg
|
|
|
- :size="120"
|
|
|
- :simpleShow="true"
|
|
|
- :imgList="[record.thumb || '/resource/img/header.jpg']"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #link="{ record }">
|
|
|
- <!-- <a
|
|
|
- v-if="record.status != 0"
|
|
|
- :href="record.webSite + `&lang=${isJA ? 'ja' : 'zh'}`"
|
|
|
- target="_blank"
|
|
|
- >
|
|
|
- {{ record.webSite }}
|
|
|
- </a> -->
|
|
|
- <span>{{ record.webSite }}</span>
|
|
|
- </template>
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction
|
|
|
- :actions="[
|
|
|
- {
|
|
|
- color: 'success',
|
|
|
- label: '复原',
|
|
|
- // disabled: record.status != -2,
|
|
|
- onClick: openSceneEditor.bind(null, record),
|
|
|
- },
|
|
|
- ]"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
- </div>
|
|
|
+ <template #cover="{ record }">
|
|
|
+ <TableImg
|
|
|
+ :size="120"
|
|
|
+ :simpleShow="true"
|
|
|
+ :imgList="[record.thumb || '/resource/img/header.jpg']"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #createTime="{ record }">
|
|
|
+ <Time v-if="record.createTime" :value="record.createTime" mode="datetime" />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, computed, h, ref } from 'vue';
|
|
|
- import { openUrl } from '/@/utils/auth';
|
|
|
- import { PageWrapper } from '/@/components/Page';
|
|
|
+ import { defineComponent, computed, ref } from 'vue';
|
|
|
import {
|
|
|
BasicTable,
|
|
|
useTable,
|
|
|
BasicColumn,
|
|
|
FormProps,
|
|
|
- TableAction,
|
|
|
+ // TableAction,
|
|
|
TableImg,
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- // import { useModal } from '/@/components/Modal';
|
|
|
import { Tabs } from 'ant-design-vue';
|
|
|
- import { sceneDetail, buildSceneObj } from '/@/api/lastApi/index';
|
|
|
- // import { Progress } from 'ant-design-vue';
|
|
|
- // import { h } from 'vue';
|
|
|
- // addDownloadNumApi,
|
|
|
- // checkDownloadApi,
|
|
|
- // generateSceneEditTokenApi,
|
|
|
- import {
|
|
|
- ListApi,
|
|
|
- downloadSceneDataAPi,
|
|
|
- addDownloadNumApi,
|
|
|
- checkDownloadApi,
|
|
|
- DeleteApi,
|
|
|
- UpgradeToV4,
|
|
|
- sceneCopy,
|
|
|
- } from '/@/api/scene/list';
|
|
|
- import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- import {
|
|
|
- downloadByUrl,
|
|
|
- // downloadByData,
|
|
|
- // downloadByBase64,
|
|
|
- // downloadByOnlineUrl,
|
|
|
- } from '/@/utils/file/download';
|
|
|
+ import { contractorListApi } from '/@/api/corporation/list';
|
|
|
|
|
|
- import { useUserStore } from '/@/store/modules/user';
|
|
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ import { Time } from '/@/components/Time';
|
|
|
+ // import { useUserStore } from '/@/store/modules/user';
|
|
|
|
|
|
import { useLocaleStore } from '/@/store/modules/locale';
|
|
|
- import { SceneDownloadParam } from '/@/api/scene/model';
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
+
|
|
|
const localeStore = useLocaleStore();
|
|
|
console.log('localeStore', localeStore);
|
|
|
- const userStore = useUserStore();
|
|
|
+
|
|
|
+ // const userStore = useUserStore();
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
|
BasicTable,
|
|
|
- TableAction,
|
|
|
+ // TableAction,
|
|
|
TableImg,
|
|
|
PageWrapper,
|
|
|
+ Time,
|
|
|
[Tabs.name]: Tabs,
|
|
|
[Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
},
|
|
|
setup() {
|
|
|
- const { createMessage, createConfirm } = useMessage();
|
|
|
+ const { createMessage } = useMessage();
|
|
|
const { t } = useI18n();
|
|
|
const loading = ref(false);
|
|
|
const tableType = ref<Number>(0); //0看看 、1看见、2深时
|
|
|
@@ -122,88 +80,57 @@
|
|
|
defaultHidden: true,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.scenes.sceneName'),
|
|
|
- dataIndex: 'sceneName',
|
|
|
+ title: '总承包商名称',
|
|
|
+ dataIndex: 'mainContractorName',
|
|
|
ellipsis: false,
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.corporation.enterpriseName'),
|
|
|
- dataIndex: 'companyName',
|
|
|
+ title: '总承包商账号',
|
|
|
+ dataIndex: 'mainContractorAccount',
|
|
|
ellipsis: false,
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.scenes.webSite'),
|
|
|
- dataIndex: 'webSite',
|
|
|
+ title: '承包商昵称',
|
|
|
+ dataIndex: 'contractorName',
|
|
|
ellipsis: false,
|
|
|
- slots: { customRender: 'link' },
|
|
|
+ // slots: { customRender: 'link' },
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.scenes.appListPicUrl'),
|
|
|
- dataIndex: 'thumb',
|
|
|
+ title: '承包商账号',
|
|
|
+ dataIndex: 'contractorAccount',
|
|
|
ellipsis: true,
|
|
|
- slots: { customRender: 'cover' },
|
|
|
+ // slots: { customRender: 'cover' },
|
|
|
width: 150,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.scenes.childName'),
|
|
|
- dataIndex: 'childName',
|
|
|
+ title: '拍摄场景数',
|
|
|
+ dataIndex: 'sceneCount',
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: t('routes.scenes.viewCount'),
|
|
|
- dataIndex: 'viewCount',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: t('routes.scenes.createTime'),
|
|
|
+ title: '关联时间',
|
|
|
dataIndex: 'createTime',
|
|
|
- width: 140,
|
|
|
+ slots: { customRender: 'createTime' },
|
|
|
+ width: 200,
|
|
|
},
|
|
|
-
|
|
|
- {
|
|
|
- title: t('routes.scenes.num'),
|
|
|
- dataIndex: 'num',
|
|
|
- width: 180,
|
|
|
- },
|
|
|
-
|
|
|
// {
|
|
|
- // title: t('routes.scenes.process'),
|
|
|
+ // title: t('common.operation'),
|
|
|
// dataIndex: '',
|
|
|
- // width: 180,
|
|
|
- // slots: { customRender: 'process' },
|
|
|
- // ifShow: false,
|
|
|
+ // slots: { customRender: 'action' },
|
|
|
+ // width: isJA.value ? 100 : 100,
|
|
|
+ // fixed: 'right',
|
|
|
// },
|
|
|
-
|
|
|
- {
|
|
|
- title: t('common.operation'),
|
|
|
- dataIndex: '',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- width: isJA.value ? 100 : 100,
|
|
|
- fixed: 'right',
|
|
|
- },
|
|
|
];
|
|
|
|
|
|
const searchForm: Partial<FormProps> = {
|
|
|
labelWidth: 100,
|
|
|
schemas: [
|
|
|
{
|
|
|
- field: 'companyName',
|
|
|
- label: t('routes.corporation.enterpriseName'),
|
|
|
- component: 'Input',
|
|
|
- colProps: {
|
|
|
- lg: 6,
|
|
|
- xl: 6,
|
|
|
- xxl: 6,
|
|
|
- sm: 12,
|
|
|
- xs: 24,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'sceneName',
|
|
|
- label: t('routes.scenes.sceneName'),
|
|
|
+ field: 'mainContractorName',
|
|
|
+ label: '总承包商名称',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
|
lg: 6,
|
|
|
@@ -214,8 +141,8 @@
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- field: 'childName',
|
|
|
- label: t('routes.scenes.childName'),
|
|
|
+ field: 'contractorName',
|
|
|
+ label: '承包商名称',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
|
lg: 6,
|
|
|
@@ -229,8 +156,8 @@
|
|
|
};
|
|
|
// { getForm }
|
|
|
const [registerTable, { reload, getSelectRowKeys }] = useTable({
|
|
|
- title: t('routes.scenes.sceneList'),
|
|
|
- api: ListApi,
|
|
|
+ title: t('routes.dashboard.contractorManage'),
|
|
|
+ api: contractorListApi,
|
|
|
columns: columns,
|
|
|
useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
|
@@ -249,109 +176,7 @@
|
|
|
return T;
|
|
|
},
|
|
|
});
|
|
|
- async function handleGenerate(record: Recordable) {
|
|
|
- let { data } = await sceneDetail({ id: record.id });
|
|
|
- let { buildObjStatus } = data.data;
|
|
|
- let toastText =
|
|
|
- buildObjStatus == 2
|
|
|
- ? t('routes.scenes.objTips.Modifying')
|
|
|
- : buildObjStatus == 1
|
|
|
- ? t('routes.scenes.objTips.coverData')
|
|
|
- : t('routes.scenes.objTips.updateSuccess');
|
|
|
- console.log('buildObjStatus', data);
|
|
|
- if (data.code === 200) {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', t('routes.scenes.creatobj')),
|
|
|
- content: () => h('span', toastText),
|
|
|
- onOk: async () => {
|
|
|
- if (buildObjStatus !== 2) {
|
|
|
- await buildSceneObj({ id: record.id });
|
|
|
- }
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- },
|
|
|
- });
|
|
|
- } else {
|
|
|
- createMessage.error(t(`apiCode.errCode${data.code}`));
|
|
|
- }
|
|
|
- }
|
|
|
- function handleLivestream(item) {
|
|
|
- let url = item.webSite;
|
|
|
- let page = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.html'));
|
|
|
- url = url.replace(page, 'rtc-live');
|
|
|
- window.open(url.replace('http://', 'https://') + (isJA.value ? '&lang=ja' : ''), '_blank');
|
|
|
- }
|
|
|
- function handleCopy(item) {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', t('routes.scenes.copyInfi.title')),
|
|
|
- content: () => h('span', t('routes.scenes.copyInfi.content')),
|
|
|
- onOk: async () => {
|
|
|
- await sceneCopy(item.num);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- function handleUpgrade(item) {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', t('routes.scenes.upgradeMessg.title')),
|
|
|
- content: () => h('span', t('routes.scenes.upgradeMessg.text')),
|
|
|
- onOk: async () => {
|
|
|
- console.log('item', item);
|
|
|
- let res = await UpgradeToV4(item.num);
|
|
|
- console.log('res', res);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- async function openSceneEditor(record: Recordable) {
|
|
|
- try {
|
|
|
- const langtext = isJA.value ? 'ja' : 'zh';
|
|
|
- const token = userStore.getToken; //&token=${token}
|
|
|
- let url = record.webSite.replace('smobile', 'epc') + `&lang=${langtext}`;
|
|
|
- if (tableType.value == 4 || tableType.value == 2) {
|
|
|
- url = url + `&token=${token}`;
|
|
|
- }
|
|
|
- if (record.isUpgrade == 1) {
|
|
|
- url = url.replace('smg', 'epg');
|
|
|
- }
|
|
|
- openUrl(url);
|
|
|
- } catch (error) {
|
|
|
- console.log('error', error);
|
|
|
- }
|
|
|
- }
|
|
|
- async function handleDelete(record: Recordable) {
|
|
|
- console.log('DeleteApi', record);
|
|
|
- await DeleteApi(record.num);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- }
|
|
|
|
|
|
- async function handleDownloadScene(record: Recordable) {
|
|
|
- let param: SceneDownloadParam = {
|
|
|
- num: record.num,
|
|
|
- isObj: null,
|
|
|
- };
|
|
|
- if (tableType.value == 4 || tableType.value == 2) {
|
|
|
- param.isObj = tableType.value == 4 ? 1 : 0;
|
|
|
- }
|
|
|
- await addDownloadNumApi(param);
|
|
|
- // SceneDownloadModel
|
|
|
- const checker = await checkDownloadApi(param);
|
|
|
- if (checker.downloadStatus < 3) {
|
|
|
- const res = await downloadSceneDataAPi(param);
|
|
|
- console.log('res', res);
|
|
|
- } else {
|
|
|
- downloadByUrl({
|
|
|
- url: checker.downloadUrl,
|
|
|
- target: '_self',
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
function changeTable(val: Number) {
|
|
|
tableType.value = val;
|
|
|
reload();
|
|
|
@@ -360,22 +185,19 @@
|
|
|
const keys = getSelectRowKeys();
|
|
|
console.log('key', keys);
|
|
|
};
|
|
|
+ const handleCreate = () => {
|
|
|
+ console.log('handleCreate');
|
|
|
+ };
|
|
|
return {
|
|
|
registerTable,
|
|
|
createMessage,
|
|
|
t,
|
|
|
- handleGenerate,
|
|
|
- openSceneEditor,
|
|
|
- handleDownloadScene,
|
|
|
- handleDelete,
|
|
|
- handleLivestream,
|
|
|
- handleUpgrade,
|
|
|
changeTable,
|
|
|
- handleCopy,
|
|
|
tableType,
|
|
|
loading,
|
|
|
isJA,
|
|
|
handleSelect,
|
|
|
+ handleCreate,
|
|
|
};
|
|
|
},
|
|
|
});
|