CN-936 开发appearance页面:调整保存按钮位置;修改时区列表获取接口;
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
.appearance{
|
.appearance{
|
||||||
height: calc(100% - 100px);
|
height: 100%;
|
||||||
display:flex;
|
display:flex;
|
||||||
flex-direction:column;
|
flex-direction:column;
|
||||||
.appearance-form {
|
.appearance-form {
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
//width: 600px;
|
|
||||||
.el-input {
|
.el-input {
|
||||||
width:600px;
|
width:600px;
|
||||||
}
|
}
|
||||||
@@ -23,10 +22,10 @@
|
|||||||
.edit-appearance-base__footer {
|
.edit-appearance-base__footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: start;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
box-shadow: 0 -1px 4px 0 rgba(0,0,0,0.10);
|
padding-left:200px;
|
||||||
|
|
||||||
.footer__btn {
|
.footer__btn {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const api = {
|
|||||||
login: '/sys/login',
|
login: '/sys/login',
|
||||||
// user
|
// user
|
||||||
user: '/sys/user',
|
user: '/sys/user',
|
||||||
|
timezone:'/sys/timezones',
|
||||||
// 获取配置
|
// 获取配置
|
||||||
config: '/sys/config',
|
config: '/sys/config',
|
||||||
// role
|
// role
|
||||||
|
|||||||
@@ -38,21 +38,21 @@
|
|||||||
popper-class="right-box-select-dropdown right-box-select-report "
|
popper-class="right-box-select-dropdown right-box-select-report "
|
||||||
size="small">
|
size="small">
|
||||||
<template v-for="timezone in timezoneList" :key="timezone.id">
|
<template v-for="timezone in timezoneList" :key="timezone.id">
|
||||||
<el-option :label="timezone.value" :value="timezone.value">
|
<el-option :label="timezone.name" :value="timezone.name">
|
||||||
<span style="float: left">{{ timezone.value }}</span>
|
<span style="float: left">{{ timezone.name }}</span>
|
||||||
<span style="float: right;">{{ timezone.remark}}</span>
|
<span style="float: right;">{{ timezone.offset}}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
<div class="edit-appearance-base__footer">
|
||||||
<div class="edit-appearance-base__footer">
|
<button style="position: relative;" :class="{'footer__btn--disabled': blockOperation.save}" :disabled="blockOperation.save" class="footer__btn" @click="save">
|
||||||
<button style="position: relative;" :class="{'footer__btn--disabled': blockOperation.save}" :disabled="blockOperation.save" class="footer__btn" @click="save">
|
<loading size="small" :loading="blockOperation.save"></loading>
|
||||||
<loading size="small" :loading="blockOperation.save"></loading>
|
<span>{{$t('overall.save')}}</span>
|
||||||
<span>{{$t('overall.save')}}</span>
|
</button>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -115,16 +115,21 @@
|
|||||||
this.dateFormatList.forEach(date => {
|
this.dateFormatList.forEach(date => {
|
||||||
date.example = window.$dayJs(new Date()).tz().format(date.value)
|
date.example = window.$dayJs(new Date()).tz().format(date.value)
|
||||||
})
|
})
|
||||||
this.timezoneList = await getDictList({ type: 'timezoneList',pageSize: -1 })
|
await get(api.timezone).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.timezoneList = response.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if (this.timezoneList && this.timezoneList.length > 0) {
|
if (this.timezoneList && this.timezoneList.length > 0) {
|
||||||
this.timezoneList.forEach(mapData => {
|
this.timezoneList.forEach(mapData => {
|
||||||
let remark = Number(mapData.remark)/3600000 //转换为小
|
let offset = Number(mapData.offset)/3600000 //转换为小
|
||||||
mapData.timezoneOffset = remark
|
mapData.timezoneOffset = offset
|
||||||
let hour = Math.abs(parseInt(remark))
|
let hour = Math.abs(parseInt(offset))
|
||||||
let remarkStr = remark.toString()
|
let offsetStr = offset.toString()
|
||||||
let minute = 0
|
let minute = 0
|
||||||
if(remarkStr.indexOf('.') > -1){
|
if(offsetStr.indexOf('.') > -1){
|
||||||
minute = Math.abs(Number(remarkStr.substring(remarkStr.indexOf('.')))*60)
|
minute = Math.abs(Number(offsetStr.substring(offsetStr.indexOf('.')))*60)
|
||||||
}
|
}
|
||||||
let str = ''
|
let str = ''
|
||||||
if(hour<10){
|
if(hour<10){
|
||||||
@@ -138,12 +143,12 @@
|
|||||||
}else {
|
}else {
|
||||||
str += minute
|
str += minute
|
||||||
}
|
}
|
||||||
if(remark > 0){
|
if(offset > 0){
|
||||||
mapData.remark = 'UTC+'+str
|
mapData.offset = 'UTC+'+str
|
||||||
}else if(remark === 0){
|
}else if(offset === 0){
|
||||||
mapData.remark = 'UTC'
|
mapData.offset = 'UTC'
|
||||||
}else {
|
}else {
|
||||||
mapData.remark = 'UTC-'+str
|
mapData.offset = 'UTC-'+str
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -177,7 +182,7 @@
|
|||||||
if (this.appearanceObject.timezone !== localStorage.getItem(storageKey.sysTimezone)) {
|
if (this.appearanceObject.timezone !== localStorage.getItem(storageKey.sysTimezone)) {
|
||||||
localStorage.setItem(storageKey.sysTimezone, this.appearanceObject.timezone)
|
localStorage.setItem(storageKey.sysTimezone, this.appearanceObject.timezone)
|
||||||
}
|
}
|
||||||
let timezone = this.timezoneList.find(mapData => mapData.value === this.appearanceObject.timezone)
|
let timezone = this.timezoneList.find(mapData => mapData.name === this.appearanceObject.timezone)
|
||||||
if (timezone.timezoneOffset !== localStorage.getItem(storageKey.timezoneOffset)) {
|
if (timezone.timezoneOffset !== localStorage.getItem(storageKey.timezoneOffset)) {
|
||||||
localStorage.setItem(storageKey.timezoneOffset, timezone.timezoneOffset)
|
localStorage.setItem(storageKey.timezoneOffset, timezone.timezoneOffset)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user