userName 2025-05-23 16:37:48 +08:00
commit bf091923b2
6 changed files with 217 additions and 76 deletions

View File

@ -3,7 +3,9 @@ enum Api {
TimeoutWarning = '/api/DroneSsny/TimeoutWarning',
TimeOutAlarmList = '/api/DroneSsny/TimeOutAlarmList',
TimeoutWarningExport = '/api/DroneSsny/TimeoutWarningExport',
TimeoutAlarmExport = '/api/DroneSsny/TimeoutAlarmExport'
TimeoutAlarmExport = '/api/DroneSsny/TimeoutAlarmExport',
HistoryProject = '/api/DroneSsny/HistoryProject',
HistoryProjectExport = '/api/DroneSsny/HistoryProjectExport',
}
export function TimeoutWarning(params) {
@ -28,3 +30,13 @@ export function TimeoutAlarmExport(params) {
responseType: 'blob',
});
}
export function HistoryProject(params) {
return defHttp.get({ url: Api.HistoryProject, params });
}
export function HistoryProjectExport(params) {
return defHttp.get({
url: Api.HistoryProjectExport,
params,
responseType: 'blob',
});
}

View File

@ -248,7 +248,7 @@
let result = {};
Object.keys(data).forEach((key) => {
if (key.indexOf('_select') !== -1 || key.indexOf('_upload') !== -1 || key.indexOf('_date_picker') !== -1) {
if(oldDefaultGroupData[key] != data[key]){
if(oldDefaultGroupData[key] != data[key] && data[key]){
result[key] = data[key];
}
}

View File

@ -3,7 +3,7 @@
<div v-show="tabsColumns.length > 1">
<a-tabs v-model:activeKey="activeTabsKey" style="width: 100%" @change="tabsChange">
<a-tab-pane v-for="(colItem, index) in tabsColumns" :tab="colItem.label" :key="index">
<BasicForm :ref="`tabsFormRef${index}`" @register="registerForm" :key="index">
<BasicForm :ref="(el) => tabsFormRefs[index] = el" @register="registerForm" :key="index">
<template #CardGroup>
<CardGourp
v-if="cardGroupData.length > 0 && cardGroupData[index]"
@ -122,6 +122,7 @@
const subTableRef = ref<any>();
const cardGroupData = ref([]);
const cardGourpFormData = ref({});
const tabsFormRefs = ref<any>([])
subTableDataStore.clearGoupData();
const nowTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'));
const userName = localStorage.getItem('fireUserLoginName');
@ -483,79 +484,21 @@
}
let resultObj = {};
let values;
switch (activeTabsKey.value) {
case 0:
resultObj = proxy.$refs.tabsFormRef0[0].getFieldsValue();
proxy.$refs.tabsFormRef0[0].setFieldsValue({
if(tabsColumns.length > 1){
resultObj = tabsFormRefs[activeTabsKey.value].getFieldsValue();
tabsFormRefs[activeTabsKey.value].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef0[0].validate();
values = proxy.$refs.tabsFormRef0[0].getFieldsValue();
break;
case 1:
resultObj = proxy.$refs.tabsFormRef1[0].getFieldsValue();
proxy.$refs.tabsFormRef1[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef1[0].validate();
values = proxy.$refs.tabsFormRef1[0].getFieldsValue();
console.log('resultValue111', JSON.parse(JSON.stringify(values)));
break;
case 2:
resultObj = proxy.$refs.tabsFormRef2[0].getFieldsValue();
proxy.$refs.tabsFormRef2[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef2[0].validate();
values = proxy.$refs.tabsFormRef2[0].getFieldsValue();
break;
case 3:
resultObj = proxy.$refs.tabsFormRef3[0].getFieldsValue();
proxy.$refs.tabsFormRef3[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef3[0].validate();
values = proxy.$refs.tabsFormRef3[0].getFieldsValue();
break;
case 4:
resultObj = proxy.$refs.tabsFormRef4[0].getFieldsValue();
proxy.$refs.tabsFormRef4[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef4[0].validate();
values = proxy.$refs.tabsFormRef4[0].getFieldsValue();
break;
case 5:
resultObj = proxy.$refs.tabsFormRef5[0].getFieldsValue();
proxy.$refs.tabsFormRef5[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef5[0].validate();
values = proxy.$refs.tabsFormRef5[0].getFieldsValue();
break;
case 6:
resultObj = proxy.$refs.tabsFormRef6[0].getFieldsValue();
proxy.$refs.tabsFormRef6[0].setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
await proxy.$refs.tabsFormRef6[0].validate();
values = proxy.$refs.tabsFormRef6[0].getFieldsValue();
break;
default:
await tabsFormRefs[activeTabsKey.value].validate();
values = tabsFormRefs[activeTabsKey.value].getFieldsValue();
}else{
resultObj = getFieldsValue();
setFieldsValue({
...resultObj,
...subTableDataStore.getGroupData,
});
values = await validate();
break;
}
for (const key in values) {
for (const fieKey in FieldsValue.value) {

View File

@ -25,6 +25,13 @@
<FormItem label="是否开启位置跳转">
<Switch v-model:checked="formConfig.currentItem.mapSetData.isEnablePostionJump" />
</FormItem>
<FormItem label="控制属性" v-if="controlPropsList.length">
<Col v-for="item of controlPropsList" :key="item.name">
<Checkbox v-model:checked="formConfig.currentItem.itemProps[item.name]">
{{ item.label }}
</Checkbox>
</Col>
</FormItem>
</Form>
<Form
label-align="left"

View File

@ -0,0 +1,103 @@
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="download"></a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '详情',
onClick: () => {
handleInfo(record);
},
}
]"
/>
</template>
</template>
</BasicTable>
<a-modal
style="width: 100vw; top: 0px; left: 0px; margin: 0px; padding: 0px"
wrap-class-name="full-modal"
v-model:open="showInfoOpen"
title="详情"
:footer="null"
:maskClosable="true"
:destroyOnClose="true"
@cancel="showInfoOpen = false"
>
<ShowInfoModal :showInfoData="showInfoData"/>
</a-modal>
</PageWrapper>
</template>
<script setup lang="ts">
import { ref } from "vue"
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema } from './utils';
import { HistoryProject, HistoryProjectExport } from '@/api/earlywarning/index'
import ShowInfoModal from '@/components/EarlyWarning/InfoModal/index.vue'
const showInfoOpen = ref(false)
const showInfoData = ref();
const [registerTable, { getForm }] = useTable({
title: '历史项目',
api: HistoryProject,
columns,
rowKey: 'id',
useSearchForm: true,
showTableSetting: true,
bordered: true,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
});
function handleInfo(record) {
showInfoData.value = record
showInfoOpen.value = true
}
const download = () => {
const form = getForm();
const filterValues = form.getFieldsValue();
HistoryProjectExport(filterValues).then(res => {
const elink = document.createElement('a');
elink.download = '历史项目数据' + new Date().getTime() + '.xls';
elink.style.display = 'none';
elink.href = URL.createObjectURL(res);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
})
}
</script>
<style lang="scss" scoped>
.full-modal {
.ant-modal {
min-width: 100vw;
top: 0px;
padding: 0px;
margin: 0px;
}
.ant-modal-content {
display: flex;
flex-direction: column;
}
.ant-modal-body {
flex: 1;
}
}
</style>

View File

@ -0,0 +1,76 @@
import { BasicColumn, FormSchema } from '@/components/Table';
import { getChildrenTree } from '@/api/demo/system';
export const columns: BasicColumn[] = [
{
title: '项目编号',
dataIndex: 'xiangmu_no',
},
{
title: '项目名称',
dataIndex: 'xiangmu_name',
width: 200,
},
{
title: '行政区划',
dataIndex: 'xingzhengquhua',
},
{
title: '备案编号',
dataIndex: 'beian_no',
},
{
title: '项目开始时间',
dataIndex: 'start_time',
width: 200,
},
{
title: '项目结束时间',
dataIndex: 'end_time',
},
{
title: '项目当前用途',
dataIndex: 'xiangmu_yt',
width: 110,
},
{
title: '设施农业申请用地面积(公顷)',
dataIndex: 'shenqing_area',
width: 200,
},
{
title: '生产设施用地(公顷)',
dataIndex: 'shengchan_area',
width: 200,
},
{
title: '辅助设施用地(公顷)',
dataIndex: 'fuzhu_area',
width: 200,
},
];
export const searchFormSchema: FormSchema[] = [
{
field: 'xiangmumc',
component: 'Input',
colProps: { span: 5 },
label: '项目名称',
},
{
field: 'streetid',
label: '乡镇',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: getChildrenTree,
params: { parentId: 371324 },
// 接口参数
resultField: 'result',
labelField: 'name',
valueField: 'id',
};
},
},
];