|
@@ -1,36 +1,40 @@
|
|
<template>
|
|
<template>
|
|
- <BasicTable @register="registerTimeTable">
|
|
|
|
- <template #action="{ record }">
|
|
|
|
- <TableAction
|
|
|
|
- :actions="[
|
|
|
|
- {
|
|
|
|
- label: '详情',
|
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
|
- },
|
|
|
|
- ]"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </BasicTable>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <BasicTable @register="registerTimeTable">
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
+ <TableAction
|
|
|
|
+ :actions="[
|
|
|
|
+ {
|
|
|
|
+ label: record.sceneCount || 0,
|
|
|
|
+ onClick: handleCreate.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ <sceneListModal @register="register" />
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import { defineComponent } from 'vue';
|
|
import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
|
|
import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
|
|
import { userShareList } from '/@/api/account';
|
|
import { userShareList } from '/@/api/account';
|
|
- import { userListSchema } from '../data';
|
|
|
|
|
|
+ import { userListSchema } from './data';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
- import { useRouter } from 'vue-router';
|
|
|
|
- import { otherInfoStore } from '/@/store/modules/other';
|
|
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
|
+ import sceneListModal from './sceneListModal.vue';
|
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
|
+
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
components: {
|
|
components: {
|
|
BasicTable,
|
|
BasicTable,
|
|
|
|
+ sceneListModal,
|
|
TableAction,
|
|
TableAction,
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
- const { setOverviewInfo } = otherInfoStore();
|
|
|
|
- const router = useRouter();
|
|
|
|
const permissionStore = usePermissionStore();
|
|
const permissionStore = usePermissionStore();
|
|
|
|
+ const [register, { openModal }] = useModal();
|
|
const { getCheckPerm } = permissionStore;
|
|
const { getCheckPerm } = permissionStore;
|
|
const searchForm: Partial<FormProps> = {
|
|
const searchForm: Partial<FormProps> = {
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
@@ -68,6 +72,7 @@
|
|
formConfig: searchForm,
|
|
formConfig: searchForm,
|
|
showTableSetting: true,
|
|
showTableSetting: true,
|
|
showIndexColumn: false,
|
|
showIndexColumn: false,
|
|
|
|
+ searchInfo: { type: 1 },
|
|
rowKey: 'id',
|
|
rowKey: 'id',
|
|
fetchSetting: {
|
|
fetchSetting: {
|
|
pageField: 'pageNum',
|
|
pageField: 'pageNum',
|
|
@@ -83,25 +88,24 @@
|
|
},
|
|
},
|
|
canResize: true,
|
|
canResize: true,
|
|
});
|
|
});
|
|
|
|
+ function handleCreate(record) {
|
|
|
|
+ openModal(true, record);
|
|
|
|
+ }
|
|
function tabChange(val: string) {
|
|
function tabChange(val: string) {
|
|
console.log('tabChange', val);
|
|
console.log('tabChange', val);
|
|
reload();
|
|
reload();
|
|
}
|
|
}
|
|
- function handleOpen(record: Recordable) {
|
|
|
|
|
|
+ function handleOpen(record) {
|
|
console.log('点击了启用', record);
|
|
console.log('点击了启用', record);
|
|
}
|
|
}
|
|
- function handleEdit(record: Recordable) {
|
|
|
|
- console.log('record', record);
|
|
|
|
- setOverviewInfo(record);
|
|
|
|
- router.push({ path: 'details' });
|
|
|
|
- }
|
|
|
|
return {
|
|
return {
|
|
registerTimeTable,
|
|
registerTimeTable,
|
|
handleOpen,
|
|
handleOpen,
|
|
tabChange,
|
|
tabChange,
|
|
reload,
|
|
reload,
|
|
- handleEdit,
|
|
|
|
|
|
+ register,
|
|
getCheckPerm,
|
|
getCheckPerm,
|
|
|
|
+ handleCreate,
|
|
t,
|
|
t,
|
|
};
|
|
};
|
|
},
|
|
},
|