perf : panelBox 样式及其编辑时数据请求方式调整
This commit is contained in:
@@ -1,10 +1,17 @@
|
|||||||
.right-box-panel{
|
.right-box-panel{
|
||||||
|
.item-report{
|
||||||
|
.form__sub-title{
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.item-receivers{
|
.item-receivers{
|
||||||
.el-select.el-select--small{
|
.el-select.el-select--small{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.item-receivers-text{
|
.item-receivers-text{
|
||||||
|
font-size: 12px;
|
||||||
color: $--color-text-secondary;
|
color: $--color-text-secondary;
|
||||||
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-input--suffix.el-date-editor--datetime .el-input__inner{
|
.el-input--suffix.el-date-editor--datetime .el-input__inner{
|
||||||
@@ -64,8 +71,15 @@
|
|||||||
height: 41px;
|
height: 41px;
|
||||||
.el-radio-group{
|
.el-radio-group{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-left: 1px solid $--border-color-light;
|
.el-radio-button{
|
||||||
|
border: 1px solid $--border-color-light;
|
||||||
|
margin-right: -1px;
|
||||||
|
}
|
||||||
|
.el-radio-button.is-active{
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
.el-radio-button__inner{
|
.el-radio-button__inner{
|
||||||
|
border: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -76,6 +90,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
.el-checkbox-button{
|
.el-checkbox-button{
|
||||||
margin-right: -2px;
|
margin-right: -2px;
|
||||||
|
width: calc(100% / 6.9) !important;
|
||||||
.el-checkbox-button__inner{
|
.el-checkbox-button__inner{
|
||||||
background-color: $--background-color-empty;
|
background-color: $--background-color-empty;
|
||||||
border:1px solid $--border-color-light;
|
border:1px solid $--border-color-light;
|
||||||
@@ -101,6 +116,7 @@
|
|||||||
}
|
}
|
||||||
.form-tabs{
|
.form-tabs{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
.el-tabs__nav{
|
.el-tabs__nav{
|
||||||
display: flex;
|
display: flex;
|
||||||
.el-tabs__item{
|
.el-tabs__item{
|
||||||
@@ -126,7 +142,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item__content{
|
.el-form-item__content{
|
||||||
text-align: unset !important;
|
|
||||||
.el-checkbox-button{
|
.el-checkbox-button{
|
||||||
width: calc(100% / 7) !important;
|
width: calc(100% / 7) !important;
|
||||||
.el-checkbox-button__inner{
|
.el-checkbox-button__inner{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- Report -->
|
<!-- Report -->
|
||||||
<div>
|
<div>
|
||||||
<el-form-item >
|
<el-form-item class="item-report">
|
||||||
<div class="form__sub-title">
|
<div class="form__sub-title">
|
||||||
<span>{{$t('dashboard.panel.report')}}</span>
|
<span>{{$t('dashboard.panel.report')}}</span>
|
||||||
<el-switch v-model="editPanel.param.report.enable" size="small"></el-switch>
|
<el-switch v-model="editPanel.param.report.enable" size="small"></el-switch>
|
||||||
@@ -264,17 +264,6 @@ export default {
|
|||||||
this.dateFormatStr = 'YYYY-MM-DD HH:mm:ss'
|
this.dateFormatStr = 'YYYY-MM-DD HH:mm:ss'
|
||||||
if (this.editPanel.id) {
|
if (this.editPanel.id) {
|
||||||
this.isShow = Number(this.editPanel.param.report.schedule.type)
|
this.isShow = Number(this.editPanel.param.report.schedule.type)
|
||||||
this.editPanel.param.report.schedule.type = this.editPanel.param.report.schedule.type + ''
|
|
||||||
if (this.editPanel.param.report.schedule.stime !== '') {
|
|
||||||
this.editPanel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.editPanel.param.report.schedule.stime)
|
|
||||||
} else {
|
|
||||||
this.editPanel.param.report.schedule.stime = ''
|
|
||||||
}
|
|
||||||
if (this.editPanel.param.report.schedule.etime !== '') {
|
|
||||||
this.editPanel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.editPanel.param.report.schedule.etime)
|
|
||||||
} else {
|
|
||||||
this.editPanel.param.report.schedule.etime = ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@@ -327,8 +316,8 @@ export default {
|
|||||||
type: Number(this.editPanel.param.report.schedule.type),
|
type: Number(this.editPanel.param.report.schedule.type),
|
||||||
repeat: this.editPanel.param.report.schedule.repeat ? this.editPanel.param.report.schedule.repeat : 1,
|
repeat: this.editPanel.param.report.schedule.repeat ? this.editPanel.param.report.schedule.repeat : 1,
|
||||||
nums: this.editPanel.param.report.schedule.nums,
|
nums: this.editPanel.param.report.schedule.nums,
|
||||||
stime: this.editPanel.param.report.schedule.stime !== '' ? this.timezoneToUtcTimeStr(this.editPanel.param.report.schedule.stime) : this.editPanel.param.report.schedule.stime,
|
stime: this.editPanel.param.report.schedule.stime !== '' ? this.timezoneToUtcTimeStr(this.editPanel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss') : this.editPanel.param.report.schedule.stime,
|
||||||
etime: this.editPanel.param.report.schedule.etime !== '' ? this.timezoneToUtcTimeStr(this.editPanel.param.report.schedule.etime) : this.editPanel.param.report.schedule.etime
|
etime: this.editPanel.param.report.schedule.etime !== '' ? this.timezoneToUtcTimeStr(this.editPanel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss') : this.editPanel.param.report.schedule.etime
|
||||||
},
|
},
|
||||||
receivers: this.editPanel.param.report.receivers
|
receivers: this.editPanel.param.report.receivers
|
||||||
},
|
},
|
||||||
@@ -404,17 +393,23 @@ export default {
|
|||||||
'editPanel.param.report.schedule.stime': {
|
'editPanel.param.report.schedule.stime': {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
|
const startTime = this.$loadsh.get(this.editPanel, 'param.report.schedule.stime', '')
|
||||||
|
if (startTime !== '') {
|
||||||
this.editPanel.param.report.schedule.stime = bus
|
this.editPanel.param.report.schedule.stime = bus
|
||||||
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')
|
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'editPanel.param.report.schedule.etime': {
|
'editPanel.param.report.schedule.etime': {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
|
const endTime = this.$loadsh.get(this.editPanel, 'param.report.schedule.etime', '')
|
||||||
|
if (endTime !== '') {
|
||||||
this.editPanel.param.report.schedule.etime = bus
|
this.editPanel.param.report.schedule.etime = bus
|
||||||
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')
|
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -389,10 +389,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
edit (u) {
|
edit (u) {
|
||||||
this.panel = Object.assign({}, u)
|
this.$get('visual/panel?ids=' + u.id).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.panel = res.data.list[0]
|
||||||
if (!this.panel.param.report) {
|
if (!this.panel.param.report) {
|
||||||
this.panel = {
|
this.panel = {
|
||||||
...u,
|
...this.panel,
|
||||||
param: {
|
param: {
|
||||||
report: {
|
report: {
|
||||||
enable: false,
|
enable: false,
|
||||||
@@ -412,7 +414,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.panel.param.report.schedule.type = this.panel.param.report.schedule.type + ''
|
||||||
|
const startTime = this.$loadsh.get(this.panel, 'param.report.schedule.stime', '')
|
||||||
|
if (startTime !== '') {
|
||||||
|
this.panel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
} else {
|
||||||
|
this.panel.param.report.schedule.stime = ''
|
||||||
|
}
|
||||||
|
const endTime = this.$loadsh.get(this.panel, 'param.report.schedule.etime', '')
|
||||||
|
if (endTime !== '') {
|
||||||
|
this.panel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
} else {
|
||||||
|
this.panel.param.report.schedule.etime = ''
|
||||||
|
}
|
||||||
this.rightBox.panel.show = true
|
this.rightBox.panel.show = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// this.panel = Object.assign({}, u)
|
||||||
},
|
},
|
||||||
toAdd () {
|
toAdd () {
|
||||||
if (!this.hasButton('panel_view')) {
|
if (!this.hasButton('panel_view')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user