dbsd_kczx/src/views/kc/jiaoshi/indexLogDetail.vue

121 lines
2.9 KiB
Vue
Raw Normal View History

2024-02-28 08:29:30 +08:00
<template>
<a-modal :visible="isShowPage" width="80%" style="top: 20px" title="详情" :ok-button-props="{ style: { display: 'none' } }" cancelText="关闭" @cancel="() => (isShowPage = false)">
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
</BasicTable>
</a-modal>
</template>
2024-02-29 10:39:24 +08:00
<script lang="ts" name="jiaoshi-kcJiaoshirongliangSfyc" setup>
import {ref, computed, unref, Ref, nextTick } from 'vue';
2024-02-28 08:29:30 +08:00
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import { columns, searchFormSchema } from './KcZhihuijiaoshiStateLog.data';
import { list } from './KcZhihuijiaoshiStateLog.api';
const queryParam:any = ref({});
const checkedKeys = ref<Array<string | number>>([]);
//注册model
const [registerModal, { openModal }] = useModal();
//注册table数据
const { tableContext } = useListPage({
tableProps:{
title: '教室容量',
api: list,
columns,
canResize:false,
showActionColumn: false,
immediate: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
beforeFetch: (params) => {
params.column = '',params.order = '';//新生成的默认不带排序
return Object.assign(params, queryParam.value);
},
actionColumn: {
width: 120,
fixed:'right'
},
},
})
const [registerTable, { reload },{ rowSelection, selectedRowKeys }] = tableContext
const isShowPage:Ref<boolean> = ref(false);
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}
]
}
function getDropDownAction(record){
return []
}
2024-02-29 10:39:24 +08:00
async function open(param){
console.log(`🚀 ~ detaillogopen ~ param:`, param)
2024-02-28 08:29:30 +08:00
// changeQueryParam(param);
2024-02-29 10:39:24 +08:00
// reload();
await nextTick(() => {
queryParam.value = Object.assign({ }, param);
reload();
isShowPage.value = true;
setTimeout(() => {
reload();
}, 100);
});
2024-02-28 08:29:30 +08:00
}
function close(){
isShowPage.value = false;
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
defineExpose({
open,
close,
});
</script>
<style scoped>
</style>