大屏显示

yanzili 3 years ago
parent 4026dd06fa
commit ee658ecd4d

@ -27,9 +27,14 @@
"nprogress": "0.2.0", "nprogress": "0.2.0",
"sortablejs": "^1.10.2", "sortablejs": "^1.10.2",
"uninstall": "0.0.0", "uninstall": "0.0.0",
"v-chart": "^1.0.0",
"vue": "2.6.11", "vue": "2.6.11",
"vue-codemirror": "^4.0.6", "vue-codemirror": "^4.0.6",
"vue-color": "^2.8.1",
"vue-drag-resize": "^1.5.4",
"vue-echarts": "^5.0.0-beta.0",
"vue-router": "3.0.1", "vue-router": "3.0.1",
"vue-ruler-tool": "^1.2.4",
"vuedraggable": "^2.24.1", "vuedraggable": "^2.24.1",
"vuex": "3.0.1" "vuex": "3.0.1"
}, },

@ -14,6 +14,13 @@ import router from './router'
import store from './store' import store from './store'
import * as filter from './filter' import * as filter from './filter'
import mixins from '@/mixins' import mixins from '@/mixins'
import echarts from 'echarts';
// 全局定义echarts
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/bar'
import 'echarts/lib/component/tooltip'
// import 'echarts-gl'
Vue.component('v-chart', ECharts)
// permission control // permission control
import '@/permission' import '@/permission'

@ -85,6 +85,45 @@ export default {
return 0; return 0;
} }
} }
},
objToOne (obj) {
var tmpData = {}
for (var index in obj) {
if (typeof obj[index] == 'object') {
var resObj = this.objToOne(obj[index])
Object.assign(tmpData, resObj) // 这里使用对象合并
} else {
tmpData[index] = obj[index]
}
}
return tmpData
},
isNotNull (val) {
return !this.isNull(val)
},
isNull (val) {
// 特殊判断
if (val && parseInt(val) === 0) return false
const list = ['$parent']
if (val instanceof Date || typeof val === 'boolean' || typeof val === 'number') return false
if (val instanceof Array) {
if (val.length === 0) return true
} else if (val instanceof Object) {
val = this.deepClone(val)
list.forEach((ele) => {
delete val[ele]
})
for (var o in val) {
return false
} }
return true
} else {
if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') {
return true
}
return false
}
return false
},
} }
} }

@ -83,8 +83,12 @@ export const constantRouterMap = [
meta: { title: '大屏报表', icon: 'iconnavicon-ywcs' }, meta: { title: '大屏报表', icon: 'iconnavicon-ywcs' },
children: [ children: [
{ path: 'bigscreen', name: 'bigscreen', component: () => import('@/views/report/bigscreen/index'), meta: { title: '大屏报表', icon: 'iconchufaqipeizhi-hui', keepAlive: true, isBack: true } }, { path: 'bigscreen', name: 'bigscreen', component: () => import('@/views/report/bigscreen/index'), meta: { title: '大屏报表', icon: 'iconchufaqipeizhi-hui', keepAlive: true, isBack: true } },
// { path: '/bigscreen/viewer', name: 'bigscreenViewer', component: () => import('@/views/report/bigscreen/viewer'), meta: { title: '预览', icon: 'i', keepAlive: false, isBack: true } },
// { path: '/bigscreen/designer', name: 'bigscreenDesigner', component: () => import('@/views/report/bigscreen/designer'), meta: { title: '设计', icon: 'i', keepAlive: false, isBack: true } },
] ]
}, },
{ path: '/bigscreen/viewer', component: () => import('@/views/report/bigscreen/viewer'), hidden: true },
{ path: '/bigscreen/designer', component: () => import('@/views/report/bigscreen/designer'), hidden: true },
// { // {
// path: '/report', // path: '/report',
// component: Layout, // component: Layout,

@ -1,6 +1,11 @@
<template> <template>
<div v-show="visible" class="contentmenu" :style="styleObj"> <div v-show="visible"
<div class="contentmenu__item" @click="deleteLayer"><svg-icon icon-class="guanbi" /> 删除图层</div> class="contentmenu"
:style="styleObj">
<div class="contentmenu__item"
@click="deleteLayer">
<!-- <svg-icon icon-class="guanbi" /> -->删除图层
</div>
</div> </div>
</template> </template>
<script> <script>

@ -1,37 +1,56 @@
<template> <template>
<div> <div>
<el-button type="primary" icon="el-icon-plus" plain @click="handleAddClick"></el-button> <el-button type="primary"
<el-table :data="formData" style="width: 100%"> icon="el-icon-plus"
<el-table-column prop="color" label="颜色" align="center"> plain
@click="handleAddClick">新增</el-button>
<el-table :data="formData"
style="width: 100%">
<el-table-column prop="color"
label="颜色"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="color-box" :style="{ background: scope.row.color }" /> <span class="color-box"
:style="{ background: scope.row.color }" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="位置" align="center"> <el-table-column label="位置"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="editor" @click="handleEditorClick(scope.$index, scope.row)"> <i class="el-icon-edit" /> 编辑 </span> <span class="editor"
@click="handleEditorClick(scope.$index, scope.row)"> <i class="el-icon-edit" /> 编辑 </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="editor" @click="handleDeleteClick(scope.$index, scope.row)"> <i class="el-icon-delete" /> 删除 </span> <span class="editor"
@click="handleDeleteClick(scope.$index, scope.row)"> <i class="el-icon-delete" /> 删除 </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog title="新增" :visible.sync="dialogVisible" width="30%" :before-close="handleClose"> <el-dialog title="新增"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form> <el-form>
<el-form-item label="颜色"> <el-form-item label="颜色">
<el-input v-model="colorValue" style="width: 200px" placeholder="请输入颜色"> <el-input v-model="colorValue"
style="width: 200px"
placeholder="请输入颜色">
<template slot="append"> <template slot="append">
<el-color-picker v-model="colorValue" :predefine="predefineColors" /> <el-color-picker v-model="colorValue"
:predefine="predefineColors" />
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleSaveClick"> </el-button> <el-button type="primary"
@click="handleSaveClick"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -98,7 +117,7 @@ export default {
}, },
} }
</script> </script>
<style lang="less" scoped> <style lang="scss" scoped>
.color-box { .color-box {
.title { .title {
display: flex; display: flex;

@ -1,80 +0,0 @@
<template>
<el-collapse accordion>
<el-collapse-item
v-for="(item, index) in options"
:key="index"
:title="item.name"
:name="index"
>
<dynamicForm
:options="item.list"
@onChanged="onChanged"
/>
</el-collapse-item>
</el-collapse>
</template>
<script>
import dynamicForm from './dynamicForm'
export default {
name: 'WidgetTemp',
components: {
dynamicForm,
},
props: {
options: Array,
},
data() {
return {
formData: {},
}
},
watch: {
options(val) {
console.log(val)
}
},
mounted() {
this.handlerOptions()
},
methods: {
onChanged(val) {
console.log(val)
for (const i in val) {
this.formData[i] = this.deepClone(val[i])
}
this.$emit('onChanged', this.formData)
},
handlerOptions() {
for (let i = 0; i < this.options.length; i++) {
const item = this.options[i]
for (let j = 0; j < item.list.length; j++) {
this.formData[item.list[j].name] = item.list[j].value
}
}
},
},
}
</script>
<style scoped lang="scss">
.el-collapse {
border-top: none;
border-bottom: none;
}
/deep/.el-collapse-item__header {
height: 40px;
line-height: 40px;
background: transparent;
color: #bcc9d4;
font-weight: 300;
font-size: 12px;
border-color: #282e3a;
}
/deep/.el-collapse-item__wrap {
background: transparent;
border: none;
}
/deep/.el-collapse-item__content {
padding-bottom: 0;
}
</style>

@ -36,7 +36,6 @@ export default {
data() { data() {
return { return {
dataSetValue: '', dataSetValue: '',
dataSet: [], // dataSet: [], //
userNameList: [], // userNameList: [], //
setParamList: [], // setParamList: [], //

@ -1,3 +1,4 @@
/* eslint-disable vue/valid-v-for */
<!-- <!--
* @Author: lide1202@hotmail.com * @Author: lide1202@hotmail.com
* @Date: 2021-4-6 11:04:24 * @Date: 2021-4-6 11:04:24
@ -8,130 +9,74 @@
<div class="collapse-input-style"> <div class="collapse-input-style">
<el-form label-width="80px" label-position="left"> <el-form label-width="80px" label-position="left">
<template v-for="(item, index) in options"> <template v-for="(item, index) in options">
<el-form-item v-if="inputShow[item.name]" :key="index" :label="item.label" :prop="item.name" :required="item.required"> <div v-if="isShowForm(item, '[object Object]')" :key="index">
<el-input-number <el-form-item v-if="inputShow[item.name]" :label="item.label" :prop="item.name" :required="item.required">
v-if="item.type == 'el-input-number'" <el-input-number v-if="item.type == 'el-input-number'" v-model="formData[item.name]" controls-position="right" :placeholder="item.placeholder" @change="changed($event, item.name)" />
v-model="formData[item.name]"
controls-position="right"
:placeholder="item.placeholder"
@change="changed($event, item.name)"
/>
<el-input <el-input v-if="item.type == 'el-input-text'" v-model.trim="formData[item.name]" type="text" placeholder="请输入内容" clearable @change="changed($event, item.name)" />
v-if="item.type == 'el-input-text'"
v-model.trim="formData[item.name]"
type="text"
placeholder="请输入内容"
clearable
@change="changed($event, item.name)"
/>
<el-input <el-input v-if="item.type == 'el-input-textarea'" v-model.trim="formData[item.name]" type="textarea" rows="2" placeholder="请输入内容" @change="changed($event, item.name)" />
v-if="item.type == 'el-input-textarea'"
v-model.trim="formData[item.name]"
type="textarea"
rows="2"
placeholder="请输入内容"
@change="changed($event, item.name)"
/>
<el-switch <el-switch v-if="item.type == 'el-switch'" v-model="formData[item.name]" placeholder="请输入内容" @change="changed($event, item.name)" />
v-if="item.type == 'el-switch'"
v-model="formData[item.name]"
placeholder="请输入内容"
@change="changed($event, item.name)"
/>
<ColorPicker <ColorPicker v-if="item.type == 'vue-color'" v-model="formData[item.name]" @change="(val) => changed(val, item.name)" />
v-if="item.type == 'vue-color'"
v-model="formData[item.name]"
@change="(val) => changed(val, item.name)"
/>
<el-upload <el-upload v-if="item.type == 'el-upload-picture'" action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card" />
v-if="item.type == 'el-upload-picture'"
action="https://jsonplaceholder.typicode.com/posts/"
list-type="picture-card"
/>
<el-radio-group <el-radio-group v-if="item.type == 'el-radio-group'" v-model="formData[item.name]" @change="(val) => changed(val, item.name)">
v-if="item.type == 'el-radio-group'" <el-radio v-for="itemChild in item.selectOptions" :key="itemChild.code" :label="itemChild.code">{{ itemChild.name }}</el-radio>
v-model="formData[item.name]"
@change="(val) => changed(val, item.name)"
>
<el-radio
v-for="itemChild in item.selectOptions"
:key="itemChild.code"
:label="itemChild.code"
>{{ itemChild.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-select <el-select v-if="item.type == 'el-select'" v-model="formData[item.name]" clearable placeholder="请选择" @change="(val) => changed(val, item.name)">
v-if="item.type == 'el-select'" <el-option v-for="itemChild in item.selectOptions" :key="itemChild.code" :label="itemChild.name" :value="itemChild.code" />
v-model="formData[item.name]"
clearable
placeholder="请选择"
@change="(val) => changed(val, item.name)"
>
<el-option
v-for="itemChild in item.selectOptions"
:key="itemChild.code"
:label="itemChild.name"
:value="itemChild.code"
/>
</el-select> </el-select>
<el-slider <el-slider v-if="item.type == 'el-slider'" v-model="formData[item.name]" @change="(val) => changed(val, item.name)" />
v-if="item.type == 'el-slider'"
v-model="formData[item.name]"
@change="(val) => changed(val, item.name)"
/>
<el-button <el-button v-if="item.type == 'el-button'" type="primary" plain @click="addStaticData"></el-button>
v-if="item.type == 'el-button'"
type="primary"
plain
@click="addStaticData"
>编辑</el-button>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog <el-dialog title="代码编辑" :visible.sync="dialogVisibleStaticData" width="50%" :before-close="handleClose">
title="代码编辑" <codemirror v-model.trim="formData[item.name]" class="code-mirror" :options="optionsJavascript" style="height: 190px" />
:visible.sync="dialogVisibleStaticData" <span slot="footer" class="dialog-footer">
width="50%"
:before-close="handleClose"
>
<codemirror
v-model.trim="formData[item.name]"
class="code-mirror"
:options="optionsJavascript"
style="height: 190px"
/>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="dialogVisibleStaticData = false"> </el-button> <el-button @click="dialogVisibleStaticData = false"> </el-button>
<el-button <el-button type="primary" @click="saveData"> </el-button>
type="primary"
@click="saveData"
> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</el-form-item> </el-form-item>
<dynamicComponents v-if="item.type == 'dycustComponents' && inputShow[item.name]" v-model="formData[item.name]" :chart-type="item.chartType" />
</div>
<div v-else-if="isShowForm(item, '[object Array]')" :key="'a-' + index">
<el-collapse accordion>
<el-collapse-item v-for="(itemChild, indexChild) in item" :key="indexChild" :title="itemChild.name" :name="indexChild">
<template v-for="(itemChildList, idx) in itemChild.list">
<el-form-item :key="idx" :label="itemChildList.label" :prop="itemChildList.name" :required="itemChildList.required">
<el-input-number v-if="itemChildList.type == 'el-input-number'" v-model="formData[itemChildList.name]" controls-position="right" :placeholder="itemChildList.placeholder" @change="changed($event, itemChildList.name)" />
<el-input v-if="itemChildList.type == 'el-input-text'" v-model.trim="formData[itemChildList.name]" type="text" placeholder="请输入内容" clearable @change="changed($event, itemChildList.name)" />
<el-input v-if="itemChildList.type == 'el-input-textarea'" v-model.trim="formData[itemChildList.name]" type="textarea" rows="2" placeholder="请输入内容" @change="changed($event, itemChildList.name)" />
<el-switch v-if="itemChildList.type == 'el-switch'" v-model="formData[itemChildList.name]" placeholder="请输入内容" @change="changed($event, itemChildList.name)" />
<ColorPicker v-if="itemChildList.type == 'vue-color'" v-model="formData[itemChildList.name]" @change="(val) => changed(val, itemChildList.name)" />
<el-upload v-if="itemChildList.type == 'el-upload-picture'" action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card" />
<el-radio-group v-if="itemChildList.type == 'el-radio-group'" v-model="formData[itemChildList.name]" @change="(val) => changed(val, itemChildList.name)">
<el-radio v-for="it in itemChildList.selectOptions" :key="it.code" :label="it.code">{{ it.name }}</el-radio>
</el-radio-group>
<el-select v-if="itemChildList.type == 'el-select'" v-model="formData[itemChildList.name]" clearable placeholder="请选择" @change="(val) => changed(val, itemChildList.name)">
<el-option v-for="it in itemChildList.selectOptions" :key="it.code" :label="it.name" :value="it.code" />
</el-select>
<el-slider v-if="itemChildList.type == 'el-slider'" v-model="formData[itemChildList.name]" @change="(val) => changed(val, itemChildList.name)" />
</el-form-item>
<customColorComponents v-if="itemChildList.type == 'customColor'" :key="'b-' + idx" v-model="formData[itemChildList.name]" />
</template> </template>
<!-- 自定义组件 --> </el-collapse-item>
<template v-for="item in options"> </el-collapse>
<div :key="item.name">
<dynamicComponents
v-if="item.type == 'dycustComponents' && inputShow[item.name]"
v-model="formData[item.name]"
:chart-type="item.chartType"
/>
<customColorComponents
v-if="item.type == 'customColor' && inputShow[item.name]"
v-model="formData[item.name]"
/>
</div> </div>
</template> </template>
</el-form> </el-form>
@ -150,7 +95,6 @@ import 'codemirror/mode/sql/sql.js'
import 'codemirror/mode/shell/shell.js' import 'codemirror/mode/shell/shell.js'
import dynamicComponents from './dynamicComponents.vue' import dynamicComponents from './dynamicComponents.vue'
import customColorComponents from './customColorComponents' import customColorComponents from './customColorComponents'
import vueJsonEditor from 'vue-json-editor'
export default { export default {
name: 'DynamicForm', name: 'DynamicForm',
components: { components: {
@ -158,8 +102,6 @@ export default {
codemirror, codemirror,
dynamicComponents, dynamicComponents,
customColorComponents, customColorComponents,
// eslint-disable-next-line vue/no-unused-components
vueJsonEditor
}, },
model: { model: {
prop: 'value', prop: 'value',
@ -194,7 +136,6 @@ export default {
}, },
watch: { watch: {
value(newValue, oldValue) { value(newValue, oldValue) {
console.log(newValue)
this.formData = newValue || {} this.formData = newValue || {}
}, },
options() { options() {
@ -265,11 +206,25 @@ export default {
setDefaultValue() { setDefaultValue() {
if (this.options && this.options.length > 0) { if (this.options && this.options.length > 0) {
for (let i = 0; i < this.options.length; i++) { for (let i = 0; i < this.options.length; i++) {
const obj = this.options[i]
if (Object.prototype.toString.call(obj) == '[object Object]') {
this.formData[this.options[i].name] = this.deepClone(this.options[i].value) this.formData[this.options[i].name] = this.deepClone(this.options[i].value)
} else if (Object.prototype.toString.call(obj) == '[object Array]') {
for (let j = 0; j < obj.length; j++) {
const list = obj[j].list
list.forEach((el) => {
this.formData[el.name] = el.value
})
}
}
} }
this.formData = Object.assign({}, this.formData) this.formData = Object.assign({}, this.formData)
} }
}, },
//
isShowForm(val, type) {
return Object.prototype.toString.call(val) == type
},
}, },
} }
</script> </script>
@ -283,4 +238,24 @@ export default {
width: 100%; width: 100%;
height: 100% !important; height: 100% !important;
} }
.el-collapse {
border-top: none;
border-bottom: none;
}
/deep/.el-collapse-item__header {
height: 40px;
line-height: 40px;
background: transparent;
color: #bcc9d4;
font-weight: 300;
font-size: 12px;
border-color: #282e3a;
}
/deep/.el-collapse-item__wrap {
background: transparent;
border: none;
}
/deep/.el-collapse-item__content {
padding-bottom: 0;
}
</style> </style>

@ -6,15 +6,20 @@
!--> !-->
<template> <template>
<div class="layout"> <div class="layout">
<div v-if="toolIsShow" class="layout-left" :style="{ width: widthLeftForTools + 'px' }"> <div v-if="toolIsShow"
<el-tabs type="border-card" :stretch="true"> class="layout-left"
:style="{ width: widthLeftForTools + 'px' }">
<el-tabs type="border-card"
:stretch="true">
<!-- 左侧组件栏--> <!-- 左侧组件栏-->
<el-tab-pane label="工具栏"> <el-tab-pane label="工具栏">
<!-- <el-divider content-position="center">html</el-divider>--> <!-- <el-divider content-position="center">html</el-divider>-->
<draggable v-for="widget in widgetTools" :key="widget.code" @end="(evt) => widgetOnDragged(evt, widget.code)"> <draggable v-for="widget in widgetTools"
:key="widget.code"
@end="(evt) => widgetOnDragged(evt, widget.code)">
<div class="tools-item"> <div class="tools-item">
<span class="tools-item-icon"> <span class="tools-item-icon">
<svg-icon :icon-class="widget.icon" /> <!-- <svg-icon :icon-class="widget.icon" /> -->1
</span> </span>
<span class="tools-item-text">{{ widget.label }}</span> <span class="tools-item-text">{{ widget.label }}</span>
</div> </div>
@ -22,9 +27,11 @@
</el-tab-pane> </el-tab-pane>
<!-- 左侧图层--> <!-- 左侧图层-->
<el-tab-pane label="图层"> <el-tab-pane label="图层">
<div v-for="(item, index) in layerWidget" :key="index" class="tools-item"> <div v-for="(item, index) in layerWidget"
:key="index"
class="tools-item">
<span class="tools-item-icon"> <span class="tools-item-icon">
<svg-icon :icon-class="item.icon" /> <!-- <svg-icon :icon-class="item.icon" /> -->2
</span> </span>
<span class="tools-item-text">{{ item.label }}</span> <span class="tools-item-text">{{ item.label }}</span>
</div> </div>
@ -32,48 +39,90 @@
</el-tabs> </el-tabs>
</div> </div>
<div class="layout-left-fold" :style="{ width: widthLeftForToolsHideButton + 'px' }" @click="toolIsShow = !toolIsShow"> <div class="layout-left-fold"
:style="{ width: widthLeftForToolsHideButton + 'px' }"
@click="toolIsShow = !toolIsShow">
<i class="iconfont iconfold" /> <i class="iconfont iconfold" />
</div> </div>
<div class="layout-middle" :style="{ width: middleWidth + 'px', height: middleHeight + 'px' }"> <div class="layout-middle"
:style="{ width: middleWidth + 'px', height: middleHeight + 'px' }">
<div class="top-button"> <div class="top-button">
<span class="btn"> <span class="btn">
<el-tooltip class="item" effect="dark" content="保存" placement="bottom"> <el-tooltip class="item"
<svg-icon icon-class="report" @click="saveData" /> effect="dark"
content="保存"
placement="bottom">
<!-- <svg-icon icon-class="report" @click="saveData" /> -->3
</el-tooltip> </el-tooltip>
</span> </span>
<span class="btn"> <span class="btn">
<el-tooltip class="item" effect="dark" content="预览" placement="bottom"> <el-tooltip class="item"
<svg-icon icon-class="eye-open" @click="viewScreen" /> effect="dark"
content="预览"
placement="bottom">
<!-- <svg-icon icon-class="eye-open" @click="viewScreen" /> -->4
</el-tooltip> </el-tooltip>
</span> </span>
</div> </div>
<div class="workbench-container" :style="{ width: bigscreenWidthInWorkbench + 'px', height: bigscreenHeightInWorkbench + 'px' }"> <div class="workbench-container"
<vue-ruler-tool v-model="dashboard.presetLine" class="vueRuler" :step-length="50" :parent="true" :position="'relative'" :is-scale-revise="true" :visible.sync="dashboard.presetLineVisible"> :style="{ width: bigscreenWidthInWorkbench + 'px', height: bigscreenHeightInWorkbench + 'px' }">
<div id="workbench" class="workbench" :style="{ transform: workbenchTransform, width: bigscreenWidth + 'px', height: bigscreenHeight + 'px', 'background-color': dashboard.backgroundColor, 'background-image': 'url(' + dashboard.backgroundImage + ')', 'background-position': '0% 0%', 'background-size': '100% 100%', 'background-repeat': 'initial', 'background-attachment': 'initial', 'background-origin': 'initial', 'background-clip': 'initial' }" @click="setOptionsOnClickScreen"> <vue-ruler-tool v-model="dashboard.presetLine"
<widget v-for="(widget, index) in widgets" :key="index" v-model="widget.value" :index="index" :type="widget.type" :bigscreen="{ bigscreenWidth, bigscreenHeight }" @onActivated="setOptionsOnClickWidget" @contextmenu.prevent.native="rightClick($event, index)" /> class="vueRuler"
:step-length="50"
:parent="true"
:position="'relative'"
:is-scale-revise="true"
:visible.sync="dashboard.presetLineVisible">
<div id="workbench"
class="workbench"
:style="{ transform: workbenchTransform, width: bigscreenWidth + 'px', height: bigscreenHeight + 'px', 'background-color': dashboard.backgroundColor, 'background-image': 'url(' + dashboard.backgroundImage + ')', 'background-position': '0% 0%', 'background-size': '100% 100%', 'background-repeat': 'initial', 'background-attachment': 'initial', 'background-origin': 'initial', 'background-clip': 'initial' }"
@click="setOptionsOnClickScreen">
<widget v-for="(widget, index) in widgets"
:key="index"
v-model="widget.value"
:index="index"
:type="widget.type"
:bigscreen="{ bigscreenWidth, bigscreenHeight }"
@onActivated="setOptionsOnClickWidget"
@contextmenu.prevent.native="rightClick($event, index)" />
</div> </div>
</vue-ruler-tool> </vue-ruler-tool>
</div> </div>
</div> </div>
<div class="layout-right" :style="{ width: widthLeftForOptions + 'px' }"> <div class="layout-right"
<el-tabs v-model="activeName" type="border-card" :stretch="true"> :style="{ width: widthLeftForOptions + 'px' }">
<el-tab-pane v-if="isNotNull(widgetOptions.setup) || isNotNull(widgetOptions.collapse)" name="first" label="配置"> <el-tabs v-model="activeName"
<dynamicForm ref="formData" :options="widgetOptions.setup" @onChanged="(val) => widgetValueChanged('setup', val)" /> type="border-card"
<dynamicCollapseForm v-if="widgetOptions.collapse && widgetOptions.collapse.length > 0" ref="formData" :options="widgetOptions.collapse" @onChanged="(val) => widgetValueChanged('collapse', val)" /> :stretch="true">
<el-tab-pane v-if="isNotNull(widgetOptions.setup) || isNotNull(widgetOptions.collapse)"
name="first"
label="配置">
<dynamicForm ref="formData"
:options="widgetOptions.setup"
@onChanged="(val) => widgetValueChanged('setup', val)" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="isNotNull(widgetOptions.data)" name="second" label="数据"> <el-tab-pane v-if="isNotNull(widgetOptions.data)"
<dynamicForm ref="formData" :options="widgetOptions.data" @onChanged="(val) => widgetValueChanged('data', val)" /> name="second"
label="数据">
<dynamicForm ref="formData"
:options="widgetOptions.data"
@onChanged="(val) => widgetValueChanged('data', val)" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="isNotNull(widgetOptions.position)" name="third" label="坐标"> <el-tab-pane v-if="isNotNull(widgetOptions.position)"
<dynamicForm ref="formData" :options="widgetOptions.position" @onChanged="(val) => widgetValueChanged('position', val)" /> name="third"
label="坐标">
<dynamicForm ref="formData"
:options="widgetOptions.position"
@onChanged="(val) => widgetValueChanged('position', val)" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<content-menu :visible.sync="visibleContentMenu" :style-obj="styleObj" @deletelayer="deletelayer" /> <content-menu :visible.sync="visibleContentMenu"
:style-obj="styleObj"
@deletelayer="deletelayer" />
</div> </div>
</template> </template>
@ -82,7 +131,6 @@ import { insertDashboard, detailDashboard } from '@/api/bigscreen'
import { widgetTools, getToolByCode } from './tools' import { widgetTools, getToolByCode } from './tools'
import widget from './widget/widget.vue' import widget from './widget/widget.vue'
import dynamicForm from './form/dynamicForm.vue' import dynamicForm from './form/dynamicForm.vue'
import dynamicCollapseForm from './form/dynamicCollapseForm.vue'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import VueRulerTool from 'vue-ruler-tool' // import VueRulerTool from 'vue-ruler-tool' //
import contentMenu from './form/contentMenu' import contentMenu from './form/contentMenu'
@ -93,7 +141,6 @@ export default {
VueRulerTool, VueRulerTool,
widget, widget,
dynamicForm, dynamicForm,
dynamicCollapseForm,
contentMenu, contentMenu,
}, },
data () { data () {
@ -147,7 +194,6 @@ export default {
// //
widgetOptions: { widgetOptions: {
setup: [], // setup: [], //
collapse: [],
data: [], // data: [], //
position: [], // position: [], //
}, },
@ -238,6 +284,7 @@ export default {
} }
}, },
handleInitEchartsData (data) { handleInitEchartsData (data) {
console.log(data)
const widgets = data.dashboard.widgets const widgets = data.dashboard.widgets
const widgetsData = [] const widgetsData = []
for (let i = 0; i < widgets.length; i++) { for (let i = 0; i < widgets.length; i++) {
@ -281,17 +328,17 @@ export default {
} }
} }
} }
// collapse // // collapse
for (const key in data.collapse) { // for (const key in data.collapse) {
for (let i = 0; i < option.collapse.length; i++) { // for (let i = 0; i < option.collapse.length; i++) {
const itemList = option.collapse[i].list // const itemList = option.collapse[i].list
for (let j = 0; j < itemList.length; j++) { // for (let j = 0; j < itemList.length; j++) {
if (key == itemList[j].name) { // if (key == itemList[j].name) {
itemList[j].value = data.collapse[key] // itemList[j].value = data.collapse[key]
} // }
} // }
} // }
} // }
return option return option
}, },
// //
@ -311,14 +358,15 @@ export default {
}, },
widgets: this.widgets, widgets: this.widgets,
} }
console.log(this.dashboard)
console.log(screenData)
const { code, data } = await insertDashboard(screenData) const { code, data } = await insertDashboard(screenData)
if (code != '200') return if (code != '200') return
}, },
// //
viewScreen () { viewScreen () {
var routeUrl = this.$router.resolve({ path: '/report/bigscreen/viewer', query: { reportCode: this.$route.query.reportCode }}) var routeUrl = this.$router.resolve({
path: '/report/bigscreen/viewer',
query: { reportCode: this.$route.query.reportCode },
})
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
}, },
// //
@ -344,13 +392,11 @@ export default {
// //
var tool = getToolByCode(widgetType) var tool = getToolByCode(widgetType)
var widgetJson = { var widgetJson = {
type: widgetType, type: widgetType,
value: { value: {
setup: {}, setup: {},
data: {}, data: {},
collapse: {},
position: { position: {
width: 0, width: 0,
height: 0, height: 0,
@ -361,14 +407,10 @@ export default {
}, },
options: tool.options, options: tool.options,
} }
// //
const widgetJsonValue = this.handleDefaultValue(widgetJson) const widgetJsonValue = this.handleDefaultValue(widgetJson)
// //
this.widgets.push(this.deepClone(widgetJsonValue)) this.widgets.push(this.deepClone(widgetJsonValue))
console.log(this.widgets)
// //
this.setOptionsOnClickWidget(this.widgets.length - 1) this.setOptionsOnClickWidget(this.widgets.length - 1)
@ -382,8 +424,15 @@ export default {
// setup // setup
for (let i = 0; i < widgetJson.options.setup.length; i++) { for (let i = 0; i < widgetJson.options.setup.length; i++) {
const item = widgetJson.options.setup[i] const item = widgetJson.options.setup[i]
if (item.value) { if (Object.prototype.toString.call(item) == '[object Object]') {
widgetJson.value.setup[item.name] = item.value widgetJson.value.setup[item.name] = item.value
} else if (Object.prototype.toString.call(item) == '[object Array]') {
for (let j = 0; j < item.length; j++) {
const list = item[j].list
list.forEach((el) => {
widgetJson.value.setup[el.name] = el.value
})
}
} }
} }
// position // position
@ -393,18 +442,6 @@ export default {
widgetJson.value.position[item.name] = item.value widgetJson.value.position[item.name] = item.value
} }
} }
// collapse
if (widgetJson.options.collapse && widgetJson.options.collapse.length > 0) {
for (let i = 0; i < widgetJson.options.collapse.length; i++) {
const itemList = widgetJson.options.collapse[i].list
for (let j = 0; j < itemList.length; j++) {
const itemChildList = itemList[j]
if (itemChildList.value) {
widgetJson.value.collapse[itemChildList.name] = itemChildList.value
}
}
}
}
// data // data
if (widgetJson.options.data && widgetJson.options.data.length > 0) { if (widgetJson.options.data && widgetJson.options.data.length > 0) {
for (let i = 0; i < widgetJson.options.data.length; i++) { for (let i = 0; i < widgetJson.options.data.length; i++) {
@ -437,6 +474,7 @@ export default {
return return
} }
this.widgetIndex = index this.widgetIndex = index
console.log(this.deepClone(this.widgets[index]['options']))
this.widgetOptions = this.deepClone(this.widgets[index]['options']) this.widgetOptions = this.deepClone(this.widgets[index]['options'])
return return
} else { } else {
@ -456,17 +494,16 @@ export default {
position: {} position: {}
} }
}]*/ }]*/
if (this.screenCode == 'screen') { if (this.screenCode == 'screen') {
this.dashboard = this.deepClone(val) this.dashboard = this.deepClone(val)
} }
for (let i = 0; i < this.widgets.length; i++) { for (let i = 0; i < this.widgets.length; i++) {
if (this.widgetIndex == i) { if (this.widgetIndex == i) {
this.widgets[i].value[key] = this.deepClone(val) this.widgets[i].value[key] = this.deepClone(val)
this.setDefaultValue(this.widgets[i].options[key], key, val) this.setDefaultValue(this.widgets[i].options[key], val)
} }
} }
// console.log(this.widgets)
}, },
rightClick (event, index) { rightClick (event, index) {
this.rightClickIndex = index this.rightClickIndex = index
@ -485,30 +522,28 @@ export default {
deletelayer () { deletelayer () {
this.widgets.splice(this.rightClickIndex, 1) this.widgets.splice(this.rightClickIndex, 1)
}, },
setDefaultValue(options, type, val) { setDefaultValue (options, val) {
// type: setupcollapsedataposition for (let i = 0; i < options.length; i++) {
const optionsArr = options if (Object.prototype.toString.call(options[i]) == '[object Object]') {
if (type == 'collapse') {
for (let i = 0; i < optionsArr.length; i++) {
const list = optionsArr[i].list
for (let j = 0; j < list.length; j++) {
for (const k in val) { for (const k in val) {
if (list[j].name == k) { if (options[i].name == k) {
list[j].value = val[k] options[i].value = val[k]
} }
} }
} } else if (Object.prototype.toString.call(options[i]) == '[object Array]') {
} for (let j = 0; j < options[i].length; j++) {
} else { const list = options[i][j].list
for (let i = 0; i < optionsArr.length; i++) { for (let z = 0; z < list.length; z++) {
for (const k in val) { for (const k in val) {
if (optionsArr[i].name == k) { if (list[z].name == k) {
optionsArr[i].value = val[k] list[z].value = val[k]
} }
} }
} }
} }
} }
}
},
}, },
} }
</script> </script>

File diff suppressed because it is too large Load Diff

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -48,14 +47,14 @@ export default {
type: 'bar', type: 'bar',
barGap: '0%', barGap: '0%',
itemStyle: { itemStyle: {
borderRadius: null borderRadius: null,
} },
}, },
], ],
}, },
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsSetup: {},
} }
}, },
computed: { computed: {
@ -66,15 +65,17 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
console.log(val)
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.setup
this.optionsSetup = val.setup this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
@ -84,7 +85,7 @@ export default {
mounted() { mounted() {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.setup
this.optionsSetup = this.value.setup this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
@ -103,10 +104,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.textAlign = optionsCollapse.textAlign title.show = optionsCollapse.isNoTitle
title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -123,7 +125,7 @@ export default {
}, },
// X // X
setOptionsX() { setOptionsX() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const xAxis = { const xAxis = {
type: 'category', type: 'category',
show: optionsCollapse.hideX, // show: optionsCollapse.hideX, //
@ -143,12 +145,18 @@ export default {
fontSize: optionsCollapse.fontSizeX, fontSize: optionsCollapse.fontSizeX,
}, },
}, },
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
} }
this.options.xAxis = xAxis this.options.xAxis = xAxis
}, },
// Y // Y
setOptionsY() { setOptionsY() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const yAxis = { const yAxis = {
type: 'value', type: 'value',
show: optionsCollapse.isShowY, // show: optionsCollapse.isShowY, //
@ -165,13 +173,22 @@ export default {
fontSize: optionsCollapse.fontSizeY, fontSize: optionsCollapse.fontSizeY,
}, },
}, },
splitLine: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
} }
this.options.yAxis = yAxis this.options.yAxis = yAxis
}, },
// or // or
setOptionsTop() { setOptionsTop() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
for (const key in series) { for (const key in series) {
@ -192,7 +209,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -205,19 +222,19 @@ export default {
}, },
// //
setOptionsMargin() { setOptionsMargin() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const grid = { const grid = {
left: optionsCollapse.marginLeft, left: optionsCollapse.marginLeft,
right: optionsCollapse.marginRight, right: optionsCollapse.marginRight,
bottom: optionsCollapse.marginBottom, bottom: optionsCollapse.marginBottom,
top: optionsCollapse.marginTop, top: optionsCollapse.marginTop,
containLabel: true containLabel: true,
} }
this.options.grid = grid this.options.grid = grid
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -233,22 +250,22 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
let itemStyle = { const itemStyle = {
normal: { normal: {
color: (params) => { color: (params) => {
return arrColor[params.dataIndex] return arrColor[params.dataIndex]
}, },
barBorderRadius: optionsCollapse.radius barBorderRadius: optionsCollapse.radius,
} },
} }
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'bar') { if (this.options.series[key].type == 'bar') {
this.options.series[key].itemStyle = itemStyle this.options.series[key].itemStyle = itemStyle
} }
@ -258,7 +275,9 @@ export default {
// //
setOptionsData() { setOptionsData() {
const optionsSetup = this.optionsSetup const optionsSetup = this.optionsSetup
console.log(optionsSetup)
const optionsData = this.optionsData // or const optionsData = this.optionsData // or
console.log(optionsData)
optionsData.dataType == 'staticData' ? this.staticDataFn(optionsData.staticData, optionsSetup) : this.dynamicDataFn(optionsData.dynamicData, optionsSetup) optionsData.dataType == 'staticData' ? this.staticDataFn(optionsData.staticData, optionsSetup) : this.dynamicDataFn(optionsData.dynamicData, optionsSetup)
}, },
// //
@ -278,7 +297,7 @@ export default {
} }
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
if (series[i].type == 'bar') { if (series[i].type == 'bar') {
series[i].data = staticData.series[0].data series[i].data = staticData.series[0].data
} }
@ -286,6 +305,7 @@ export default {
}, },
// //
dynamicDataFn(val, optionsSetup) { dynamicDataFn(val, optionsSetup) {
console.log(val)
if (!val) return if (!val) return
// x // x
if (optionsSetup.verticalShow) { if (optionsSetup.verticalShow) {
@ -302,7 +322,7 @@ export default {
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
if (series[i].type == 'bar') { if (series[i].type == 'bar') {
series[i].data = val.series[i].data series[i].data = val.series[i].data
} }

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -32,7 +31,7 @@ export default {
textStyle: { textStyle: {
color: '#fff', color: '#fff',
}, },
data: ["货运量", "货运总量"] data: ['货运量', '货运总量'],
}, },
xAxis: [ xAxis: [
{ {
@ -80,21 +79,22 @@ export default {
type: 'bar', type: 'bar',
data: [], data: [],
itemStyle: { itemStyle: {
barBorderRadius: null barBorderRadius: null,
} },
}, },
{ {
name: '', name: '',
type: 'line', type: 'line',
yAxisIndex: 1, yAxisIndex: 1,
data: [], data: [],
itemStyle: {} itemStyle: {},
}, },
], ],
}, },
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsCollapse: {}, //
optionsSetup: {},
} }
}, },
computed: { computed: {
@ -105,6 +105,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -114,6 +115,7 @@ export default {
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.collapse
this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
deep: true, deep: true,
@ -123,6 +125,7 @@ export default {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.collapse
this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
methods: { methods: {
@ -141,10 +144,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.textAlign = optionsCollapse.textAlign title.show = optionsCollapse.isNoTitle
title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -161,8 +165,7 @@ export default {
}, },
// X // X
setOptionsX() { setOptionsX() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
console.log(optionsCollapse)
const xAxis = { const xAxis = {
type: 'category', type: 'category',
show: optionsCollapse.hideX, // show: optionsCollapse.hideX, //
@ -182,12 +185,18 @@ export default {
fontSize: optionsCollapse.fontSizeX, fontSize: optionsCollapse.fontSizeX,
}, },
}, },
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
} }
this.options.xAxis = xAxis this.options.xAxis = xAxis
}, },
// Y // Y
setOptionsY() { setOptionsY() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const yAxis = [ const yAxis = [
{ {
type: 'value', type: 'value',
@ -205,6 +214,15 @@ export default {
fontSize: optionsCollapse.fontSizeY, fontSize: optionsCollapse.fontSizeY,
}, },
}, },
splitLine: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
}, },
{ {
type: 'value', type: 'value',
@ -222,6 +240,15 @@ export default {
fontSize: optionsCollapse.fontSizeY, fontSize: optionsCollapse.fontSizeY,
}, },
}, },
splitLine: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
}, },
] ]
@ -229,7 +256,7 @@ export default {
}, },
// 线 // 线
setOptionsTop() { setOptionsTop() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
for (const key in series) { for (const key in series) {
if (series[key].type == 'line') { if (series[key].type == 'line') {
@ -262,7 +289,7 @@ export default {
this.options.series = series this.options.series = series
}, },
setOptionsBar() { setOptionsBar() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
for (const key in series) { for (const key in series) {
if (series[key].type == 'bar') { if (series[key].type == 'bar') {
@ -283,7 +310,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -296,19 +323,19 @@ export default {
}, },
// //
setOptionsMargin() { setOptionsMargin() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const grid = { const grid = {
left: optionsCollapse.marginLeft, left: optionsCollapse.marginLeft,
right: optionsCollapse.marginRight, right: optionsCollapse.marginRight,
bottom: optionsCollapse.marginBottom, bottom: optionsCollapse.marginBottom,
top: optionsCollapse.marginTop, top: optionsCollapse.marginTop,
containLabel: true containLabel: true,
} }
this.options.grid = grid this.options.grid = grid
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -324,10 +351,10 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
@ -345,8 +372,8 @@ export default {
this.options.xAxis.data = staticData.xAxis this.options.xAxis.data = staticData.xAxis
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
for (let j in staticData.series) { for (const j in staticData.series) {
if (series[i].type == staticData.series[j].type) { if (series[i].type == staticData.series[j].type) {
series[i].data = staticData.series[j].data series[i].data = staticData.series[j].data
} }
@ -359,8 +386,8 @@ export default {
this.options.xAxis.data = val.xAxis this.options.xAxis.data = val.xAxis
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
for (let j in val.series) { for (const j in val.series) {
if (series[i].type == val.series[j].type) { if (series[i].type == val.series[j].type) {
series[i].data = val.series[j].data series[i].data = val.series[j].data
} }

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -75,6 +74,7 @@ export default {
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsCollapse: {}, //
optionsSetup: {},
} }
}, },
computed: { computed: {
@ -85,6 +85,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -94,6 +95,7 @@ export default {
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.collapse
this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
deep: true, deep: true,
@ -103,6 +105,7 @@ export default {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.collapse
this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
methods: { methods: {
@ -117,7 +120,7 @@ export default {
}, },
// //
setOptionsText() { setOptionsText() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
for (const key in series) { for (const key in series) {
@ -133,11 +136,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.show = optionsCollapse.isNoTitle title.show = optionsCollapse.isNoTitle
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.textAlign = optionsCollapse.textAlign title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -154,7 +157,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -167,7 +170,7 @@ export default {
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -183,10 +186,10 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
@ -199,7 +202,7 @@ export default {
}, },
staticDataFn(val) { staticDataFn(val) {
const staticData = JSON.parse(val) const staticData = JSON.parse(val)
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'funnel') { if (this.options.series[key].type == 'funnel') {
this.options.series[key].data = staticData this.options.series[key].data = staticData
} }
@ -207,7 +210,7 @@ export default {
}, },
dynamicDataFn(val) { dynamicDataFn(val) {
if (!val) return if (!val) return
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'funnel') { if (this.options.series[key].type == 'funnel') {
this.options.series[key].data = val this.options.series[key].data = val
} }

@ -61,6 +61,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -106,7 +107,7 @@ export default {
staticDataFn(val) { staticDataFn(val) {
const unit = JSON.parse(val).unit const unit = JSON.parse(val).unit
const series = this.options.series const series = this.options.series
for (let key in series) { for (const key in series) {
series[key].detail.formatter = `{value}${unit}` series[key].detail.formatter = `{value}${unit}`
series[key].data[0] = { series[key].data[0] = {
value: JSON.parse(val).value, value: JSON.parse(val).value,
@ -117,7 +118,7 @@ export default {
dynamicDataFn(val) { dynamicDataFn(val) {
if (!val) return if (!val) return
const series = this.options.series const series = this.options.series
for (let key in series) { for (const key in series) {
series[key].detail.formatter = `{value}${val.unit}` series[key].detail.formatter = `{value}${val.unit}`
series[key].data[0] = { series[key].data[0] = {
value: val.value, value: val.value,

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -53,6 +52,7 @@ export default {
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsCollapse: {}, //
optionsSetup: {},
} }
}, },
computed: { computed: {
@ -63,6 +63,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -72,6 +73,7 @@ export default {
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.collapse
this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
deep: true, deep: true,
@ -81,6 +83,7 @@ export default {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.collapse
this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
methods: { methods: {
@ -95,11 +98,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.show = optionsCollapse.isNoTitle title.show = optionsCollapse.isNoTitle
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.textAlign = optionsCollapse.textAlign title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -116,7 +119,7 @@ export default {
}, },
// //
setOptionsValue() { setOptionsValue() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
const numberValue = optionsCollapse.numberValue ? '{c}' : '' const numberValue = optionsCollapse.numberValue ? '{c}' : ''
const percentage = optionsCollapse.percentage ? '({d})%' : '' const percentage = optionsCollapse.percentage ? '({d})%' : ''
@ -144,7 +147,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -157,7 +160,7 @@ export default {
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -173,10 +176,10 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
@ -189,7 +192,7 @@ export default {
}, },
staticDataFn(val) { staticDataFn(val) {
const staticData = JSON.parse(val) const staticData = JSON.parse(val)
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'pie') { if (this.options.series[key].type == 'pie') {
this.options.series[key].data = staticData this.options.series[key].data = staticData
} }
@ -197,7 +200,7 @@ export default {
}, },
dynamicDataFn(val) { dynamicDataFn(val) {
if (!val) return if (!val) return
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'pie') { if (this.options.series[key].type == 'pie') {
this.options.series[key].data = val this.options.series[key].data = val
} }

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -62,6 +61,7 @@ export default {
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsCollapse: {}, //
optionsSetup: {},
} }
}, },
computed: { computed: {
@ -72,6 +72,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -81,6 +82,7 @@ export default {
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.collapse
this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
deep: true, deep: true,
@ -90,6 +92,7 @@ export default {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.collapse
this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
methods: { methods: {
@ -107,11 +110,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.show = optionsCollapse.isNoTitle title.show = optionsCollapse.isNoTitle
title.textAlign = optionsCollapse.textAlign title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -128,7 +131,7 @@ export default {
}, },
// X // X
setOptionsX() { setOptionsX() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const xAxis = { const xAxis = {
type: 'category', type: 'category',
show: optionsCollapse.hideX, // show: optionsCollapse.hideX, //
@ -148,12 +151,18 @@ export default {
fontSize: optionsCollapse.fontSizeX, fontSize: optionsCollapse.fontSizeX,
}, },
}, },
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
} }
this.options.xAxis = xAxis this.options.xAxis = xAxis
}, },
// Y // Y
setOptionsY() { setOptionsY() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const yAxis = { const yAxis = {
type: 'value', type: 'value',
show: optionsCollapse.isShowY, // show: optionsCollapse.isShowY, //
@ -170,13 +179,22 @@ export default {
fontSize: optionsCollapse.fontSizeY, fontSize: optionsCollapse.fontSizeY,
}, },
}, },
splitLine: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: '#fff',
},
},
} }
this.options.yAxis = yAxis this.options.yAxis = yAxis
}, },
// 线 // 线
setOptionsTop() { setOptionsTop() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
for (const key in series) { for (const key in series) {
if (series[key].type == 'line') { if (series[key].type == 'line') {
@ -210,7 +228,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -223,19 +241,19 @@ export default {
}, },
// //
setOptionsMargin() { setOptionsMargin() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const grid = { const grid = {
left: optionsCollapse.marginLeft, left: optionsCollapse.marginLeft,
right: optionsCollapse.marginRight, right: optionsCollapse.marginRight,
bottom: optionsCollapse.marginBottom, bottom: optionsCollapse.marginBottom,
top: optionsCollapse.marginTop, top: optionsCollapse.marginTop,
containLabel: true containLabel: true,
} }
this.options.grid = grid this.options.grid = grid
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -252,10 +270,10 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
@ -273,7 +291,7 @@ export default {
this.options.xAxis.data = staticData.categories this.options.xAxis.data = staticData.categories
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
if (series[i].type == 'line') { if (series[i].type == 'line') {
series[i].data = staticData.series[0].data series[i].data = staticData.series[0].data
} }
@ -285,7 +303,7 @@ export default {
this.options.xAxis.data = val.xAxis this.options.xAxis.data = val.xAxis
// series // series
const series = this.options.series const series = this.options.series
for (let i in series) { for (const i in series) {
if (series[i].type == 'line') { if (series[i].type == 'line') {
series[i].data = val.series[i].data series[i].data = val.series[i].data
} }

@ -1,7 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" <v-chart :options="options" autoresize />
autoresize />
</div> </div>
</template> </template>
@ -48,6 +47,7 @@ export default {
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, // optionsCollapse: {}, //
optionsSetup: {},
} }
}, },
computed: { computed: {
@ -58,6 +58,7 @@ export default {
height: this.optionsStyle.height + 'px', height: this.optionsStyle.height + 'px',
left: this.optionsStyle.left + 'px', left: this.optionsStyle.left + 'px',
top: this.optionsStyle.top + 'px', top: this.optionsStyle.top + 'px',
background: this.optionsSetup.background,
} }
}, },
}, },
@ -67,6 +68,7 @@ export default {
this.optionsStyle = val.position this.optionsStyle = val.position
this.optionsData = val.data this.optionsData = val.data
this.optionsCollapse = val.collapse this.optionsCollapse = val.collapse
this.optionsSetup = val.setup
this.editorOptions() this.editorOptions()
}, },
deep: true, deep: true,
@ -76,6 +78,7 @@ export default {
this.optionsStyle = this.value.position this.optionsStyle = this.value.position
this.optionsData = this.value.data this.optionsData = this.value.data
this.optionsCollapse = this.value.collapse this.optionsCollapse = this.value.collapse
this.optionsSetup = this.value.setup
this.editorOptions() this.editorOptions()
}, },
methods: { methods: {
@ -90,11 +93,11 @@ export default {
}, },
// //
setOptionsTitle() { setOptionsTitle() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const title = {} const title = {}
title.show = optionsCollapse.isNoTitle title.show = optionsCollapse.isNoTitle
title.text = optionsCollapse.titleText title.text = optionsCollapse.titleText
title.textAlign = optionsCollapse.textAlign title.left = optionsCollapse.textAlign
title.textStyle = { title.textStyle = {
color: optionsCollapse.textColor, color: optionsCollapse.textColor,
fontSize: optionsCollapse.textFontSize, fontSize: optionsCollapse.textFontSize,
@ -111,7 +114,7 @@ export default {
}, },
// //
setOptionsValue() { setOptionsValue() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const series = this.options.series const series = this.options.series
const numberValue = optionsCollapse.numberValue ? '{c}' : '' const numberValue = optionsCollapse.numberValue ? '{c}' : ''
const percentage = optionsCollapse.percentage ? '({d})%' : '' const percentage = optionsCollapse.percentage ? '({d})%' : ''
@ -139,7 +142,7 @@ export default {
}, },
// tooltip // tooltip
setOptionsTooltip() { setOptionsTooltip() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const tooltip = { const tooltip = {
trigger: 'item', trigger: 'item',
show: true, show: true,
@ -152,7 +155,7 @@ export default {
}, },
// legend // legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const legend = this.options.legend const legend = this.options.legend
legend.show = optionsCollapse.isShowLegend legend.show = optionsCollapse.isShowLegend
legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto' legend.left = optionsCollapse.lateralPosition == 'left' ? 0 : 'auto'
@ -168,10 +171,10 @@ export default {
}, },
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsCollapse const optionsCollapse = this.optionsSetup
const customColor = optionsCollapse.customColor const customColor = optionsCollapse.customColor
if (!customColor) return if (!customColor) return
let arrColor = [] const arrColor = []
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color) arrColor.push(customColor[i].color)
} }
@ -184,7 +187,7 @@ export default {
}, },
staticDataFn(val) { staticDataFn(val) {
const staticData = JSON.parse(val) const staticData = JSON.parse(val)
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'pie') { if (this.options.series[key].type == 'pie') {
this.options.series[key].data = staticData this.options.series[key].data = staticData
} }
@ -192,7 +195,7 @@ export default {
}, },
dynamicDataFn(val) { dynamicDataFn(val) {
if (!val) return if (!val) return
for (let key in this.options.series) { for (const key in this.options.series) {
if (this.options.series[key].type == 'pie') { if (this.options.series[key].type == 'pie') {
this.options.series[key].data = val this.options.series[key].data = val
} }

@ -72,11 +72,11 @@ export default {
mounted () { }, mounted () { },
methods: { methods: {
openDesign (reportId) { openDesign (reportId) {
var routeUrl = this.$router.resolve({ path: '/report/bigscreen/designer', query: { reportId: reportId } }) var routeUrl = this.$router.resolve({ path: '/bigscreen/designer', query: { reportId: reportId } })
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
}, },
viewDesign (reportId) { viewDesign (reportId) {
var routeUrl = this.$router.resolve({ path: '/report/bigscreen/viewer', query: { reportId: reportId } }) var routeUrl = this.$router.resolve({ path: '/bigscreen/viewer', query: { reportId: reportId } })
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
}, },
}, },
@ -102,11 +102,11 @@ export default {
} }
.bg::before { .bg::before {
content: ''; content: "";
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url('../../../assets/images/charts.jpg'); background-image: url("../../../assets/images/charts.jpg");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: left top; background-position: left top;

@ -7,7 +7,10 @@
<template> <template>
<div class="layout"> <div class="layout">
<div :style="bigScreenStyle"> <div :style="bigScreenStyle">
<widget v-for="(widget, index) in widgets" :key="index" v-model="widget.value" :type="widget.type" /> <widget v-for="(widget, index) in widgets"
:key="index"
v-model="widget.value"
:type="widget.type" />
</div> </div>
</div> </div>
</template> </template>

@ -340,7 +340,7 @@ export default {
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
} else { } else {
// eslint-disable-next-line no-redeclare // eslint-disable-next-line no-redeclare
var routeUrl = this.$router.resolve({ path: '/report/bigscreen/viewer', query: { reportCode: val.reportCode } }) var routeUrl = this.$router.resolve({ path: '/bigscreen/viewer', query: { reportCode: val.reportCode } })
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
} }
}, },
@ -351,7 +351,7 @@ export default {
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
} else { } else {
// eslint-disable-next-line no-redeclare // eslint-disable-next-line no-redeclare
var routeUrl = this.$router.resolve({ path: '/report/bigscreen/designer', query: { reportCode: val.reportCode, reportId: val.id, accessKey: val.accessKey } }) var routeUrl = this.$router.resolve({ path: '/bigscreen/designer', query: { reportCode: val.reportCode, reportId: val.id, accessKey: val.accessKey } })
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, '_blank')
} }
}, },

Loading…
Cancel
Save