Browse Source

基础信息接入

feature-no-sdk
zth 4 weeks ago
parent
commit
09c5d97617
  1. 64
      src/api/dike/index.ts
  2. 77
      src/api/sluice/index.ts
  3. 8
      src/components.d.ts
  4. 425
      src/views/Main/Dike/components/BaseInfo.vue
  5. 276
      src/views/Main/Dike/components/fileManagement.vue
  6. 244
      src/views/Main/Dike/components/floodControlMaterials.vue
  7. 208
      src/views/Main/Dike/components/safetyAppraisal.vue
  8. 26
      src/views/Main/Dike/index.vue
  9. 349
      src/views/Main/Sluice/components/BaseInfo.vue
  10. 242
      src/views/Main/Sluice/components/fileManagement.vue
  11. 286
      src/views/Main/Sluice/components/floodControlMaterials.vue
  12. 230
      src/views/Main/Sluice/components/safetyAppraisal.vue
  13. 24
      src/views/Main/Sluice/index.vue

64
src/api/dike/index.ts

@ -28,6 +28,9 @@ export function getJbxx(id: any) {
});
}
// 查询水文特征列表
export function listSwtz(query: any) {
return request({
@ -40,6 +43,65 @@ export function listSwtz(query: any) {
});
}
export function listHdmtzz(query: any) {
return request({
url: '/df/hdmtzz/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
});
}
export function listJyjl(query:any) {
return request({
url: '/df/jyjl/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
export function listAqjdxx(query:any) {
return request({
url: '/df/aqjdxx/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
export function listFzwz(query:any) {
return request({
url: '/df/fxwz/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
export function listDagl(query:any) {
return request({
url: '/df/dagl/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
// 查询水文特征详细
export function getSwtz(id: any) {
return request({
@ -108,4 +170,4 @@ export function getV2PatrolStatisticChart(data: any) {
shuili: 'water ' + shuili
}
});
}
}

77
src/api/sluice/index.ts

@ -26,3 +26,80 @@ export function listSwtz(query: any) {
}
});
}
export function listXlnl(query: any) {
return request({
url: '/yg/xlnl/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
});
}
export function listGctx(query: any) {
return request({
url: '/sz/gctx/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
});
}
export function listGcjg(query: any) {
return request({
url: '/sz/gcjg/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
});
}
export function listCxjl(query: any) {
return request({
url: '/sz/cxjl/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
});
}
export function listFzwz(query:any) {
return request({
url: '/fxwz/fxwz/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
export function listAqjd(query:any) {
return request({
url: '/aqjdxx/aqjdxx/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}
export function listDaglsz(query:any) {
return request({
url: '/sz/dagl/list',
method: 'post',
data: query,
headers: {
shuili: 'water ' + shuili
}
})
}

8
src/components.d.ts

@ -15,10 +15,10 @@ declare module 'vue' {
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElSelect: typeof import('element-plus/es')['ElSelect']
@ -26,9 +26,6 @@ declare module 'vue' {
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
Form: typeof import('./components/Form/index.vue')['default']
InputNumber: typeof import('./components/Input/input-number.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
@ -36,4 +33,7 @@ declare module 'vue' {
TableColumn: typeof import('./components/TableColumn/index.vue')['default']
Tree: typeof import('./components/Tree/index.vue')['default']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}

425
src/views/Main/Dike/components/BaseInfo.vue

@ -142,150 +142,282 @@
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="水文特征" name="2">
<div class="sub-title">水库水文特征</div>
<el-descriptions
class="mt-16"
:column="3"
border
:labelStyle="{
'text-align': 'left',
width: '120px',
height: '50px',
}"
:contentStyle="{ minWidth: '180px' }"
<el-tab-pane label="堤防横断面特征值" name="2">
<el-table
:data="hdmzData"
>
<el-descriptions-item>
<template #label> 河道宽度 </template>
{{ form.riverWidth }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 河道比降 </template>
{{ form.riverGradient }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 多年平均径流量 </template>
{{ form.annualAverageRunoff }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 多年平均输沙量 </template>
{{ form.averageSedimentTransport }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 多年平均最低气温 </template>
{{ form.averageMinimumTemperature }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计重现期 </template>
{{ form.dsrcin }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计洪峰流量 </template>
{{ form.peakFlowRate }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核重现期 </template>
{{ form.chrcin }}
</el-descriptions-item>
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="堤防横断面代码"
align="center"
prop="bntrCode"
min-width="120"
/>
<el-table-column
label="测量日期"
align="center"
prop="srDate"
min-width="120"
/>
<el-table-column
label="断面桩号"
align="center"
prop="trCh"
min-width="120"
/>
<el-table-column
label="起始断面位置"
align="center"
prop="intrPl"
min-width="120"
/>
<el-table-column
label="起始断面桩号"
align="center"
prop="intrCh"
min-width="120"
/>
<el-table-column
label="至起始断面距离"
align="center"
prop="tointrDs"
min-width="120"
/>
<el-table-column
label="起测点位置"
align="center"
prop="jmsrpnPl"
min-width="120"
/>
<el-table-column
label="起测点高程"
align="center"
prop="jmsrpneLev"
min-width="120"
/>
<el-table-column
label="堤身土质"
align="center"
prop="bnbdSlch"
min-width="120"
/>
<el-table-column
label="堤身防渗形式"
align="center"
prop="bnbdAntp"
min-width="120"
/>
<el-table-column
label="堤基地质"
align="center"
prop="bnbsGl"
min-width="120"
/>
<el-table-column
label="堤基防渗形式"
align="center"
prop="bnbsAntp"
min-width="120"
/>
<el-table-column
label="堤身净高度"
align="center"
prop="bnbdHigh"
min-width="120"
/>
<el-table-column
label="堤顶高程"
align="center"
prop="bntpeLev"
min-width="120"
/>
<el-table-column
label="堤顶超高"
align="center"
prop="bntpFr"
min-width="120"
/>
<el-table-column
label="堤顶宽度"
align="center"
prop="bntpWd"
min-width="120"
/>
<el-table-column
label="迎河面堤脚高程"
align="center"
prop="upbnToel"
min-width="120"
/>
<el-table-column
label="背河面堤脚高程"
align="center"
prop="dwbnToel"
min-width="120"
/>
<el-table-column
label="迎河坡坡比"
align="center"
prop="upslSlrt"
min-width="120"
/>
<el-table-column
label="背河坡坡比"
align="center"
prop="dwslSlrt"
min-width="120"
/>
<el-table-column
label="迎河坡坡比"
align="center"
prop="upslSlrt"
min-width="120"
/>
<el-table-column
label="迎河坡护坡情况"
align="center"
prop="uspsIn"
min-width="120"
/>
<el-table-column
label="背河坡护坡情况"
align="center"
prop="dspsIn"
min-width="120"
/>
<el-table-column
label="迎河面滩地宽度"
align="center"
prop="upbtWide"
min-width="120"
/>
<el-table-column
label="迎河面滩地宽度"
align="center"
prop="upbtWide"
min-width="120"
/>
<el-table-column
label="迎河面平台(前戗)顶高程"
align="center"
prop="ufrteLev"
min-width="120"
/>
<el-table-column
label="迎河面平台(前戗)顶宽"
align="center"
prop="ufrtWide"
min-width="120"
/>
<el-table-column
label="迎河面平台(前戗)坡度"
align="center"
prop="upflRfsl"
min-width="120"
/>
<el-table-column
label="背河面平台(后戗)顶高程"
align="center"
prop="dfrtEl"
min-width="120"
/>
<el-table-column
label="背河面平台(后戗)顶高程"
align="center"
prop="dfrtEl"
min-width="120"
/>
<el-table-column
label="背河面平台(后戗)顶宽"
align="center"
prop="dfrtWide"
min-width="120"
/>
<el-table-column
label="背河面平台(后戗)坡度"
align="center"
prop="dwflRfsl"
min-width="120"
/>
<el-table-column
label="备注"
align="center"
prop="note"
min-width="120"
/>
<el-descriptions-item>
<template #label> 校核洪峰流量 </template>
{{ form.verifyFlowRate }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计过闸流量 </template>
{{ form.dslcfl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计闸上水位 </template>
{{ form.dsuswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计闸下水位 </template>
{{ form.dsdswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核过闸流量 </template>
{{ form.chlcfl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核闸上水位 </template>
{{ form.chuswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核闸下水位 </template>
{{ form.chdswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计洪水标准 </template>
{{ form.designFloodStandard }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计洪水位 </template>
{{ form.designFloodHigh }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 保证水位 </template>
{{ form.ensureLevel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 警戒水位 </template>
{{ form.alertLevel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设防水位 </template>
{{ form.fortificationLevel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设计流量 </template>
{{ form.designFlow }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 警戒流量 </template>
{{ form.alertFlow }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核水位 </template>
{{ form.checkLevel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 校核流量 </template>
{{ form.checkFlow }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 历史最高水位 </template>
{{ form.highestWaterLevel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 最高水位日期 </template>
{{ form.highestWaterLevelTime }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 历史最大洪峰流量 </template>
{{ form.highestWaterFlow }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 历史最大洪峰流量日期 </template>
{{ form.highestWaterFlowTime }}
</el-descriptions-item>
</el-descriptions>
</el-table>
</el-tab-pane>
<el-tab-pane label="例子" name="3">
<!-- 添加你需要的代码 -->
<el-tab-pane label="历史决溢记录" name="4">
<el-table
:data="overflows"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="堤防名称"
align="center"
prop="dikeName"
min-width="120"
/>
<el-table-column
label="记录更新时间"
align="center"
prop="updateDate"
min-width="120"
/>
<el-table-column
label="决溢地点"
align="center"
prop="brspPl"
min-width="120"
/>
<el-table-column
label="决溢时间"
align="center"
prop="brspDatetime"
min-width="120"
/>
<el-table-column
label=""
align="决溢形式"
prop="brspForm"
min-width="120"
/>
<!-- <el-table-column
label="责任人类型"
align="center"
prop="personResponsibleType"
:formatter="personResponsibleTypeFormat"
min-width="120"
/> -->
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from "vue";
import { getJbxx, listSwtz } from "@/api/dike";
import {getJbxx, listHdmtzz, listJyjl, listSwtz} from "@/api/dike";
import { getDictLabel } from "@/utils/dictUtils";
const props = defineProps({
resCode: {
type: String,
default: "",
default: "HP0174401000000148",
},
pattOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
@ -300,12 +432,16 @@ const props = defineProps({
default: [],
},
});
let code: any = null;
const activeName: any = ref("1");
let typeApi: any = {
["1"]: initBaseAndRsppInfo,
["2"]: initBaseAndRsppInfo,
["2"]: initHdmtzz,
["4"]: initJyjl,
};
const hdmzData: any=ref([]);
const overflows: any=ref([])
const form: any = ref({});
const emits = defineEmits(["getResInfo"]);
@ -334,9 +470,38 @@ function initRsppInfo() {
});
}
function initHdmtzz() {
listHdmtzz({
page: 1,
pageSize: 10,
data: {
dikeCode: props.resCode,
},
}).then((res) => {
if (res) {
hdmzData.value=res.records || [];
}
});
}
function initJyjl() {
listJyjl({
page: 1,
pageSize: 10,
data: {
dikeCode: props.resCode,
},
}).then((res) => {
if (res) {
overflows.value=res.records || [];
}
});
}
function initBaseAndRsppInfo() {
initBaseInfo();
initRsppInfo();
}
function initData() {

276
src/views/Main/Dike/components/fileManagement.vue

@ -0,0 +1,276 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<div class="search-item">
<span class="option-label">档案类型</span>
<el-select
v-model="selectedFileType"
placeholder="请选择档案类型"
clearable
style="width: 200px;"
>
<el-option
v-for="item in scaleOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</div>
</div>
<div class="right-options">
<el-button type="primary" class="add-button" @click="handleSearch">查询</el-button>
<el-button class="reset-button" @click="handleReset">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black">
<el-table-column type="index" label="序号" width="120" align="center" />
<el-table-column prop="regulationsAttachment" label="档案类型" width="180" align="center" >
<template #default="{ row }">
{{projTypeFormat(row.regulationsAttachment)}}
</template>
</el-table-column>
<el-table-column prop="planAttachment" label="档案附件" align="center">
<template #default="{ row }">
<div
v-for="(item, index) in parseAttachments(row.planAttachment)"
:key="index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(item, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
v-model="dialogVisible"
title="档案详情"
width="50%"
:before-close="handleDialogClose"
>
<div class="detail-container">
<div class="detail-item">
<span class="detail-label">档案类型</span>
<span class="detail-value">{{ projTypeFormat(currentRow.regulationsAttachment) || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">档案附件</span>
<div class="detail-value attachment-list">
<div
v-for="(item, index) in parseAttachments(currentRow.planAttachment)"
:key="index"
class="attachment-item"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(item, index)"
style="cursor: pointer; margin-left: 8px;"
></i>
</div>
<div v-if="!parseAttachments(currentRow.planAttachment).length" class="no-attachments">
无附件
</div>
</div>
</div>
<!-- 如果有其他字段可以在此添加 -->
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import {ref, onMounted, watch, reactive} from 'vue';
import type { PropType } from 'vue';
import {listAqjdxx, listDagl, listFzwz} from "~/api/dike";
import {getDicts} from "~/api/common";
import {getDictLabel} from "~/utils/dictUtils";
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '',
},
});
const scaleOptions=ref([])
function getType() {
getDicts("file_data_type").then((res) => {
scaleOptions.value = res || [];
});
}
// Data for the table
const tableData = ref([]);
// Search parameters
const searchDate = ref([]);
function projTypeFormat(key: string) {
if (!key) return '--';
return getDictLabel(scaleOptions.value, key) || key;
}
const dialogVisible = ref(false);
// Current row being viewed
const currentRow = reactive({
regulationsAttachment: '',
planAttachment: ''
});
// View function
const handleView = (row: any) => {
console.log('View row:', row);
// Copy row data to currentRow
currentRow.regulationsAttachment = row.regulationsAttachment || '';
currentRow.planAttachment = row.planAttachment || '';
// Show dialog
dialogVisible.value = true;
};
const selectedFileType = ref('');
// View function
// const handleView = (row: any) => {
// console.log('View row:', row);
// };
const handleSearch = () => {
initDagl();
};
//
const handleReset = () => {
selectedFileType.value = '';
initDagl();
};
function downloadFile(item: string, index: number): void {
const file = JSON.parse(item)[index];
handlePreview(file);
}
function parseAttachments(attachment: string): FileItem[] {
return JSON.parse(attachment);
}
function handlePreview(file: { fileName: string; name: string }): void {
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
type: "application/xlsx",
});
const href = URL.createObjectURL(blob);
const a = document.createElement("a");
a.style.display = "none";
a.href = href;
a.download = file.name;
a.click();
URL.revokeObjectURL(a.href);
});
}
// Fetch data based on resCode changes
watch(
() => props.resCode,
(newVal) => {
if (newVal) {
fetchSafetyData();
}
},
{ immediate: true }
);
// Fetch safety appraisal data
const fetchSafetyData = async () => {
};
function initDagl() {
const requestData: any = {
dikeCode: props.resCode,
};
//
if (selectedFileType.value) {
requestData.regulationsAttachment = selectedFileType.value;
}
listDagl({
page: 1,
pageSize: 10,
data:requestData
}).then((res) => {
if (res) {
tableData.value=res.records || [];
}
});
}
onMounted(() => {
getType();
initDagl();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
}
}
.right-options {
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: white;
}
}
}
.table-container {
.view-button {
color: #3a89fe;
}
}
}
</style>

244
src/views/Main/Dike/components/floodControlMaterials.vue

@ -0,0 +1,244 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<div class="search-item">
<span class="option-label">采购时间</span>
<el-date-picker
v-model="dateRange"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 240px"
/>
</div>
<div class="search-item">
<span class="option-label">物资名称</span>
<el-input
v-model="materialName"
placeholder="请输入物资名称"
style="width: 200px"
/>
</div>
<div class="search-item">
<span class="option-label">负责人姓名</span>
<el-input
v-model="responsiblePerson"
placeholder="请输入负责人姓名"
style="width: 200px"
/>
</div>
</div>
<div class="right-options">
<el-button type="primary" class="add-button" @click="handleSearch">查询</el-button>
<el-button class="reset-button" @click="handleReset">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black">
<el-table-column type="index" label="序号" width="120" align="center" />
<el-table-column prop="materialName" label="物资名称" width="180" align="center" />
<el-table-column prop="materialNumber" label="物资数量" align="center" />
<el-table-column prop="materialType" label="物资类型" align="center" />
<el-table-column prop="materialNumber" label="采购时间" align="center" />
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
v-model="dialogVisible"
title="物资详情"
width="50%"
:before-close="handleDialogClose"
>
<div class="detail-container">
<div class="detail-item">
<span class="detail-label">物资名称</span>
<span class="detail-value">{{ currentRow.materialName || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">物资数量</span>
<span class="detail-value">{{ currentRow.materialNumber || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">物资类型</span>
<span class="detail-value">{{ currentRow.materialType || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">采购时间</span>
<span class="detail-value">{{ currentRow.purchaseTime || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">负责人</span>
<span class="detail-value">{{ currentRow.responsiblePerson || '--' }}</span>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import {ref, onMounted, watch, reactive} from 'vue';
import type { PropType } from 'vue';
import {listAqjdxx, listFzwz} from "~/api/dike";
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '',
},
});
const dateRange = ref([]);
const materialName = ref('');
const responsiblePerson = ref('');
// Dialog visibility
const dialogVisible = ref(false);
// Current row being viewed
const currentRow = reactive({
materialName: '',
materialNumber: '',
materialType: '',
purchaseTime: '',
responsiblePerson: ''
});
// View function
const handleView = (row: any) => {
console.log('View row:', row);
// Copy row data to currentRow
currentRow.materialName = row.materialName || '';
currentRow.materialNumber = row.materialNumber || '';
currentRow.materialType = row.materialType || '';
currentRow.purchaseTime = row.purchaseTime || '';
currentRow.responsiblePerson = row.responsiblePerson || '';
// Show dialog
dialogVisible.value = true;
};
// Handle dialog close
const handleDialogClose = () => {
dialogVisible.value = false;
};
// Search function
const handleSearch = () => {
initFxwz();
};
// Data for the table
const tableData = ref([]);
// Search parameters
const searchDate = ref([]);
// View function
// Fetch data based on resCode changes
watch(
() => props.resCode,
(newVal) => {
if (newVal) {
fetchSafetyData();
}
},
{ immediate: true }
);
// Fetch safety appraisal data
const fetchSafetyData = async () => {
};
function initFxwz() {
const requestData: any = {
dikeCode: props.resCode,
};
// Add search parameters if they exist
if (materialName.value) {
requestData.materialName = materialName.value;
}
if (responsiblePerson.value) {
requestData.responsiblePerson = responsiblePerson.value;
}
// Add date range if selected
if (dateRange.value && dateRange.value.length === 2) {
requestData.startTime = dateRange.value[0];
requestData.endTime = dateRange.value[1];
}
listFzwz({
page: 1,
pageSize: 10,
data:requestData
}).then((res) => {
if (res) {
tableData.value=res.records || [];
}
});
}
onMounted(() => {
initFxwz();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
}
}
.right-options {
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: white;
}
}
}
.table-container {
.view-button {
color: #3a89fe;
}
}
}
</style>

208
src/views/Main/Dike/components/safetyAppraisal.vue

@ -0,0 +1,208 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<span class="option-label">安全评定时间</span>
<el-date-picker
v-model="identifyTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期"
@change="initSafe"
style="color: black"
/>
</div>
<div class="right-options">
<el-button class="reset-button" @click="resetFilter">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black" class="custom-table">
<el-table-column type="index" label="序号" width="120" align="center"/>
<el-table-column prop="identifyTime" label="安全评定时间" width="180" align="center" />
<el-table-column prop="safetyEvaluationUnit" label="安全评的单位" align="center" />
<el-table-column prop="unitQualification" label="评价单位资质" align="center" />
<el-table-column prop="mainIssues" label="安全评价结论" align="center" />
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
v-model="dialogVisible"
title="安全评定详情"
width="50%"
:before-close="handleDialogClose"
>
<div class="detail-container">
<div class="detail-item">
<span class="detail-label">安全评定时间</span>
<span class="detail-value">{{ currentRow.identifyTime || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">安全评的单位</span>
<span class="detail-value">{{ currentRow.safetyEvaluationUnit || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">评价单位资质</span>
<span class="detail-value">{{ currentRow.unitQualification || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">安全评价结论</span>
<span class="detail-value">{{ currentRow.mainIssues || '--' }}</span>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import {ref, onMounted, watch, reactive} from 'vue';
import type { PropType } from 'vue';
import {listAqjdxx, listJyjl} from "~/api/dike";
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '',
},
});
// Data for the table
const tableData = ref([]);
const identifyTime = ref(null);
// Search parameters
const searchDate = ref([]);
// View function
// const handleView = (row: any) => {
// console.log('View row:', row);
// };
// Fetch data based on resCode changes
watch(
() => props.resCode,
(newVal) => {
if (newVal) {
fetchSafetyData();
}
},
{ immediate: true }
);
// Fetch safety appraisal data
const fetchSafetyData = async () => {
};
const currentRow = reactive({
identifyTime: '',
safetyEvaluationUnit: '',
unitQualification: '',
mainIssues: ''
});
const handleView = (row: any) => {
console.log('View row:', row);
// Copy row data to currentRow
currentRow.identifyTime = row.identifyTime || '';
currentRow.safetyEvaluationUnit = row.safetyEvaluationUnit || '';
currentRow.unitQualification = row.unitQualification || '';
currentRow.mainIssues = row.mainIssues || '';
// Show dialog
dialogVisible.value = true;
};
const resetFilter = () => {
identifyTime.value = null;
initSafe();
};
const dialogVisible = ref(false);
function initSafe() {
console.log("Selected date:", identifyTime.value);
// Build request data object
const requestData: any = {
dfrwId: props.resCode
};
// Only add identifyTime if it has a value
if (identifyTime.value) {
requestData.identifyTime = identifyTime.value;
}
listAqjdxx({
page: 1,
pageSize: 10,
data: requestData,
}).then((res) => {
if (res) {
tableData.value=res.records || [];
}
});
}
onMounted(() => {
initSafe();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
color: #333; //
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
}
}
.right-options {
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: black;
}
}
}
.table-container {
.custom-table {
.el-table__cell {
color: #333; //
}
}
.view-button {
color: #3a89fe;
}
}
}
</style>

26
src/views/Main/Dike/index.vue

@ -52,19 +52,37 @@
:resCode="resCode"
></PestAnimalAnalysis>
</el-tab-pane>
<el-tab-pane label="安全鉴定" name="" lazy disabled> </el-tab-pane>
<el-tab-pane label="安全鉴定" name="6" lazy >
<safetyAppraisal
ref="safetyAppraisal"
:resCode="resCode"
/>
</el-tab-pane>
<el-tab-pane label="病险核查" name="" lazy disabled> </el-tab-pane>
<el-tab-pane label="防汛物资" name="" lazy disabled> </el-tab-pane>
<el-tab-pane label="档案管理" name="" lazy disabled> </el-tab-pane>
<el-tab-pane label="防汛物资" name="8" lazy >
<floodControlMaterials
ref="floodControlMaterials"
:resCode="resCode"
/>
</el-tab-pane>
<el-tab-pane label="档案管理" name="9" lazy >
<fileManagement
ref="fileManagement"
:resCode="resCode"
/>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, watch, onMounted } from "vue";
import floodControlMaterials from './components/floodControlMaterials.vue'
import fileManagement from './components/fileManagement.vue'
import BaseInfo from "./components/BaseInfo.vue";
import DataStatistics from "./components/DataStatistics.vue";
import MonitorWarning from "./components/MonitorWarning.vue";
import safetyAppraisal from "./components/safetyAppraisal.vue"
import StatisticsAnalysis from "./components/StatisticsAnalysis.vue";
import PestAnimalAnalysis from "./components/PestAnimalAnalysis.vue";
import { Close } from "@element-plus/icons-vue";
@ -82,7 +100,7 @@ const props = defineProps({
default: {},
},
});
const resCode = ref("");
const resCode = ref("HP0174406000000022");
defineOptions({
name: "ProjectDetail",
});

349
src/views/Main/Sluice/components/BaseInfo.vue

@ -180,18 +180,255 @@
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="水位过闸流量" name="3">
<el-descriptions
class="margin-top"
:column="2"
border
:labelStyle="{
'text-align': 'left',
width: '180px',
height: '50px',
}"
:contentStyle="{ minWidth: '350px' }"
>
<el-descriptions-item>
<template #label> 水闸名称 </template>
{{ form.wagaName }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 记录更新时间 </template>
{{ form.updateDate }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸上水位m </template>
{{ form.uswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸下水位m </template>
{{ form.dswl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 过闸总流量m/s </template>
{{ form.ttfl }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 备注 </template>
{{ form.note }}
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="工程特性" name="4">
<el-descriptions
class="margin-top"
:column="2"
border
:labelStyle="{
'text-align': 'left',
width: '180px',
height: '50px',
}"
:contentStyle="{ minWidth: '350px' }"
>
<el-descriptions-item>
<template #label> 枢纽组成简介 </template>
{{ form.hfBrf }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 运用原则 </template>
{{ form.opPr }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸基地质条件 </template>
{{ form.slbsglcn }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 地震基本烈度 </template>
{{ form.bsssin }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 设防地震烈度 </template>
{{ form.freqin }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 是否穿堤建筑物 </template>
{{ leStruFlagFormat(form.leStruFlag) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸上游堤顶高程 </template>
{{ form.gubTel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸下游堤顶高程 </template>
{{ form.gdbTel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸门全开需要时间 </template>
{{ form.gtfloptm }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 存在问题 </template>
{{ form.existQa }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 备注 </template>
{{ form.note }}
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="工程结构" name="5">
<el-descriptions
class="margin-top"
:column="2"
border
:labelStyle="{
'text-align': 'left',
width: '180px',
height: '50px',
}"
:contentStyle="{ minWidth: '350px' }"
>
<!-- <el-descriptions-item>-->
<!-- <template #label> 近闸边坡稳定性 </template>-->
<!-- {{ this.form.nrgtslst }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item>
<template #label> 水闸名称 </template>
{{ form.wagaName }}
</el-descriptions-item>
<!-- <el-descriptions-item>-->
<!-- <template #label> 闸室结构 </template>-->
<!-- {{ this.form.slwrst }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item>
<template #label> 启闭机型式 </template>
{{form.hseq }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 启闭机数量 </template>
{{ form.hsgram }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 记录更新时间 </template>
{{form.updateDate }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸室结构 </template>
{{ slwrstFormat(form.slwrst) }}
</el-descriptions-item>
<!-- <el-descriptions-item>-->
<!-- <template #label> 闸孔净高m </template>-->
<!-- {{ this.form.gthlnthg }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item>
<template #label> 闸孔净宽m </template>
{{ form.gthlntwd }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸孔数量 </template>
{{ form.gaorNum }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 副闸闸孔数量 </template>
{{ form.agaorNum }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 副闸闸孔总净宽m </template>
{{ form.agthlntwd }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 高程系统 </template>
{{ gcxtFormat(form.elevSys) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 高程转换值 </template>
{{ form.elevSysConver }}
</el-descriptions-item>
<el-descriptions-item>
<template #label>启闭机型式 </template>
{{ machineFormFormat(form.hseq) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 启闭机数量 </template>
{{ form.hsgram }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸门顶高程m </template>
{{ form.gttpel }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 消能型式 </template>
{{ endsstFormat(form.endsst) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 闸门型式 </template>
{{ gtstFormat(form.gtst) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 备注 </template>
{{ form.note }}
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="出险记录" name="6">
<el-descriptions
class="margin-top"
:column="2"
border
:labelStyle="{
'text-align': 'left',
width: '180px',
height: '50px',
}"
:contentStyle="{ minWidth: '350px' }"
>
<el-descriptions-item>
<template #label> 水闸名称 </template>
{{ form.wagaName }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 记录更新时间 </template>
{{ form.updateDate }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 险情描述 </template>
{{ form.dnstov }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 出险时间 </template>
{{ form.dntm }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 水闸险情类别 </template>
{{ dnstgrFormat(form.wagaDnstgr) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label> 备注 </template>
{{ form.note }}
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from "vue";
import { getJbxx, listSwtz } from "@/api/sluice";
import {getJbxx, listCxjl, listGcjg, listGctx, listSwtz, listXlnl} from "@/api/sluice";
import { getDictLabel } from "@/utils/dictUtils";
const props = defineProps({
resCode: {
type: String,
default: "",
default: "HP0074405150000010",
},
projTypeOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
@ -209,10 +446,40 @@ const props = defineProps({
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
mainOptions:{
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
gcxtOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
slwrstOptions:{
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
endsstOptions:{
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
leStruFlagOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
gtstOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
seismicOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
dnstgrOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
},
departmentOptions: {
type: Array<{ dictLabel: string; dictValue: string }>,
default: [],
@ -223,6 +490,10 @@ const activeName: any = ref("1");
let typeApi: any = {
["1"]: initBaseAndRsppInfo,
["2"]: initBaseAndRsppInfo,
["3"]: initXlnl,
["4"]:initGctx,
["5"]:initGcjg,
["6"]:initCxjl,
};
const form: any = ref({});
const emits = defineEmits(["getResInfo"]);
@ -242,7 +513,57 @@ function initRsppInfo() {
pageNum: 1,
pageSize: 10,
data: {
wagaId: props.resCode,
wagaCode: props.resCode,
},
}).then((res) => {
if (res?.records) {
Object.assign(form.value, res.records[0] || {});
}
});
}function initXlnl() {
listXlnl({
pageNum: 1,
pageSize: 10,
data: {
wagaCode: props.resCode,
},
}).then((res) => {
if (res?.records) {
Object.assign(form.value, res.records[0] || {});
}
});
}function initGctx() {
listGctx({
pageNum: 1,
pageSize: 10,
data: {
wagaCode: props.resCode,
},
}).then((res) => {
if (res?.records) {
Object.assign(form.value, res.records[0] || {});
}
});
}
function initGcjg() {
listGcjg({
pageNum: 1,
pageSize: 10,
data: {
wagaCode: props.resCode,
},
}).then((res) => {
if (res?.records) {
Object.assign(form.value, res.records[0] || {});
}
});
}
function initCxjl() {
listCxjl({
pageNum: 1,
pageSize: 10,
data: {
wagaCode: props.resCode,
},
}).then((res) => {
if (res?.records) {
@ -275,9 +596,31 @@ function gradeFormat(key: string) {
function scaleFormat(key: string) {
return getDictLabel(props.scaleOptions, key);
}
function dnstgrFormat(key: string) {
return getDictLabel(props.dnstgrOptions, key);
}
function machineFormFormat(key: string) {
return getDictLabel(props.mainOptions, key);
}
function buildingLevelFormat(key: string) {
return getDictLabel(props.buildingLevelOptions, key);
}
function endsstFormat(key: string) {
return getDictLabel(props.endsstOptions, key);
}
function slwrstFormat(key:string){
return getDictLabel(props.slwrstOptions,key)
}
function gcxtFormat(key:string){
return getDictLabel(props.gcxtOptions,key)
}
function leStruFlagFormat(key: string) {
return getDictLabel(props.leStruFlagOptions, key);
}
function gtstFormat(key: string) {
return getDictLabel(props.leStruFlagOptions, key);
}
function seismicFormat(key: string) {
return getDictLabel(props.seismicOptions, key);
}

242
src/views/Main/Sluice/components/fileManagement.vue

@ -0,0 +1,242 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<div class="search-item">
<span class="option-label">档案类型</span>
<el-select
v-model="selectedFileType"
placeholder="请选择档案类型"
clearable
style="width: 200px;"
>
<el-option
v-for="item in scaleOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</div>
</div>
<div class="right-options">
<el-button type="primary" class="add-button" @click="handleSearch">查询</el-button>
<el-button class="reset-button" @click="handleReset">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black">
<el-table-column type="index" label="序号" width="120" align="center" />
<el-table-column prop="regulationsAttachment" label="档案类型" width="180" align="center" >
<template #default="{ row }">
{{projTypeFormat(row.regulationsAttachment)}}
</template>
</el-table-column>
<el-table-column prop="planAttachment" label="档案附件" align="center">
<template #default="{ row }">
<div
v-for="(item, index) in parseAttachments(row.planAttachment)"
:key="index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(item, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue';
import type { PropType } from 'vue';
import {listDaglsz} from "~/api/sluice";
import {getDicts} from "~/api/common";
import {getDictLabel} from "~/utils/dictUtils";
// import {getFileStream} from "~/api/common"; //
interface FileItem {
fileName: string;
name: string;
[key: string]: any;
}
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '',
},
});
//
const selectedFileType = ref('');
const scaleOptions = ref([]);
function getType() {
getDicts("file_data_type").then((res) => {
scaleOptions.value = res || [];
});
}
// Data for the table
const tableData = ref([]);
// Search parameters
const searchDate = ref([]);
// View function
// const handleView = (row: any) => {
// console.log('View row:', row);
// };
//
const handleSearch = () => {
initDagl();
};
//
const handleReset = () => {
selectedFileType.value = '';
initDagl();
};
function projTypeFormat(key: string) {
console.log(scaleOptions.value, 11111111);
return getDictLabel(scaleOptions.value, key);
}
function downloadFile(item: string, index: number): void {
const file = JSON.parse(item)[index];
handlePreview(file);
}
function parseAttachments(attachment: string): FileItem[] {
if (!attachment) return [];
try {
return JSON.parse(attachment);
} catch (error) {
console.error('Error parsing attachments:', error);
return [];
}
}
function handlePreview(file: { fileName: string; name: string }): void {
// getFileStream({ fileName: file.fileName }).then((res) => {
// const blob = new Blob([res], {
// type: "application/xlsx",
// });
// const href = URL.createObjectURL(blob);
// const a = document.createElement("a");
// a.style.display = "none";
// a.href = href;
// a.download = file.name;
// a.click();
// URL.revokeObjectURL(a.href);
// });
}
// Fetch data based on resCode changes
watch(
() => props.resCode,
(newVal) => {
if (newVal) {
fetchSafetyData();
}
},
{ immediate: true }
);
// Fetch safety appraisal data
const fetchSafetyData = async () => {
};
function initDagl() {
//
const requestData: any = {
wagaCode: props.resCode,
};
//
if (selectedFileType.value) {
requestData.regulationsAttachment = selectedFileType.value;
}
listDaglsz({
page: 1,
pageSize: 10,
data: requestData,
}).then((res) => {
if (res) {
tableData.value = res.records || [];
}
}).catch(error => {
console.error("API error:", error);
});
}
onMounted(() => {
getType();
initDagl();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
.search-item {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
white-space: nowrap;
}
}
}
.right-options {
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: white;
}
}
}
.table-container {
.view-button {
color: #3a89fe;
}
}
}
</style>

286
src/views/Main/Sluice/components/floodControlMaterials.vue

@ -0,0 +1,286 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<div class="search-item">
<span class="option-label">采购时间</span>
<el-date-picker
v-model="dateRange"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 240px"
/>
</div>
<div class="search-item">
<span class="option-label">物资名称</span>
<el-input
v-model="materialName"
placeholder="请输入物资名称"
style="width: 200px"
/>
</div>
<div class="search-item">
<span class="option-label">负责人姓名</span>
<el-input
v-model="responsiblePerson"
placeholder="请输入负责人姓名"
style="width: 200px"
/>
</div>
</div>
<div class="right-options">
<el-button type="primary" class="add-button" @click="handleSearch">查询</el-button>
<el-button class="reset-button" @click="handleReset">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black">
<el-table-column type="index" label="序号" width="120" align="center" />
<el-table-column prop="materialName" label="物资名称" width="180" align="center" />
<el-table-column prop="materialNumber" label="物资数量" align="center" />
<el-table-column prop="materialType" label="物资类型" align="center" />
<el-table-column prop="purchaseTime" label="采购时间" align="center" />
<el-table-column prop="responsiblePerson" label="负责人" align="center" />
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 查看详情对话框 -->
<el-dialog
v-model="dialogVisible"
title="物资详情"
width="50%"
:before-close="handleDialogClose"
>
<div class="detail-container">
<div class="detail-item">
<span class="detail-label">物资名称</span>
<span class="detail-value">{{ currentRow.materialName || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">物资数量</span>
<span class="detail-value">{{ currentRow.materialNumber || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">物资类型</span>
<span class="detail-value">{{ currentRow.materialType || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">采购时间</span>
<span class="detail-value">{{ currentRow.purchaseTime || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">负责人</span>
<span class="detail-value">{{ currentRow.responsiblePerson || '--' }}</span>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch, reactive } from 'vue';
import type { PropType } from 'vue';
import {listFzwz} from "~/api/sluice";
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '',
},
});
// Data for the table
const tableData = ref([]);
// Search parameters
const dateRange = ref([]);
const materialName = ref('');
const responsiblePerson = ref('');
// Dialog visibility
const dialogVisible = ref(false);
// Current row being viewed
const currentRow = reactive({
materialName: '',
materialNumber: '',
materialType: '',
purchaseTime: '',
responsiblePerson: ''
});
// View function
const handleView = (row: any) => {
console.log('View row:', row);
// Copy row data to currentRow
currentRow.materialName = row.materialName || '';
currentRow.materialNumber = row.materialNumber || '';
currentRow.materialType = row.materialType || '';
currentRow.purchaseTime = row.purchaseTime || '';
currentRow.responsiblePerson = row.responsiblePerson || '';
// Show dialog
dialogVisible.value = true;
};
// Handle dialog close
const handleDialogClose = () => {
dialogVisible.value = false;
};
// Search function
const handleSearch = () => {
initFxwz();
};
// Reset function
const handleReset = () => {
dateRange.value = [];
materialName.value = '';
responsiblePerson.value = '';
initFxwz();
};
// Fetch data based on resCode changes
watch(
() => props.resCode,
(newVal) => {
if (newVal) {
initFxwz();
}
},
{ immediate: true }
);
function initFxwz() {
// Prepare request data
const requestData: any = {
wagaCode: props.resCode,
};
// Add search parameters if they exist
if (materialName.value) {
requestData.materialName = materialName.value;
}
if (responsiblePerson.value) {
requestData.responsiblePerson = responsiblePerson.value;
}
// Add date range if selected
if (dateRange.value && dateRange.value.length === 2) {
requestData.startTime = dateRange.value[0];
requestData.endTime = dateRange.value[1];
}
listFzwz({
page: 1,
pageSize: 10,
data: requestData,
}).then((res) => {
if (res) {
tableData.value = res.records || [];
}
}).catch(error => {
console.error("API error:", error);
});
}
onMounted(() => {
initFxwz();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 15px;
.search-item {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
white-space: nowrap;
}
}
}
.right-options {
display: flex;
align-items: center;
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: white;
}
}
}
.table-container {
.view-button {
color: #3a89fe;
}
}
}
/* 详情对话框样式 */
.detail-container {
padding: 10px;
.detail-item {
margin-bottom: 15px;
display: flex;
.detail-label {
width: 100px;
font-weight: 500;
color: #606266;
}
.detail-value {
flex: 1;
color: #333;
}
}
}
.dialog-footer {
text-align: right;
margin-top: 20px;
}
</style>

230
src/views/Main/Sluice/components/safetyAppraisal.vue

@ -0,0 +1,230 @@
<template>
<div class="safety-appraisal-container">
<div class="top-options">
<div class="left-options">
<span class="option-label">安全评定时间</span>
<el-date-picker
v-model="identifyTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期"
@change="initSafe"
style="color: black"
/>
</div>
<div class="right-options">
<el-button class="reset-button" @click="resetFilter">重置</el-button>
</div>
</div>
<div class="table-container">
<el-table :data="tableData" border style="width: 100%;color: black" class="custom-table">
<el-table-column type="index" label="序号" width="120" align="center"/>
<el-table-column prop="identifyTime" label="安全评定时间" width="180" align="center" />
<el-table-column prop="safetyEvaluationUnit" label="安全评的单位" align="center" />
<el-table-column prop="unitQualification" label="评价单位资质" align="center" />
<el-table-column prop="mainIssues" label="安全评价结论" align="center" />
<el-table-column label="操作" align="center" width="120">
<template #default="scope">
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 查看详情对话框 -->
<el-dialog
v-model="dialogVisible"
title="安全评定详情"
width="50%"
:before-close="handleDialogClose"
>
<div class="detail-container">
<div class="detail-item">
<span class="detail-label">安全评定时间</span>
<span class="detail-value">{{ currentRow.identifyTime || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">安全评的单位</span>
<span class="detail-value">{{ currentRow.safetyEvaluationUnit || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">评价单位资质</span>
<span class="detail-value">{{ currentRow.unitQualification || '--' }}</span>
</div>
<div class="detail-item">
<span class="detail-label">安全评价结论</span>
<span class="detail-value">{{ currentRow.mainIssues || '--' }}</span>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive } from 'vue';
import type { PropType } from 'vue';
import { listAqjd } from "~/api/sluice";
import { isDate } from "lodash-es";
const props = defineProps({
resCode: {
type: String as PropType<string>,
default: '1900034196855689218',
}
});
// Use null as default, so we don't send an empty string
const identifyTime = ref(null);
// Data for the table
const tableData = ref([]);
// Dialog visibility
const dialogVisible = ref(false);
// Current row being viewed
const currentRow = reactive({
identifyTime: '',
safetyEvaluationUnit: '',
unitQualification: '',
mainIssues: ''
});
// View function
const handleView = (row: any) => {
console.log('View row:', row);
// Copy row data to currentRow
currentRow.identifyTime = row.identifyTime || '';
currentRow.safetyEvaluationUnit = row.safetyEvaluationUnit || '';
currentRow.unitQualification = row.unitQualification || '';
currentRow.mainIssues = row.mainIssues || '';
// Show dialog
dialogVisible.value = true;
};
// Handle dialog close
const handleDialogClose = () => {
dialogVisible.value = false;
};
// Reset filter function
const resetFilter = () => {
identifyTime.value = null;
initSafe();
};
function initSafe() {
console.log("Selected date:", identifyTime.value);
// Build request data object
const requestData: any = {
szrwId: props.resCode
};
// Only add identifyTime if it has a value
if (identifyTime.value) {
requestData.identifyTime = identifyTime.value;
}
console.log("Request data:", requestData);
listAqjd({
page: 1,
pageSize: 10,
data: requestData,
}).then((res) => {
if (res) {
tableData.value = res.records || [];
}
}).catch(error => {
console.error("API error:", error);
});
}
onMounted(() => {
initSafe();
});
</script>
<style scoped lang="scss">
.safety-appraisal-container {
padding: 16px;
height: 100%;
color: #333; //
.top-options {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.left-options {
display: flex;
align-items: center;
.option-label {
margin-right: 8px;
}
}
.right-options {
.add-button {
background-color: #4cd964;
border-color: #4cd964;
margin-right: 8px;
}
.reset-button {
background-color: #666;
border-color: #666;
color: black;
}
}
}
.table-container {
.custom-table {
.el-table__cell {
color: #333; //
}
}
.view-button {
color: #3a89fe;
}
}
}
/* 详情对话框样式 */
.detail-container {
padding: 10px;
.detail-item {
margin-bottom: 15px;
display: flex;
.detail-label {
width: 120px;
font-weight: 500;
color: #606266;
}
.detail-value {
flex: 1;
color: #333;
}
}
}
.dialog-footer {
text-align: right;
margin-top: 20px;
}
</style>

24
src/views/Main/Sluice/index.vue

@ -53,10 +53,25 @@
</el-tab-pane>
<el-tab-pane label="巡查养护" name="7" disabled lazy> </el-tab-pane>
<el-tab-pane label="动物防治" name="8" disabled lazy> </el-tab-pane>
<el-tab-pane label="安全鉴定" name="9" disabled lazy> </el-tab-pane>
<el-tab-pane label="安全鉴定" name="9" lazy>
<safetyAppraisal
ref="safetyAppraisal"
:resCode="resCode"
/>
</el-tab-pane>
<el-tab-pane label="病险核查" name="10" disabled lazy> </el-tab-pane>
<el-tab-pane label="防汛物资" name="11" disabled lazy> </el-tab-pane>
<el-tab-pane label="档案管理" name="12" disabled lazy> </el-tab-pane>
<el-tab-pane label="防汛物资" name="11" lazy>
<floodControlMaterials
ref="floodControlMaterials"
:resCode="resCode"
/>
</el-tab-pane>
<el-tab-pane label="档案管理" name="12" lazy>
<fileManagement
ref="fileManagement"
:resCode="resCode"
/>
</el-tab-pane>
</el-tabs>
</div>
</div>
@ -67,6 +82,9 @@ import BaseInfo from "./components/BaseInfo.vue";
import DataStatistics from "./components/DataStatistics.vue";
import MonitorWarning from "./components/MonitorWarning.vue";
import StatisticsAnalysis from "./components/StatisticsAnalysis.vue";
import safetyAppraisal from './components/safetyAppraisal.vue'
import floodControlMaterials from './components/floodControlMaterials.vue'
import fileManagement from './components/fileManagement.vue'
// import VideoAnalysis from "./components/VideoAnalysis.vue";
import { Close } from "@element-plus/icons-vue";
import SB from "@/assets/map/sluice_big.png";

Loading…
Cancel
Save