diff --git a/report-ui/config/dev.env.js b/report-ui/config/dev.env.js index ee3d90dc..f50fc84e 100644 --- a/report-ui/config/dev.env.js +++ b/report-ui/config/dev.env.js @@ -4,6 +4,6 @@ const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"', - BASE_API: '"http://127.0.0.1:9095"' - // BASE_API: '"http://10.108.26.197:9095"' + // BASE_API: '"http://127.0.0.1:9095"' + BASE_API: '"http://10.108.26.197:9095"' }) diff --git a/report-ui/src/assets/styles/screen.scss b/report-ui/src/assets/styles/screen.scss new file mode 100644 index 00000000..b412dffb --- /dev/null +++ b/report-ui/src/assets/styles/screen.scss @@ -0,0 +1,508 @@ +.mr10 { + margin-right: 10px; +} + +.ml20 { + margin-left: 20px; +} + +.border-right { + border-right: 1px solid #273b4d; +} + +.border-left { + border-left: 1px solid #273b4d; +} + +.el-icon-arrow-down { + font-size: 10px; +} + +.is-active { + background: #31455d !important; + color: #bfcbd9 !important; +} + +.layout { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: 100%; + height: 100%; + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + + .layout-left { + display: inline-block; + height: 100%; + box-sizing: border-box; + -webkit-box-sizing: border-box; + border: 0px; + background-color: #263445; + + //工具栏一个元素 + .tools-item { + display: flex; + position: relative; + width: 100%; + height: 48px; + align-items: center; + -webkit-box-align: center; + padding: 0 6px; + cursor: pointer; + font-size: 12px; + margin-bottom: 1px; + + .tools-item-icon { + color: #409eff; + margin-right: 10px; + width: 53px; + height: 30px; + line-height: 30px; + text-align: center; + display: block; + border: 1px solid #3a4659; + background: #282a30; + } + + .tools-item-text {} + } + } + + .layout-left-fold { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + height: 100%; + + font-size: 12px; + overflow: hidden; + background-color: #242a30; + cursor: pointer; + padding-top: 26%; + + i { + font-size: 18px; + width: 18px; + height: 23px; + margin-left: 0px; + color: #bfcbd9; + } + } + + .layout-middle { + // display: flex; + position: relative; + //width: calc(100% - 445px); + height: 100%; + background-color: rgb(36, 42, 48); + box-sizing: border-box; + -webkit-box-sizing: border-box; + border: 1px solid rgb(36, 42, 48); + align-items: center; + vertical-align: middle; + text-align: center; + + .top-button { + display: flex; + flex-direction: row; + height: 40px; + line-height: 40px; + margin-left: 9px; + + .btn { + color: #788994; + width: 55px; + text-align: center; + display: block; + cursor: pointer; + + .el-icon-arrow-down { + transform: rotate(0deg); + -ms-transform: rotate(0deg); + /* IE 9 */ + -moz-transform: rotate(0deg); + /* Firefox */ + -webkit-transform: rotate(0deg); + /* Safari 和 Chrome */ + -o-transform: rotate(0deg); + /* Opera */ + transition: all 0.4s ease-in-out; + } + + &:hover { + background: rgb(25, 29, 34); + + .el-icon-arrow-down { + transform: rotate(180deg); + -ms-transform: rotate(180deg); + /* IE 9 */ + -moz-transform: rotate(180deg); + /* Firefox */ + -webkit-transform: rotate(180deg); + /* Safari 和 Chrome */ + -o-transform: rotate(180deg); + /* Opera */ + transition: all 0.4s ease-in-out; + } + } + } + + .btn-disable { + opacity: 0.3; + cursor: no-drop; + } + + .scale-num { + color: #788994; + opacity: 1; + cursor: pointer; + + &.btn-disable { + cursor: no-drop; + + &:hover { + background: #20262c; + } + } + } + } + + .workbench-container { + position: relative; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + overflow: auto; + + .vueRuler { + // width: 100%; + // padding: 18px 0px 0px 18px; + padding: 0; + } + + .workbench { + background-color: #1e1e1e; + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + margin: 0; + padding: 0; + } + + .bg-grid { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-size: 30px 30px, 30px 30px; + background-image: linear-gradient(hsla(0, 0%, 100%, 0.1) 1px, + transparent 0), + linear-gradient(90deg, hsla(0, 0%, 100%, 0.1) 1px, transparent 0); + // z-index: 2; + } + } + + .bottom-text { + width: 100%; + color: #a0a0a0; + font-size: 16px; + position: absolute; + bottom: 20px; + } + } + + .layout-right { + display: inline-block; + height: 100%; + } + + /deep/ .el-tabs--border-card { + border: 0; + + .el-tabs__header { + .el-tabs__nav { + .el-tabs__item { + background-color: #242f3b; + border: 0px; + } + + .el-tabs__item.is-active { + background-color: #31455d; + } + } + } + + .el-tabs__content { + background-color: #242a30; + height: calc(100vh - 39px); + overflow-x: hidden; + overflow-y: auto; + + .el-tab-pane { + color: #bfcbd9; + } + + &::-webkit-scrollbar { + width: 5px; + height: 14px; + } + + &::-webkit-scrollbar-track, + &::-webkit-scrollbar-thumb { + border-radius: 1px; + border: 0 solid transparent; + } + + &::-webkit-scrollbar-track-piece { + /*修改滚动条的背景和圆角*/ + background: #29405c; + } + + &::-webkit-scrollbar-track { + box-shadow: 1px 1px 5px rgba(116, 148, 170, 0.5) inset; + } + + &::-webkit-scrollbar-thumb { + min-height: 20px; + background-clip: content-box; + box-shadow: 0 0 0 5px rgba(116, 148, 170, 0.5) inset; + } + + &::-webkit-scrollbar-corner { + background: transparent; + } + + /*修改垂直滚动条的样式*/ + &::-webkit-scrollbar-thumb:vertical { + background-color: #00113a; + // -webkit-border-radius: 7px; + } + + /*修改水平滚动条的样式*/ + &::-webkit-scrollbar-thumb:horizontal { + background-color: #00113a; + // -webkit-border-radius: 7px; + } + } + } +} + +ul, +li { + list-style: none; + margin: 0; + padding: 0; +} + +.nav { + width: 40px; + padding: 0; + list-style: none; + /* overflow: hidden; */ +} + +.nav { + zoom: 1; +} + +.nav:before, +.nav:after { + content: ""; + display: table; +} + +.nav:after { + clear: both; +} + +.nav>li { + width: 55px; + text-align: left; + position: relative; +} + +.nav>li a { + float: left; + padding: 12px 30px; + color: #999; + font: bold 12px; + text-decoration: none; +} + +.nav>li:hover { + color: #788994; +} + +.nav>li ul { + visibility: hidden; + position: absolute; + z-index: 1000; + list-style: none; + left: 0; + padding: 0; + background-color: rgb(36, 42, 48); + opacity: 0; + _margin: 0; + width: 120px; + transition: all 0.2s ease-in-out; +} + +.nav>li:hover>ul { + opacity: 1; + visibility: visible; + margin: 0; + + li:hover { + background-color: rgb(25, 29, 34); + } +} + +.nav ul li { + float: left; + display: block; + border: 0; + width: 100%; + font-size: 12px; +} + +.nav ul a { + padding: 10px; + width: 100%; + display: block; + float: none; + height: 120px; + border: 1px solid #30445c; + background-color: rgb(25, 29, 34); + transition: all 0.2s ease-in-out; +} + +.nav ul a:hover { + border: 1px solid #3c5e88; +} + +.nav ul li:first-child>a:hover:before { + border-bottom-color: #04acec; +} + +.nav ul ul { + top: 0; + left: 120px; + width: 400px; + height: 300px; + overflow: auto; + padding: 10px; + _margin: 0; +} + +.nav ul ul li { + width: 120px; + height: 120px; + margin-right: 3px; + display: block; + float: left; +} + +.nav .item { + padding: 5px; +} + +/deep/ .vue-ruler-h { + opacity: 0.3; +} + +/deep/ .vue-ruler-v { + opacity: 0.3; +} + +.layout-left { + width: 200px; + background: #242a30; + overflow-x: hidden; + overflow-y: auto; + + .chart-type { + display: flex; + flex-direction: row; + overflow: hidden; + + .type-left { + width: 100%; + height: calc(100vh - 80px); + text-align: center; + + /deep/.el-tabs__header { + width: 30%; + margin-right: 0; + + .el-tabs__nav-wrap { + &::after { + background: transparent; + } + + .el-tabs__item { + text-align: center; + width: 100% !important; + color: #fff; + padding: 0; + font-size: 12px !important; + } + } + } + + /deep/.el-tabs__content { + width: 70%; + } + } + } + + //工具栏一个元素 + .tools-item { + display: flex; + position: relative; + width: 100%; + height: 48px; + align-items: center; + -webkit-box-align: center; + padding: 0 6px; + cursor: pointer; + font-size: 12px; + margin-bottom: 1px; + + .tools-item-icon { + color: #409eff; + margin-right: 10px; + width: 53px; + height: 30px; + line-height: 30px; + text-align: center; + display: block; + border: 1px solid #3a4659; + background: #282a30; + } + + .tools-item-text { + font-size: 12px !important; + } + } + + /deep/.el-tabs__content { + padding: 0; + } +} + +/* 设置滚动条的样式 */ + +::-webkit-scrollbar { + width: 0; + height: 10px; +} \ No newline at end of file diff --git a/report-ui/src/mixins/common.js b/report-ui/src/mixins/common.js index 7eb628bf..f4dfba9e 100644 --- a/report-ui/src/mixins/common.js +++ b/report-ui/src/mixins/common.js @@ -1,40 +1,40 @@ import Cookies from 'js-cookie' import { getStorageItem } from '@/utils/storage' export default { - data () { + data() { return { } }, computed: { // 网页高度 - bodyWidth () { + bodyWidth() { return document.body.clientWidth }, // 网页宽度 - bodyHeight () { + bodyHeight() { return document.body.clientHeight }, }, - created () { + created() { }, - mounted () { + mounted() { }, - destroyed () { + destroyed() { }, methods: { - setCookies (key, val, option) { + setCookies(key, val, option) { if (option == null) { option = { expires: 15 } } Cookies.set(key, val, option) }, - goBack () { + goBack() { this.$router.go(-1) }, - refresh () { + refresh() { this.$router.go(0) }, - parseString (object) { + parseString(object) { if (typeof object === 'undefined' || object == null) { return '' } @@ -49,7 +49,7 @@ export default { } return '' }, - isBlank (val) { + isBlank(val) { if (typeof val === 'undefined') { return true } @@ -59,7 +59,7 @@ export default { return false }, // 封装定制删除数组中的值 - contains (a, obj) { + contains(a, obj) { let i = a.length while (i--) { if (a[i] === obj) { @@ -82,13 +82,13 @@ export default { /** * */ - resetForm (data) { + resetForm(data) { let formKeys = Object.keys(data) for (let k of formKeys) { data[k] = null } }, - sortArray (propertyName) { + sortArray(propertyName) { return function (object1, object2) { let value1 = object1[propertyName]; let value2 = object2[propertyName]; @@ -103,7 +103,7 @@ export default { } }, // 获取对象类型 - getObjectType (obj) { + getObjectType(obj) { let toString = Object.prototype.toString let map = { '[object Boolean]': 'boolean', @@ -122,23 +122,22 @@ export default { } return map[toString.call(obj)] }, - isNumber (obj) { + isNumber(obj) { return this.getObjectType(obj) == 'number' }, - isString (obj) { + isString(obj) { return this.getObjectType(obj) == 'string' }, - isArray (obj) { + isArray(obj) { return this.getObjectType(obj) == 'array' }, - hasOwn (obj, key) { + hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key) }, - - isNotBlank (val) { + isNotBlank(val) { return !this.isBlank(val) }, - isBlank (val) { + isBlank(val) { if (this.isNull(val)) { return true } @@ -153,10 +152,10 @@ export default { } return false }, - isNotNull (val) { + isNotNull(val) { return !this.isNull(val) }, - isNull (val) { + isNull(val) { // 特殊判断 if (val && parseInt(val) === 0) return false const list = ['$parent'] @@ -182,7 +181,7 @@ export default { }, // 对象深拷贝 - deepClone (data) { + deepClone(data) { let type = this.getObjectType(data) let obj if (type === 'array') { @@ -218,7 +217,7 @@ export default { }, // 合并json - mergeObject () { + mergeObject() { let target = arguments[0] || {} let deep = false let arr = Array.prototype.slice.call(arguments) @@ -261,7 +260,7 @@ export default { }, // 获取dom在屏幕中的top和left - getDomTopLeftById (id) { + getDomTopLeftById(id) { let dom = document.getElementById(id) let top = 0 let left = 0 @@ -271,7 +270,7 @@ export default { } return { top: top, left: left } }, - objToOne (obj) { + objToOne(obj) { console.log(obj) let tmpData = {} for (let index in obj) { @@ -291,13 +290,16 @@ export default { return Object.prototype.toString.call(value) === "[object Array]"; } }, - urlEncode (val) { + isObjectFn(value) { + return Object.prototype.toString.call(value) === "[object Object]"; + }, + urlEncode(val) { return encodeURIComponent(val) }, - urlDecode (val) { + urlDecode(val) { return decodeURIComponent(val) }, - urlEncodeObject (obj, ingoreFields) { + urlEncodeObject(obj, ingoreFields) { if (toString.call(obj) != '[object Object]') { return obj } @@ -316,7 +318,7 @@ export default { }, // 根据数据字典,查询指定字典dict指定值code的,返回整个dictItem{id, text, extend} - getDictItemByCode (dict, code) { + getDictItemByCode(dict, code) { let dicts = getStorageItem('AJReportDict') if (!dicts.hasOwnProperty(dict)) { return null @@ -334,7 +336,7 @@ export default { return null }, // 根据数据字典,查询指定字典dict指定值code的dictItem.text - getDictLabelByCode (dict, code) { + getDictLabelByCode(dict, code) { let dictItem = this.getDictItemByCode(dict, code) if (dictItem != null) { return dictItem['text'] @@ -343,7 +345,7 @@ export default { } }, // 根据数据字典,查询指定字典dict指定值code的dictItem.extend - getDictExtendByCode (dict, code) { + getDictExtendByCode(dict, code) { let dictItem = this.getDictItemByCode(dict, code) if (dictItem == null) { return null diff --git a/report-ui/src/utils/screenMixins.js b/report-ui/src/utils/screenMixins.js new file mode 100644 index 00000000..5d345279 --- /dev/null +++ b/report-ui/src/utils/screenMixins.js @@ -0,0 +1,355 @@ +import { Revoke } from "@/utils/revoke"; +import { getToken } from "@/utils/auth"; +import { getToolByCode } from "@/views/bigscreenDesigner/designer/tools/index"; +import { insertDashboard, detailDashboard, exportDashboard, } from "@/api/bigscreen"; +const mixin = { + data() { + return { + reportCode: this.$route.query.reportCode, + uploadUrl: process.env.BASE_API + "/reportDashboard/import/" + this.reportCode, + rightClickIndex: -1, + } + }, + computed: { + step() { + return Number(100 / (this.bigscreenScaleInWorkbench * 100)); + }, + headers() { + return { + Authorization: getToken(), + }; + }, + // 初始的缩放百分比 和 下标 + defaultSize() { + const obj = { + index: -1, + size: "50", + }; + this.sizeRange.some((item, index) => { + if (item <= 100 * this.bigscreenScaleInWorkbench) { + obj.index = index; + obj.size = 100 * this.bigscreenScaleInWorkbench; + } + }); + if (obj.index === -1) { + obj.index = 0; + obj.size = this.sizeRange[0]; + } + return obj; + }, + }, + watch: { + defaultSize: { + handler(val) { + if (val !== -1) { + this.currentSizeRangeIndex = val.index; + this.scaleNum = val.size; + } + }, + immediate: true, + }, + bigscreenWidth() { + this.initVueRulerTool(); + }, + bigscreenHeight() { + this.initVueRulerTool(); + }, + }, + created() { + this.revoke = new Revoke(); + this.getData(); + }, + methods: { + /** + * @param num: 0缩小 1放大 2默认比例 + * sizeRange: [20, 40, 60, 72, 100, 150, 200, 300, 400] + */ + setSize(num) { + switch (num) { + case 0: this.currentSizeRangeIndex === 0 ? '' : this.currentSizeRangeIndex -= 1; + break; + case 1: this.currentSizeRangeIndex === 8 ? '' : this.currentSizeRangeIndex += 1; + break; + case 2: this.currentSizeRangeIndex = this.defaultSize.index; + } + this.scaleNum = this.currentSizeRangeIndex === this.defaultSize.index ? this.defaultSize.size : this.sizeRange[this.currentSizeRangeIndex]; + }, + // 初始化 修正插件样式 + initVueRulerTool() { + const vueRulerToolDom = this.$refs["vue-ruler-tool"].$el; // 操作面板 第三方插件工具 + const contentDom = vueRulerToolDom.querySelector(".vue-ruler-content"); + const vueRulerX = vueRulerToolDom.querySelector(".vue-ruler-h"); // 横向标尺 + const vueRulerY = vueRulerToolDom.querySelector(".vue-ruler-v"); // 纵向标尺 + contentDom.style.width = "100%"; + contentDom.style.height = "100%"; + + let xHtmlContent = ""; + let yHtmlContent = ""; + let currentNum = 0; + while (currentNum < +this.bigscreenWidth) { + xHtmlContent += `${currentNum}`; + currentNum += 50; + } + currentNum = 0; + while (currentNum < +this.bigscreenHeight) { + yHtmlContent += `${currentNum}`; + currentNum += 50; + } + vueRulerX.innerHTML = xHtmlContent; + vueRulerY.innerHTML = yHtmlContent; + }, + // 初始化接口数据 + async getData() { + const { code, data } = await detailDashboard(this.reportCode); + if (code != 200) return; + this.widgets = this.initWidgetsData(data); + this.dashboard = this.initScreenData(data.dashboard); + this.bigscreenWidth = this.dashboard.width; + this.bigscreenHeight = this.dashboard.height; + }, + // 组件数据 + initWidgetsData(data) { + const widgets = data.dashboard ? data.dashboard.widgets : []; + const widgetsData = []; + for (let i = 0; i < widgets.length; i++) { + const widget = widgets[i] + const { setup, data, position } = { ...widget.value } + const obj = { + type: widget.type, + value: { setup, data, position } + }; + const tool = this.deepClone(getToolByCode(widget.type)); + if (!tool) { + const message = "暂未提供该组件或该组件下线了,组件code: " + widget.type; + if (process.env.NODE_ENV === "development") { + this.$message.error(message); + } + continue; // 找不到就跳过,避免整个报表都加载不出来 + } + obj.options = this.setDefaultWidgetConfigValue(widget.value, tool.options); + obj.value.widgetId = obj.value.setup.widgetId; + widgetsData.push(obj); + } + return widgetsData; + }, + // 重写默认数据 + setDefaultWidgetConfigValue(data, option) { + this.setConfigValue(data.setup, option.setup) + this.setConfigValue(data.position, option.position) + this.setConfigValue(data.data, option.data) + return option; + }, + setConfigValue(objValue, setup) { + Object.keys(objValue).forEach(key => { + setup.forEach(item => { + if (this.isObjectFn(item) && key == item.name) { + item.value = objValue[key] + } + if (this.isArrayFn(item)) { + item.forEach(itemChild => { + itemChild.list.forEach(el => { + if (key == el.name) { + el.value = objValue[key] + } + }) + }) + } + }) + }) + }, + // 大屏数据 + initScreenData(data) { + const optionScreen = getToolByCode("screen").options; + this.setConfigValue(data, optionScreen.setup) + this.setOptionsOnClickScreen(); + return { + backgroundColor: + (data && data.backgroundColor) || (!data ? "#1e1e1e" : ""), + backgroundImage: (data && data.backgroundImage) || "", + height: (data && data.height) || "1080", + title: (data && data.title) || "", + width: (data && data.width) || "1920", + }; + }, + // 保存数据 + async saveData() { + if (!this.widgets || this.widgets.length == 0) { + return this.$message.error("请添加组件"); + } + const { title, width, height, backgroundColor, backgroundImage } = { ...this.dashboard } + const screenData = { + reportCode: this.reportCode, + dashboard: { title, width, height, backgroundColor, backgroundImage }, + widgets: this.widgets, + }; + screenData.widgets.forEach((widget) => { + widget.value.setup.widgetId = widget.value.widgetId; + }); + const { code, data } = await insertDashboard(screenData); + if (code == "200") { + this.$message.success("保存成功!"); + } + }, + // 预览 + viewScreen() { + let routeUrl = this.$router.resolve({ + path: "/bigscreen/viewer", + query: { reportCode: this.reportCode }, + }); + window.open(routeUrl.href, "_blank"); + }, + async exportDashboard(val) { + const fileName = this.reportCode + ".zip"; + + const param = { + reportCode: this.reportCode, + showDataSet: val, + }; + exportDashboard(param).then((res) => { + const that = this; + const type = res.type; + if (type == "application/json") { + let reader = new FileReader(); + reader.readAsText(res, "utf-8"); + reader.onload = function () { + const data = JSON.parse(reader.result); + that.$message.error(data.message); + }; + return; + } + const blob = new Blob([res], { type: "application/octet-stream" }); + if (window.navigator.msSaveOrOpenBlob) { + //msSaveOrOpenBlob方法返回bool值 + navigator.msSaveBlob(blob, fileName); //本地保存 + } else { + const link = document.createElement("a"); //a标签下载 + link.href = window.URL.createObjectURL(blob); + link.download = fileName; + link.click(); + window.URL.revokeObjectURL(link.href); + } + }); + }, + handleUndo() { + const record = this.revoke.undo(); + if (!record) { + return false; + } + this.widgets = record; + }, + handleRedo() { + const record = this.revoke.redo(); + if (!record) { + return false; + } + this.widgets = record; + }, + handleUpload(response, file, fileList) { + this.$refs.upload.clearFiles(); + this.initEchartData(); + if (response.code == "200") { + this.$message({ + message: "导入成功!", + type: "success", + }); + } else { + this.$message({ + message: response.message, + type: "error", + }); + } + }, + handleError(err) { + this.$message({ + message: "上传失败!", + type: "error", + }); + }, + // 右键 + rightClick(event, index) { + this.rightClickIndex = index; + const left = event.clientX; + const top = event.clientY; + if (left || top) { + this.styleObj = { + left: left + "px", + top: top + "px", + display: "block", + }; + } + this.visibleContentMenu = true; + return false; + }, + // 数组 元素互换位置 + swapArr(arr, oldIndex, newIndex) { + arr[oldIndex] = arr.splice(newIndex, 1, arr[oldIndex])[0]; + return arr; + }, + // 删除 + deletelayer() { + this.widgets.splice(this.rightClickIndex, 1); + }, + // 锁定 + lockLayer() { + const obj = this.widgets[this.rightClickIndex]; + this.$set(obj.value.position, "disabled", true); + }, + // 解除锁定 + noLockLayer() { + const obj = this.widgets[this.rightClickIndex]; + this.$set(obj.value.position, "disabled", false); + }, + // 复制 + copylayer() { + const obj = this.deepClone(this.widgets[this.rightClickIndex]); + obj.value.position.top += 40; // 复制的元素向右下角偏移一点 + obj.value.position.left += 40; + obj.value.widgetId = Number(Math.random().toString().substr(2)).toString( + 36 + ); + this.widgets.splice(this.widgets.length, 0, obj); + this.$nextTick(() => { + this.layerClick(this.widgets.length - 1); // 复制后定位到最新的组件 + }); + }, + // 置顶 + istopLayer() { + if (this.rightClickIndex + 1 < this.widgets.length) { + const temp = this.widgets.splice(this.rightClickIndex, 1)[0]; + this.widgets.push(temp); + } + }, + // 置底 + setlowLayer() { + if (this.rightClickIndex != 0) { + this.widgets.unshift(this.widgets.splice(this.rightClickIndex, 1)[0]); + } + }, + // 上移一层 + moveupLayer() { + if (this.rightClickIndex != 0) { + this.widgets[this.rightClickIndex] = this.widgets.splice( + this.rightClickIndex - 1, + 1, + this.widgets[this.rightClickIndex] + )[0]; + } else { + this.widgets.push(this.widgets.shift()); + } + }, + // 下移一层 + movedownLayer() { + if (this.rightClickIndex != this.widgets.length - 1) { + this.widgets[this.rightClickIndex] = this.widgets.splice( + this.rightClickIndex + 1, + 1, + this.widgets[this.rightClickIndex] + )[0]; + } else { + this.widgets.unshift(this.widgets.splice(this.rightClickIndex, 1)[0]); + } + }, + } +} + +export default mixin \ No newline at end of file diff --git a/report-ui/src/views/bigscreenDesigner/designer/index.vue b/report-ui/src/views/bigscreenDesigner/designer/index.vue index 47a256fc..d3fe7199 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/index.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/index.vue @@ -130,13 +130,9 @@ content="缩小" placement="bottom" > - - - @@ -228,10 +223,6 @@ -