|
@@ -44,31 +44,32 @@ updateUserId: null -->
|
|
|
<template #houseType="{ record }">
|
|
|
{{ renderHouseType(record.houseType) }}
|
|
|
</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: '删除',
|
|
|
- popConfirm: {
|
|
|
- title: '是否确认删除',
|
|
|
- confirm: () => {
|
|
|
- createMessage.info(`暂未接入`);
|
|
|
- },
|
|
|
- },
|
|
|
+ icon: 'eos-icons:role-binding',
|
|
|
+ label: '绑定主播',
|
|
|
+ color: 'warning',
|
|
|
+ onClick: handleBindAnchor.bind(null, record),
|
|
|
},
|
|
|
+
|
|
|
+ // {
|
|
|
+ // icon: 'ant-design:delete-outlined',
|
|
|
+ // color: 'error',
|
|
|
+ // label: '删除',
|
|
|
+ // popConfirm: {
|
|
|
+ // title: '是否确认删除',
|
|
|
+ // confirm: () => {
|
|
|
+ // createMessage.info(`暂未接入`);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
]"
|
|
|
/>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
+ <bindModal @register="registerBindModal" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
@@ -77,22 +78,26 @@ updateUserId: null -->
|
|
|
BasicTable,
|
|
|
useTable,
|
|
|
BasicColumn,
|
|
|
+ // FormSchema,
|
|
|
FormProps,
|
|
|
TableAction,
|
|
|
TableImg,
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { uploadApi } from '/@/api/sys/upload';
|
|
|
- import { Switch } from 'ant-design-vue';
|
|
|
+ // import { uploadApi } from '/@/api/sys/upload';
|
|
|
+ import { Tag } from 'ant-design-vue';
|
|
|
import { h } from 'vue';
|
|
|
- import { ListApi } from '/@/api/scene/live';
|
|
|
+ import { ListApi, brandTypeListApi } from '/@/api/scene/live';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
+ import bindModal from './bindModal.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, TableAction, TableImg },
|
|
|
+ components: { BasicTable, TableAction, TableImg, bindModal },
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
const { t } = useI18n();
|
|
|
+ const [registerBindModal, { openModal: openBindModal }] = useModal();
|
|
|
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
@@ -131,44 +136,51 @@ updateUserId: null -->
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
+ title: '已绑定主播',
|
|
|
+ dataIndex: 'bindShowerNameList',
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
title: '是否开播',
|
|
|
- dataIndex: 'isSteam',
|
|
|
+ dataIndex: 'livestreamStatus',
|
|
|
width: 180,
|
|
|
customRender: ({ record }) => {
|
|
|
- if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
- record.pendingStatus = false;
|
|
|
- }
|
|
|
- return h(Switch, {
|
|
|
- checked: record.isSteam,
|
|
|
- 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;
|
|
|
- // });
|
|
|
- },
|
|
|
- });
|
|
|
+ const enable = record.livestreamStatus === 0;
|
|
|
+ const color = enable ? 'green' : 'red';
|
|
|
+ const text = enable ? '是' : '否';
|
|
|
+ return h(Tag, { color: color }, () => text);
|
|
|
},
|
|
|
},
|
|
|
+ // {
|
|
|
+ // title: '是否开播',
|
|
|
+ // dataIndex: 'isSteam',
|
|
|
+ // width: 180,
|
|
|
+ // customRender: ({ record }) => {
|
|
|
+ // if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
+ // record.pendingStatus = false;
|
|
|
+ // }
|
|
|
+ // return h(Switch, {
|
|
|
+ // checked: record.isSteam,
|
|
|
+ // 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);
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // },
|
|
|
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: '',
|
|
|
slots: { customRender: 'action' },
|
|
|
width: 120,
|
|
|
+ fixed: 'right',
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -176,21 +188,59 @@ updateUserId: null -->
|
|
|
labelWidth: 100,
|
|
|
schemas: [
|
|
|
{
|
|
|
- field: 'id',
|
|
|
- label: 'id',
|
|
|
+ field: 'sceneName',
|
|
|
+ label: '直播间名称',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
|
- xl: 3,
|
|
|
- xxl: 3,
|
|
|
+ xl: 5,
|
|
|
+ xxl: 5,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- field: 'userName',
|
|
|
- label: '企业账号',
|
|
|
- component: 'Input',
|
|
|
+ field: 'type',
|
|
|
+ label: '类型',
|
|
|
+ component: 'ApiSelect',
|
|
|
colProps: {
|
|
|
- xl: 12,
|
|
|
- xxl: 8,
|
|
|
+ xl: 5,
|
|
|
+ xxl: 5,
|
|
|
+ },
|
|
|
+ componentProps: {
|
|
|
+ api: brandTypeListApi,
|
|
|
+ resultField: 'list',
|
|
|
+ labelField: 'name',
|
|
|
+ valueField: 'id',
|
|
|
+ params: {
|
|
|
+ page: 1,
|
|
|
+ limit: 1000,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'livestreamStatus',
|
|
|
+ label: '是否开播',
|
|
|
+ component: 'Select',
|
|
|
+ colProps: {
|
|
|
+ xl: 5,
|
|
|
+ xxl: 5,
|
|
|
+ },
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: '全部',
|
|
|
+ value: '',
|
|
|
+ key: '1',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是',
|
|
|
+ value: '',
|
|
|
+ key: '2',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '否',
|
|
|
+ value: '0',
|
|
|
+ key: '2',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -214,7 +264,7 @@ updateUserId: null -->
|
|
|
title: '直播列表',
|
|
|
api: ListApi,
|
|
|
columns: columns,
|
|
|
- useSearchForm: false,
|
|
|
+ useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
|
showTableSetting: true,
|
|
|
tableSetting: { fullScreen: true },
|
|
@@ -233,12 +283,18 @@ updateUserId: null -->
|
|
|
},
|
|
|
});
|
|
|
|
|
|
+ function handleBindAnchor(record: Recordable) {
|
|
|
+ console.log('record', record);
|
|
|
+ openBindModal(true, record);
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
registerTable,
|
|
|
createMessage,
|
|
|
renderHouseType,
|
|
|
t,
|
|
|
- uploadApi: uploadApi as any,
|
|
|
+ registerBindModal,
|
|
|
+ handleBindAnchor,
|
|
|
};
|
|
|
},
|
|
|
});
|