Files
EdgeAdmin/web/views/@default/clusters/cluster/settings/index.js

35 lines
885 B
JavaScript
Raw Normal View History

2020-09-06 16:19:34 +08:00
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
2021-10-12 11:43:53 +08:00
this.timeZoneGroupCode = "asia"
if (this.timeZoneLocation != null) {
this.timeZoneGroupCode = this.timeZoneLocation.group
}
2021-10-12 11:49:26 +08:00
let oldTimeZoneGroupCode = this.timeZoneGroupCode
let oldTimeZoneName = ""
if (this.timeZoneLocation != null) {
oldTimeZoneName = this.timeZoneLocation.name
}
2021-10-12 11:43:53 +08:00
this.$delay(function () {
this.$watch("timeZoneGroupCode", function (groupCode) {
2021-10-12 11:49:26 +08:00
if (groupCode == oldTimeZoneGroupCode && oldTimeZoneName.length > 0) {
this.cluster.timeZone = oldTimeZoneName
return
}
2021-10-12 11:43:53 +08:00
let firstLocation = null
this.timeZoneLocations.forEach(function (v) {
if (firstLocation != null) {
return
}
if (v.group == groupCode) {
firstLocation = v
}
})
if (firstLocation != null) {
this.cluster.timeZone = firstLocation.name
}
})
})
2020-09-06 16:19:34 +08:00
})