mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-03 10:20:25 +08:00
管理界面设置和用户界面设置可以修改时区
This commit is contained in:
@@ -78,6 +78,29 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4>其他</h4>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">时区</td>
|
||||
<td>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" v-model="timeZoneGroupCode">
|
||||
<option v-for="timeZoneGroup in timeZoneGroups" :value="timeZoneGroup.code">{{timeZoneGroup.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" name="timeZone" v-model="config.timeZone">
|
||||
<option v-for="timeZoneLocation in timeZoneLocations" :value="timeZoneLocation.name" v-if="timeZoneLocation.group == timeZoneGroupCode">{{timeZoneLocation.name}} ({{timeZoneLocation.offset}})</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="comment">显示时间使用的时区。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p class="comment">修改后,在3分钟内生效。</p>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user