fix:添加同步按钮 以及module 添加chartTemp
This commit is contained in:
@@ -46,6 +46,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
<i class="nz-icon nz-icon-edit" style="font-size: 16px;"></i><span>{{$t('dashboard.edit')}}</span></li>
|
||||
<li v-has="'panel_chart_delete'" v-if="from !== 'chartTemp'" class="el-dropdown-menu__item" @click="removeChart">
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
<!-- <li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">-->
|
||||
<!-- <i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>-->
|
||||
</ul>
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:panel-id="filter.panelId"
|
||||
:is-lock="panelLock"
|
||||
:chart-index="item.chartIndex"
|
||||
@@ -86,6 +87,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -99,6 +101,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
:chart-data="item"
|
||||
@@ -113,6 +116,7 @@
|
||||
@on-drag-chart="editChartForDrag"
|
||||
:is-lock="panelLock"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:panel-id="filter.panelId"
|
||||
:chart-data="item"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
@@ -134,6 +138,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -155,6 +160,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
></chart-alert-list>
|
||||
<chartBarStatis :from="from" :key="'inner' + item.id" :ref="'editChart'+item.id" v-if="(item.type === 'bar'&& item.param.statistics && item.param.statistics !== 'null')" :temp-dom="tempDom"
|
||||
@@ -164,6 +170,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -176,6 +183,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -1500,6 +1508,16 @@ export default {
|
||||
}
|
||||
}
|
||||
}, 500)
|
||||
},
|
||||
chartBySync (item) {
|
||||
this.$post('visual/panel/chart/syncTmpl', { ids: [item.id] }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.getData(this.filter)
|
||||
this.$message.success(this.$t('tip.syncSuccess'))
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:panel-id="filter.panelId"
|
||||
:is-lock="panelLock"
|
||||
:chart-index="index"
|
||||
@@ -84,6 +85,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -97,6 +99,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
:chart-data="item"
|
||||
@@ -111,6 +114,7 @@
|
||||
@on-drag-chart="editChartForDrag"
|
||||
:is-lock="panelLock"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:panel-id="filter.panelId"
|
||||
:chart-data="item"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
@@ -120,6 +124,7 @@
|
||||
:from="from" :panel-id="filter.panelId"
|
||||
:chart-index="index"
|
||||
@on-refresh-data="refreshChart"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:is-lock="panelLock"
|
||||
:chart-data="item"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
@@ -132,6 +137,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -152,6 +158,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
@dropmenu-change="(show) => {dropmenuChange(item.id, show)}"
|
||||
:chartData="item"
|
||||
></chart-alert-list>
|
||||
@@ -163,6 +170,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -175,6 +183,7 @@
|
||||
@on-duplicate-chart-block="duplicateChart"
|
||||
@on-drag-chart="editChartForDrag"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
:chart-data="item"
|
||||
:is-lock="panelLock"
|
||||
:panel-id="filter.panelId"
|
||||
@@ -190,6 +199,7 @@
|
||||
:panelLock="panelLock"
|
||||
:filter="filter"
|
||||
@on-edit-chart-block="editData"
|
||||
@sync="()=>{chartBySync(item)}"
|
||||
@on-edit-group-chart="editDataGroup"
|
||||
@on-remove-group-chart="removeChartGroup"
|
||||
@on-duplicate-group-chart="duplicateChartGroup"
|
||||
@@ -1835,6 +1845,16 @@ export default {
|
||||
init () {
|
||||
this.stepWidth = this.chartResizeTool.stepWidth(document.getElementById('listContainer').offsetWidth - 14)
|
||||
this.tempDomInit()
|
||||
},
|
||||
chartBySync (item) {
|
||||
this.$post('visual/panel/chart/syncTmpl', { ids: [item.id] }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.getData(this.filter)
|
||||
this.$message.success(this.$t('tip.syncSuccess'))
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
||||
<li v-has="'panel_chart_add'" class="el-dropdown-menu__item" @click="duplicate">
|
||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||
<li v-has="'panel_chart_edit'" v-if="from !== 'chartTemp'&&chartData.pid" class="el-dropdown-menu__item" @click="$emit('sync')">
|
||||
<i class="nz-icon nz-icon-sync" style="font-size: 16px;"></i>{{$t('overall.syncChart')}}</li>
|
||||
</ul>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<button id="panel-lock" :title='panelLock ? $t("overall.locked") : $t("overall.unlocked")' class="top-tool-btn margin-r-10" @click="panelLock=!panelLock" type="button">
|
||||
<i :class="{'nz-icon nz-icon-lock':panelLock,'nz-icon nz-icon-unlock':!panelLock}"></i>
|
||||
</button>
|
||||
<button @click="chartBySync" id="chart-sync" :title='panelLock ? $t("overall.locked") : $t("overall.unlocked")' class="top-tool-btn margin-r-10"
|
||||
<button @click="chartBySync" id="chart-sync" :title="$t('overall.syncChart')" class="top-tool-btn margin-r-10"
|
||||
type="button">
|
||||
<i class="nz-icon nz-icon-sync"></i>
|
||||
</button>
|
||||
|
||||
@@ -84,13 +84,13 @@
|
||||
</el-form-item>
|
||||
</span>
|
||||
|
||||
<!-- ChartTemplate 'visual/panel/chart' -->
|
||||
<!-- ChartTemplate -->
|
||||
<el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate">
|
||||
<v-selectpage
|
||||
:data="chartlList"
|
||||
:data="'visual/panel/chart'"
|
||||
:tb-columns="ChartSearchShowFields"
|
||||
:params="{
|
||||
varType: 1, panelId: 0
|
||||
varType: 2, panelId: 0
|
||||
}"
|
||||
:multiple="true"
|
||||
:language="language"
|
||||
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
chartBySync (row) {
|
||||
this.$post('visual/panel/chart/syncTmpl', { pid: row.id }).then(res => {
|
||||
this.$post('visual/panel/chart/syncTmpl', { models: [row.id] }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.getTableData()
|
||||
this.$message.success(this.$t('tip.syncSuccess'))
|
||||
|
||||
@@ -144,8 +144,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
edit (u) {
|
||||
this.object = JSON.parse(JSON.stringify(u))
|
||||
edit (row) {
|
||||
this.$get('monitor/module/' + row.id).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.object = JSON.parse(JSON.stringify(res.data))
|
||||
this.object.configs = JSON.parse(this.object.configs)
|
||||
this.object.walk = this.object.configs.walk ? JSON.parse(JSON.stringify(this.object.configs.walk)) : []
|
||||
this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : 9100
|
||||
@@ -166,9 +168,11 @@ export default {
|
||||
this.object.paramObj.push({ key: '', value: [] })
|
||||
}
|
||||
if (!this.object.chartIds) {
|
||||
this.object.chartIds = []
|
||||
this.object.chartIds = ''
|
||||
}
|
||||
this.rightBox.show = true
|
||||
}
|
||||
})
|
||||
},
|
||||
getTableData () {
|
||||
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
||||
@@ -205,7 +209,7 @@ export default {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user