|
@@ -18,6 +18,16 @@
|
|
|
场景名称: {{ headerInfo?.sceneName }} 直播间名称:{{ headerInfo?.name }}</div
|
|
|
>
|
|
|
</template>
|
|
|
+ <template #canShowSwitch="{ record }">
|
|
|
+ <div>
|
|
|
+ <Switch
|
|
|
+ :disabled="!SelectRowsList.includes(record.id)"
|
|
|
+ v-model:checked="record.canShow"
|
|
|
+ :checkedChildren="t('layout.setting.on')"
|
|
|
+ :unCheckedChildren="t('layout.setting.off')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</BasicTable>
|
|
|
<!-- <BasicForm @register="registerForm" :model="model" /> -->
|
|
|
</div>
|
|
@@ -27,7 +37,8 @@
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, reactive, h } from 'vue';
|
|
|
+ import { defineComponent, reactive, h, ref, computed } from 'vue';
|
|
|
+ import { Switch } from 'ant-design-vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
// import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { BasicTable, useTable, BasicColumn, FormSchema } from '/@/components/Table';
|
|
@@ -41,7 +52,6 @@
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
const { createMessage } = useMessage();
|
|
|
-
|
|
|
const schemas: FormSchema[] = [
|
|
|
{
|
|
|
field: 'own',
|
|
@@ -75,24 +85,8 @@
|
|
|
{
|
|
|
title: '是否同时开通一起逛',
|
|
|
dataIndex: 'canShow',
|
|
|
+ slots: { customRender: 'canShowSwitch' },
|
|
|
width: 140,
|
|
|
- editComponent: 'Switch',
|
|
|
- ellipsis: false,
|
|
|
- edit: true,
|
|
|
- editable: true,
|
|
|
- editValueMap: (value) => {
|
|
|
- return value ? '是' : '否';
|
|
|
- },
|
|
|
-
|
|
|
- // customRender: ({ record }) => {
|
|
|
- // return (
|
|
|
- // record.createTime &&
|
|
|
- // h(Time, {
|
|
|
- // value: record.createTime,
|
|
|
- // mode: 'datetime',
|
|
|
- // })
|
|
|
- // );
|
|
|
- // },
|
|
|
},
|
|
|
{
|
|
|
title: '绑定时间',
|
|
@@ -110,7 +104,7 @@
|
|
|
},
|
|
|
];
|
|
|
export default defineComponent({
|
|
|
- components: { BasicModal, BasicTable },
|
|
|
+ components: { BasicModal, BasicTable, Switch },
|
|
|
props: {
|
|
|
userData: { type: Object },
|
|
|
},
|
|
@@ -119,6 +113,11 @@
|
|
|
const [register, { closeModal }] = useModalInner((data) => {
|
|
|
data && onDataReceive(data);
|
|
|
});
|
|
|
+ const SelectRowsList = computed(() => {
|
|
|
+ const data = getSelectRowKeys();
|
|
|
+ return data;
|
|
|
+ });
|
|
|
+ const checked = ref<boolean>(false);
|
|
|
const headerInfo = reactive<Recordable>({});
|
|
|
const searchInfo = reactive<Recordable>({});
|
|
|
const [
|
|
@@ -203,18 +202,25 @@
|
|
|
// const keys = getSelectRowKeys();
|
|
|
// console.log('key', key);
|
|
|
};
|
|
|
-
|
|
|
+ const handleChange = (val, row) => {
|
|
|
+ console.log('val,row', val, row);
|
|
|
+ // updateTableDataRecord('canShow', values);
|
|
|
+ // updateTableDataRecord
|
|
|
+ };
|
|
|
return {
|
|
|
register,
|
|
|
schemas,
|
|
|
registerTable,
|
|
|
-
|
|
|
handleSubmit,
|
|
|
searchInfo,
|
|
|
closeModal,
|
|
|
handleSelect,
|
|
|
headerInfo,
|
|
|
clearSelectedRowKeys,
|
|
|
+ handleChange,
|
|
|
+ t,
|
|
|
+ checked,
|
|
|
+ SelectRowsList,
|
|
|
};
|
|
|
},
|
|
|
});
|