管理界面设置和用户界面设置可以修改时区

This commit is contained in:
刘祥超
2022-03-26 10:23:03 +08:00
parent 68f0b2efc3
commit 4699d1c2ee
7 changed files with 152 additions and 1 deletions

View File

@@ -1,3 +1,36 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
// 时区
this.timeZoneGroupCode = "asia"
if (this.timeZoneLocation != null) {
this.timeZoneGroupCode = this.timeZoneLocation.group
}
let oldTimeZoneGroupCode = this.timeZoneGroupCode
let oldTimeZoneName = ""
if (this.timeZoneLocation != null) {
oldTimeZoneName = this.timeZoneLocation.name
}
this.$delay(function () {
this.$watch("timeZoneGroupCode", function (groupCode) {
if (groupCode == oldTimeZoneGroupCode && oldTimeZoneName.length > 0) {
this.config.timeZone = oldTimeZoneName
return
}
let firstLocation = null
this.timeZoneLocations.forEach(function (v) {
if (firstLocation != null) {
return
}
if (v.group == groupCode) {
firstLocation = v
}
})
if (firstLocation != null) {
this.config.timeZone = firstLocation.name
}
})
})
})