提交 69ae877b authored 作者: wangjiahao's avatar wangjiahao

feat:格式化代码

上级 da17802f
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!--通用组件操作--> <!--通用组件操作-->
<el-tab-pane name="PublicTools"> <el-tab-pane name="PublicTools">
<span slot="label"><i class="el-icon-s-grid"/>组件</span> <span slot="label"><i class="el-icon-s-grid" />组件</span>
开发中... 开发中...
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-col class="panel-design"> <el-col class="panel-design">
<!--TODO 仪表盘设计公共设置区域--> <!--TODO 仪表盘设计公共设置区域-->
<el-row class="panel-design-head"> <el-row class="panel-design-head">
<span style="float: left;line-height: 40px; color: gray">名称:{{panelInfo.name}}</span> <span style="float: left;line-height: 40px; color: gray">名称:{{ panelInfo.name }}</span>
<span style="float: right;line-height: 40px;"> <span style="float: right;line-height: 40px;">
<el-button size="mini"> <el-button size="mini">
背景图 背景图
...@@ -46,12 +46,17 @@ ...@@ -46,12 +46,17 @@
</el-row> </el-row>
<el-row class="panel-design-show"> <el-row class="panel-design-show">
<div class="container" :style="panelDetails.gridStyle"> <div class="container" :style="panelDetails.gridStyle">
<vue-drag-resize-rotate v-for="panelDesign in panelDetails.panelDesigns" v-show="panelDesign.keepFlag" <vue-drag-resize-rotate
v-for="panelDesign in panelDetails.panelDesigns"
v-show="panelDesign.keepFlag"
:key="panelDesign.id" :key="panelDesign.id"
:panel-design-id="panelDesign.id" :parent="true" @newStyle="newStyle" :panel-design-id="panelDesign.id"
@removeView="removeView"> :parent="true"
@newStyle="newStyle"
@removeView="removeView"
>
<!--视图显示 panelDesign.componentType==='view'--> <!--视图显示 panelDesign.componentType==='view'-->
<chart-component v-if="panelDesign.componentType==='view'" :ref="panelDesign.id" :chart-id="panelDesign.id" :chart="panelDesign.chartView"/> <chart-component v-if="panelDesign.componentType==='view'" :ref="panelDesign.id" :chart-id="panelDesign.id" :chart="panelDesign.chartView" />
<!--组件显示(待开发)--> <!--组件显示(待开发)-->
...@@ -65,15 +70,15 @@ ...@@ -65,15 +70,15 @@
</template> </template>
<script> <script>
import {post, get} from '@/api/panel/panel' import { get } from '@/api/panel/panel'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import ChartComponent from '../../chart/components/ChartComponent' import ChartComponent from '../../chart/components/ChartComponent'
import VueDragResizeRotate from '@/components/vue-drag-resize-rotate' import VueDragResizeRotate from '@/components/vue-drag-resize-rotate'
import { uuid } from 'vue-uuid'; import { uuid } from 'vue-uuid'
export default { export default {
name: 'PanelViewShow', name: 'PanelViewShow',
components: {draggable, ChartComponent, VueDragResizeRotate}, components: { draggable, ChartComponent, VueDragResizeRotate },
data() { data() {
return { return {
panelDetails: { panelDetails: {
...@@ -99,52 +104,51 @@ ...@@ -99,52 +104,51 @@
}, },
watch: { watch: {
panelInfo(newVal, oldVal) { panelInfo(newVal, oldVal) {
this.panelDesign(newVal.id); this.panelDesign(newVal.id)
} }
}, },
created() { created() {
// this.get(this.$store.state.chart.viewId); // this.get(this.$store.state.chart.viewId);
}, },
mounted() { mounted() {
let panelId = this.$store.state.panel.panelInfo.id; const panelId = this.$store.state.panel.panelInfo.id
if (panelId) { if (panelId) {
this.panelDesign(panelId); this.panelDesign(panelId)
} }
}, },
activated() { activated() {
}, },
methods: { methods: {
//加载公共组件 // 加载公共组件
//加载panel design // 加载panel design
panelDesign(panelId) { panelDesign(panelId) {
get('panel/group/findOne/' + panelId).then(res => { get('panel/group/findOne/' + panelId).then(res => {
let panelDetailsInfo = res.data; const panelDetailsInfo = res.data
if (panelDetailsInfo) { if (panelDetailsInfo) {
this.panelDetails = panelDetailsInfo; this.panelDetails = panelDetailsInfo
} }
if (!panelDetailsInfo.gridStyle) { if (!panelDetailsInfo.gridStyle) {
this.panelDetails.gridStyle = this.gridStyleDefault; this.panelDetails.gridStyle = this.gridStyleDefault
} }
}); })
}, },
panelViewAdd(view) { panelViewAdd(view) {
let panelDesigns = this.panelDetails.panelDesigns; const panelDesigns = this.panelDetails.panelDesigns
this.panelDetails.viewsUsable.forEach(function (item, index) { this.panelDetails.viewsUsable.forEach(function(item, index) {
if (item.id === view.id) { if (item.id === view.id) {
let newComponent = { const newComponent = {
id: uuid.v1(), id: uuid.v1(),
keepFlag : true, keepFlag: true,
chartView: item, chartView: item,
componentType: 'view' componentType: 'view'
} }
panelDesigns.push(newComponent) panelDesigns.push(newComponent)
} }
}); })
}, },
removeView(panelDesignId) { removeView(panelDesignId) {
this.panelDetails.panelDesigns.forEach(function (panelDesign, index) { this.panelDetails.panelDesigns.forEach(function(panelDesign, index) {
if (panelDesign.id === panelDesignId) { if (panelDesign.id === panelDesignId) {
panelDesign.keepFlag = false panelDesign.keepFlag = false
} }
...@@ -178,11 +182,11 @@ ...@@ -178,11 +182,11 @@
console.log(e) console.log(e)
return true return true
}, },
preViewShow(){ preViewShow() {
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论