This commit is contained in:
2025-12-17 16:29:55 +08:00
parent d4c28a74e0
commit 2268a1aadb
5 changed files with 56 additions and 44 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

Binary file not shown.

View File

@ -109,7 +109,7 @@
class="input height custom-number-input with-arrows arrows2" class="input height custom-number-input with-arrows arrows2"
type="number" type="number"
:min="0.1" :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 == '播放')
@ -403,7 +407,7 @@ var decrementValue = () => {
watch( watch(
() => weatherData.speed, () => weatherData.speed,
(newValue) => { (newValue) => {
if (newValue < 0 || newValue == 0) { if (newValue < 0 || newValue == 0 || newValue > 9999) {
return return
} }
if (!currWeatherData) { if (!currWeatherData) {
@ -416,11 +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 = () => {
let val = 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 = 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()
@ -549,7 +555,11 @@ var changDarkness = () => {
sunshine && (sunshine.darkness = 1 - weatherData.darkness) sunshine && (sunshine.darkness = 1 - weatherData.darkness)
} }
var changSpeed = () => { var changSpeed = () => {
weatherData.speed = weatherData.speed < 0 || weatherData.speed == 0 ? 0.1 : weatherData.speed 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

@ -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
} // }
] // ]
} }
} }
//光照 //光照
@ -191,11 +191,11 @@ var clickFun = (childData) => {
//天气效果 //天气效果
// 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: '您没有该功能的权限',

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) {