154 lines
3.7 KiB
Vue
154 lines
3.7 KiB
Vue
|
<template>
|
||
|
<a-spin :spinning="syncoading">
|
||
|
<div class="p-2">
|
||
|
<!--引用表格-->
|
||
|
<BasicTable @register="registerTable">
|
||
|
<!--插槽:table标题-->
|
||
|
<template #tableTitle>
|
||
|
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="handleSync"> 同步</a-button>
|
||
|
</template>
|
||
|
<!--操作栏-->
|
||
|
<template #action="{ record }">
|
||
|
<TableAction :actions="getTableAction(record)"/>
|
||
|
</template>
|
||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||
|
</template>
|
||
|
</BasicTable>
|
||
|
<!-- 表单区域 -->
|
||
|
<ProjectInfoDrawer @register="registerDrawer" @success="handleSuccess" />
|
||
|
</div>
|
||
|
</a-spin>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts" name="iot-nuIotCameraInfo" setup>
|
||
|
import {ref, reactive, createVNode, h} from 'vue';
|
||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||
|
import { columns,searchFormSchema } from './ProjectInfo.data';
|
||
|
import { list, sync } from './ProjectInfo.api';
|
||
|
import { useUserStore } from '/@/store/modules/user';
|
||
|
import { useRouter } from 'vue-router';
|
||
|
import { useDrawer } from "@/components/Drawer";
|
||
|
import ProjectInfoDrawer from './components/ProjectInfoDrawer.vue';
|
||
|
//注册drawer
|
||
|
const [registerDrawer, { openDrawer }] = useDrawer();
|
||
|
let router = useRouter();
|
||
|
const formRef = ref();
|
||
|
const syncoading = ref<boolean>(false);
|
||
|
const queryParam = reactive<any>({});
|
||
|
const userStore = useUserStore();
|
||
|
//注册table数据
|
||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||
|
tableProps: {
|
||
|
title: '护理单元-物联管理-项目信息',
|
||
|
api: list,
|
||
|
columns,
|
||
|
canResize:false,
|
||
|
formConfig: {
|
||
|
// labelWidth: 200,
|
||
|
schemas: searchFormSchema,
|
||
|
},
|
||
|
actionColumn: {
|
||
|
width: 120,
|
||
|
fixed: 'right',
|
||
|
},
|
||
|
beforeFetch: async (params) => {
|
||
|
return Object.assign(params, queryParam);
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||
|
const labelCol = reactive({
|
||
|
xs:24,
|
||
|
sm:4,
|
||
|
xl:6,
|
||
|
xxl:4
|
||
|
});
|
||
|
const wrapperCol = reactive({
|
||
|
xs: 24,
|
||
|
sm: 20,
|
||
|
});
|
||
|
|
||
|
/**
|
||
|
* 详情
|
||
|
*/
|
||
|
function handleDetail(record: Recordable) {
|
||
|
openDrawer(true, {
|
||
|
record,
|
||
|
isUpdate: true,
|
||
|
showFooter: false,
|
||
|
tenantSaas: false,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 操作栏
|
||
|
*/
|
||
|
function getTableAction(record) {
|
||
|
return [
|
||
|
{
|
||
|
label: '详情',
|
||
|
onClick: handleDetail.bind(null, record),
|
||
|
},
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查询
|
||
|
*/
|
||
|
function searchQuery() {
|
||
|
reload();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 重置
|
||
|
*/
|
||
|
function searchReset() {
|
||
|
formRef.value.resetFields();
|
||
|
selectedRowKeys.value = [];
|
||
|
//刷新数据
|
||
|
reload();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 信息同步
|
||
|
*/
|
||
|
function handleSync(){
|
||
|
syncoading.value = true;
|
||
|
sync({}).then(res=>{
|
||
|
syncoading.value = false;
|
||
|
//刷新数据
|
||
|
reload();
|
||
|
}).catch(res=>{
|
||
|
syncoading.value = false;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<style lang="less" scoped>
|
||
|
.jeecg-basic-table-form-container {
|
||
|
padding: 0;
|
||
|
.table-page-search-submitButtons {
|
||
|
display: block;
|
||
|
margin-bottom: 24px;
|
||
|
white-space: nowrap;
|
||
|
}
|
||
|
.query-group-cust{
|
||
|
min-width: 100px !important;
|
||
|
}
|
||
|
.query-group-split-cust{
|
||
|
width: 30px;
|
||
|
display: inline-block;
|
||
|
text-align: center
|
||
|
}
|
||
|
.ant-form-item:not(.ant-form-item-with-help){
|
||
|
margin-bottom: 16px;
|
||
|
height: 32px;
|
||
|
}
|
||
|
:deep(.ant-picker),:deep(.ant-input-number){
|
||
|
width: 100%;
|
||
|
}
|
||
|
}
|
||
|
</style>
|