提交 2441edd1 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: ESLint插件格式化前端代码

上级 221227e7
...@@ -21,7 +21,6 @@ import directives from './directive' ...@@ -21,7 +21,6 @@ import directives from './directive'
import './styles/vdrr/common-temp.scss' import './styles/vdrr/common-temp.scss'
import vdrr from './components/vue-drag-resize-rotate' import vdrr from './components/vue-drag-resize-rotate'
Vue.component('vdrr', vdrr) Vue.component('vdrr', vdrr)
......
<template xmlns:el-col="http://www.w3.org/1999/html"> <template xmlns:el-col="http://www.w3.org/1999/html">
<el-row style="height: 100%;overflow-y: hidden;width: 100%;"> <el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<span>仪表盘名称:{{panelName}}</span> <span>仪表盘名称:{{ panelName }}</span>
</el-row> </el-row>
</template> </template>
<script> <script>
import {loadTable, getScene, addGroup, delGroup, addTable, delTable, groupTree} from '@/api/dataset/dataset' import { loadTable, getScene, addGroup, delGroup, addTable, delTable, groupTree } from '@/api/dataset/dataset'
export default { export default {
name: 'PanelView', name: 'PanelView',
data() { data() {
return { return {
...@@ -35,21 +35,21 @@ ...@@ -35,21 +35,21 @@
}, },
groupFormRules: { groupFormRules: {
name: [ name: [
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'} { required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
] ]
}, },
tableFormRules: { tableFormRules: {
name: [ name: [
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'} { required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
], ],
mode: [ mode: [
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'} { required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
] ]
} }
} }
}, },
computed: { computed: {
panelName: function () { panelName: function() {
console.log(this.$store.state.panel.panelName) console.log(this.$store.state.panel.panelName)
return this.$store.state.panel.panelName return this.$store.state.panel.panelName
} }
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
}) })
this.tableTree() this.tableTree()
// this.$router.push('/dataset/home') // this.$router.push('/dataset/home')
this.$emit('switchComponent', {name: ''}) this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null) this.$store.dispatch('dataset/setTable', null)
}) })
} else { } else {
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
}) })
this.tableTree() this.tableTree()
// this.$router.push('/dataset/home') // this.$router.push('/dataset/home')
this.$emit('switchComponent', {name: ''}) this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null) this.$store.dispatch('dataset/setTable', null)
}) })
}).catch(() => { }).catch(() => {
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
// console.log(route) // console.log(route)
// this.$router.push('/dataset/index') // this.$router.push('/dataset/index')
this.$store.dispatch('dataset/setSceneData', null) this.$store.dispatch('dataset/setSceneData', null)
this.$emit('switchComponent', {name: ''}) this.$emit('switchComponent', { name: '' })
}, },
clickAddData(param) { clickAddData(param) {
// console.log(param); // console.log(param);
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
// scene: this.currGroup // scene: this.currGroup
// } // }
// }) // })
this.$emit('switchComponent', {name: 'AddDB', param: this.currGroup}) this.$emit('switchComponent', { name: 'AddDB', param: this.currGroup })
}, },
sceneClick(data, node) { sceneClick(data, node) {
// console.log(data); // console.log(data);
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
// table: data // table: data
// } // }
// }) // })
this.$emit('switchComponent', {name: 'ViewTable'}) this.$emit('switchComponent', { name: 'ViewTable' })
}, },
refresh() { refresh() {
const path = this.$route.path const path = this.$route.path
...@@ -340,9 +340,9 @@ ...@@ -340,9 +340,9 @@
panelDefaultClick(data, node) { panelDefaultClick(data, node) {
// console.log(data); // console.log(data);
// console.log(node); // console.log(node);
},
} }
} }
}
</script> </script>
<style scoped> <style scoped>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-tabs v-model="ViewActiveName"> <el-tabs v-model="ViewActiveName">
<!--视图展示操作--> <!--视图展示操作-->
<el-tab-pane name="Views" class="view-list-thumbnails-outline"> <el-tab-pane name="Views" class="view-list-thumbnails-outline">
<span slot="label"><i class="el-icon-s-data"/>视图</span> <span slot="label"><i class="el-icon-s-data" />视图</span>
<draggable <draggable
v-model="thumbnails" v-model="thumbnails"
:options="{group:{name: 'itxst',pull:'clone'},sort: true}" :options="{group:{name: 'itxst',pull:'clone'},sort: true}"
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
@end="end1" @end="end1"
> >
<transition-group> <transition-group>
<div v-for="item in thumbnails" :key="item.name" v-on:dblclick = panelViewAdd(item)> <div v-for="item in thumbnails" :key="item.name" @dblclick="panelViewAdd(item)">
<span style="color: gray">{{item.name}}</span> <span style="color: gray">{{ item.name }}</span>
<img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt=""/> <img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt="">
</div> </div>
</transition-group> </transition-group>
</draggable> </draggable>
...@@ -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>
...@@ -47,18 +47,18 @@ ...@@ -47,18 +47,18 @@
<div class="container" style="overflow-y: auto"> <div class="container" style="overflow-y: auto">
<div :style="gridStyle"> <div :style="gridStyle">
<!-- <draggable--> <!-- <draggable-->
<!-- v-model="thumbnailsTmp"--> <!-- v-model="thumbnailsTmp"-->
<!-- :options="{group:{name: 'itxst',pull:'clone'},sort: true}"--> <!-- :options="{group:{name: 'itxst',pull:'clone'},sort: true}"-->
<!-- animation="300"--> <!-- animation="300"-->
<!-- :move="onMove"--> <!-- :move="onMove"-->
<!-- style="height: 100%;overflow:auto"--> <!-- style="height: 100%;overflow:auto"-->
<!-- @end="end1"--> <!-- @end="end1"-->
<!-- >--> <!-- >-->
<vdrr v-if="item.keepFlag" :view-id="item.id" :parent="true" v-for="item in thumbnailsTmp" :key="item.name" @newStyle="newStyle" @removeView="removeView"> <vdrr v-for="item in thumbnailsTmp" v-show="item.keepFlag" :key="item.name" :view-id="item.id" :parent="true" @newStyle="newStyle" @removeView="removeView">
<img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt=""/> <img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt="">
</vdrr> </vdrr>
<!-- </draggable>--> <!-- </draggable>-->
</div> </div>
</div> </div>
...@@ -74,13 +74,13 @@ ...@@ -74,13 +74,13 @@
</template> </template>
<script> <script>
import {post} from '@/api/dataset/dataset' import { post } from '@/api/dataset/dataset'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import {BASE_BAR} from '../chart/chart' import { BASE_BAR } from '../chart/chart'
export default { export default {
name: 'PanelViewShow', name: 'PanelViewShow',
components: {draggable}, components: { draggable },
data() { data() {
return { return {
gridStyle: { gridStyle: {
...@@ -94,14 +94,14 @@ ...@@ -94,14 +94,14 @@
ViewActiveName: 'Views', ViewActiveName: 'Views',
table: {}, table: {},
thumbnailsTmp: [ thumbnailsTmp: [
{id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST1',keepFlag:true,style:''}, { id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST1', keepFlag: true, style: '' },
{id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2',keepFlag:true,style:''} { id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2', keepFlag: true, style: '' }
], ],
thumbnails: [ thumbnails: [
{id: 'e70d7955-44dc-4158-9002-7b48ed0d5d80', name: 'TEST1'}, { id: 'e70d7955-44dc-4158-9002-7b48ed0d5d80', name: 'TEST1' },
{id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2'}, { id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2' },
{id: 'aebc8346-c3f2-44ad-97d3-1e36a10dd0fa', name: 'TEST3'}, { id: 'aebc8346-c3f2-44ad-97d3-1e36a10dd0fa', name: 'TEST3' },
{id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST4'} { id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST4' }
], ],
quota: [], quota: [],
view: { view: {
...@@ -113,14 +113,14 @@ ...@@ -113,14 +113,14 @@
}, },
// 定义要被拖拽对象的数组 // 定义要被拖拽对象的数组
arr1: [ arr1: [
{id: 1, name: 'id'}, { id: 1, name: 'id' },
{id: 2, name: '名称'}, { id: 2, name: '名称' },
{id: 3, name: '类型'}, { id: 3, name: '类型' },
{id: 5, name: '状态'}, { id: 5, name: '状态' },
{id: 4, name: '指标指标指标'} { id: 4, name: '指标指标指标' }
], ],
arr2: [ arr2: [
{id: 11, name: '容量'} { id: 11, name: '容量' }
], ],
moveId: -1 moveId: -1
} }
...@@ -154,27 +154,26 @@ ...@@ -154,27 +154,26 @@
activated() { activated() {
}, },
methods: { methods: {
panelViewAdd(item){ panelViewAdd(item) {
let pushItem = { const pushItem = {
id:item.id, id: item.id,
name:item.name, name: item.name,
keepFlag:true keepFlag: true
} }
debugger debugger
this.thumbnailsTmp.push(pushItem) this.thumbnailsTmp.push(pushItem)
console.log(this.thumbnailsTmp); console.log(this.thumbnailsTmp)
}, },
removeView(viewId) { removeView(viewId) {
this.thumbnailsTmp.forEach(function(item, index) { this.thumbnailsTmp.forEach(function(item, index) {
if(item.id===viewId){ if (item.id === viewId) {
item.keepFlag = false item.keepFlag = false
} }
}) })
}, },
newStyle(viewId,newStyleInfo) { newStyle(viewId, newStyleInfo) {
console.log(viewId); console.log(viewId)
console.log(JSON.stringify(newStyleInfo)) console.log(JSON.stringify(newStyleInfo))
}, },
initTableData(id) { initTableData(id) {
if (id != null) { if (id != null) {
...@@ -192,7 +191,7 @@ ...@@ -192,7 +191,7 @@
}, },
click1(item) { click1(item) {
// console.log(item); // console.log(item);
const c = this.view.xaxis.filter(function (ele) { const c = this.view.xaxis.filter(function(ele) {
return ele.id === item.id return ele.id === item.id
}) })
// console.log(c); // console.log(c);
...@@ -202,7 +201,7 @@ ...@@ -202,7 +201,7 @@
}, },
click2(item) { click2(item) {
// console.log(item); // console.log(item);
const c = this.view.yaxis.filter(function (ele) { const c = this.view.yaxis.filter(function(ele) {
return ele.id === item.id return ele.id === item.id
}) })
// console.log(c); // console.log(c);
...@@ -255,7 +254,7 @@ ...@@ -255,7 +254,7 @@
if (chart.data) { if (chart.data) {
chart_option.title.text = chart.title chart_option.title.text = chart.title
chart_option.xAxis.data = chart.data.x chart_option.xAxis.data = chart.data.x
chart.data.series.forEach(function (y) { chart.data.series.forEach(function(y) {
chart_option.legend.data.push(y.name) chart_option.legend.data.push(y.name)
chart_option.series.push(y) chart_option.series.push(y)
}) })
...@@ -313,12 +312,12 @@ ...@@ -313,12 +312,12 @@
var myChart = this.$echarts.init(document.getElementById('echart')) var myChart = this.$echarts.init(document.getElementById('echart'))
// 指定图表的配置项和数据 // 指定图表的配置项和数据
setTimeout(myChart.setOption(option, true), 500) setTimeout(myChart.setOption(option, true), 500)
window.onresize = function () { window.onresize = function() {
myChart.resize() myChart.resize()
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论