|
@@ -3,15 +3,14 @@
|
|
|
v-bind="$attrs"
|
|
|
@register="register"
|
|
|
title="绑定主播"
|
|
|
- width="700px"
|
|
|
- @visible-change="handleVisibleChange"
|
|
|
+ width="800px"
|
|
|
@ok="handleSubmit"
|
|
|
>
|
|
|
<div class="pt-2px pr-3px">
|
|
|
<BasicTable
|
|
|
@register="registerTable"
|
|
|
:searchInfo="searchInfo"
|
|
|
- :rowSelection="{ type: 'checkbox' }"
|
|
|
+ :rowSelection="{ type: 'checkbox', onChange: handleSelect }"
|
|
|
/>
|
|
|
<!-- <BasicForm @register="registerForm" :model="model" /> -->
|
|
|
</div>
|
|
@@ -21,14 +20,15 @@
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, reactive, nextTick } from 'vue';
|
|
|
+ import { defineComponent, reactive, h } from 'vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
// import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
|
|
|
// import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
// import { checkUserAddAble } from '/@/api/corporation/modal';
|
|
|
// import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- import { bindAnchorListApi } from '/@/api/scene/live';
|
|
|
+ import { bindAnchorListApi, bindUserApi } from '/@/api/scene/live';
|
|
|
+ import { Time } from '/@/components/Time';
|
|
|
|
|
|
// const { t } = useI18n();
|
|
|
const schemas: FormSchema[] = [
|
|
@@ -60,7 +60,7 @@
|
|
|
},
|
|
|
{
|
|
|
title: '员工名称',
|
|
|
- dataIndex: 'name',
|
|
|
+ dataIndex: 'userName',
|
|
|
width: 100,
|
|
|
},
|
|
|
{
|
|
@@ -75,9 +75,40 @@
|
|
|
width: 100,
|
|
|
},
|
|
|
{
|
|
|
+ title: '是否同时开通一起逛',
|
|
|
+ dataIndex: 'canShow',
|
|
|
+ width: 100,
|
|
|
+ editComponent: 'Checkbox',
|
|
|
+ // edit: true,
|
|
|
+ editRow: true,
|
|
|
+ editValueMap: (value) => {
|
|
|
+ console.log('value', value);
|
|
|
+ return value === 0 ? '是' : '否';
|
|
|
+ },
|
|
|
+ // editable: true,
|
|
|
+ // customRender: ({ record }) => {
|
|
|
+ // return (
|
|
|
+ // record.createTime &&
|
|
|
+ // h(Time, {
|
|
|
+ // value: record.createTime,
|
|
|
+ // mode: 'datetime',
|
|
|
+ // })
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '绑定时间',
|
|
|
dataIndex: 'createTime',
|
|
|
width: 100,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ return (
|
|
|
+ record.createTime &&
|
|
|
+ h(Time, {
|
|
|
+ value: record.createTime,
|
|
|
+ mode: 'datetime',
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
export default defineComponent({
|
|
@@ -85,13 +116,13 @@
|
|
|
props: {
|
|
|
userData: { type: Object },
|
|
|
},
|
|
|
- setup(props) {
|
|
|
+ setup() {
|
|
|
const [register, { closeModal }] = useModalInner((data) => {
|
|
|
data && onDataReceive(data);
|
|
|
});
|
|
|
|
|
|
const searchInfo = reactive<Recordable>({});
|
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
+ const [registerTable, { reload, getSelectRowKeys }] = useTable({
|
|
|
title: '主播列表',
|
|
|
api: bindAnchorListApi,
|
|
|
columns: columns,
|
|
@@ -112,19 +143,34 @@
|
|
|
// searchInfo.key = data.id;
|
|
|
reload();
|
|
|
}
|
|
|
- const handleSubmit = async () => {};
|
|
|
- function handleVisibleChange(v) {
|
|
|
- v && props.userData && nextTick(() => onDataReceive(props.userData));
|
|
|
- }
|
|
|
+ const handleSubmit = async () => {
|
|
|
+ const keys = getSelectRowKeys();
|
|
|
+ console.log('keys', keys);
|
|
|
+ const params = [
|
|
|
+ {
|
|
|
+ brandId: '1046662',
|
|
|
+ canShow: 0,
|
|
|
+ type: 1,
|
|
|
+ userId: '1',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ const result = await bindUserApi(params);
|
|
|
+ console.log('result', result);
|
|
|
+ };
|
|
|
+ const handleSelect = async (key) => {
|
|
|
+ // const keys = getSelectRowKeys();
|
|
|
+ console.log('key', key);
|
|
|
+ };
|
|
|
|
|
|
return {
|
|
|
register,
|
|
|
schemas,
|
|
|
registerTable,
|
|
|
- handleVisibleChange,
|
|
|
+
|
|
|
handleSubmit,
|
|
|
searchInfo,
|
|
|
closeModal,
|
|
|
+ handleSelect,
|
|
|
};
|
|
|
},
|
|
|
});
|