本地接口对接

This commit is contained in:
王兴凯 2026-05-28 08:36:32 +08:00
parent a43b35b5a8
commit 17e688e8ef
15 changed files with 1506 additions and 233 deletions

View File

@ -1,7 +1,7 @@
import request from '@/utils/request';
export function getKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/alongList/qgc/GetKendoListCust',
url: '/wt/alongList/qgc/GetKendoListCust',
method: 'post',
data
});
@ -9,7 +9,7 @@ export function getKendoListCust(data: any) {
//获取水温下拉框
export function wbsbGetKendoList(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/wbsb/GetKendoList',
url: '/wt/wbsb/GetKendoList',
method: 'post',
data
});
@ -21,7 +21,7 @@ export function wbsbGetKendoList(data: any) {
*/
export function getChuiXiangShuiWenTreeStcd(data: any) {
return request({
url: '/api/wmp-env-server/base/sdrvwts/default/treeStcd',
url: '/wt/sdrvwts/default/treeStcd',
method: 'post',
data,
});
@ -34,7 +34,7 @@ export function getChuiXiangShuiWenTreeStcd(data: any) {
*/
export function getCxswList(data: any) {
return request({
url: '/api/wmp-env-server/sw/dzCxList/GetKendoListCust',
url: '/wt/dzCxList/GetKendoListCust',
method: 'post',
data
});
@ -42,7 +42,7 @@ export function getCxswList(data: any) {
//获取出入库水温下拉选则树
export function getVmsstbprpt(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
url: '/wt/vmsstbprpt/GetKendoList',
method: 'post',
data
});
@ -51,7 +51,7 @@ export function getVmsstbprpt(data: any) {
//
export function inOutOneGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/inOutOne/GetKendoListCust',
url: '/wt/inOutOne/GetKendoListCust',
method: 'post',
data
});
@ -59,7 +59,7 @@ export function inOutOneGetKendoListCust(data: any) {
//水温监测工作开展情况
export function baseEvnmAutoMonitorGetKendoListCust(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/evnmAutoMonitor/GetKendoListCust',
url: '/wt/evnmAutoMonitor/GetKendoListCust',
method: 'post',
data
});
@ -67,7 +67,7 @@ export function baseEvnmAutoMonitorGetKendoListCust(data: any) {
////水温监测工作开展情况弹框
export function vmsstbprptGetKendoList(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
url: '/wt/vmsstbprpt/GetKendoList',
method: 'post',
data
});
@ -75,7 +75,7 @@ export function vmsstbprptGetKendoList(data: any) {
//出入库水温打开弹框api/wmp-env-server/sw/inOutOne/details
export function inOutOneDetails(data: any) {
return request({
url: '/api/wmp-env-server/sw/inOutOne/details',
url: '/wt/inOutOne/details',
method: 'post',
data
});
@ -83,7 +83,7 @@ export function inOutOneDetails(data: any) {
//鱼类适宜性分析 - select
export function infoGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/wtrv/fish/info/GetKendoListCust',
url: '/wt/wtrv/fish/info/GetKendoListCust',
method: 'post',
data
});
@ -91,7 +91,7 @@ export function infoGetKendoListCust(data: any) {
//鱼类适宜性分析-图表和table
export function fishGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/wtrv/fish/GetKendoListCust',
url: '/wt/wtrv/fish/GetKendoListCust',
method: 'post',
data
});
@ -99,7 +99,7 @@ export function fishGetKendoListCust(data: any) {
//月平均水温历史对比
export function avgMonGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/monthList/avgMon/GetKendoListCust',
url: '/wt/monthList/avgMon/GetKendoListCust',
method: 'post',
data
});
@ -107,7 +107,7 @@ export function avgMonGetKendoListCust(data: any) {
//水温年内分布
export function yearListGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/yearList/GetKendoListCust',
url: '/wt/yearList/GetKendoListCust',
method: 'post',
data
});
@ -115,7 +115,7 @@ export function yearListGetKendoListCust(data: any) {
//设施类型介绍
export function sttpbGetKendoList(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/sttpb/GetKendoList',
url: '/wt/sttpb/GetKendoList',
method: 'post',
data
});
@ -123,7 +123,7 @@ export function sttpbGetKendoList(data: any) {
//设施类型及接入情况
export function dwInfoGetKendoListCust(data: any) {
return request({
url: '/api/dec-lygk-base-server/base/dwInfo/GetKendoListCust',
url: '/wt/dwInfo/GetKendoListCust',
method: 'post',
data
});
@ -131,7 +131,7 @@ export function dwInfoGetKendoListCust(data: any) {
//月均水温对比,图表,表格 /api/wmp-env-server/sw/monthDetail/Det/GetKendoListCust
export function DetGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/monthDetail/Det/GetKendoListCust',
url: '/wt/monthDetail/Det/GetKendoListCust',
method: 'post',
data
});
@ -139,7 +139,7 @@ export function DetGetKendoListCust(data: any) {
//水温年内分布
export function yearDetailGetKendoListCust(data: any) {
return request({
url: '/api/wmp-env-server/sw/yearDetail/GetKendoListCust',
url: '/wt/yearDetail/GetKendoListCust',
method: 'post',
data
});
@ -147,7 +147,7 @@ export function yearDetailGetKendoListCust(data: any) {
//获取建设状态
export function dictgetRemoteDictValue(data: any) {
return request({
url: '/api/dec-modules-usm-springcloud-starter/usm/v1/dict/getRemoteDictValue',
url: '/wt/usm/v1/dict/getRemoteDictValue',
method: 'get',
params: data
});

View File

@ -42,7 +42,7 @@
</a-col>
</a-row>
<div v-if="isLogo">
<div v-if="isLogo" class="img_box_one">
<div class="img_box">
<div class="img_box_img">
<a-image style="width: 100%;" :src="baseUrl + '/?' + data2.msStbprpT.logo" />
@ -184,7 +184,7 @@ const getData = async () => {
if (res.success) {
let data = res.data
data2.value = data
// debugger
let columns = [];
columns = columnsConfig.value.find((item) => item.type == modelStore.params.sttp)
.columns;
@ -252,7 +252,7 @@ const getData = async () => {
} else {
isLogo.value = false
}
// debugger
}
}
@ -277,7 +277,10 @@ onMounted(() => {
overflow-y: auto;
display: flex;
justify-content: space-between;
.img_box_one{
width: 40%;
// height: 80%;
}
.img_box {
// width: 20%;
padding: 12px;

View File

@ -24,7 +24,16 @@
<div class="echarts" ref="chartRef"></div>
<div class="table">
<BasicTable ref="tableRef" :scrollY="460" :columns="columns" :list-url="fishGetKendoListCust"
:search-params="{}" :transform-data="customTransform" />
:search-params="{}" :transform-data="customTransform">
<!-- 同期对比列的自定义渲染 -->
<template #contrast="{ record }">
<span v-if="record.wt && record.beforeWt"
:style="{ color: (record.wt - record.beforeWt) > 0 ? 'rgb(255, 85, 0)' : 'rgb(135, 208, 104)' }">
{{ (record.wt - record.beforeWt) > 0 ? '+' : '' }}{{ (record.wt - record.beforeWt).toFixed(2) }}
</span>
<span v-else>-</span>
</template>
</BasicTable>
</div>
</div>
</div>
@ -65,14 +74,7 @@ const columns = [
title: '同期对比',
dataIndex: 'contrast',
width: 120,
customRender: ({ record }: any) => {
if (record.wt && record.beforeWt) {
const diff = (record.wt - record.beforeWt).toFixed(2);
const diffNum = record.wt - record.beforeWt;
return (diffNum > 0) ? `+${diff}` : diff;
}
return '-';
}
slots: { customRender: 'contrast' }
},
{
title: '适宜产卵鱼',
@ -146,7 +148,8 @@ const getSelectOption = async () => {
pretemp: item.pretemp,
}
})
selectValue.value = data.map(item => item.id)
// ID2221
selectValue.value = data.length >= 2 ? data.slice(0, 2).map(item => item.id) : (data.length > 0 ? [data[0].id] : [])
}
//echarts
const getEchartsData = async () => {
@ -240,9 +243,9 @@ const processChartData = (rawData: any[]) => {
// wt beforeWt null
const filtered = rawData.filter(item =>
item.wt !== null && item.wt !== undefined &&
item.beforeWt !== null && item.beforeWt !== undefined
item.wt !== null && item.wt !== undefined
);
// && item.beforeWt !== null && item.beforeWt !== undefined
// dt
return filtered.sort((a, b) =>
@ -430,7 +433,7 @@ const getChartOption = computed(() => {
show: false
},
axisLabel: {
interval: Math.ceil(xAxisData.length / 7),
interval: xAxisData.length > 7 ? Math.floor((xAxisData.length - 1) / 7) : 0,
fontSize: 12,
rotate: 0,
margin: 10

View File

@ -8,7 +8,8 @@
<div class="carousel-inner">
<div class="carousel-track" :style="trackStyle">
<div v-for="(item, index) in originalMediaData" :key="index" class="carousel-item">
<img :src="item.image" :alt="item.title" />
<a-image :src="item.url" />
<!-- <img :src="item.url" :alt="item.title" /> -->
</div>
</div>
</div>
@ -24,12 +25,14 @@
</div>
<div style="width: 100%;display: flex;justify-content: center;">
<div class="card_button">
<LeftOutlined @click="prevSlide" />
<LeftOutlined @click="prevSlide" :class="{ 'disabled': currentIndex === 0 }"
:style="{ cursor: currentIndex === 0 ? 'not-allowed' : 'pointer' }" />
<div class="pagination-dots">
<span v-for="(item, index) in originalMediaData" :key="index" class="dot-item"
:class="{ 'active': currentIndex === index }" @click="jumpToSlide(index)" />
</div>
<RightOutlined @click="nextSlide" />
<RightOutlined @click="nextSlide" :class="{ 'disabled': currentIndex === originalMediaData.length - 1 }"
:style="{ cursor: currentIndex === originalMediaData.length - 1 ? 'not-allowed' : 'pointer' }" />
</div>
</div>
</div>
@ -47,14 +50,15 @@ const props = defineProps<{
dataSource: Array<{
title: string;
description: string;
image: string;
url: string;
}>;
index:any
}>();
interface MediaItem {
title: string;
description: string;
image: string;
url: string;
}
const originalMediaData = ref<MediaItem[]>([]);
@ -66,11 +70,21 @@ const initOriginalData = () => {
originalMediaData.value = props.dataSource.map(item => ({
title: item.title,
description: item.description,
image: item.image
url: item.url
}));
}
};
// index prop
const setCurrentIndexFromProps = () => {
if (props.index !== undefined && props.index !== null && originalMediaData.value.length > 0) {
const validIndex = Math.max(0, Math.min(props.index, originalMediaData.value.length - 1));
currentIndex.value = validIndex;
} else {
currentIndex.value = 0;
}
};
// - React
const trackStyle = computed(() => {
return {
@ -104,16 +118,21 @@ const currentDescription = computed(() => {
//
onMounted(() => {
console.log('ArtsDetail mounted - props.index:', props.index, 'props.dataSource.length:', props.dataSource?.length);
initOriginalData();
setCurrentIndexFromProps();
console.log('After setCurrentIndexFromProps - currentIndex.value:', currentIndex.value);
});
// dataSource
// dataSource index
watch(
() => props.dataSource,
(newData) => {
if (newData && newData.length > 0) {
currentIndex.value = 0;
//
initOriginalData();
// 0 props.index
setCurrentIndexFromProps();
}
},
{ deep: true }
@ -255,14 +274,14 @@ watch(
color: #6c8cf7;
transition: all 0.3s;
&:hover:not([disabled]) {
&:hover:not(.disabled) {
color: #4a6fd4;
transform: scale(1.1);
}
&[disabled] {
&.disabled {
color: #d9d9d9;
cursor: not-allowed;
cursor: not-allowed !important;
}
}
}

View File

@ -644,8 +644,6 @@ const handleModalClose = () => {
* @param data - 包含moreSelect(下拉框值)和datetime(日期范围)的对象
*/
const handlePanelChange1 = (data: any) => {
// console.log(':', data);
// debugger
// TODO:
if (data.moreSelect) {
paramsOne.value.value = data.moreSelect;

View File

@ -34,7 +34,7 @@
<a-form-item>
<a-space>
<a-button type="primary" @click="handleSearch">查询</a-button>
<a-button type="primary" @click="handleSearchOne">查询</a-button>
</a-space>
</a-form-item>
</a-form>
@ -73,6 +73,7 @@ import { message } from 'ant-design-vue'
import BasicTable from '@/components/BasicTable/index.vue'
// import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent'
import { dictgetRemoteDictValue, dwInfoGetKendoListCust, vmsstbprptGetKendoList } from '@/api/sw'
import { getDictItemsByCode } from "@/api/dict";
import { useModelStore } from "@/store/modules/model";
const modelStore = useModelStore();
@ -166,7 +167,20 @@ const columns = [
title: '接入日期',
dataIndex: 'dtinTm',
key: 'dtinTm',
width: 120
width: 120,
customRender: ({ record }: any) => {
const date = record.dtinTm
if (!date) return '-'
// YYYY-MM-DD
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
return date
}
//
if (typeof date === 'string' && date.includes(' ')) {
return date.split(' ')[0]
}
return date
}
},
{
title: '建设状态',
@ -178,13 +192,39 @@ const columns = [
title: '开工日期',
dataIndex: 'ststdt',
key: 'ststdt',
width: 120
width: 120,
customRender: ({ record }: any) => {
const date = record.ststdt
if (!date) return '-'
// YYYY-MM-DD
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
return date
}
//
if (typeof date === 'string' && date.includes(' ')) {
return date.split(' ')[0]
}
return date
}
},
{
title: '建成日期',
dataIndex: 'jcdt',
key: 'jcdt',
width: 120
width: 120,
customRender: ({ record }: any) => {
const date = record.jcdt
if (!date) return '-'
// YYYY-MM-DD
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
return date
}
//
if (typeof date === 'string' && date.includes(' ')) {
return date.split(' ')[0]
}
return date
}
},
{
title: '所在河段',
@ -283,12 +323,13 @@ const fetchBuildStateList = async () => {
try {
buildStateLoading.value = true
// TODO: API
const res = await dictgetRemoteDictValue({ dictCode: 'BLDSTT3T' })
//getDictItemsByCode({ dictCode: "caoType" })
const res = await getDictItemsByCode({ dictCode: 'BLDSTT3T' })
buildStateList.value = res.data.map((item: any) => ({
label: item.dictMeaning,
value: item.dictValue
label: item.dictName,
value: item.itemCode
}))
buildStateList.value.push({ label: '全部', value: '' })
buildStateList.value.unshift({ label: '全部', value: '' })
// 使
// buildStateList.value = [
// { label: '', value: '' },
@ -306,8 +347,8 @@ const fetchBuildStateList = async () => {
//
const handleBaseChange = async () => {
formState.stnm = ''
await fetchFacilityStats()
handleSearch()
// await fetchFacilityStats()
// handleSearch()
}
// Tab
@ -318,7 +359,10 @@ const handleTabChange = (key: string) => {
handleSearch()
})
}
const handleSearchOne = async () => {
await fetchFacilityStats()
handleSearch()
}
//
const handleSearch = () => {
@ -339,7 +383,7 @@ const handleSearch = () => {
"field": "baseId",
"operator": "eq",
"dataType": "string",
"value": "01"
"value": formState.dataDimensionVal
} : null,
formState.hydrodtin ? {
"field": "dtin",
@ -429,8 +473,8 @@ const handleViewDetail = (record: any, type: string) => {
watch(
() => [formState.dataDimensionVal, formState.hydrodtin, formState.bldstt],
async () => {
await fetchFacilityStats()
handleSearch()
// await fetchFacilityStats()
// handleSearch()
}
)

View File

@ -38,7 +38,6 @@ const initText = () => {
getBaseWbsb(params).then((res) => {
console.log(res);
title_text.value = res.data.data[0].introduce;
// debugger
});
};
const title_text = ref("");

View File

@ -4,6 +4,9 @@
@update-values="handlePanelChange1">
<a-spin :spinning="loading" tip="加载中...">
<div v-show="!loading && showemit" class="water-temp-compare-chart" ref="chartRef"></div>
<div v-show="!loading && showemit" class="water_bottom" @click="handleChartZoomIn">
<ZoomInOutlined />图表放大展示
</div>
<div v-show="!loading && !showemit" class="water-temp-compare-chart">
<a-empty description="暂无数据" />
</div>
@ -11,24 +14,19 @@
</SidePanelItem>
<!-- 数据点详情弹框 -->
<a-modal
v-model:open="modalVisible"
:title="'月均水温对比'"
width="1536px"
:footer="null"
@cancel="handleModalClose"
>
<a-modal v-model:open="modalVisible" :title="'月均水温对比'" width="1536px" :footer="null" @cancel="handleModalClose">
<div v-if="modalData" class="modal-content">
<MonthlyAverage
:tm="modalData.date ? moment(modalData.date).format('YYYY-MM') + '-01 00:00:00' : moment().format('YYYY-MM') + '-01 23:59:59'"
:dataDimensionVal="modalData.baseid"
:rvcd='modalData.rvcd'
:stcd="modalData.stcd"
:jdList="jiDiList"
/>
:dataDimensionVal="modalData.baseid" :rvcd='modalData.rvcd' :stcd="modalData.stcd" :jdList="jiDiList" />
</div>
</a-modal>
<!-- 图表放大展示弹框 -->
<a-modal v-model:open="zoomModalVisible" title="月平均水温历史对比" width="1536px" :footer="null" @cancel="handleZoomModalClose">
<MonthlyAverageMaxModal v-model="searchParams" :visible="zoomModalVisible" />
</a-modal>
</template>
<script setup lang="ts">
@ -38,7 +36,11 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
import { wbsbGetKendoList, avgMonGetKendoListCust } from "@/api/sw";
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
import MonthlyAverage from './monthlyAverage.vue'
import MonthlyAverageMaxModal from './TwoLayers/monthlyAverageMaxModal.vue'
import moment from 'moment'
import {
ZoomInOutlined
} from '@ant-design/icons-vue';
defineOptions({
name: 'monthlyAvgWaterTemCompareHistory'
@ -47,7 +49,10 @@ defineOptions({
const JidiSelectEventStore = useJidiSelectEventStore();
const chartRef = ref<HTMLElement | null>(null)
let chartInstance: echarts.ECharts | null = null
const searchParams = ref({
selectValue: '',
dateValue: '' // string Dayjs
});
const unit = '°C'
const baseid: any = ref(null);
const loading = ref(false);
@ -58,6 +63,9 @@ const modalVisible = ref(false);
const modalData = ref<any>(null);
const stationName = ref('');
//
const zoomModalVisible = ref(false);
//
const jiDiList: any = ref([
{
@ -342,7 +350,6 @@ const getEchartsData = async () => {
let res = await avgMonGetKendoListCust(params)
console.log('接口返回数据:', res)
let data = res?.data?.data || res?.data || []
if (data.length === 0) {
showemit.value = false
return
@ -617,13 +624,27 @@ const handleModalClose = () => {
stationName.value = '';
};
// -
const handleChartZoomIn = () => {
zoomModalVisible.value = true;
};
// -
const handleZoomModalClose = () => {
zoomModalVisible.value = false;
};
//
const handlePanelChange1 = (data) => {
console.log('当前所有控件状态:', data);
//
if (data.moreSelect || data.datetime) {
select.value.value = data.moreSelect
datetimePicker.value.value = data.datetime
getEchartsData()
searchParams.value.selectValue = data.moreSelect
searchParams.value.dateValue = data.datetime
}
}
@ -664,8 +685,17 @@ onBeforeUnmount(() => {
align-items: center;
}
.water_bottom {
width: 100%;
display: flex;
justify-content: end;
align-items: center;
color: #2f6b96;
cursor: pointer;
}
:deep(.ant-spin-nested-loading) {
height: 260px !important;
height: 280px !important;
}
.modal-content {

View File

@ -794,11 +794,11 @@ defineExpose({
<style scoped lang="scss">
.monthly-average-container {
width: 100%;
padding: 16px;
/* padding: 16px; */
.search-form {
margin-bottom: 16px;
padding: 16px;
/* padding: 16px; */
background: #fff;
border-radius: 4px;
}
@ -808,7 +808,7 @@ defineExpose({
height: 600px;
background: #fff;
border-radius: 4px;
padding: 16px;
/* padding: 16px; */
box-sizing: border-box;
}
@ -816,7 +816,7 @@ defineExpose({
flex: 7;
background: #fff;
border-radius: 4px;
padding: 16px;
/* padding: 16px; */
box-sizing: border-box;
}

View File

@ -1,43 +1,45 @@
<!-- SidePanelItem.vue -->
<template>
<SidePanelItem title="设施类型介绍">
<a-spin :spinning="loading">
<div v-if="carouselData.length > 0" class="carousel-wrapper">
<a-carousel v-model:current="currentIndex" autoplay class="tech-carousel" :dot-style="{ bottom: '0px' }">
<!-- -->
<div v-for="(item, index) in carouselData" :key="index" class="carousel-item">
<div class="image-container" @click="handleItemClick(carouselData)">
<img :src="item.image" :alt="item.title" class="carousel-image" />
<div class="container" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
<!-- 跑马灯轨道容器 -->
<div class="carousel-track" :class="{ 'no-transition': isTransitioning }"
:style="{ transform: `translateX(-${currentIndex * 100}%)` }">
<!-- 遍历所有媒体项包含克隆项 -->
<div v-for="(item, index) in renderMediaData" :key="index" class="carousel-item"
@click="handleItemClick(originalMediaData)">
<!-- 图片 -->
<img v-if="item.url" :src="item.url" alt="" />
<!-- 说明文字随媒体项移动 -->
<!-- <div class="text">{{ item.text }}</div> -->
</div>
</div>
</a-carousel>
<!-- 文字描述区域 -->
<div v-if="carouselData[currentIndex]" class="description-container" @click="handleItemClick(carouselData)">
<p class="item-description">{{ carouselData[currentIndex].description }}</p>
</div>
</div>
<div v-else style="width: 100%;height: 300px;display: flex; align-items: center; justify-content: center;">
<a-empty description="暂无数据" />
</div>
</a-spin>
</SidePanelItem>
<!-- 面板指示器固定在底部右侧 -->
<div class="pagination-dots-fixed">
<span v-for="(dot, index) in originalMediaData" :key="index" class="dot"
:class="{ active: getCurrentRealIndex() === index }" @click="goToSlide(index)"></span>
</div>
</div>
<!-- 独立的文字说明区域随跑马灯切换而变化 -->
<div class="description-text" @click="handleItemClick(originalMediaData)">
{{ currentDescription }}
</div>
</SidePanelItem>
<!-- 设施详情弹框 -->
<a-modal
v-model:open="modalVisible"
:title="'设施类型介绍'"
width="1536px"
:footer="null"
>
<a-modal v-model:open="modalVisible" :title="'设施类型介绍'" width="1536px" :footer="null">
<!-- 你在这里编写弹框内容 -->
<div v-if="currentItem">
<ArtsDetail :dataSource='currentItem' />
<ArtsDetail :dataSource='currentItem' :index="getCurrentRealIndex()" />
</div>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { ref, onMounted, onUnmounted, computed } from 'vue';
import SidePanelItem from '@/components/SidePanelItem/index.vue';
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
import { sttpbGetKendoList } from "@/api/sw";
@ -46,21 +48,106 @@ defineOptions({
name: 'diwenshuijianhuansheshileixingzuchengjijieruqingkuang'
});
//
const currentIndex = ref(0);
//
interface MediaItem {
type: 'image' | 'video';
url: string;
text: string;
description: string;
}
//
const loading = ref(false);
// 3
const originalMediaData = ref<MediaItem[]>([
//
const carouselData = ref<any[]>([]);
]);
//
// [, ..., ]
const renderMediaData = ref<MediaItem[]>([]);
// renderMediaData
const currentIndex = ref(1); // 1
//
let timer: any = null;
//
const isHovering = ref(false);
// transition
const isTransitioning = ref(false);
//
const modalVisible = ref(false);
const currentItem = ref<any>(null);
//
const initRenderData = () => {
const length = originalMediaData.value.length;
if (length === 0) return;
renderMediaData.value = [
originalMediaData.value[length - 1], //
...originalMediaData.value, //
originalMediaData.value[0] //
];
};
//
const startAutoPlay = () => {
if (timer) clearInterval(timer);
timer = setInterval(() => {
if (!isHovering.value && !isTransitioning.value) {
nextSlide();
}
}, 4000);
};
//
const nextSlide = () => {
currentIndex.value++;
//
setTimeout(() => {
checkSeamlessJump();
}, 500); // transition
};
//
const checkSeamlessJump = () => {
const realLength = originalMediaData.value.length;
// = realLength + 1
if (currentIndex.value >= realLength + 1) {
// 1.
isTransitioning.value = true;
// 2. 1
currentIndex.value = 1;
// 3. DOM
requestAnimationFrame(() => {
requestAnimationFrame(() => {
isTransitioning.value = false;
});
});
}
};
//
const handleMouseEnter = () => {
isHovering.value = true;
};
//
const handleMouseLeave = () => {
isHovering.value = false;
};
//
const currentDescription = computed(() => {
const realIndex = getCurrentRealIndex();
return originalMediaData.value[realIndex]?.description || '';
});
const getListData = async () => {
loading.value = true;
try {
const params = {
"filter": {
@ -90,118 +177,156 @@ const getListData = async () => {
//
const baseUrl = import.meta.env.VITE_APP_PREVIEW_URL;
carouselData.value = data.map((item: any) => ({
title: item.sttpName,
originalMediaData.value = data.map((item: any) => ({
text: item.sttpName,
description: item.introduce,
image: item.logo ? `${baseUrl}/?${item.logo}` : ''
url: item.logo ? `${baseUrl}/?${item.logo}` : ''
}));
console.log(originalMediaData.value);
} catch (error) {
console.error('获取设施类型数据失败:', error);
carouselData.value = [];
originalMediaData.value = [];
} finally {
loading.value = false;
}
};
//
const handleItemClick = (item: any) => {
console.log('轮播图项目被点击:', item);
console.log('轮播图项目被点击:', item,getCurrentRealIndex());
currentItem.value = item;
modalVisible.value = true;
};
//
onMounted(() => {
//
getListData()
//
onMounted(async () => {
//
await getListData();
//
initRenderData();
//
startAutoPlay();
});
//
onUnmounted(() => {
if (timer) clearInterval(timer);
});
//
const getCurrentRealIndex = () => {
const realLength = originalMediaData.value.length;
let realIndex = currentIndex.value - 1; //
//
if (realIndex < 0) realIndex = realLength - 1;
if (realIndex >= realLength) realIndex = 0;
return realIndex;
};
//
const goToSlide = (targetIndex: number) => {
if (isTransitioning.value) return;
//
currentIndex.value = targetIndex + 1;
};
</script>
<style lang="scss" scoped>
.carousel-wrapper {
width: 414px;
:deep(.slick-slide) {
text-align: center;
height: 250px;
line-height: 160px;
background: #364d79;
overflow: hidden;
}
.image-container {
.container {
width: 100%;
height: 250px;
overflow: hidden;
cursor: pointer;
}
height: 228px;
// border: 1px solid #7fd6ff;
// border-radius: 5px;
position: relative;
overflow: hidden; //
.carousel-image {
//
.carousel-track {
display: flex; //
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform 0.5s ease-in-out; // 0.5
//
&.no-transition {
transition: none;
}
:deep() {
.ant-carousel .slick-dots li {
width: 5px !important;
height: 5px !important;
border-radius: 50% !important;
background-color: #888e95;
//
.carousel-item {
min-width: 100%; //
height: 100%;
position: relative;
flex-shrink: 0; //
cursor: pointer;
}
.ant-carousel .slick-dots li button {
width: 5px !important;
height: 5px !important;
border-radius: 50% !important;
background-color: #888e95;
}
.ant-carousel .slick-dots li.slick-active {
background-color: #005293 !important;
}
.ant-carousel .slick-dots li.slick-active button {
background-color: #005293 !important;
}
.ant-carousel .slick-dots li :hover {
width: 5px !important;
height: 5px !important;
border-radius: 50% !important;
background-color: #ffffffcc;
}
.ant-carousel .slick-dots li button :hover {
width: 5px !important;
height: 5px !important;
border-radius: 50% !important;
background-color: #ffffffcc;
}
}
.description-container {
height: 44px;
img,
video {
width: 100%;
margin-top: 6px;
height: 100%;
object-fit: cover; //
}
.text {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 22px;
line-height: 22px;
background: rgba(0, 0, 0, 0.1);
color: #fff;
padding-left: 10px;
}
}
}
//
.pagination-dots-fixed {
position: absolute;
bottom: 10px;
right: 10px;
display: flex;
gap: 6px;
z-index: 10; //
.dot {
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #D8D8D8;
cursor: pointer;
transition: background-color 0.3s ease;
&.active {
background-color: #005293;
}
&:hover {
opacity: 0.8;
}
}
}
}
//
.description-text {
// padding: 8px 12px;
font-size: 14px;
line-height: 1.5;
// min-height: 40px;
transition: all 0.3s ease;
margin-bottom: 20px;
cursor: pointer;
//
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-indent: 0em;
cursor: pointer;
}
}
:deep(.ant-spin-nested-loading) {
height: 300px !important;
word-break: break-word;
}
</style>

View File

@ -303,11 +303,12 @@ watch(
//
if (newDataDimensionVal !== oldDataDimensionVal && newDataDimensionVal) {
await fetchDmData()
}
//
handleSearch()
}
}
},
{ deep: true }
)
@ -370,10 +371,12 @@ defineExpose({
}
}
}
.text_hocer{
.text_hocer {
color: #2f6b98;
}
.text_hocer:hover{
.text_hocer:hover {
color: #40a9ff;
}
</style>

View File

@ -152,7 +152,7 @@ const getColorByCodeAndType = (_code: string[], _typeKey: string[]) => {
//
const handleChartClick = (params: any) => {
if (!params || !params.dataIndex) return
if (!params || !String(params.dataIndex)) return
//
const dataIndex = params.dataIndex
@ -269,7 +269,6 @@ const getselectData = async () => {
select.value.options = [...dataMapNameArr, ...otherArr]
// debugger
// if (baseid.value == 'all') {
// select.value.value = '008640202300001021'
// }
@ -286,7 +285,11 @@ const getselectData = async () => {
//
const getshuiwenList = async () => {
if (loading.value) return; //
if (!select.value.value) {
showemit.value = false
waterTempData.value = []
return;
}
loading.value = true;
const params = {
@ -387,7 +390,8 @@ const getChartOption = () => {
params.forEach((item: any) => {
result += `<div style="display: flex; align-items: center; margin: 4px 0;">`;
result += `<span style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: ${item.color}; margin-right: 8px;"></span>`;
result += `<span>${item.seriesName} ${item.value}${unit}</span>`;
const displayValue = item.value !== null && item.value !== undefined ? item.value : '-';
result += `<span>${item.seriesName} ${displayValue}${unit}</span>`;
result += `</div>`;
});
return result;
@ -556,11 +560,10 @@ const handleResize = () => {
onMounted(() => {
//
initChart()
//
if (select.value.value) {
getshuiwenList()
}
// if (select.value.value) {
// getshuiwenList()
// }
})
onBeforeUnmount(() => {
@ -577,6 +580,8 @@ const handlePanelChange1 = (data) => {
//
if (data.moreSelect || data.datetime) {
select.value.value = data.moreSelect
datetimePicker.value.value = data.datetime
// debugger
getshuiwenList()
}
}

View File

@ -51,7 +51,7 @@
<!-- 操作 -->
<template v-else-if="column.key === 'action'">
<a @click="handleViewDetail(record)" class="text_hocer" >查看详情</a>
<a @click="handleViewDetail(record)" class="text_hocer">查看详情</a>
</template>
</template>
</a-table>
@ -79,6 +79,7 @@ const pagination = ref({
current: 1,
pageSize: 20,
total: 0,
size: 'small',
showSizeChanger: true,
showQuickJumper: true,
showTotal: (total: number) => `${total}`,
@ -322,7 +323,6 @@ const fetchData = async () => {
//
let total = res.data.total
let records = res?.data?.data || res?.data
// debugger
// if (Array.isArray(res?.data?.data)) {
// records = res.data.data
// total = res.data.data.length
@ -539,10 +539,12 @@ onMounted(() => {
overflow: hidden;
}
}
.text_hocer{
.text_hocer {
color: #2f6b98;
}
.text_hocer:hover{
.text_hocer:hover {
color: #40a9ff;
}
</style>

View File

@ -410,7 +410,6 @@ const init = async () => {
//
const getSelectConfig = async () => {
loading.value = true;
try {
let obj: any = {}
if (baseid.value === 'all') {
@ -473,7 +472,6 @@ const getSelectConfig = async () => {
}
return { label: item.wbsName, value: item.wbsCode, baseId: objId, baseName: jiDiListMap[objId] }
})
// debugger
let dataMapNameArr: any = []
Object.keys(dataMapNameMap).forEach((item: any) => {