forked from github/dataease
feat: ESLint插件格式化前端代码
This commit is contained in:
parent
221227e710
commit
2441edd166
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@ import directives from './directive'
|
||||
|
||||
import './styles/vdrr/common-temp.scss'
|
||||
|
||||
|
||||
import vdrr from './components/vue-drag-resize-rotate'
|
||||
Vue.component('vdrr', vdrr)
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template xmlns:el-col="http://www.w3.org/1999/html">
|
||||
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
|
||||
<span>仪表盘名称:{{panelName}}</span>
|
||||
<span>仪表盘名称:{{ panelName }}</span>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<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',
|
||||
data() {
|
||||
return {
|
||||
@ -35,21 +35,21 @@
|
||||
},
|
||||
groupFormRules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'}
|
||||
{ required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
tableFormRules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'}
|
||||
{ required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
|
||||
],
|
||||
mode: [
|
||||
{required: true, message: this.$t('commons.input_content'), trigger: 'blur'}
|
||||
{ required: true, message: this.$t('commons.input_content'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
panelName: function () {
|
||||
panelName: function() {
|
||||
console.log(this.$store.state.panel.panelName)
|
||||
return this.$store.state.panel.panelName
|
||||
}
|
||||
@ -165,7 +165,7 @@
|
||||
})
|
||||
this.tableTree()
|
||||
// this.$router.push('/dataset/home')
|
||||
this.$emit('switchComponent', {name: ''})
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
this.$store.dispatch('dataset/setTable', null)
|
||||
})
|
||||
} else {
|
||||
@ -211,7 +211,7 @@
|
||||
})
|
||||
this.tableTree()
|
||||
// this.$router.push('/dataset/home')
|
||||
this.$emit('switchComponent', {name: ''})
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
this.$store.dispatch('dataset/setTable', null)
|
||||
})
|
||||
}).catch(() => {
|
||||
@ -280,7 +280,7 @@
|
||||
// console.log(route)
|
||||
// this.$router.push('/dataset/index')
|
||||
this.$store.dispatch('dataset/setSceneData', null)
|
||||
this.$emit('switchComponent', {name: ''})
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
},
|
||||
clickAddData(param) {
|
||||
// console.log(param);
|
||||
@ -313,7 +313,7 @@
|
||||
// scene: this.currGroup
|
||||
// }
|
||||
// })
|
||||
this.$emit('switchComponent', {name: 'AddDB', param: this.currGroup})
|
||||
this.$emit('switchComponent', { name: 'AddDB', param: this.currGroup })
|
||||
},
|
||||
sceneClick(data, node) {
|
||||
// console.log(data);
|
||||
@ -325,7 +325,7 @@
|
||||
// table: data
|
||||
// }
|
||||
// })
|
||||
this.$emit('switchComponent', {name: 'ViewTable'})
|
||||
this.$emit('switchComponent', { name: 'ViewTable' })
|
||||
},
|
||||
refresh() {
|
||||
const path = this.$route.path
|
||||
@ -340,9 +340,9 @@
|
||||
panelDefaultClick(data, node) {
|
||||
// console.log(data);
|
||||
// console.log(node);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-tabs v-model="ViewActiveName">
|
||||
<!--视图展示操作-->
|
||||
<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
|
||||
v-model="thumbnails"
|
||||
:options="{group:{name: 'itxst',pull:'clone'},sort: true}"
|
||||
@ -15,9 +15,9 @@
|
||||
@end="end1"
|
||||
>
|
||||
<transition-group>
|
||||
<div v-for="item in thumbnails" :key="item.name" v-on:dblclick = panelViewAdd(item)>
|
||||
<span style="color: gray">{{item.name}}</span>
|
||||
<img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt=""/>
|
||||
<div v-for="item in thumbnails" :key="item.name" @dblclick="panelViewAdd(item)">
|
||||
<span style="color: gray">{{ item.name }}</span>
|
||||
<img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt="">
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
<!--通用组件操作-->
|
||||
<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-tabs>
|
||||
@ -47,18 +47,18 @@
|
||||
<div class="container" style="overflow-y: auto">
|
||||
|
||||
<div :style="gridStyle">
|
||||
<!-- <draggable-->
|
||||
<!-- v-model="thumbnailsTmp"-->
|
||||
<!-- :options="{group:{name: 'itxst',pull:'clone'},sort: true}"-->
|
||||
<!-- animation="300"-->
|
||||
<!-- :move="onMove"-->
|
||||
<!-- style="height: 100%;overflow:auto"-->
|
||||
<!-- @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">
|
||||
<img class="view-list-thumbnails" :src="'/common-files/images/'+item.id" alt=""/>
|
||||
<!-- <draggable-->
|
||||
<!-- v-model="thumbnailsTmp"-->
|
||||
<!-- :options="{group:{name: 'itxst',pull:'clone'},sort: true}"-->
|
||||
<!-- animation="300"-->
|
||||
<!-- :move="onMove"-->
|
||||
<!-- style="height: 100%;overflow:auto"-->
|
||||
<!-- @end="end1"-->
|
||||
<!-- >-->
|
||||
<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="">
|
||||
</vdrr>
|
||||
<!-- </draggable>-->
|
||||
<!-- </draggable>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -74,13 +74,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {post} from '@/api/dataset/dataset'
|
||||
import draggable from 'vuedraggable'
|
||||
import {BASE_BAR} from '../chart/chart'
|
||||
import { post } from '@/api/dataset/dataset'
|
||||
import draggable from 'vuedraggable'
|
||||
import { BASE_BAR } from '../chart/chart'
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'PanelViewShow',
|
||||
components: {draggable},
|
||||
components: { draggable },
|
||||
data() {
|
||||
return {
|
||||
gridStyle: {
|
||||
@ -94,14 +94,14 @@
|
||||
ViewActiveName: 'Views',
|
||||
table: {},
|
||||
thumbnailsTmp: [
|
||||
{id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST1',keepFlag:true,style:''},
|
||||
{id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2',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: '' }
|
||||
],
|
||||
thumbnails: [
|
||||
{id: 'e70d7955-44dc-4158-9002-7b48ed0d5d80', name: 'TEST1'},
|
||||
{id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2'},
|
||||
{id: 'aebc8346-c3f2-44ad-97d3-1e36a10dd0fa', name: 'TEST3'},
|
||||
{id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST4'}
|
||||
{ id: 'e70d7955-44dc-4158-9002-7b48ed0d5d80', name: 'TEST1' },
|
||||
{ id: 'bf91a1dc-10c1-4383-87ae-9ab1d6e57918', name: 'TEST2' },
|
||||
{ id: 'aebc8346-c3f2-44ad-97d3-1e36a10dd0fa', name: 'TEST3' },
|
||||
{ id: 'b4e3fd39-1424-4f22-bbac-07885829fb59', name: 'TEST4' }
|
||||
],
|
||||
quota: [],
|
||||
view: {
|
||||
@ -113,14 +113,14 @@
|
||||
},
|
||||
// 定义要被拖拽对象的数组
|
||||
arr1: [
|
||||
{id: 1, name: 'id'},
|
||||
{id: 2, name: '名称'},
|
||||
{id: 3, name: '类型'},
|
||||
{id: 5, name: '状态'},
|
||||
{id: 4, name: '指标指标指标'}
|
||||
{ id: 1, name: 'id' },
|
||||
{ id: 2, name: '名称' },
|
||||
{ id: 3, name: '类型' },
|
||||
{ id: 5, name: '状态' },
|
||||
{ id: 4, name: '指标指标指标' }
|
||||
],
|
||||
arr2: [
|
||||
{id: 11, name: '容量'}
|
||||
{ id: 11, name: '容量' }
|
||||
],
|
||||
moveId: -1
|
||||
}
|
||||
@ -154,27 +154,26 @@
|
||||
activated() {
|
||||
},
|
||||
methods: {
|
||||
panelViewAdd(item){
|
||||
let pushItem = {
|
||||
id:item.id,
|
||||
name:item.name,
|
||||
keepFlag:true
|
||||
panelViewAdd(item) {
|
||||
const pushItem = {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
keepFlag: true
|
||||
}
|
||||
debugger
|
||||
this.thumbnailsTmp.push(pushItem)
|
||||
console.log(this.thumbnailsTmp);
|
||||
console.log(this.thumbnailsTmp)
|
||||
},
|
||||
removeView(viewId) {
|
||||
this.thumbnailsTmp.forEach(function(item, index) {
|
||||
if(item.id===viewId){
|
||||
if (item.id === viewId) {
|
||||
item.keepFlag = false
|
||||
}
|
||||
})
|
||||
},
|
||||
newStyle(viewId,newStyleInfo) {
|
||||
console.log(viewId);
|
||||
newStyle(viewId, newStyleInfo) {
|
||||
console.log(viewId)
|
||||
console.log(JSON.stringify(newStyleInfo))
|
||||
|
||||
},
|
||||
initTableData(id) {
|
||||
if (id != null) {
|
||||
@ -192,7 +191,7 @@
|
||||
},
|
||||
click1(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
|
||||
})
|
||||
// console.log(c);
|
||||
@ -202,7 +201,7 @@
|
||||
},
|
||||
click2(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
|
||||
})
|
||||
// console.log(c);
|
||||
@ -255,7 +254,7 @@
|
||||
if (chart.data) {
|
||||
chart_option.title.text = chart.title
|
||||
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.series.push(y)
|
||||
})
|
||||
@ -313,12 +312,12 @@
|
||||
var myChart = this.$echarts.init(document.getElementById('echart'))
|
||||
// 指定图表的配置项和数据
|
||||
setTimeout(myChart.setOption(option, true), 500)
|
||||
window.onresize = function () {
|
||||
window.onresize = function() {
|
||||
myChart.resize()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user