This commit is contained in:
zh
2025-12-17 18:10:49 +08:00
6 changed files with 121 additions and 91 deletions

View File

@ -1,7 +1,7 @@
server: server:
host: 127.0.0.1 host: 127.0.0.1
port: 8848 port: 8848
path: C:\Users\MSI\AppData\Roaming\dzsp_shijingjun_offline_Y_save path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
poi: poi:
global: global:
enabled: false enabled: false

View File

@ -88,8 +88,8 @@
class="input height custom-number-input with-arrows" class="input height custom-number-input with-arrows"
type="number" type="number"
step="0.1" step="0.1"
min="0" :min="0"
max="1" :max="1"
v-model="weatherData.darkness" v-model="weatherData.darkness"
@change="changDarkness" @change="changDarkness"
> >
@ -108,8 +108,8 @@
<el-input <el-input
class="input height custom-number-input with-arrows arrows2" class="input height custom-number-input with-arrows arrows2"
type="number" type="number"
min="-9999999" :min="0.1"
max="999999999" :max="9999"
v-model="weatherData.speed" v-model="weatherData.speed"
@change="changSpeed" @change="changSpeed"
size="small" size="small"
@ -264,16 +264,19 @@ onMounted(() => {
weatherData.softShadow = data.softShadow weatherData.softShadow = data.softShadow
weatherData.darkness = data.darkness weatherData.darkness = data.darkness
weatherData.speed = data.speed weatherData.speed = data.speed
data?.wearther.forEach((item, index) => { // data?.wearther.forEach((item, index) => {
list[index].status = item.status // list[index].status = item.status
}) // })
} }
// list = data.wearther // list = data.wearther
switchStatus.value = true switchStatus.value = true
sunshine = window.sunshine sunshine = window.sunshine
myData = formatTimeToBeijing() myData = formatTimeToBeijing()
} }
let wearther = JSON.parse(localStorage.getItem('weartherSetting'))
wearther?.forEach((item, index) => {
list[index].status = item.status
})
timeline && timeline.clear() timeline && timeline.clear()
timeline = new TimeLine(window.earth, weatherData.speed, switchStatus.value, myData, initCallback) timeline = new TimeLine(window.earth, weatherData.speed, switchStatus.value, myData, initCallback)
@ -302,10 +305,11 @@ onBeforeUnmount(() => {
darkness: weatherData.darkness, darkness: weatherData.darkness,
speed: weatherData.speed, speed: weatherData.speed,
time: weatherData.time, time: weatherData.time,
timeerTime: document.getElementById('currentTime').textContent, timeerTime: document.getElementById('currentTime').textContent
wearther: list // wearther: list
} }
localStorage.setItem('shineSetting', JSON.stringify(data)) localStorage.setItem('shineSetting', JSON.stringify(data))
localStorage.setItem('weartherSetting', JSON.stringify(list))
// sunshine && sunshine.remove() // sunshine && sunshine.remove()
timeline && timeline.clear() timeline && timeline.clear()
emit('isPause', document.getElementById('timePause').textContent == '播放') emit('isPause', document.getElementById('timePause').textContent == '播放')
@ -379,8 +383,11 @@ var getDateTimeString = () => {
watch( watch(
() => weatherData.darkness, () => weatherData.darkness,
(newValue) => { (newValue) => {
if (newValue < 0 || newValue > 1) {
return
}
if (sunshine) { if (sunshine) {
sunshine.darkness = newValue sunshine.darkness = 1 - newValue
} }
} }
) )
@ -400,6 +407,9 @@ var decrementValue = () => {
watch( watch(
() => weatherData.speed, () => weatherData.speed,
(newValue) => { (newValue) => {
if (newValue < 0 || newValue == 0 || newValue > 9999) {
return
}
if (!currWeatherData) { if (!currWeatherData) {
weatherData.currWeather = false weatherData.currWeather = false
} else { } else {
@ -410,10 +420,13 @@ watch(
} }
) )
var incrementValue2 = () => { var incrementValue2 = () => {
weatherData.speed = new Decimal(weatherData.speed).add(1).toNumber() let val = new Decimal(weatherData.speed).add(1).toNumber()
weatherData.speed = Math.min(val, 9999)
} }
var decrementValue2 = () => { var decrementValue2 = () => {
weatherData.speed = new Decimal(weatherData.speed).sub(1).toNumber() let val = new Decimal(weatherData.speed).sub(1).toNumber()
// weatherData.speed = val < 0 || val == 0 ? 0.1 : val
weatherData.speed = Math.max(val, 0.1)
} }
var getCurrentTime = () => { var getCurrentTime = () => {
const now = new Date() const now = new Date()
@ -461,7 +474,7 @@ var switchFunc = () => {
sunshine = window.sunshine sunshine = window.sunshine
sunshine.timeBar(document.getElementById('currentTime').textContent) sunshine.timeBar(document.getElementById('currentTime').textContent)
if (weatherData) { if (weatherData) {
sunshine.darkness = weatherData.darkness sunshine.darkness = 1 - weatherData.darkness
sunshine.speed = weatherData.speed sunshine.speed = weatherData.speed
sunshine.softShadow = weatherData.softShadow sunshine.softShadow = weatherData.softShadow
} }
@ -534,9 +547,19 @@ var clickTimeIcon = (item: any) => {
} }
var changDarkness = () => { var changDarkness = () => {
sunshine && (sunshine.darkness = weatherData.darkness) if (weatherData.darkness < 0) {
weatherData.darkness = 0
} else if (weatherData.darkness > 1) {
weatherData.darkness = 1
}
sunshine && (sunshine.darkness = 1 - weatherData.darkness)
} }
var changSpeed = () => { var changSpeed = () => {
if (weatherData.speed < 0 || weatherData.speed == 0) {
weatherData.speed = 0.1
} else if (weatherData.speed > 9999) {
weatherData.speed = 9999
}
weatherData.currWeather = false weatherData.currWeather = false
sunshine && (sunshine.speed = weatherData.speed) sunshine && (sunshine.speed = weatherData.speed)
timeline.setSpeed(weatherData.speed) timeline.setSpeed(weatherData.speed)

View File

@ -81,6 +81,7 @@ export default class TimeLine {
// }) // })
// } else { // } else {
that.pauseed = !that.pauseed; that.pauseed = !that.pauseed;
if (that.pauseed) {//暂停 if (that.pauseed) {//暂停
that.pausedTime = performance.now(); // 记录暂停时刻 that.pausedTime = performance.now(); // 记录暂停时刻
document.getElementById('timePause').textContent = '播放'; document.getElementById('timePause').textContent = '播放';
@ -88,7 +89,7 @@ export default class TimeLine {
that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false) that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false)
//判断当没有开启光照时,点击停止播放时关闭实时光照按钮 //判断当没有开启光照时,点击停止播放时关闭实时光照按钮
if (document.getElementById('weatherSwitch').style.color == 'rgba(var(--color-base1), 1)') { if (document.getElementById('weatherSwitch').style.color == 'rgba(var(--color-base1), 1)' || document.getElementById('weatherSwitch').style.color == 'rgb(255, 255, 255)') {
callback(false) callback(false)
} }
} else {//播放 } else {//播放

View File

@ -147,33 +147,33 @@ var clickFun = (childData) => {
darkness: 0.4, darkness: 0.4,
speed: 1, speed: 1,
time: formattedDate, time: formattedDate,
timeerTime: '00:00:00', timeerTime: '00:00:00'
wearther: [ // wearther: [
// 雨 // //
{ // {
name: '雨', // name: '雨',
svg: 'rain', // svg: 'rain',
status: false // status: false
}, // },
// 雪 // //
{ // {
name: '雪', // name: '雪',
svg: 'snow', // svg: 'snow',
status: false // status: false
}, // },
//雾 // //
{ // {
name: '雾', // name: '雾',
svg: 'fog', // svg: 'fog',
status: false // status: false
}, // },
//星空 // //星空
{ // {
name: '星空', // name: '星空',
svg: 'skystarry', // svg: 'skystarry',
status: false // status: false
} // }
] // ]
} }
} }
//光照 //光照
@ -186,22 +186,22 @@ var clickFun = (childData) => {
hour: data.currWeather ? new Date().toLocaleTimeString() : data.timeerTime hour: data.currWeather ? new Date().toLocaleTimeString() : data.timeerTime
}) })
window.sunshine = sunshine window.sunshine = sunshine
sunshine.darkness = data.darkness sunshine.darkness = 1 - data.darkness
sunshine.softShadow = data.softShadow sunshine.softShadow = data.softShadow
//天气效果 //天气效果
if ((window as any).checkAuthIsValid) { // if ((window as any).checkAuthIsValid) {
data.wearther.forEach((item) => { // data.wearther.forEach((item) => {
if (item.status) { // if (item.status) {
func[item.svg](item) // func[item.svg](item)
} // }
}) // })
} else { // } else {
// ElMessage({ // // ElMessage({
// message: '您没有该功能的权限', // // message: '您没有该功能的权限',
// type: 'warning' // // type: 'warning'
// }) // // })
} // }
} else if (weatherClickPop.value === false) { } else if (weatherClickPop.value === false) {
sunshine = new YJ.Global.efflect.Sunshine(window.earth, { sunshine = new YJ.Global.efflect.Sunshine(window.earth, {
id: 123, id: 123,

View File

@ -38,8 +38,8 @@
y2="-6.678619384765625" y2="-6.678619384765625"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
> >
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/> <stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/> <stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
</linearGradient> </linearGradient>
<linearGradient <linearGradient
id="linear_border_2442_491_0" id="linear_border_2442_491_0"
@ -49,8 +49,8 @@
y2="29.435516357421875" y2="29.435516357421875"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
> >
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/> <stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="var(--color-border1)"/> <stop offset="1" stop-color="var(--color-border1)" />
</linearGradient> </linearGradient>
<filter <filter
id="filter_2442_492" id="filter_2442_492"
@ -61,21 +61,21 @@
filterUnits="userSpaceOnUse" filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB" color-interpolation-filters="sRGB"
> >
<feFlood flood-opacity="0" result="feFloodId_2442_492"/> <feFlood flood-opacity="0" result="feFloodId_2442_492" />
<feColorMatrix <feColorMatrix
in="SourceAlpha" in="SourceAlpha"
type="matrix" type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha_2442_492" result="hardAlpha_2442_492"
/> />
<feOffset dx="0" dy="0"/> <feOffset dx="0" dy="0" />
<feGaussianBlur stdDeviation="2"/> <feGaussianBlur stdDeviation="2" />
<feComposite in2="hardAlpha_2442_492" operator="out"/> <feComposite in2="hardAlpha_2442_492" operator="out" />
<feColorMatrix <feColorMatrix
type="matrix" type="matrix"
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0" values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0"
/> />
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492"/> <feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492" />
<feBlend <feBlend
mode="normal" mode="normal"
in="SourceGraphic" in="SourceGraphic"
@ -132,8 +132,8 @@
y2="-131.6942138671875" y2="-131.6942138671875"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
> >
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/> <stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/> <stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
</linearGradient> </linearGradient>
<linearGradient <linearGradient
id="linear_border_2409_300_0" id="linear_border_2409_300_0"
@ -143,8 +143,8 @@
y2="580.431640625" y2="580.431640625"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
> >
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/> <stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="var(--color-border1)"/> <stop offset="1" stop-color="var(--color-border1)" />
</linearGradient> </linearGradient>
</defs> </defs>
</svg> </svg>
@ -196,7 +196,7 @@
size="small" size="small"
@click="searchPlace" @click="searchPlace"
:loading="loading" :loading="loading"
>{{ t('btn.search') }} >{{ t('btn.search') }}
</el-button> </el-button>
</div> </div>
<div id="selectorBox"> <div id="selectorBox">
@ -247,22 +247,22 @@
<script setup lang="ts"> <script setup lang="ts">
// @ts-nocheck // @ts-nocheck
import {debounce} from '@/utils' import { debounce } from '@/utils'
import {useI18n} from 'vue-i18n' import { useI18n } from 'vue-i18n'
import {useTree} from './hooks/tree' import { useTree } from './hooks/tree'
import AMapLoader from '@amap/amap-jsapi-loader' import AMapLoader from '@amap/amap-jsapi-loader'
import rightMenu from './components/rightMenu.vue' import rightMenu from './components/rightMenu.vue'
import {$changeComponentShow} from '@/utils/communication' import { $changeComponentShow } from '@/utils/communication'
import {ref, nextTick} from 'vue' import { ref, nextTick } from 'vue'
import {ElMessage} from 'element-plus' import { ElMessage } from 'element-plus'
import {bus} from '@/utils/bus' import { bus } from '@/utils/bus'
import {TreeApi} from '@/api/tree' import { TreeApi } from '@/api/tree'
import {PoiApi} from '@/api/poi' import { PoiApi } from '@/api/poi'
import {get} from 'jquery' import { get } from 'jquery'
const {initTree, rightMenuRef, initTreeCallBack} = useTree() const { initTree, rightMenuRef, initTreeCallBack } = useTree()
const {t} = useI18n() const { t } = useI18n()
const isShow = ref(false) const isShow = ref(false)
const select = ref('poi') const select = ref('poi')
const searchKey: any = ref('') const searchKey: any = ref('')
@ -372,8 +372,7 @@ var key =
(localStorage.getItem('AMapKey') && localStorage.getItem('AMapKey').split('|')[0]) || (localStorage.getItem('AMapKey') && localStorage.getItem('AMapKey').split('|')[0]) ||
'd88fcc689d1aa99866b2d0d83fd36677' 'd88fcc689d1aa99866b2d0d83fd36677'
var isOnline = false var isOnline = false
var loadAmp = (cb = () => { var loadAmp = (cb = () => {}) => {
}) => {
AMapLoader.reset() AMapLoader.reset()
AMapLoader.load({ AMapLoader.load({
key: key, // 申请好的Web端开发者Key首次调用 load 时必填 key: key, // 申请好的Web端开发者Key首次调用 load 时必填
@ -474,7 +473,7 @@ const searchPlace = debounce(function () {
let string = searchKey.value.trim() let string = searchKey.value.trim()
if (string) { if (string) {
// TreeApi.queryPOI({ name: string, pageNum: 1, pageSize: 1000 }).then((res) => { // TreeApi.queryPOI({ name: string, pageNum: 1, pageSize: 1000 }).then((res) => {
PoiApi.searchPoi({name: string, pageNum: 1, pageSize: 1000}).then((res) => { PoiApi.searchPoi({ name: string, pageNum: 1, pageSize: 1000 }).then((res) => {
console.log(res, 'resres') console.log(res, 'resres')
poiOptions.value = res.data poiOptions.value = res.data
if (poiOptions.value.length) { if (poiOptions.value.length) {
@ -527,7 +526,7 @@ const locationChange = () => {
// let sg84 = YJ.Global.CoordTransform.GCJ02ToWGS84(item.lng, item.lat); // let sg84 = YJ.Global.CoordTransform.GCJ02ToWGS84(item.lng, item.lat);
let params = { let params = {
id, id,
position: {lng: item.lng, lat: item.lat, alt: item.alt ? item.alt : 0}, position: { lng: item.lng, lat: item.lat, alt: item.alt ? item.alt : 0 },
billboard: { billboard: {
show: true, show: true,
image: 'http://localhost:' + availablePort.value + '/' + 'GEMarker1/A-ablu-blank.png', image: 'http://localhost:' + availablePort.value + '/' + 'GEMarker1/A-ablu-blank.png',
@ -659,10 +658,10 @@ defineExpose({
text-shadow: 0px 0px 9px var(--color-text-shadow); text-shadow: 0px 0px 9px var(--color-text-shadow);
font-weight: 700; font-weight: 700;
background: linear-gradient( background: linear-gradient(
90deg, 90deg,
rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.5) 55.55%, rgba(var(--color-base1), 0.5) 55.55%,
rgba(var(--color-base1), 0) 100% rgba(var(--color-base1), 0) 100%
); );
> svg { > svg {
@ -841,4 +840,9 @@ defineExpose({
.el-select-dropdown__loading { .el-select-dropdown__loading {
margin-top: -150px !important; margin-top: -150px !important;
} }
::v-deep .el-select-dropdown {
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%),
rgba(0, 0, 0, 0.6) !important;
border: 1px solid rgba(0, 255, 255, 0.5) !important;
}
</style> </style>

View File

@ -160,6 +160,8 @@ if (!localStorage.getItem('defaultLabelStyle')) {
let defaultLabelStyle = getdefaultLabelStyle(null) let defaultLabelStyle = getdefaultLabelStyle(null)
localStorage.setItem('defaultLabelStyle', JSON.stringify(defaultLabelStyle)) localStorage.setItem('defaultLabelStyle', JSON.stringify(defaultLabelStyle))
} }
//移除天气设置
localStorage.removeItem('weartherSetting')
eventBus.on('openDialog', async (sourceType: any, id: any) => { eventBus.on('openDialog', async (sourceType: any, id: any) => {
if (dynamicComponentRef.value && dynamicComponentRef.value.close) { if (dynamicComponentRef.value && dynamicComponentRef.value.close) {