From 1fc262ddad685c613aabf821103e806a9b020c76 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:46:26 +0800 Subject: [PATCH 01/53] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 2 +- frontend/src/lang/tw.js | 2 +- frontend/src/lang/zh.js | 2 +- frontend/src/views/dataset/add/AddSQL.vue | 2 +- .../src/views/dataset/common/datasetTree.vue | 32 +- .../src/views/dataset/data/UpdateRecords.vue | 985 ++++++++++++++++++ frontend/src/views/dataset/data/ViewTable.vue | 13 +- frontend/src/views/msg/all.vue | 1 + frontend/src/views/panel/list/PanelList.vue | 338 +++--- 9 files changed, 1226 insertions(+), 151 deletions(-) create mode 100644 frontend/src/views/dataset/data/UpdateRecords.vue diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 8a35b14753..6d9cee4774 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1436,7 +1436,7 @@ export default { field_rename: 'Rename Field', params_work: 'Effective only when editing SQL', sql_variable_limit_1: '1、SQL variables can only be used in where conditions', - sql_variable_limit_2: '2、Example:select * from table_name where column_name1=${parm_name1} and column_name2 in ${parm_name2}', + sql_variable_limit_2: "2、Example:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", select_year: 'Select Year', select_month: 'Select Month', select_date: 'Select Date', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 190436c596..35e6952961 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1436,7 +1436,7 @@ export default { field_rename: '字段重命名', params_work: '僅在編輯 sql 時生效', sql_variable_limit_1: '1、SQL變數只能在WHERE條件中使用', - sql_variable_limit_2: '2、示例:select * from table_name where column_name1=${parm_name1} and column_name2 in ${parm_name2}', + sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", selesql_variable_limit_2ct_year: '選擇年', select_month: '選擇月', select_date: '選擇日期', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 0722d9c43f..1023462e2c 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1436,7 +1436,7 @@ export default { params_work: '仅在编辑sql时生效', select_year: '选择年', sql_variable_limit_1: '1、SQL 变量只能在 WHERE 条件中使用', - sql_variable_limit_2: '2、示例:select * from table_name where column_name1=${parm_name1} and column_name2 in ${parm_name2} ', + sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", select_month: '选择月', select_date: '选择日期', select_time: '选择时间', diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 0686cd2223..1bf66a13e3 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -871,7 +871,7 @@ export default { border-radius: 4px; background: #e1eaff; position: relative; - padding: 9px 19px 9px 40px; + padding: 9px 0 9px 40px; font-family: PingFang SC; font-size: 14px; font-weight: 400; diff --git a/frontend/src/views/dataset/common/datasetTree.vue b/frontend/src/views/dataset/common/datasetTree.vue index 0ef6b5012c..949dd1e094 100644 --- a/frontend/src/views/dataset/common/datasetTree.vue +++ b/frontend/src/views/dataset/common/datasetTree.vue @@ -60,6 +60,16 @@ :class="`ds-icon-${data.modelInnerType}`" /> + + + + + {{ $t('dataset.update_setting') }} + + + {{ $t('commons.refresh') }} + + + + + + + + + + + + + + + + + + + + + + + {{ error_massage }} + + + {{ $t('dataset.close') }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('dataset.add_task') }} + + + + + + + + + + + + + + + + + + + + + + {{ $t('dataset.incremental_update_type') }}: + + + {{ $t('dataset.incremental_add') }} + {{ $t('dataset.incremental_delete') }} + + + + + + + + {{ $t('dataset.param') }}: + + {{ $t('dataset.last_update_time') }} + {{ $t('dataset.current_update_time') }} + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index 2e0b46400a..bfedb958e0 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -125,14 +125,18 @@ + @@ -175,7 +179,7 @@ import DatasetDetail from '../common/DatasetDetail' import FieldEdit from './FieldEdit' import { pluginLoaded } from '@/api/user' import PluginCom from '@/views/system/plugin/PluginCom' - +import UpdateRecords from './UpdateRecords' export default { name: 'ViewTable', components: { @@ -183,6 +187,7 @@ export default { DatasetDetail, UpdateInfo, TabDataPreview, + UpdateRecords, PluginCom }, props: { diff --git a/frontend/src/views/msg/all.vue b/frontend/src/views/msg/all.vue index 0a625ec2f0..b5df51cc09 100644 --- a/frontend/src/views/msg/all.vue +++ b/frontend/src/views/msg/all.vue @@ -6,6 +6,7 @@
- + {{ data.name }} {{ $t('panel.rename') }} {{ $t('panel.delete') }} @@ -98,6 +103,18 @@ +

+ {{ defaultExpansion ? '收起' : '展开' }} + +

@@ -105,7 +122,7 @@ {{ $t('panel.panel_list') }} - + @@ -148,16 +165,21 @@ {{ data.name }} - + {{ $t('panel.groupAdd') }} - + {{ $t('panel.edit') }} {{ $t('panel.share') }} {{ $t('panel.copy') }} {{ $t('dataset.move_to') }} {{ $t('panel.create_public_links') }} {{ $t('panel.to_default_panel') }} {{ $t('panel.rename') }} {{ $t('panel.delete') }} @@ -305,7 +331,9 @@ {{ $t('panel.cancel') }} + >{{ + $t('panel.cancel') + }} {{ $t('dataset.cancel') }} + >{{ + $t('dataset.cancel') + }} { + this.clearLocalStorage.forEach((item) => { localStorage.removeItem(item) }) this.responseSource = 'panelQuery' @@ -582,9 +632,9 @@ export default { }, initCache() { // 初始化时提前加载视图和数据集的缓存 - this.initLocalStorage.forEach(item => { + this.initLocalStorage.forEach((item) => { if (!localStorage.getItem(item + '-tree')) { - queryAuthModel({ modelType: item }, false).then(res => { + queryAuthModel({ modelType: item }, false).then((res) => { localStorage.setItem(item + '-tree', JSON.stringify(res.data)) }) } @@ -596,7 +646,11 @@ export default { this.defaultTree() this.tree() // 默认展开 同时点击 新增的节点 - if (panelInfo && panelInfo.panelType === 'self' && this.lastActiveNodeData.id) { + if ( + panelInfo && + panelInfo.panelType === 'self' && + this.lastActiveNodeData.id + ) { if (this.editPanel.optType === 'rename') { this.lastActiveNodeData.name = panelInfo.name return @@ -692,10 +746,10 @@ export default { }, beforeClickEdit(type, optType, data, node) { return { - 'type': type, - 'data': data, - 'node': node, - 'optType': optType + type: type, + data: data, + node: node, + optType: optType } }, @@ -726,10 +780,10 @@ export default { beforeClickMore(optType, data, node) { return { - 'type': data.nodeType, - 'data': data, - 'node': node, - 'optType': optType + type: data.nodeType, + data: data, + node: node, + optType: optType } }, @@ -750,7 +804,7 @@ export default { saveGroup(group) { this.$refs['groupForm'].validate((valid) => { if (valid) { - addGroup(group).then(res => { + addGroup(group).then((res) => { this.close() this.$message({ message: this.$t('commons.save_success'), @@ -776,19 +830,20 @@ export default { confirmButtonText: this.$t('panel.confirm'), cancelButtonText: this.$t('panel.cancel'), type: 'warning' - }).then(() => { - delGroup(data.id).then(response => { - this.$message({ - type: 'success', - message: this.$t('panel.delete_success'), - showClose: true - }) - this.clearCanvas() - this.tree() - this.defaultTree() - }) - }).catch(() => { }) + .then(() => { + delGroup(data.id).then((response) => { + this.$message({ + type: 'success', + message: this.$t('panel.delete_success'), + showClose: true + }) + this.clearCanvas() + this.tree() + this.defaultTree() + }) + }) + .catch(() => {}) }, clearCanvas() { @@ -815,11 +870,11 @@ export default { }, tree(cache = false) { const modelInfo = localStorage.getItem('panel-main-tree') - const userCache = (modelInfo && cache) + const userCache = modelInfo && cache if (userCache) { this.tData = JSON.parse(modelInfo) } - groupTree(this.groupForm, !userCache).then(res => { + groupTree(this.groupForm, !userCache).then((res) => { localStorage.setItem('panel-main-tree', JSON.stringify(res.data)) if (!userCache) { this.tData = res.data @@ -839,12 +894,12 @@ export default { panelType: 'system' } const modelInfo = localStorage.getItem('panel-default-tree') - const userCache = (modelInfo && cache) + const userCache = modelInfo && cache if (userCache) { this.defaultData = JSON.parse(modelInfo) } - defaultTree(requestInfo, false).then(res => { + defaultTree(requestInfo, false).then((res) => { localStorage.setItem('panel-default-tree', JSON.stringify(res.data)) if (!userCache) { this.defaultData = res.data @@ -865,7 +920,7 @@ export default { // 清理pc布局缓存 this.$store.commit('setComponentDataCache', null) initPanelData(data.id, false, function(response) { - viewPanelLog({ panelId: data.id }).then(res => { + viewPanelLog({ panelId: data.id }).then((res) => { bus.$emit('set-panel-show-type', 0) data.mobileLayout = response.data.mobileLayout }) @@ -889,7 +944,7 @@ export default { }, beforeClickAddData(type) { return { - 'type': type + type: type } }, @@ -930,15 +985,13 @@ export default { }, resetID(data) { if (data) { - data.forEach(item => { + data.forEach((item) => { item.type !== 'custom' && (item.id = uuid.v1()) }) } return data }, - newPanelSave(id) { - - }, + newPanelSave(id) {}, // 激活并点击当前节点 activeNodeAndClick(panelInfo) { if (panelInfo) { @@ -979,10 +1032,13 @@ export default { moveTo(data) { const _this = this this.moveInfo = data - this.moveDialogTitle = this.$t('dataset.m1') + (data.name.length > 10 ? (data.name.substr(0, 10) + '...') : data.name) + this.$t('dataset.m2') + this.moveDialogTitle = + this.$t('dataset.m1') + + (data.name.length > 10 ? data.name.substr(0, 10) + '...' : data.name) + + this.$t('dataset.m2') const queryInfo = JSON.parse(JSON.stringify(this.groupForm)) queryInfo['nodeType'] = 'folder' - groupTree(queryInfo).then(res => { + groupTree(queryInfo).then((res) => { if (data.nodeType === 'folder') { _this.tGroupData = [ { @@ -1005,7 +1061,7 @@ export default { saveMoveGroup() { this.moveInfo.pid = this.tGroup.id this.moveInfo['optType'] = 'move' - panelUpdate(this.moveInfo).then(response => { + panelUpdate(this.moveInfo).then((response) => { this.tree() this.closeMoveGroup() }) @@ -1050,6 +1106,22 @@ export default { From a7a344d729b87557095a5149b91c78a661659bd0 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:50:48 +0800 Subject: [PATCH 02/53] =?UTF-8?q?fix:=20=E6=B3=A8=E9=87=8A=E5=8E=BB?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/data/UpdateRecords.vue | 9 --------- 1 file changed, 9 deletions(-) diff --git a/frontend/src/views/dataset/data/UpdateRecords.vue b/frontend/src/views/dataset/data/UpdateRecords.vue index 161a3b7c4c..d0e65f8d2c 100644 --- a/frontend/src/views/dataset/data/UpdateRecords.vue +++ b/frontend/src/views/dataset/data/UpdateRecords.vue @@ -484,16 +484,11 @@ - diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index ffd15ea2ae..227387ac25 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -22,6 +22,7 @@ @mouseleave="leave" >
- +
- +
@@ -98,9 +100,13 @@ import { imgUrlTrans } from '@/components/canvas/utils/utils' export default { replace: true, - name: 'Dedrag', + name: 'DeDrag', components: { EditBar, MobileCheckBar }, props: { + canvasId: { + type: String, + default: 'canvas-main' + }, className: { type: String, default: 'vdr' @@ -370,10 +376,21 @@ export default { batchOptActive: { type: Boolean, default: false + }, + // tab 移入检测 + isTabMoveCheck: { + type: Boolean, + default: true } }, data: function() { return { + contentDisplay: true, + //当画布在tab中是 宽度左右拓展的余量 + parentWidthTabOffset: 40, + canvasChangeTips: 'none', + tabMoveInYOffset: 70, + tabMoveInXOffset: 40, left: this.x, top: this.y, right: null, @@ -417,6 +434,16 @@ export default { } }, computed: { + parentWidthOffset(){ + if(this.canvasId==='canvas-main'){ + return 0 + }else{ + return this.parentWidthTabOffset + } + }, + curCanvasScaleSelf() { + return this.curCanvasScaleMap[this.canvasId] + }, svgBg() { return { width: this.width + 'px!important', @@ -558,7 +585,7 @@ export default { } } if (this.element.auxiliaryMatrix) { - const width = Math.round(this.width / this.curCanvasScale.matrixStyleWidth) * this.curCanvasScale.matrixStyleWidth + const width = Math.round(this.width / this.curCanvasScaleSelf.matrixStyleWidth) * this.curCanvasScaleSelf.matrixStyleWidth return (width - this.curGap * 2) + 'px' } else { return (this.width - this.curGap * 2) + 'px' @@ -572,7 +599,7 @@ export default { } } if (this.element.auxiliaryMatrix) { - const height = Math.round(this.height / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight + const height = Math.round(this.height / this.curCanvasScaleSelf.matrixStyleHeight) * this.curCanvasScaleSelf.matrixStyleHeight return (height - this.curGap * 2) + 'px' } else { return (this.height - this.curGap * 2) + 'px' @@ -625,14 +652,14 @@ export default { return (this.canvasStyleData.panel.gap === 'yes' && this.element.auxiliaryMatrix) ? this.componentGap : 0 }, miniWidth() { - return this.element.auxiliaryMatrix ? this.curCanvasScale.matrixStyleWidth * (this.mobileLayoutStatus ? 1 : 4) : 0 + return this.element.auxiliaryMatrix ? this.curCanvasScaleSelf.matrixStyleWidth * (this.mobileLayoutStatus ? 1 : 4) : 0 }, miniHeight() { if (this.element.auxiliaryMatrix) { if (this.element.component === 'de-number-range') { - return this.element.auxiliaryMatrix ? this.curCanvasScale.matrixStyleHeight * (this.mobileLayoutStatus ? 1 : 4) : 0 + return this.element.auxiliaryMatrix ? this.curCanvasScaleSelf.matrixStyleHeight * (this.mobileLayoutStatus ? 1 : 4) : 0 } else { - return this.element.auxiliaryMatrix ? this.curCanvasScale.matrixStyleHeight * (this.mobileLayoutStatus ? 1 : 4) : 0 + return this.element.auxiliaryMatrix ? this.curCanvasScaleSelf.matrixStyleHeight * (this.mobileLayoutStatus ? 1 : 4) : 0 } } else { return 0 @@ -640,13 +667,17 @@ export default { }, ...mapState([ 'editor', - 'curCanvasScale', + 'curCanvasScaleMap', 'canvasStyleData', 'linkageSettingStatus', 'mobileLayoutStatus', 'componentGap', 'scrollAutoMove', - 'batchOptStatus' + 'batchOptStatus', + 'tabMoveInActiveId', + 'tabActiveTabNameMap', + 'mousePointShadowMap', + 'tabMoveOutComponentId' ]) }, watch: { @@ -799,6 +830,7 @@ export default { const rect = this.$el.parentNode.getBoundingClientRect() this.parentX = rect.x this.parentY = rect.y + // 高度不设置上限100000 宽度增加左右 60px return [Math.round(parseFloat(style.getPropertyValue('width'), 10)) + 6, 100000] } if (typeof this.parent === 'string') { @@ -834,6 +866,8 @@ export default { this.elementDown(e) this.$nextTick(() => { this.$store.commit('setCurComponent', { component: this.element, index: this.index }) + this.curComponent.optStatus.dragging = true + this.$store.commit('clearTabMoveInfo') }) }, // 元素按下 @@ -905,8 +939,9 @@ export default { } } else { return { - minLeft: this.left % this.grid[0], - maxLeft: Math.floor((this.parentWidth - this.width - this.left) / this.grid[0]) * this.grid[0] + this.left, + // X方向余量向左右偏移this.parentWidthOffset 个余量,可以做到类型像移出canvas的效果,适配Tab的canvas组件 + minLeft: this.left % this.grid[0] - this.parentWidthOffset, + maxLeft: (Math.floor((this.parentWidth - this.width - this.left) / this.grid[0]) * this.grid[0] + this.left) + this.parentWidthOffset, minRight: this.right % this.grid[0], maxRight: Math.floor((this.parentWidth - this.width - this.right) / this.grid[0]) * this.grid[0] + this.right, minTop: this.top % this.grid[1], @@ -1106,7 +1141,8 @@ export default { const bounds = this.bounds const mouseClickPosition = this.mouseClickPosition // 水平移动 - const tmpDeltaX = axis && axis !== 'y' ? mouseClickPosition.mouseX - (e.touches ? e.touches[0].pageX : e.pageX) : 0 + const mX = e.touches ? e.touches[0].pageX : e.pageX + const tmpDeltaX = axis && axis !== 'y' ? mouseClickPosition.mouseX - mX : 0 // 垂直移动 const mY = e.touches ? e.touches[0].pageY : e.pageY const tmpDeltaY = axis && axis !== 'x' ? mouseClickPosition.mouseY - mY : 0 @@ -1132,7 +1168,15 @@ export default { if (this.element.auxiliaryMatrix) { this.$emit('onDragging', e, this.element) } - + if ((-left > (this.parentWidthOffset - 10) || left - bounds.maxRight > (this.parentWidthOffset - 10)) && this.canvasId !== 'canvas-main') { + this.contentDisplay = false + this.$store.commit('setMousePointShadowMap', { mouseX: mX, mouseY: mY, width: this.width, height: this.height }) + this.$store.commit('setTabMoveOutComponentId', this.element.id) + } else { + this.$store.commit('setTabMoveOutComponentId', null) + this.contentDisplay = true + } + await this.tabMoveInCheck() // private 记录当前样式 this.recordCurStyle() }, @@ -1365,9 +1409,6 @@ export default { this.resizing = false this.conflictCheck() this.$emit('refLineParams', refLine) - // this.$emit('resizestop', this.left, this.top, this.width, this.height) - // private - // this.$emit('resizestop') } if (this.dragging) { this.dragging = false @@ -1384,9 +1425,14 @@ export default { // 如果辅助设计 需要最后调整矩阵 if (this.element.auxiliaryMatrix) { - // this.recordMatrixCurStyle() + const _this = this + const historyTabMoveInActiveId = this.tabMoveInActiveId + const historyTabMoveOutComponentId = this.tabMoveOutComponentId setTimeout(() => { - this.recordMatrixCurShadowStyle() + // 移入组件移入Tab时 不需要计算根据阴影面积重置大小 + if (!historyTabMoveInActiveId && !historyTabMoveOutComponentId) { + this.recordMatrixCurShadowStyle(this.curCanvasScaleSelf) + } this.hasMove && this.$store.commit('recordSnapshot', 'handleUp') // 记录snapshot后 移动已记录设置为false this.hasMove = false @@ -1404,14 +1450,78 @@ export default { // 挤占式画布设计 handleUp this.element.auxiliaryMatrix && this.$emit('onHandleUp', e) + this.componentCanvasChange() + // 还原Tab画布状态 + this.$store.commit('clearTabMoveInfo') + // 松开鼠标时 如果当前内容被隐藏,则需要进行显示出来 + if (!this.contentDisplay) { + this.contentDisplay = true + } }, - // 新增方法 ↓↓↓ - // 设置属性 + // 如果Tab移入状态还是Active 状态 则将当前的组件 放置到tab页中 + componentCanvasChange() { + // 主画布移入Tab画布 + if (this.tabMoveInActiveId) { + //从当前画布移除 + this.$emit('amRemoveItem') + this.element.canvasPid = this.element.canvasId + //Tab内部的画布ID 为 tab组件id + '-' + tabActiveName + const targetCanvasId = this.tabMoveInActiveId + '-' + this.tabActiveTabNameMap[this.tabMoveInActiveId] + const targetCanvasScale = this.curCanvasScaleMap[targetCanvasId] + if (this.element.auxiliaryMatrix) { + this.element.x = 1 + this.element.y = 108 + this.element.sizex = Math.round(this.element.sizex * this.curCanvasScaleSelf.matrixStyleWidth / targetCanvasScale.matrixStyleWidth) + this.element.sizey = Math.round(this.element.sizey * this.curCanvasScaleSelf.matrixStyleHeight / targetCanvasScale.matrixStyleHeight) + this.element.style.width = this.element.sizex * targetCanvasScale.matrixStyleOriginWidth + this.element.style.height = this.element.sizey * targetCanvasScale.matrixStyleOriginHeight + this.element.style.left = 0 + this.element.style.top = (this.element.y - 1) * targetCanvasScale.matrixStyleOriginHeight + } else { + this.element.style.left = 0 + this.element.style.top = 0 + this.element.style.width = this.element.style.width * this.curCanvasScaleSelf.matrixStyleWidth / targetCanvasScale.matrixStyleWidth + this.element.style.height = this.element.style.height * this.curCanvasScaleSelf.matrixStyleHeight / targetCanvasScale.matrixStyleHeight + } + this.element.canvasId = targetCanvasId + } + // Tab 画布 移入主画布 + if (this.tabMoveOutComponentId) { + //从当前画布移除 + this.$emit('amRemoveItem') + this.element.canvasPid = 0 + this.element.canvasId = 'canvas-main' + //Tab内部的画布ID 为 tab组件id + '-' + tabActiveName + const targetCanvasScale = this.curCanvasScaleMap['canvas-main'] + // 按照阴影位置定位 + this.element.style.left = (this.mousePointShadowMap.mouseX - (this.mousePointShadowMap.width)) / targetCanvasScale.scalePointWidth + this.element.style.top = (this.mousePointShadowMap.mouseY - (this.mousePointShadowMap.height / 2))/ targetCanvasScale.scalePointHeight + this.element.style.width = this.mousePointShadowMap.width/ targetCanvasScale.scalePointWidth + this.element.style.height = this.mousePointShadowMap.height/ targetCanvasScale.scalePointHeight + + if (this.element.auxiliaryMatrix) { + this.element.x = Math.round(this.element.style.left / targetCanvasScale.matrixStyleOriginWidth) + 1 + this.element.y = Math.round(this.element.style.top / targetCanvasScale.matrixStyleOriginHeight) + 1 + this.element.sizex = Math.round(this.element.style.width /targetCanvasScale.matrixStyleOriginWidth) + this.element.sizey = Math.round(this.element.style.height / targetCanvasScale.matrixStyleOriginHeight) + this.recordMatrixCurShadowStyle(targetCanvasScale) + } + } + + }, + + // 设置属性(属性跟随所属canvas component类型 要做出改变) settingAttribute() { // 设置冲突检测 this.$el.setAttribute('data-is-check', `${this.isConflictCheck}`) // 设置对齐元素 this.$el.setAttribute('data-is-snap', `${this.snap}`) + // 设置Tab移入检测 + this.$el.setAttribute('tab-is-check', `${this.isTabMoveCheck}`) + // 设置组件类型 + this.$el.setAttribute('component-type', `${this.element.component}`) + // 设置组件ID + this.$el.setAttribute('component-id', `${this.element.id}`) }, // 冲突检测 conflictCheck() { @@ -1688,10 +1798,10 @@ export default { // 记录当前样式 矩阵处理 recordMatrixCurStyle() { - const left = Math.round(this.left / this.curCanvasScale.matrixStyleWidth) * this.curCanvasScale.matrixStyleWidth - const top = Math.round(this.top / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight - const width = Math.round(this.width / this.curCanvasScale.matrixStyleWidth) * this.curCanvasScale.matrixStyleWidth - const height = Math.round(this.height / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight + const left = Math.round(this.left / this.curCanvasScaleSelf.matrixStyleWidth) * this.curCanvasScaleSelf.matrixStyleWidth + const top = Math.round(this.top / this.curCanvasScaleSelf.matrixStyleHeight) * this.curCanvasScaleSelf.matrixStyleHeight + const width = Math.round(this.width / this.curCanvasScaleSelf.matrixStyleWidth) * this.curCanvasScaleSelf.matrixStyleWidth + const height = Math.round(this.height / this.curCanvasScaleSelf.matrixStyleHeight) * this.curCanvasScaleSelf.matrixStyleHeight const style = { ...this.defaultStyle } @@ -1705,23 +1815,13 @@ export default { // resize self.$emit('resizeView') - // const self = this - // setTimeout(function() { - // self.$emit('resizeView') - // }, 200) }, // 记录当前样式 跟随阴影位置 矩阵处理 - recordMatrixCurShadowStyle() { - const left = (this.element.x - 1) * this.curCanvasScale.matrixStyleWidth - const top = (this.element.y - 1) * this.curCanvasScale.matrixStyleHeight - const width = this.element.sizex * this.curCanvasScale.matrixStyleWidth - const height = this.element.sizey * this.curCanvasScale.matrixStyleHeight - // const t1 = Math.round(this.width / this.curCanvasScale.matrixStyleWidth) - // const left = Math.round(this.left / this.curCanvasScale.matrixStyleWidth) * this.curCanvasScale.matrixStyleWidth - // const top = Math.round(this.top / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight - // const width = t1 * this.curCanvasScale.matrixStyleWidth - // const height = Math.round(this.height / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight - + recordMatrixCurShadowStyle(scaleSelf) { + const left = (this.element.x - 1) * scaleSelf.matrixStyleWidth + const top = (this.element.y - 1) * scaleSelf.matrixStyleHeight + const width = this.element.sizex * scaleSelf.matrixStyleWidth + const height = this.element.sizey * scaleSelf.matrixStyleHeight const style = { ...this.defaultStyle } @@ -1730,16 +1830,10 @@ export default { style.width = width style.height = height style.rotate = this.rotate - // this.hasMove = true - this.$store.commit('setShapeStyle', style) - // resize const self = this self.$emit('resizeView') - // setTimeout(function() { - // self.$emit('resizeView') - // }, 200) }, mountedFunction() { // private 冲突检测 和水平设计值保持一致 @@ -1821,6 +1915,72 @@ export default { // 跳转设置 boardSet() { this.$emit('boardSet') + }, + // tab移入检测 + async tabMoveInCheck() { + const top = this.top + const left = this.left + const width = this.width + const height = this.height + // tab 移入检测开启 + if (this.isTabMoveCheck) { + const nodes = this.$el.parentNode.childNodes // 获取当前父节点下所有子节点 + for (const item of nodes) { + if ( + item.className !== undefined && + !item.className.split(' ').includes(this.classNameActive) && + item.getAttribute('tab-is-check') !== null && + item.getAttribute('tab-is-check') !== 'false' && + item.getAttribute('component-type') === 'de-tabs' + ) { + const tw = item.offsetWidth + const th = item.offsetHeight + // 正则获取left与right + const [tl, tt] = this.formatTransformVal(item.style.transform) + // 碰撞有效区域检查 + const collisionT = tt + this.tabMoveInYOffset + const collisionL = tl + (this.curCanvasScaleSelf.matrixStyleWidth / 2) - width + const collisionW = tw + 2 * width - this.curCanvasScaleSelf.matrixStyleWidth + const collisionH = th + height - this.tabMoveInYOffset + + // 左上角靠近左上角区域 + const tfAndTf = collisionT <= top && collisionL <= left + // 左下角靠近左下角区域 + const bfAndBf = (collisionT + collisionH) >= (top + height) && collisionL <= left + // 右上角靠近右上角区域 + const trAndTr = collisionT <= top && (collisionL + collisionW) >= (left + width) + // 右下角靠近右下角区域 + const brAndBr = (collisionT + collisionH) >= (top + height) && (collisionL + collisionW) >= (left + width) + if (tfAndTf && bfAndBf && trAndTr && brAndBr) { + this.$store.commit('setTabCollisionActiveId', item.getAttribute('component-id')) + } else { + this.$store.commit('setTabCollisionActiveId', null) + } + + // 移入有效区域检查 + // 碰撞有效区域检查 + const activeT = tt + this.tabMoveInYOffset + const activeL = tl + (this.curCanvasScaleSelf.matrixStyleWidth * 10) - width + const activeW = tw + 2 * width - this.curCanvasScaleSelf.matrixStyleWidth * 20 + const activeH = th + height - 2 * this.tabMoveInYOffset + + // 左上角靠近左上角区域 + const activeTfAndTf = activeT <= top && activeL <= left + // 左下角靠近左下角区域 + const activeBfAndBf = (activeT + activeH) >= (top + height) && activeL <= left + // 右上角靠近右上角区域 + const activeTrAndTr = activeT <= top && (activeL + activeW) >= (left + width) + // 右下角靠近右下角区域 + const activeBrAndBr = (activeT + activeH) >= (top + height) && (activeL + activeW) >= (left + width) + if (activeTfAndTf && activeBfAndBf && activeTrAndTr && activeBrAndBr) { + this.$store.commit('setTabMoveInActiveId', item.getAttribute('component-id')) + } else { + this.$store.commit('setTabMoveInActiveId', null) + } + + } + } + } } } diff --git a/frontend/src/components/DeDrag/pointShadow.vue b/frontend/src/components/DeDrag/pointShadow.vue new file mode 100644 index 0000000000..2a6591b714 --- /dev/null +++ b/frontend/src/components/DeDrag/pointShadow.vue @@ -0,0 +1,111 @@ + + + + diff --git a/frontend/src/components/DeDrag/shadow.vue b/frontend/src/components/DeDrag/shadow.vue index 9550c94f2f..26434ff922 100644 --- a/frontend/src/components/DeDrag/shadow.vue +++ b/frontend/src/components/DeDrag/shadow.vue @@ -10,8 +10,17 @@ import { mapState } from 'vuex' export default { replace: true, - name: 'ShadowDe', + name: 'Shadow', + props: { + canvasId: { + type: String, + required: true + } + }, computed: { + curCanvasScaleSelf(){ + return this.curCanvasScaleMap[this.canvasId] + }, styleInfo() { let left = 0 let top = 0 @@ -21,11 +30,11 @@ export default { if (this.dragComponentInfo) { // 组件移入 if (this.dragComponentInfo.auxiliaryMatrix) { - left = (this.dragComponentInfo.x - 1) * this.curCanvasScale.matrixStyleWidth - top = (this.dragComponentInfo.y - 1) * this.curCanvasScale.matrixStyleHeight + left = (this.dragComponentInfo.x - 1) * this.curCanvasScaleSelf.matrixStyleWidth + top = (this.dragComponentInfo.y - 1) * this.curCanvasScaleSelf.matrixStyleHeight - width = this.dragComponentInfo.sizex * this.curCanvasScale.matrixStyleWidth - height = this.dragComponentInfo.sizey * this.curCanvasScale.matrixStyleHeight + width = this.dragComponentInfo.sizex * this.curCanvasScaleSelf.matrixStyleWidth + height = this.dragComponentInfo.sizey * this.curCanvasScaleSelf.matrixStyleHeight transition = 0.1 } else { left = this.dragComponentInfo.shadowStyle.x @@ -34,14 +43,10 @@ export default { height = this.dragComponentInfo.style.height } } else { - // temp 临时测试 - // left = this.curComponent.style.left * this.curCanvasScale.scaleWidth / 100 - // top = this.curComponent.style.top * this.curCanvasScale.scaleHeight / 100 - left = (this.curComponent.x - 1) * this.curCanvasScale.matrixStyleWidth - top = (this.curComponent.y - 1) * this.curCanvasScale.matrixStyleHeight - - width = this.curComponent.style.width * this.curCanvasScale.scalePointWidth - height = this.curComponent.style.height * this.curCanvasScale.scalePointHeight + left = (this.curComponent.x - 1) * this.curCanvasScaleSelf.matrixStyleWidth + top = (this.curComponent.y - 1) * this.curCanvasScaleSelf.matrixStyleHeight + width = this.curComponent.style.width * this.curCanvasScaleSelf.scalePointWidth + height = this.curComponent.style.height * this.curCanvasScaleSelf.scalePointHeight if (this.curComponent.optStatus.dragging) { transition = 0.1 } @@ -70,13 +75,13 @@ export default { return this.$store.state.dragComponentInfo }, canvasWidth() { - const scaleWidth = this.curCanvasScale.scaleWidth / 100 + const scaleWidth = this.curCanvasScaleSelf.scaleWidth / 100 return this.canvasStyleData.width * scaleWidth }, ...mapState([ 'curComponent', 'editor', - 'curCanvasScale', + 'curCanvasScaleMap', 'canvasStyleData', 'linkageSettingStatus' ]) @@ -89,10 +94,10 @@ export default { this.dragComponentInfo.shadowStyle.y = this.scaleH(y) }, scaleH(h) { - return h / this.curCanvasScale.scalePointHeight + return h / this.curCanvasScaleSelf.scalePointHeight }, scaleW(w) { - return w / this.curCanvasScale.scalePointWidth + return w / this.curCanvasScaleSelf.scalePointWidth } } diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue new file mode 100644 index 0000000000..30dd77c57e --- /dev/null +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -0,0 +1,587 @@ + + + + + diff --git a/frontend/src/components/canvas/components/Editor/DateFormat.vue b/frontend/src/components/canvas/components/Editor/DateFormat.vue index c827ffbb03..af04e16a9a 100644 --- a/frontend/src/components/canvas/components/Editor/DateFormat.vue +++ b/frontend/src/components/canvas/components/Editor/DateFormat.vue @@ -84,11 +84,6 @@ - - +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/frontend/src/components/canvas/components/Editor/EditBar.vue b/frontend/src/components/canvas/components/Editor/EditBar.vue index e85008ec54..d111132bc2 100644 --- a/frontend/src/components/canvas/components/Editor/EditBar.vue +++ b/frontend/src/components/canvas/components/Editor/EditBar.vue @@ -141,6 +141,38 @@
+ + + + + + + + + + @@ -151,11 +183,17 @@ import SettingMenu from '@/components/canvas/components/Editor/SettingMenu' import LinkageField from '@/components/canvas/components/Editor/LinkageField' import toast from '@/components/canvas/utils/toast' import FieldsList from '@/components/canvas/components/Editor/fieldsList' +import LinkJumpSet from '@/views/panel/LinkJumpSet' +import Background from '@/views/background/index' export default { - components: { FieldsList, SettingMenu, LinkageField }, + components: { Background, LinkJumpSet, FieldsList, SettingMenu, LinkageField }, props: { + canvasId: { + type: String, + required: true + }, terminal: { type: String, default: 'pc' @@ -191,6 +229,9 @@ export default { }, data() { return { + boardSetVisible: false, + linkJumpSetVisible: false, + linkJumpSetViewId: null, curFields: [], multiplexingCheckModel: false, barWidth: 24, @@ -228,8 +269,8 @@ export default { }, showEditPosition() { if (this.activeModel === 'edit' && !this.linkageAreaShow && !this.batchOptAreaShow) { - const toRight = (this.canvasStyleData.width - this.element.style.left - this.element.style.width) * this.curCanvasScale.scalePointWidth - const toLeft = this.element.style.left * this.curCanvasScale.scalePointWidth + const toRight = (this.canvasStyleData.width - this.element.style.left - this.element.style.width) * this.curCanvasScaleSelf.scalePointWidth + const toLeft = this.element.style.left * this.curCanvasScaleSelf.scalePointWidth if (this.barWidth < toRight) { return 'bar-main-right' } else if (this.barWidth > toRight && this.barWidth > toLeft) { @@ -278,6 +319,9 @@ export default { miniWidth() { return this.mobileLayoutStatus ? 1 : 4 }, + curCanvasScaleSelf(){ + return this.curCanvasScaleMap[this.canvasId] + }, ...mapState([ 'menuTop', 'menuLeft', @@ -288,7 +332,7 @@ export default { 'linkageSettingStatus', 'targetLinkageInfo', 'curLinkageView', - 'curCanvasScale', + 'curCanvasScaleMap', 'batchOptStatus', 'mobileLayoutStatus', 'curBatchOptComponents', @@ -302,6 +346,16 @@ export default { } }, methods: { + backgroundSetClose() { + this.boardSetVisible = false + }, + linkJumpSet() { + this.linkJumpSetViewId = this.element.propValue.viewId + this.linkJumpSetVisible = true + }, + closeJumpSetDialog() { + this.linkJumpSetVisible = false + }, fieldsAreaDown(e) { // ignore e.preventDefault() @@ -347,10 +401,10 @@ export default { this.curComponent.auxiliaryMatrix = false this.$emit('amRemoveItem') } else { - this.curComponent.x = Math.round(this.curComponent.style.left / this.curCanvasScale.matrixStyleOriginWidth) + 1 - this.curComponent.y = Math.round(this.curComponent.style.top / this.curCanvasScale.matrixStyleOriginHeight) + 1 - this.curComponent.sizex = Math.round(this.curComponent.style.width / this.curCanvasScale.matrixStyleOriginWidth) - this.curComponent.sizey = Math.round(this.curComponent.style.height / this.curCanvasScale.matrixStyleOriginHeight) + this.curComponent.x = Math.round(this.curComponent.style.left / this.curCanvasScaleSelf.matrixStyleOriginWidth) + 1 + this.curComponent.y = Math.round(this.curComponent.style.top / this.curCanvasScaleSelf.matrixStyleOriginHeight) + 1 + this.curComponent.sizex = Math.round(this.curComponent.style.width / this.curCanvasScaleSelf.matrixStyleOriginWidth) + this.curComponent.sizey = Math.round(this.curComponent.style.height / this.curCanvasScaleSelf.matrixStyleOriginHeight) this.curComponent.sizey = this.curComponent.sizey > this.miniHeight ? this.curComponent.sizey : this.miniHeight this.curComponent.sizex = this.curComponent.sizex > this.miniWidth ? this.curComponent.sizex : this.miniWidth this.curComponent.auxiliaryMatrix = true @@ -364,10 +418,10 @@ export default { }, // 记录当前样式 跟随阴影位置 矩阵处理 recordMatrixCurShadowStyle() { - const left = (this.curComponent.x - 1) * this.curCanvasScale.matrixStyleWidth - const top = (this.curComponent.y - 1) * this.curCanvasScale.matrixStyleHeight - const width = this.curComponent.sizex * this.curCanvasScale.matrixStyleWidth - const height = this.curComponent.sizey * this.curCanvasScale.matrixStyleHeight + const left = (this.curComponent.x - 1) * this.curCanvasScaleSelf.matrixStyleWidth + const top = (this.curComponent.y - 1) * this.curCanvasScaleSelf.matrixStyleHeight + const width = this.curComponent.sizex * this.curCanvasScaleSelf.matrixStyleWidth + const height = this.curComponent.sizey * this.curCanvasScaleSelf.matrixStyleHeight const style = { left: left, top: top, @@ -409,9 +463,6 @@ export default { }) bus.$emit('clear_panel_linkage', { viewId: this.element.propValue.viewId }) }, - linkJumpSet() { - this.$emit('linkJumpSet') - }, goFile() { this.$refs.files.click() }, @@ -435,7 +486,7 @@ export default { reader.readAsDataURL(file) }, boardSet() { - this.$emit('boardSet') + this.boardSetVisible = true }, batchOptChange(val) { if (val) { diff --git a/frontend/src/components/canvas/components/Editor/PGrid.vue b/frontend/src/components/canvas/components/Editor/PGrid.vue index 8a1e8756f0..c2df81e89b 100644 --- a/frontend/src/components/canvas/components/Editor/PGrid.vue +++ b/frontend/src/components/canvas/components/Editor/PGrid.vue @@ -1,20 +1,17 @@ @@ -135,7 +195,6 @@ import bus from '@/utils/bus' import { mapState } from 'vuex' import { isChange } from '@/utils/conditionUtil' import { BASE_CHART_STRING } from '@/views/chart/chart/chart' -import eventBus from '@/components/canvas/utils/eventBus' import { deepCopy } from '@/components/canvas/utils/utils' import { getToken, getLinkToken } from '@/utils/auth' import DrillPath from '@/views/chart/view/DrillPath' @@ -151,10 +210,11 @@ import { checkAddHttp } from '@/utils/urlUtils' import DeRichTextView from '@/components/canvas/custom-component/DeRichTextView' import Vue from 'vue' import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' +import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' export default { name: 'UserView', - components: { DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 }, + components: { UserViewDialog, DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 }, props: { element: { type: Object, @@ -219,6 +279,11 @@ export default { }, data() { return { + mobileChartDetailsVisible: false, + chartDetailsVisible: false, + showChartInfo: {}, + showChartTableInfo: {}, + showChartInfoType: 'details', dataRowNameSelect: {}, dataRowSelect: {}, curFields: [], @@ -461,6 +526,12 @@ export default { } }, methods: { + exportExcel() { + this.$refs['userViewDialog'].exportExcel() + }, + exportViewImg() { + this.$refs['userViewDialog'].exportViewImg() + }, pluginEditHandler(e) { this.$emit('trigger-plugin-edit', { e, id: this.element.id }) }, @@ -728,7 +799,16 @@ export default { tableChart.customStyle.text.show = false tableChart.customAttr = JSON.stringify(tableChart.customAttr) tableChart.customStyle = JSON.stringify(tableChart.customStyle) - eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart, openType: params.openType }) + + this.showChartInfo = this.chart + this.showChartTableInfo = tableChart + this.showChartInfoType = params.openType + this.chartDetailsVisible = true + if (this.terminal === 'pc') { + this.chartDetailsVisible = true + } else { + this.mobileChartDetailsVisible = true + } }, chartClick(param) { if (this.drillClickDimensionList.length < this.chart.drillFields.length - 1) { diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index 7f07d11b07..844f31a2a7 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -394,7 +394,7 @@ const list = [ tabList: [{ title: 'Tab1', name: '1', - content: null + content: { type: 'canvas' } }] }, x: 1, diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js index 902e3f98ea..afb3f9e91f 100644 --- a/frontend/src/components/canvas/store/copy.js +++ b/frontend/src/components/canvas/store/copy.js @@ -35,7 +35,7 @@ export default { } }) const canvasStyleData = state.canvasStyleData - const curCanvasScale = state.curCanvasScale + const curCanvasScaleSelf = state.curCanvasScaleMap['canvas-main'] const componentGap = state.componentGap Object.keys(state.curMultiplexingComponents).forEach(function(componentId, index) { const component = @@ -53,15 +53,15 @@ export default { const tilePosition = index % 3 const divisiblePosition = parseInt(index / 3) if (canvasStyleData.auxiliaryMatrix) { - const width = component.sizex * curCanvasScale.matrixStyleOriginWidth + const width = component.sizex * curCanvasScaleSelf.matrixStyleOriginWidth // 取余 平铺4个 此处x 位置偏移 component.x = component.x + component.sizex * tilePosition // Y 方向根据当前应该放置的最大值 加上50矩阵余量 component.y = pYMax + 50 + state.viewBase.sizex * divisiblePosition - component.style.left = (component.x - 1) * curCanvasScale.matrixStyleOriginWidth - component.style.top = (component.y - 1) * curCanvasScale.matrixStyleOriginHeight + component.style.left = (component.x - 1) * curCanvasScaleSelf.matrixStyleOriginWidth + component.style.top = (component.y - 1) * curCanvasScaleSelf.matrixStyleOriginHeight component.style.width = width - component.style.height = component.sizey * curCanvasScale.matrixStyleOriginHeight + component.style.height = component.sizey * curCanvasScaleSelf.matrixStyleOriginHeight } else { const width = component.style.width const height = component.style.height diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index cd002ea3a0..319232a686 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -133,6 +133,10 @@ export function panelDataPrepare(componentData, componentStyle, callback) { if (item.component && item.component === 'Picture') { item.style.adaptation = item.style.adaptation || 'adaptation' } + // 增加所属画布ID(canvasId)当前所在画布的父ID(canvasPid) 主画布ID为main-canvas, PID = 0 表示当前所属canvas为最顶层 + item.canvasId = (item.canvasId || 'canvas-main') + item.canvasPid = (item.canvasPid || '0') + }) // 初始化密度为最高密度 componentStyle.aidedDesign.matrixBase = 4 @@ -145,7 +149,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) { export function resetID(data) { if (data) { data.forEach(item => { - item.type !== 'custom' && (item.id = uuid.v1()) + item.type !== 'custom' && item.type !== 'de-tabs'&& (item.id = uuid.v1()) }) } return data @@ -224,3 +228,7 @@ export function imgUrlTrans(url) { return url } } + +export function getNowCanvasComponentData(canvasId){ + return store.state.componentData.filter(item => item.canvasId===canvasId) +} diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index 847ef8e992..b5fd78d669 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -118,9 +118,6 @@ export default { } return size }, - ...mapState([ - 'curCanvasScale' - ]), deSelectGridBg() { if (this.element.component !== 'de-select-grid') return null const { backgroundColorSelect, color } = this.element.commonBackground diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index 81f480e970..f2864713be 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -63,6 +63,27 @@
+ + +
+ +
+ { try { @@ -313,7 +339,7 @@ export default { activeTabInner = item.content } }) - if (newVal && activeTabInner) { + if (newVal && activeTabInner && activeTabInner.type === 'view') { this.$store.commit('setCurActiveTabInner', activeTabInner) this.$store.dispatch('chart/setViewId', activeTabInner.propValue.viewId) } else { @@ -335,12 +361,17 @@ export default { created() { bus.$on('add-new-tab', this.addNewTab) this.activeTabName = this.element.options.tabList[0].name + this.$store.commit('setTabActiveTabNameMap', { tabId: this.element.id, activeTabName: this.activeTabName }) this.setContentThemeStyle() }, beforeDestroy() { bus.$off('add-new-tab', this.addNewTab) }, methods: { + tabCanvasComponentData(tabName) { + const result = getNowCanvasComponentData(this.element.id + '-' + tabName) + return result + }, setContentThemeStyle() { this.element.options.tabList.forEach(tab => { if (tab.content && tab.content.type === 'view') { @@ -429,7 +460,9 @@ export default { component.propValue = propValue component.filters = [] component.linkageFilters = [] - if (this.themeStyle) { component.commonBackground = JSON.parse(JSON.stringify(this.themeStyle)) } + if (this.themeStyle) { + component.commonBackground = JSON.parse(JSON.stringify(this.themeStyle)) + } } }) component.id = newComponentId @@ -494,8 +527,10 @@ export default { const tab = { title: 'NewTab', name: curName, - content: null + content: { type: 'canvas' } } + //的Tab都是画布 + this.element.options.tabList.push(tab) this.styleChange() @@ -523,18 +558,27 @@ export default { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 854bf30cc5..d6ea9912fa 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -63,6 +63,7 @@ const data = { // 当前点击组件 curComponent: null, curCanvasScale: null, + curCanvasScaleMap: {}, curComponentIndex: null, // 预览仪表板缩放信息 previewCanvasScale: { @@ -95,6 +96,10 @@ const data = { mobileLayoutStatus: false, // 公共链接状态(当前是否是公共链接打开) publicLinkStatus: false, + pcTabMatrixCount: { + x: 36, + y: 36 + }, pcMatrixCount: { x: 36, y: 18 @@ -134,7 +139,20 @@ const data = { customAttr: {} }, allViewRender: [], - isInEditor: false // 是否在编辑器中,用于判断复制、粘贴组件时是否生效,如果在编辑器外,则无视这些操作 + isInEditor: false, // 是否在编辑器中,用于判断复制、粘贴组件时是否生效,如果在编辑器外,则无视这些操作 + tabCollisionActiveId: null, // 当前在碰撞的Tab组件ID + tabMoveInActiveId: null, // 当前在移入的Tab ID + tabMoveOutActiveId: null, // 当前在移出的Tab ID + tabMoveOutComponentId: null, // 当前在移出Tab de组件ID + tabActiveTabNameMap: {}, // 编辑器中 tab组件中的活动tab页, + // 鼠标处于drag状态的坐标点 + mousePointShadowMap: { + mouseX: 0, + mouseY: 0, + width: 0, + height: 0 + } + }, mutations: { ...animation.mutations, @@ -146,6 +164,10 @@ const data = { ...snapshot.mutations, ...lock.mutations, + setTabActiveTabNameMap(state, tabActiveInfo){ + state.tabActiveTabNameMap[tabActiveInfo.tabId] = tabActiveInfo.activeTabName + }, + setClickComponentStatus(state, status) { state.isClickComponent = status }, @@ -186,8 +208,9 @@ const data = { state.curActiveTabInner = curActiveTabInner }, - setCurCanvasScale(state, curCanvasScale) { - state.curCanvasScale = curCanvasScale + setCurCanvasScale(state, curCanvasScaleSelf) { + Vue.set(state.curCanvasScaleMap, curCanvasScaleSelf.canvasId, curCanvasScaleSelf) + state.curCanvasScale = curCanvasScaleSelf }, setPreviewCanvasScale(state, scale) { if (scale.scaleWidth) { @@ -197,14 +220,16 @@ const data = { state.previewCanvasScale.scalePointHeight = scale.scaleHeight } }, - setShapeStyle({ curComponent, canvasStyleData, curCanvasScale }, { top, left, width, height, rotate }) { + setShapeStyle({ curComponent, canvasStyleData, curCanvasScaleMap }, { top, left, width, height, rotate }) { + const curCanvasScaleSelf = curCanvasScaleMap[curComponent.canvasId] if (curComponent) { - if (top || top === 0) curComponent.style.top = (top / curCanvasScale.scalePointHeight) + 0.0000001 - if (left || left === 0) curComponent.style.left = (left / curCanvasScale.scalePointWidth) + 0.0000001 - if (width || width === 0) curComponent.style.width = (width / curCanvasScale.scalePointWidth + 0.0000001) - if (height || height === 0) curComponent.style.height = (height / curCanvasScale.scalePointHeight) + 0.0000001 + if (top || top === 0) curComponent.style.top = (top / curCanvasScaleSelf.scalePointHeight) + 0.0000001 + if (left || left === 0) curComponent.style.left = (left / curCanvasScaleSelf.scalePointWidth) + 0.0000001 + if (width || width === 0) curComponent.style.width = (width / curCanvasScaleSelf.scalePointWidth + 0.0000001) + if (height || height === 0) curComponent.style.height = (height / curCanvasScaleSelf.scalePointHeight) + 0.0000001 if (rotate || rotate === 0) curComponent.style.rotate = rotate } + // console.log("setShapeStyle==="+curComponent.style.width) }, setShapeSingleStyle({ curComponent }, { key, value }) { @@ -715,6 +740,31 @@ const data = { item.needAdaptor = false } }) + }, + setTabMoveInActiveId(state, tabId) { + state.tabMoveInActiveId = tabId + }, + setTabCollisionActiveId(state, tabId) { + state.tabCollisionActiveId = tabId + }, + setTabMoveOutActiveId(state, tabId) { + state.tabMoveOutActiveId = tabId + }, + setTabMoveOutComponentId(state, componentId) { + state.tabMoveOutComponentId = componentId + }, + clearTabMoveInfo(state){ + state.tabMoveInActiveId = null + state.tabCollisionActiveId = null + state.tabMoveOutActiveId = null + state.tabMoveOutComponentId = null + }, + setMousePointShadowMap(state,mousePoint){ + state.mousePointShadowMap.mouseX = mousePoint.mouseX + state.mousePointShadowMap.mouseY = mousePoint.mouseY + state.mousePointShadowMap.width = mousePoint.width + state.mousePointShadowMap.height = mousePoint.height + // console.log("mousePointMap:"+JSON.stringify(state.mousePointMap)) } }, modules: { diff --git a/frontend/src/views/panel/AssistComponent/index.vue b/frontend/src/views/panel/AssistComponent/index.vue index 5bfa37cf75..7f08ce4c50 100644 --- a/frontend/src/views/panel/AssistComponent/index.vue +++ b/frontend/src/views/panel/AssistComponent/index.vue @@ -120,6 +120,7 @@ export default { type: 'assist', id: ev.target.dataset.id } + this.$store.commit('clearTabMoveInfo') ev.dataTransfer.setData('componentInfo', JSON.stringify(dataTrans)) eventBus.$emit('startMoveIn') }, @@ -183,6 +184,8 @@ export default { component.auxiliaryMatrix = false } component.moveStatus = 'start' + component['canvasId'] = 'canvas-main' + component['canvasPid'] = '0' return component }, handleDragEnd(ev) { diff --git a/frontend/src/views/panel/LinkJumpSet/index.vue b/frontend/src/views/panel/LinkJumpSet/index.vue index d42104e1a9..75563f28a4 100644 --- a/frontend/src/views/panel/LinkJumpSet/index.vue +++ b/frontend/src/views/panel/LinkJumpSet/index.vue @@ -408,6 +408,7 @@ import { imgUrlTrans } from '@/components/canvas/utils/utils' export default { components: { codemirror, draggable }, + name: 'LinkJumpSet', props: { viewId: { type: String, diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index b52860b98a..1fd14ed675 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -161,32 +161,22 @@ :modal-append-to-body="true" >
- - - + + +
-
- - - -
+ + - + {{ panelInfo.name }} @@ -215,15 +200,16 @@ class="this_mobile_canvas_main" :style="mobileCanvasStyle" > - + + + @@ -252,7 +238,7 @@ /> - + - + @@ -278,7 +264,7 @@ />
- +
@@ -294,7 +280,8 @@
- {{ $t('panel.select_view') }} + {{ $t('panel.select_view') }}
@@ -382,13 +369,6 @@ @click="e => {e.target.value = '';}" @change="handleFileChange" > - - - - {{ $t('panel.panel_cache_use_tips') }} + {{ $t('panel.panel_cache_use_tips') }}
{{ $t('panel.no') }} + >{{ $t('panel.no') }} + {{ $t('panel.yes') }} + >{{ $t('panel.yes') }} +
@@ -492,7 +475,7 @@ import FilterGroup from '../filter' import SubjectSetting from '../SubjectSetting' import bus from '@/utils/bus' import Editor from '@/components/canvas/components/Editor/index' -import { deepCopy, imgUrlTrans, matrixBaseChange } from '@/components/canvas/utils/utils' +import { deepCopy, getNowCanvasComponentData, imgUrlTrans, matrixBaseChange } from '@/components/canvas/utils/utils' import componentList, { BASE_MOBILE_STYLE, COMMON_BACKGROUND, @@ -534,9 +517,14 @@ import Multiplexing from '@/views/panel/ViewSelect/multiplexing' import { listenGlobalKeyDown } from '@/components/canvas/utils/shortcutKey' import { adaptCurThemeCommonStyle } from '@/components/canvas/utils/style' import eventBus from '@/components/canvas/utils/eventBus' +import DeEditor from '@/components/canvas/components/Editor/DeEditor' +import DeCanvas from '@/components/canvas/DeCanvas' + export default { name: 'PanelEdit', components: { + DeCanvas, + DeEditor, Multiplexing, ChartStyleBatchSet, OuterParamsSet, @@ -560,6 +548,7 @@ export default { }, data() { return { + canvasId: 'canvas-main', panelCacheExist: false, viewData: [], multiplexingShow: false, @@ -627,6 +616,9 @@ export default { }, computed: { + mainCanvasComponentData() { + return getNowCanvasComponentData(this.canvasId) + }, // 侧边显示控制 chartEditParam() { if (this.curComponent) { @@ -736,9 +728,12 @@ export default { multiplexingDisabled() { return Object.keys(this.curMultiplexingComponents) === 0 }, + curCanvasScaleSelf() { + return this.curCanvasScaleMap[this.canvasId] + }, ...mapState([ 'curComponent', - 'curCanvasScale', + 'curCanvasScaleMap', 'isClickComponent', 'canvasStyleData', 'curComponentIndex', @@ -796,8 +791,8 @@ export default { }, beforeDestroy() { bus.$off('component-on-drag', this.componentOnDrag) - bus.$off('component-dialog-edit', this.editDialog) - bus.$off('button-dialog-edit', this.editButtonDialog) + // bus.$off('component-dialog-edit', this.editDialog) + // bus.$off('button-dialog-edit', this.editButtonDialog) bus.$off('component-dialog-style', this.componentDialogStyle) bus.$off('previewFullScreenClose', this.previewFullScreenClose) bus.$off('change_panel_right_draw', this.changeRightDrawOpen) @@ -818,8 +813,8 @@ export default { }, initEvents() { bus.$on('component-on-drag', this.componentOnDrag) - bus.$on('component-dialog-edit', this.editDialog) - bus.$on('button-dialog-edit', this.editButtonDialog) + // bus.$on('component-dialog-edit', this.editDialog) + // bus.$on('button-dialog-edit', this.editButtonDialog) bus.$on('component-dialog-style', this.componentDialogStyle) bus.$on('previewFullScreenClose', this.previewFullScreenClose) bus.$on('change_panel_right_draw', this.changeRightDrawOpen) @@ -837,7 +832,9 @@ export default { const filterIds = com.options.attrs.filterIds let len = filterIds.length while (len--) { - if (param.componentId === filterIds[len]) { filterIds.splice(len, 1) } + if (param.componentId === filterIds[len]) { + filterIds.splice(len, 1) + } } com.options.attrs.filterIds = filterIds } @@ -857,9 +854,7 @@ export default { } this.rightDrawOpen = param if (this.rightDrawOpen) { - setTimeout(() => { - this.outStyle.width = this.outStyle.width + 0.000001 - }, 0) + this.$refs['canvasMainRef'].restore() } }, init(panelId) { @@ -933,11 +928,11 @@ export default { showPanel(type) { if (this.showIndex === -1 || this.showIndex === type) { this.$nextTick(() => { - if (this.show) { - this.showIndex === -1 + if (this.show) { + this.showIndex === -1 + } + this.show = !this.show } - this.show = !this.show - } ) } this.showIndex = type @@ -1007,15 +1002,17 @@ export default { } else { this.currentWidget = ApplicationContext.getService(componentInfo.id) this.currentFilterCom = this.currentWidget.getDrawPanel() + this.currentFilterCom['canvasId'] = 'canvas-main' + this.currentFilterCom['canvasPid'] = '0' if (this.canvasStyleData.auxiliaryMatrix) { this.currentFilterCom.x = this.dropComponentInfo.x this.currentFilterCom.y = this.dropComponentInfo.y this.currentFilterCom.sizex = this.dropComponentInfo.sizex this.currentFilterCom.sizey = this.dropComponentInfo.sizey - this.currentFilterCom.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScale.matrixStyleOriginWidth - this.currentFilterCom.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScale.matrixStyleOriginHeight - this.currentFilterCom.style.width = this.dragComponentInfo.sizex * this.curCanvasScale.matrixStyleOriginWidth - this.currentFilterCom.style.height = this.dragComponentInfo.sizey * this.curCanvasScale.matrixStyleOriginHeight + this.currentFilterCom.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScaleSelf.matrixStyleOriginWidth + this.currentFilterCom.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScaleSelf.matrixStyleOriginHeight + this.currentFilterCom.style.width = this.dragComponentInfo.sizex * this.curCanvasScaleSelf.matrixStyleOriginWidth + this.currentFilterCom.style.height = this.dragComponentInfo.sizey * this.curCanvasScaleSelf.matrixStyleOriginHeight } else { this.currentFilterCom.style.left = this.dragComponentInfo.shadowStyle.x this.currentFilterCom.style.top = this.dragComponentInfo.shadowStyle.y @@ -1046,10 +1043,10 @@ export default { component.sizex = this.dropComponentInfo.sizex component.sizey = this.dropComponentInfo.sizey - component.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScale.matrixStyleOriginWidth - component.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScale.matrixStyleOriginHeight - component.style.width = this.dragComponentInfo.sizex * this.curCanvasScale.matrixStyleOriginWidth - component.style.height = this.dragComponentInfo.sizey * this.curCanvasScale.matrixStyleOriginHeight + component.style.left = (this.dragComponentInfo.x - 1) * this.curCanvasScaleSelf.matrixStyleOriginWidth + component.style.top = (this.dragComponentInfo.y - 1) * this.curCanvasScaleSelf.matrixStyleOriginHeight + component.style.width = this.dragComponentInfo.sizex * this.curCanvasScaleSelf.matrixStyleOriginWidth + component.style.height = this.dragComponentInfo.sizey * this.curCanvasScaleSelf.matrixStyleOriginHeight } else { component.style.top = this.dropComponentInfo.shadowStyle.y component.style.left = this.dropComponentInfo.shadowStyle.x @@ -1058,6 +1055,8 @@ export default { } component.id = newComponentId + component['canvasId'] = 'canvas-main' + component['canvasPid'] = '0' // 新拖入的组件矩阵状态 和仪表板当前的矩阵状态 保持一致 component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix // 统一设置背景信息 @@ -1243,14 +1242,14 @@ export default { }, getPositionX(x) { if (this.canvasStyleData.selfAdaption) { - return x * 100 / this.curCanvasScale.scaleWidth + return x * 100 / this.curCanvasScaleSelf.scaleWidth } else { return x } }, getPositionY(y) { if (this.canvasStyleData.selfAdaption) { - return y * 100 / this.curCanvasScale.scaleHeight + return y * 100 / this.curCanvasScaleSelf.scaleHeight } else { return y } @@ -1281,10 +1280,10 @@ export default { component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix // position = absolution 或导致有偏移 这里中和一下偏移量 if (this.canvasStyleData.auxiliaryMatrix) { - component.style.left = (component.x - 1) * this.curCanvasScale.matrixStyleOriginWidth - component.style.top = (component.y - 1) * this.curCanvasScale.matrixStyleOriginHeight - component.style.width = component.sizex * this.curCanvasScale.matrixStyleOriginWidth - component.style.height = component.sizey * this.curCanvasScale.matrixStyleOriginHeight + component.style.left = (component.x - 1) * this.curCanvasScaleSelf.matrixStyleOriginWidth + component.style.top = (component.y - 1) * this.curCanvasScaleSelf.matrixStyleOriginHeight + component.style.width = component.sizex * this.curCanvasScaleSelf.matrixStyleOriginWidth + component.style.height = component.sizey * this.curCanvasScaleSelf.matrixStyleOriginHeight } else { component.style.left = 0 component.style.top = 0 @@ -1352,7 +1351,6 @@ export default { const touchOffset = 100 const canvasInfoMobile = document.getElementById('canvasInfoMobile') // 获取子盒子(高度肯定比父盒子大) - // const editorMobile = document.getElementById('editorMobile') // 画布区顶部到浏览器顶部距离 const canvasTop = canvasInfoMobile.offsetTop + 75 // 画布区有高度 @@ -1387,266 +1385,271 @@ export default { diff --git a/frontend/src/views/panel/filter/index.vue b/frontend/src/views/panel/filter/index.vue index cc0a1ec8cf..8a8cec5c49 100644 --- a/frontend/src/views/panel/filter/index.vue +++ b/frontend/src/views/panel/filter/index.vue @@ -40,6 +40,12 @@ import eventBus from '@/components/canvas/utils/eventBus' import { mapState } from 'vuex' export default { name: 'FilterGroup', + props: { + canvasId: { + type: String, + require: true + } + }, data() { return { panelInfo: this.$store.state.panel.panelInfo, @@ -73,9 +79,12 @@ export default { computed: { ...mapState([ 'canvasStyleData', - 'curCanvasScale', + 'curCanvasScaleMap', 'componentData' ]), + curCanvasScaleSelf(){ + return this.curCanvasScaleMap[this.canvasId] + }, searchButtonExist() { return this.componentData && this.componentData.some(component => component.type === 'custom-button' && component.serviceName === 'buttonSureWidget') }, @@ -119,10 +128,12 @@ export default { // 设置矩阵标记点 dragComponentInfo.x = 1 dragComponentInfo.y = 1 - dragComponentInfo.sizex = Math.round(dragComponentInfo.style.width / this.curCanvasScale.matrixStyleOriginWidth) - dragComponentInfo.sizey = Math.round(dragComponentInfo.style.height / this.curCanvasScale.matrixStyleOriginHeight) + dragComponentInfo.sizex = Math.round(dragComponentInfo.style.width / this.curCanvasScaleSelf.matrixStyleOriginWidth) + dragComponentInfo.sizey = Math.round(dragComponentInfo.style.height / this.curCanvasScaleSelf.matrixStyleOriginHeight) dragComponentInfo.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix dragComponentInfo.moveStatus = 'start' + dragComponentInfo['canvasId'] = 'canvas-main' + dragComponentInfo['canvasPid'] = '0' this.$store.commit('setDragComponentInfo', dragComponentInfo) ev.dataTransfer.effectAllowed = 'copy' const dataTrans = { diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 4aa8a8d006..106a7dbb4a 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -205,7 +205,7 @@ > Date: Mon, 24 Oct 2022 12:46:28 +0800 Subject: [PATCH 04/53] =?UTF-8?q?fix:=20excel=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=9B=B4=E6=94=B9=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddExcel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index 0829f396c9..9f5fbf0122 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -374,8 +374,8 @@ export default { this.sheetObj = data this.fields = data.fields this.jsonArray = data.jsonArray - const data = this.jsonArray - this.$refs.plxTable.reloadData(data) + const dataList = this.jsonArray + this.$refs.plxTable.reloadData(dataList) } }, handleCommand(type, field) { From 3fdeef031212105937bfadb922f6021f2749b273 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 24 Oct 2022 13:22:58 +0800 Subject: [PATCH 05/53] =?UTF-8?q?feat(=E5=B9=B3=E5=8F=B0=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?):=20=E9=A3=9E=E4=B9=A6=E5=9B=BD=E9=99=85=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/auth/api/AuthApi.java | 4 + .../io/dataease/auth/server/AuthServer.java | 8 + .../auth/service/AuthUserService.java | 4 + .../service/impl/AuthUserServiceImpl.java | 15 ++ .../auth/service/impl/ShiroServiceImpl.java | 4 + .../controller/sys/SysUserController.java | 16 +- .../controller/sys/response/AuthBindDTO.java | 2 + .../main/java/io/dataease/ext/AuthMapper.java | 1 + .../main/java/io/dataease/ext/AuthMapper.xml | 10 + .../plugins/server/XDingtalkServer.java | 2 +- .../dataease/plugins/server/XLarkServer.java | 2 +- .../plugins/server/XLarksuiteServer.java | 206 ++++++++++++++++++ .../dataease/plugins/server/XWecomServer.java | 2 +- .../dataease/service/sys/SysUserService.java | 37 +++- .../main/resources/db/migration/V42__1.16.sql | 3 + frontend/src/api/user.js | 7 + frontend/src/lang/en.js | 4 +- frontend/src/lang/tw.js | 4 +- frontend/src/lang/zh.js | 4 +- frontend/src/views/login/index.vue | 31 ++- 20 files changed, 346 insertions(+), 20 deletions(-) create mode 100644 backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java diff --git a/backend/src/main/java/io/dataease/auth/api/AuthApi.java b/backend/src/main/java/io/dataease/auth/api/AuthApi.java index e4b2df95b5..aeaee10e13 100644 --- a/backend/src/main/java/io/dataease/auth/api/AuthApi.java +++ b/backend/src/main/java/io/dataease/auth/api/AuthApi.java @@ -75,6 +75,10 @@ public interface AuthApi { @PostMapping("/isOpenLark") boolean isOpenLark(); + @ApiOperation("是否开启国际飞书") + @PostMapping("/isOpenLarksuite") + boolean isOpenLarksuite(); + @ApiIgnore @PostMapping("/isPluginLoaded") boolean isPluginLoaded(); diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index e4282473a2..ac43dc69ce 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -337,6 +337,14 @@ public class AuthServer implements AuthApi { return authUserService.supportLark(); } + @Override + public boolean isOpenLarksuite() { + Boolean licValid = PluginUtils.licValid(); + if (!licValid) + return false; + return authUserService.supportLarksuite(); + } + @Override public boolean isPluginLoaded() { Boolean licValid = PluginUtils.licValid(); diff --git a/backend/src/main/java/io/dataease/auth/service/AuthUserService.java b/backend/src/main/java/io/dataease/auth/service/AuthUserService.java index a9df96a6e8..ba9d201031 100644 --- a/backend/src/main/java/io/dataease/auth/service/AuthUserService.java +++ b/backend/src/main/java/io/dataease/auth/service/AuthUserService.java @@ -23,6 +23,8 @@ public interface AuthUserService { SysUserEntity getUserByDingtalkId(String dingtalkId); SysUserEntity getUserByLarkId(String larkId); + SysUserEntity getUserByLarksuiteId(String larksuiteId); + List roles(Long userId); List permissions(Long userId); @@ -43,6 +45,8 @@ public interface AuthUserService { Boolean supportLark(); + Boolean supportLarksuite(); + Boolean supportLoginLimit(); Boolean pluginLoaded(); diff --git a/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java index f862f84273..a148882cf5 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java @@ -21,6 +21,7 @@ import io.dataease.plugins.util.PluginUtils; import io.dataease.plugins.xpack.cas.service.CasXpackService; import io.dataease.plugins.xpack.dingtalk.service.DingtalkXpackService; import io.dataease.plugins.xpack.lark.service.LarkXpackService; +import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService; import io.dataease.plugins.xpack.ldap.service.LdapXpackService; import io.dataease.plugins.xpack.loginlimit.dto.response.LoginLimitInfo; import io.dataease.plugins.xpack.loginlimit.service.LoginLimitXpackService; @@ -108,6 +109,11 @@ public class AuthUserServiceImpl implements AuthUserService { return authMapper.findLarkUser(larkId); } + @Override + public SysUserEntity getUserByLarksuiteId(String larksuiteId) { + return authMapper.findLarksuiteUser(larksuiteId); + } + @Override public List roles(Long userId) { return authMapper.roleCodes(userId); @@ -221,6 +227,15 @@ public class AuthUserServiceImpl implements AuthUserService { return larkXpackService.isOpen(); } + @Override + public Boolean supportLarksuite() { + Map beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LarksuiteXpackService.class)); + if (beansOfType.keySet().size() == 0) return false; + LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + if (ObjectUtils.isEmpty(larkXpackService)) return false; + return larkXpackService.isOpen(); + } + @Override public Boolean supportLoginLimit() { Map beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class)); diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index a1a55baffa..b92517f050 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -86,6 +86,7 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON); filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON); + filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON); filterChainDefinitionMap.put("/api/auth/getPublicKey", ANON); filterChainDefinitionMap.put("/api/pluginCommon/component/*", ANON); filterChainDefinitionMap.put("/api/pluginCommon/staticInfo/**", ANON); @@ -101,6 +102,9 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/plugin/lark/callBack*", ANON); filterChainDefinitionMap.put("/plugin/lark/bind*", ANON); filterChainDefinitionMap.put("/plugin/lark/getQrParam", ANON); + filterChainDefinitionMap.put("/plugin/larksuite/callBack*", ANON); + filterChainDefinitionMap.put("/plugin/larksuite/bind*", ANON); + filterChainDefinitionMap.put("/plugin/larksuite/getQrParam", ANON); filterChainDefinitionMap.put("/cas/reset/**", ANON); filterChainDefinitionMap.put("/unauth", ANON); diff --git a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java index 8c8f4d0f87..7d4a68bca3 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java @@ -56,6 +56,8 @@ public class SysUserController { private static final String DINGTALK = "dingtalk"; private static final String LARK = "lark"; + private static final String LARKSUITE = "larksuite"; + @Resource private SysUserService sysUserService; @@ -254,15 +256,18 @@ public class SysUserController { if (authUserService.supportLark() && StringUtils.isNotBlank(sysUserAssist.getLarkId())) { dto.setLarkBinded(true); } + if (authUserService.supportLarksuite() && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId())) { + dto.setLarksuiteBinded(true); + } return dto; } @PostMapping("/unbindAssist/{type}") public void unbindAssist(@PathVariable("type") String type) { - Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type); + Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type) || StringUtils.equals(LARKSUITE, type); if (!valid) { - DEException.throwException("only [wecom, dingtalk, lark] is valid"); + DEException.throwException("only [wecom, dingtalk, lark, larksuite] is valid"); } Long userId = AuthUtils.getUser().getUserId(); SysUserAssist sysUserAssist = sysUserService.assistInfo(userId); @@ -275,10 +280,13 @@ public class SysUserController { if (StringUtils.equals(LARK, type)) { sysUserAssist.setLarkId(null); } - if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId())) { + if (StringUtils.equals(LARKSUITE, type)) { + sysUserAssist.setLarksuiteId(null); + } + if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId()) && StringUtils.isBlank(sysUserAssist.getLarksuiteId())) { sysUserService.changeUserFrom(userId, 0); } - sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); } diff --git a/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java b/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java index 0394961fe3..dcb2afcd1a 100644 --- a/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java +++ b/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java @@ -12,4 +12,6 @@ public class AuthBindDTO implements Serializable { private Boolean dingtalkBinded = false; private Boolean larkBinded = false; + + private Boolean larksuiteBinded = false; } diff --git a/backend/src/main/java/io/dataease/ext/AuthMapper.java b/backend/src/main/java/io/dataease/ext/AuthMapper.java index 763d41f414..5ddb83f600 100644 --- a/backend/src/main/java/io/dataease/ext/AuthMapper.java +++ b/backend/src/main/java/io/dataease/ext/AuthMapper.java @@ -37,5 +37,6 @@ public interface AuthMapper { SysUserEntity findWecomUser(@Param("wecomId") String wecomId); SysUserEntity findDingtalkUser(@Param("dingtalkId") String dingtalkId); SysUserEntity findLarkUser(@Param("larkId") String larkId); + SysUserEntity findLarksuiteUser(@Param("larksuiteId") String larksuiteId); } diff --git a/backend/src/main/java/io/dataease/ext/AuthMapper.xml b/backend/src/main/java/io/dataease/ext/AuthMapper.xml index ac07e54e79..dda18002af 100644 --- a/backend/src/main/java/io/dataease/ext/AuthMapper.xml +++ b/backend/src/main/java/io/dataease/ext/AuthMapper.xml @@ -137,4 +137,14 @@ where a.lark_id = #{larkId} + + diff --git a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java index 27414e6836..9554458b8d 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java @@ -185,7 +185,7 @@ public class XDingtalkServer { sysUserAssist.setUserId(Long.parseLong(state)); } sysUserAssist.setDingtalkId(userId); - sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java index 9f51798be4..f473c6eed8 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java @@ -185,7 +185,7 @@ public class XLarkServer { sysUserAssist.setUserId(Long.parseLong(state)); } sysUserAssist.setLarkId(userId); - sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java b/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java new file mode 100644 index 0000000000..52223daff3 --- /dev/null +++ b/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java @@ -0,0 +1,206 @@ +package io.dataease.plugins.server; + +import io.dataease.auth.entity.SysUserEntity; +import io.dataease.auth.entity.TokenInfo; +import io.dataease.auth.service.AuthUserService; +import io.dataease.auth.util.JWTUtils; +import io.dataease.commons.constants.SysLogConstants; +import io.dataease.commons.exception.DEException; +import io.dataease.commons.utils.DeLogUtils; +import io.dataease.commons.utils.LogUtil; +import io.dataease.commons.utils.ServletUtils; +import io.dataease.plugins.common.base.domain.SysUserAssist; +import io.dataease.plugins.config.SpringContextUtil; +import io.dataease.plugins.xpack.display.dto.response.SysSettingDto; +import io.dataease.plugins.xpack.lark.dto.entity.LarkQrResult; +import io.dataease.plugins.xpack.lark.dto.response.LarkInfo; +import io.dataease.plugins.xpack.larksuite.dto.entity.UserData; +import io.dataease.plugins.xpack.larksuite.dto.response.LarksuiteUserResult; +import io.dataease.plugins.xpack.larksuite.service.LarksuiteXpackService; +import io.dataease.service.sys.SysUserService; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import springfox.documentation.annotations.ApiIgnore; + +import javax.annotation.Resource; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; + +@ApiIgnore +@RequestMapping("/plugin/larksuite") +@Controller +public class XLarksuiteServer { + + @Resource + private AuthUserService authUserService; + @Resource + private SysUserService sysUserService; + + @ResponseBody + @GetMapping("/info") + public LarkInfo getLarkInfo() { + LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + return larkXpackService.info(); + } + + @ResponseBody + @RequiresPermissions("sysparam:read") + @PostMapping("/save") + public void save(@RequestBody List settings) { + LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + larkXpackService.save(settings); + } + + @ResponseBody + @PostMapping("/testConn") + public void testConn(@RequestBody LarkInfo larkInfo) { + LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + try { + larkXpackService.testConn(larkInfo); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @ResponseBody + @PostMapping("/getQrParam") + public LarkQrResult getQrParam() { + LarksuiteXpackService larkXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + return larkXpackService.getQrParam(); + } + + @GetMapping("/callBack") + public ModelAndView callBack(@RequestParam("code") String code, @RequestParam("state") String state) { + ModelAndView modelAndView = new ModelAndView("redirect:/"); + HttpServletResponse response = ServletUtils.response(); + LarksuiteXpackService larksuiteXpackService = null; + try { + Map beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LarksuiteXpackService.class)); + if (beansOfType.keySet().size() == 0) { + DEException.throwException("缺少国际飞书插件"); + } + larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + Boolean isOpen = larksuiteXpackService.isOpen(); + if (!isOpen) { + DEException.throwException("未开启国际飞书"); + } + LarksuiteUserResult larksuiteUserResult = larksuiteXpackService.userInfo(code, state, false); + UserData larkUserInfo = larksuiteUserResult.getData(); + String username = larkUserInfo.getUser_id(); + SysUserEntity sysUserEntity = authUserService.getUserByLarksuiteId(username); + if (null == sysUserEntity) { + String email = StringUtils.isNotBlank(larkUserInfo.getEmail()) ? larkUserInfo.getEmail() : (username + "@larksuite.work"); + sysUserService.validateExistUser(username, larkUserInfo.getName(), email); + sysUserService.saveLarksuiteCUser(larkUserInfo, email); + sysUserEntity = authUserService.getUserByLarkId(username); + } + TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build(); + String realPwd = sysUserEntity.getPassword(); + String token = JWTUtils.sign(tokenInfo, realPwd); + ServletUtils.setToken(token); + + DeLogUtils.save(SysLogConstants.OPERATE_TYPE.LOGIN, SysLogConstants.SOURCE_TYPE.USER, sysUserEntity.getUserId(), null, null, null); + + Cookie cookie_token = new Cookie("Authorization", token); + cookie_token.setPath("/"); + + response.addCookie(cookie_token); + } catch (Exception e) { + + String msg = e.getMessage(); + if (null != e.getCause()) { + msg = e.getCause().getMessage(); + } + try { + msg = URLEncoder.encode(msg, "UTF-8"); + LogUtil.error(e); + Cookie cookie_error = new Cookie("LarksuiteError", msg); + cookie_error.setPath("/"); + response.addCookie(cookie_error); + return modelAndView; + } catch (UnsupportedEncodingException e1) { + e.printStackTrace(); + } + } + return modelAndView; + } + + private void bindError(HttpServletResponse response, String url, String errorMsg) { + Cookie cookie_error = new Cookie("LarksuiteError", errorMsg); + cookie_error.setPath("/"); + response.addCookie(cookie_error); + try { + response.sendRedirect(url); + } catch (IOException e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException(e); + } + } + + @GetMapping("/bind") + public void bind(@RequestParam("code") String code, @RequestParam("state") String state) { + + HttpServletResponse response = ServletUtils.response(); + String url = "/#person-info/index"; + + LarksuiteXpackService larksuiteXpackService = null; + try { + SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state)); + if (ObjectUtils.isEmpty(userEntity)) { + bindError(response, url, "绑定用户不存在"); + return; + } + SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state)); + if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId())) { + bindError(response, url, "目标用户已绑定其他国际飞书账号"); + return; + } + + Boolean isOpen = authUserService.supportLarksuite(); + if (!isOpen) { + DEException.throwException("未开启国际飞书"); + } + larksuiteXpackService = SpringContextUtil.getBean(LarksuiteXpackService.class); + LarksuiteUserResult larksuiteUserResult = larksuiteXpackService.userInfo(code, state, true); + UserData larkUserInfo = larksuiteUserResult.getData(); + String userId = larkUserInfo.getUser_id(); + + + SysUserEntity sysUserEntity = authUserService.getUserByLarksuiteId(userId); + if (null != sysUserEntity) { + bindError(response, url, "当前国际飞书账号已绑定其他DE用户"); + return; + } + + if (ObjectUtils.isEmpty(sysUserAssist)) { + sysUserAssist = new SysUserAssist(); + sysUserAssist.setUserId(Long.parseLong(state)); + } + sysUserAssist.setLarksuiteId(userId); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); + response.sendRedirect(url); + } catch (Exception e) { + + String msg = e.getMessage(); + if (null != e.getCause()) { + msg = e.getCause().getMessage(); + } + try { + msg = URLEncoder.encode(msg, "UTF-8"); + LogUtil.error(e); + bindError(response, url, msg); + } catch (UnsupportedEncodingException e1) { + e.printStackTrace(); + } + } + } +} diff --git a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java index 7ff7678cdb..738f4f73bc 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java @@ -193,7 +193,7 @@ public class XWecomServer { sysUserAssist.setUserId(Long.parseLong(state)); } sysUserAssist.setWecomId(userId); - sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + sysUserService.saveAssist(sysUserAssist.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); response.sendRedirect(url); } catch (Exception e) { diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index bc929fb6d1..466153a885 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -21,6 +21,7 @@ import io.dataease.plugins.common.base.mapper.SysUsersRolesMapper; import io.dataease.plugins.common.entity.XpackLdapUserEntity; import io.dataease.plugins.xpack.dingtalk.dto.response.DingUserEntity; import io.dataease.plugins.xpack.lark.dto.entity.LarkUserInfo; +import io.dataease.plugins.xpack.larksuite.dto.entity.UserData; import io.dataease.plugins.xpack.oidc.dto.SSOUserInfo; import org.apache.commons.collections4.CollectionUtils; @@ -107,7 +108,7 @@ public class SysUserService { SysUserAssist sysUserAssist = request.getSysUserAssist(); if (ObjectUtils.isNotEmpty(sysUserAssist) && (StringUtils.isNotBlank(sysUserAssist.getWecomId()) || StringUtils.isNotBlank(sysUserAssist.getDingtalkId()) || StringUtils.isNotBlank(sysUserAssist.getLarkId()))) { - saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); } return insert; @@ -157,7 +158,7 @@ public class SysUserService { sysUser.setIsAdmin(false); sysUser.setSub(userId); sysUserMapper.insert(sysUser); - Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), u.getUsername(), null, null)); + Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), u.getUsername(), null, null, null)); } @@ -180,7 +181,7 @@ public class SysUserService { sysUser.setSub(dingUserEntity.getUnionid()); sysUser.setPhone(dingUserEntity.getMobile()); sysUserMapper.insert(sysUser); - Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, u.getUsername(), null)); + Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, u.getUsername(), null, null)); } @Transactional @@ -202,7 +203,29 @@ public class SysUserService { sysUser.setSub(larkUserInfo.getSub()); sysUser.setPhone(larkUserInfo.getMobile()); sysUserMapper.insert(sysUser); - Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, u.getUsername())); + Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, u.getUsername(), null)); + } + + @Transactional + public void saveLarksuiteCUser(UserData larkUserInfo, String email) { + long now = System.currentTimeMillis(); + SysUser sysUser = new SysUser(); + + sysUser.setUsername(larkUserInfo.getUser_id()); + sysUser.setNickName(larkUserInfo.getName()); + sysUser.setEmail(email); + sysUser.setPassword(CodingUtil.md5(DEFAULT_PWD)); + sysUser.setCreateTime(now); + sysUser.setUpdateTime(now); + + sysUser.setEnabled(1L); + sysUser.setLanguage("zh_CN"); + sysUser.setFrom(7); + sysUser.setIsAdmin(false); + sysUser.setSub(larkUserInfo.getUnion_id()); + sysUser.setPhone(larkUserInfo.getMobile()); + sysUserMapper.insert(sysUser); + Optional.ofNullable(findOne(sysUser)).ifPresent(u -> saveAssist(u.getUserId(), null, null, null, u.getUsername())); } @Transactional @@ -299,7 +322,7 @@ public class SysUserService { SysUserAssist sysUserAssist = request.getSysUserAssist(); if (ObjectUtils.isNotEmpty(sysUserAssist) && (StringUtils.isNotBlank(sysUserAssist.getWecomId()) || StringUtils.isNotBlank(sysUserAssist.getDingtalkId()) || StringUtils.isNotBlank(sysUserAssist.getLarkId()))) { - saveAssist(user.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); + saveAssist(user.getUserId(), sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId(), sysUserAssist.getLarksuiteId()); } return result; } @@ -550,12 +573,13 @@ public class SysUserService { sysUserAssistMapper.insertSelective(sysUserAssist); } - public void saveAssist(Long userId, String wecomId, String dingtlkId, String larkId) { + public void saveAssist(Long userId, String wecomId, String dingtlkId, String larkId, String larksuiteId) { SysUserAssist existAssist = sysUserAssistMapper.selectByPrimaryKey(userId); if (ObjectUtils.isNotEmpty(existAssist)) { existAssist.setWecomId(wecomId); existAssist.setDingtalkId(dingtlkId); existAssist.setLarkId(larkId); + existAssist.setLarksuiteId(larksuiteId); sysUserAssistMapper.updateByPrimaryKey(existAssist); return; } @@ -564,6 +588,7 @@ public class SysUserService { sysUserAssist.setWecomId(wecomId); sysUserAssist.setDingtalkId(dingtlkId); sysUserAssist.setLarkId(larkId); + sysUserAssist.setLarksuiteId(larksuiteId); sysUserAssistMapper.insert(sysUserAssist); } diff --git a/backend/src/main/resources/db/migration/V42__1.16.sql b/backend/src/main/resources/db/migration/V42__1.16.sql index 2423350791..75d3e058f8 100644 --- a/backend/src/main/resources/db/migration/V42__1.16.sql +++ b/backend/src/main/resources/db/migration/V42__1.16.sql @@ -14,3 +14,6 @@ ALTER TABLE `sys_task_email` ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFA UPDATE `sys_msg_type` set `type_name` = 'i18n_msg_type_dataset_sync_failed' WHERE (`msg_type_id` = 6); + +ALTER TABLE `sys_user_assist` +ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`; diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 6899c6726d..32d2067307 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -121,6 +121,13 @@ export function larkStatus() { }) } +export function larksuiteStatus() { + return request({ + url: '/api/auth/isOpenLarksuite', + method: 'post' + }) +} + export function pluginLoaded() { return request({ url: '/api/auth/isPluginLoaded', diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 804ddce80d..191845c079 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -2361,7 +2361,8 @@ export default { channel_email_msg: 'Email', channel_wecom_msg: 'Wecom', channel_dingtalk_msg: 'Dingtalk', - channel_lark_msg: 'Lark' + channel_lark_msg: 'Lark', + channel_larksuite_msg: 'Larksuite' }, denumberrange: { label: 'Number range', @@ -2477,6 +2478,7 @@ export default { wecom: 'Wecom', dingtalk: 'Dingtalk', lark: 'Lark', + larksuite: 'Larksuite', pixel: 'Pixel', default: 'Default', custom: 'Custom', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 6f69214e79..c0e2870d0c 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -2362,7 +2362,8 @@ export default { channel_email_msg: '郵件提醒', channel_wecom_msg: '企業微信', channel_dingtalk_msg: '釘釘提醒', - channel_lark_msg: '飛書提醒' + channel_lark_msg: '飛書提醒', + channel_larksuite_msg: '國際飛書' }, denumberrange: { label: '數值區間', @@ -2478,6 +2479,7 @@ export default { wecom: '企業微信', dingtalk: '釘釘', lark: '飛書', + larksuite: '國際飛書', pixel: '分辨率', default: '默認', custom: '自定義', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 73d7733c38..d4bf01b025 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -2362,7 +2362,8 @@ export default { channel_email_msg: '邮件提醒', channel_wecom_msg: '企业微信', channel_dingtalk_msg: '钉钉提醒', - channel_lark_msg: '飞书提醒' + channel_lark_msg: '飞书提醒', + channel_larksuite_msg: '国际飞书' }, denumberrange: { label: '数值区间', @@ -2478,6 +2479,7 @@ export default { wecom: '企业微信', dingtalk: '钉钉', lark: '飞书', + larksuite: '国际飞书', pixel: '分辨率', default: '默认', custom: '自定义', diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index bac3dee230..56e1e88565 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -75,6 +75,11 @@ :label="2" size="mini" >OIDC + Larksuite @@ -187,6 +192,12 @@ component-name="SSOComponent" /> + +
import { encrypt } from '@/utils/rsaEncrypt' -import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus } from '@/api/user' +import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus, larksuiteStatus } from '@/api/user' import { getSysUI } from '@/utils/auth' import { changeFavicon } from '@/utils/index' import { initTheme } from '@/utils/ThemeUtil' @@ -248,10 +259,10 @@ export default { return this.$store.state.user.loginMsg }, qrTypes() { - return this.loginTypes && this.loginTypes.filter(item => item > 3) || [] + return this.loginTypes && this.loginTypes.filter(item => item > 3 && item < 7) || [] }, radioTypes() { - return this.loginTypes && this.loginTypes.filter(item => item < 4) || [] + return this.loginTypes && this.loginTypes.filter(item => item < 4 || item > 6) || [] } }, watch: { @@ -312,6 +323,13 @@ export default { this.setDefaultType() }) + larksuiteStatus().then(res => { + if (res.success && res.data) { + this.loginTypes.push(7) + } + this.setDefaultType() + }) + getPublicKey().then(res => { if (res.success && res.data) { // 保存公钥 @@ -391,6 +409,9 @@ export default { clearLarkMsg() { Cookies.remove('LarkError') }, + clearLarksuiteMsg() { + Cookies.remove('LarksuiteError') + }, showLoginImage(uiInfo) { this.uiInfo = getSysUI() if (!this.uiInfo || Object.keys(this.uiInfo).length === 0) { @@ -427,6 +448,7 @@ export default { this.clearWecomMsg() this.clearDingtalkMsg() this.clearLarkMsg() + this.clearLarksuiteMsg() this.$refs.loginForm.validate(valid => { if (valid) { this.loading = true @@ -447,8 +469,9 @@ export default { }) }, changeLoginType(val) { - if (val !== 2) return + if (val !== 2 && val !== 7) return this.clearOidcMsg() + this.clearLarksuiteMsg() this.$nextTick(() => { }) From 3f086add3a2f5fd120435ebaa6e9dc8716b472f7 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:20:11 +0800 Subject: [PATCH 06/53] =?UTF-8?q?fix:=20eslint=E6=8A=A5=E9=94=99=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8F=82=E8=80=83=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 2 +- frontend/src/lang/tw.js | 2 +- frontend/src/lang/zh.js | 2 +- frontend/src/views/dataset/add/AddSQL.vue | 4 ++-- .../src/views/panel/GrantAuth/shareTree.vue | 8 ++++---- .../src/views/panel/filter/filterDialog.vue | 20 +++++++++---------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index d25f4ebb49..7fedee80c1 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1437,7 +1437,7 @@ export default { field_rename: 'Rename Field', params_work: 'Effective only when editing SQL', sql_variable_limit_1: '1、SQL variables can only be used in where conditions', - sql_variable_limit_2: "2、Example:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", + sql_variable_limit_2: "2、Example:select * from table_name where column_name1='${param_name1}' and column_name2 in '${param_name2}'", select_year: 'Select Year', select_month: 'Select Month', select_date: 'Select Date', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 22b8d95158..f1830592ef 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1437,7 +1437,7 @@ export default { field_rename: '字段重命名', params_work: '僅在編輯 sql 時生效', sql_variable_limit_1: '1、SQL變數只能在WHERE條件中使用', - sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", + sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${param_name1}' and column_name2 in '${param_name2}'", selesql_variable_limit_2ct_year: '選擇年', select_month: '選擇月', select_date: '選擇日期', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index cfc0ac3f27..997a236a22 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1437,7 +1437,7 @@ export default { params_work: '仅在编辑sql时生效', select_year: '选择年', sql_variable_limit_1: '1、SQL 变量只能在 WHERE 条件中使用', - sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${parm_name1}' and column_name2 in '${parm_name2}'", + sql_variable_limit_2: "2、示例:select * from table_name where column_name1='${param_name1}' and column_name2 in '${param_name2}'", select_month: '选择月', select_date: '选择日期', select_time: '选择时间', diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index e3cc00cdd6..4426915030 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -263,7 +263,7 @@ :title="dialogTitle" :visible.sync="showVariableMgm" custom-class="de-user-drawer sql-dataset-drawer" - size="840px" + size="870px" direction="rtl" >
@@ -868,7 +868,7 @@ export default { } .content { height: 62px; - width: 792px; + width: 822px; border-radius: 4px; background: #e1eaff; position: relative; diff --git a/frontend/src/views/panel/GrantAuth/shareTree.vue b/frontend/src/views/panel/GrantAuth/shareTree.vue index 98adbb9e72..88955c5479 100644 --- a/frontend/src/views/panel/GrantAuth/shareTree.vue +++ b/frontend/src/views/panel/GrantAuth/shareTree.vue @@ -8,7 +8,7 @@ > { - this.data = res.data + this.treeData = res.data if (this.msgPanelIds && this.msgPanelIds.length > 0) { this.expandMsgNode(this.msgPanelIds) } @@ -188,7 +188,7 @@ export default { }) }, getMsgNodes(panelIds) { - this.data.forEach(item => { + this.treeData.forEach(item => { if (item.children && item.children.length > 0) { item.children.forEach(node => { if (panelIds.includes(node.id)) { diff --git a/frontend/src/views/panel/filter/filterDialog.vue b/frontend/src/views/panel/filter/filterDialog.vue index c9fe37ef69..bf6c0b64ef 100644 --- a/frontend/src/views/panel/filter/filterDialog.vue +++ b/frontend/src/views/panel/filter/filterDialog.vue @@ -53,7 +53,7 @@ v-if="showDomType === 'tree'" :default-expanded-keys="expandedArray" node-key="id" - :data="tempTreeData || data" + :data="tempTreeData || treeData" :props="defaultProps" @node-click="handleNodeClick" @@ -347,7 +347,7 @@ export default { link: false, type: 'root' }], - data: [], + treeData: [], sceneData: [], fieldData: [], originFieldData: [], @@ -472,7 +472,7 @@ export default { this.tData = JSON.parse(modelInfo) const results = this.buildTree(this.tData) this.defaultData = JSON.parse(JSON.stringify(results)) - this.data = JSON.parse(JSON.stringify(results)) + this.treeData = JSON.parse(JSON.stringify(results)) } queryAuthModel({ modelType: 'dataset' }, !userCache).then(res => { localStorage.setItem('dataset-tree', JSON.stringify(res.data)) @@ -480,7 +480,7 @@ export default { this.tData = res.data const results = this.buildTree(this.tData) this.defaultData = JSON.parse(JSON.stringify(results)) - this.data = JSON.parse(JSON.stringify(results)) + this.treeData = JSON.parse(JSON.stringify(results)) } }) }, @@ -513,7 +513,7 @@ export default { name: val } authModel(queryCondition).then(res => { - this.data = this.buildTree(res.data) + this.treeData = this.buildTree(res.data) }) }, buildTree(arrs) { @@ -602,7 +602,7 @@ export default { groupTree({}).then(res => { const data = res.data - this.data = data + this.treeData = data }) }, @@ -629,7 +629,7 @@ export default { this.dataSetBreads = this.dataSetBreads.slice(0, 1) const root = { id: null, - children: JSON.parse(JSON.stringify(this.data)) + children: JSON.parse(JSON.stringify(this.treeData)) } this.getPathById(node.id, root, res => { if (res.length > 1) { @@ -709,7 +709,7 @@ export default { this.keyWord = '' this.isTreeSearch = false if (bread.id) { - const node = this.getNode(bread.id, this.data) + const node = this.getNode(bread.id, this.treeData) if (node) { this.tempTreeData = node.children } @@ -717,7 +717,7 @@ export default { this.tempTreeData = null } - this.data = JSON.parse(JSON.stringify(this.defaultData)) + this.treeData = JSON.parse(JSON.stringify(this.defaultData)) }) }, comBackLink(bread) { @@ -795,7 +795,7 @@ export default { }) if (xItems && xItems.length > 1) { - this.data.splice(e.newDraggableIndex, 1) + this.treeData.splice(e.newDraggableIndex, 1) } }, removeCheckedKey(e) { From 5d051359bd67c7cc6edc18c1f35e6cab0853ab08 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:38:10 +0800 Subject: [PATCH 07/53] =?UTF-8?q?feat:=20=E6=8F=92=E4=BB=B6=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/AsyncComponent/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/AsyncComponent/index.vue b/frontend/src/components/AsyncComponent/index.vue index 485e46a61e..553188bcd8 100644 --- a/frontend/src/components/AsyncComponent/index.vue +++ b/frontend/src/components/AsyncComponent/index.vue @@ -52,7 +52,8 @@ export default { if (res) { const Fn = Function const dynamicCode = res.data || res - this.mode = new Fn(`return ${dynamicCode}`)() + const component = new Fn(`return ${dynamicCode}`)() + this.mode = component.default || component } } } From c01d44f2804cd2eb8724a393e075083a327f7bf6 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 24 Oct 2022 14:42:37 +0800 Subject: [PATCH 08/53] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF=EF=BC=8C=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/sys/SysUserController.java | 8 +- .../controller/sys/response/AuthBindDTO.java | 8 +- .../main/java/io/dataease/ext/AuthMapper.xml | 151 ++++++++++++------ .../main/resources/db/migration/V42__1.16.sql | 32 ++-- 4 files changed, 135 insertions(+), 64 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java index 7d4a68bca3..b528f45bb3 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java @@ -248,16 +248,16 @@ public class SysUserController { AuthBindDTO dto = new AuthBindDTO(); if (ObjectUtils.isEmpty(sysUserAssist)) return dto; if (authUserService.supportWecom() && StringUtils.isNotBlank(sysUserAssist.getWecomId())) { - dto.setWecomBinded(true); + dto.setWecomBound(true); } if (authUserService.supportDingtalk() && StringUtils.isNotBlank(sysUserAssist.getDingtalkId())) { - dto.setDingtalkBinded(true); + dto.setDingtalkBound(true); } if (authUserService.supportLark() && StringUtils.isNotBlank(sysUserAssist.getLarkId())) { - dto.setLarkBinded(true); + dto.setLarkBound(true); } if (authUserService.supportLarksuite() && StringUtils.isNotBlank(sysUserAssist.getLarksuiteId())) { - dto.setLarksuiteBinded(true); + dto.setLarksuiteBound(true); } return dto; } diff --git a/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java b/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java index dcb2afcd1a..b01f031a67 100644 --- a/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java +++ b/backend/src/main/java/io/dataease/controller/sys/response/AuthBindDTO.java @@ -7,11 +7,11 @@ import java.io.Serializable; @Data public class AuthBindDTO implements Serializable { - private Boolean wecomBinded = false; + private Boolean wecomBound = false; - private Boolean dingtalkBinded = false; + private Boolean dingtalkBound = false; - private Boolean larkBinded = false; + private Boolean larkBound = false; - private Boolean larksuiteBinded = false; + private Boolean larksuiteBound = false; } diff --git a/backend/src/main/java/io/dataease/ext/AuthMapper.xml b/backend/src/main/java/io/dataease/ext/AuthMapper.xml index dda18002af..9710597aa6 100644 --- a/backend/src/main/java/io/dataease/ext/AuthMapper.xml +++ b/backend/src/main/java/io/dataease/ext/AuthMapper.xml @@ -23,8 +23,7 @@ diff --git a/backend/src/main/resources/db/migration/V42__1.16.sql b/backend/src/main/resources/db/migration/V42__1.16.sql index 75d3e058f8..7644233454 100644 --- a/backend/src/main/resources/db/migration/V42__1.16.sql +++ b/backend/src/main/resources/db/migration/V42__1.16.sql @@ -1,19 +1,33 @@ -UPDATE `sys_menu` set `component` = REPLACE(`component`, 'SysParam', 'sysParam') where (`component` like '%SysParam%'); +UPDATE `sys_menu` +set `component` = REPLACE(`component`, 'SysParam', 'sysParam') +where (`component` like '%SysParam%'); -UPDATE `sys_menu` set `component` = REPLACE(`component`, 'privateForm', 'PrivateForm') where (`component` like '%privateForm%'); +UPDATE `sys_menu` +set `component` = REPLACE(`component`, 'privateForm', 'PrivateForm') +where (`component` like '%privateForm%'); -UPDATE `sys_menu` set `component` = REPLACE(`component`, 'personPwd', 'PersonPwd') where (`component` like '%personPwd%'); +UPDATE `sys_menu` +set `component` = REPLACE(`component`, 'personPwd', 'PersonPwd') +where (`component` like '%personPwd%'); -UPDATE `sys_menu` set `component` = REPLACE(`component`, 'dataset', 'Dataset') where (`component` = 'system/task/dataset'); +UPDATE `sys_menu` +set `component` = REPLACE(`component`, 'dataset', 'Dataset') +where (`component` = 'system/task/dataset'); -UPDATE `sys_menu` set `component` = REPLACE(`component`, 'form', 'Form') where (`component` = 'system/task/form'); +UPDATE `sys_menu` +set `component` = REPLACE(`component`, 'form', 'Form') +where (`component` = 'system/task/form'); -ALTER TABLE `dataset_table_field` ADD COLUMN `date_format` VARCHAR(255) NULL AFTER `accuracy`; +ALTER TABLE `dataset_table_field` + ADD COLUMN `date_format` VARCHAR(255) NULL AFTER `accuracy`; -ALTER TABLE `sys_task_email` ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`; +ALTER TABLE `sys_task_email` + ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`; -UPDATE `sys_msg_type` set `type_name` = 'i18n_msg_type_dataset_sync_failed' WHERE (`msg_type_id` = 6); +UPDATE `sys_msg_type` +set `type_name` = 'i18n_msg_type_dataset_sync_failed' +WHERE (`msg_type_id` = 6); ALTER TABLE `sys_user_assist` -ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`; + ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`; From 570af17d2675662a6da74489ffddae332eea908c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 24 Oct 2022 14:51:27 +0800 Subject: [PATCH 09/53] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BFTab=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=A7=BB=E5=85=A5=E7=A7=BB=E5=87=BA=E8=87=AA=E7=94=B1?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 26 ++++++++++--------- frontend/src/components/canvas/DeCanvas.vue | 1 - .../canvas/components/Editor/DeEditor.vue | 1 - .../src/components/widget/DeWidget/DeTabs.vue | 8 ------ frontend/src/store/index.js | 2 -- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index 227387ac25..0ecc9460aa 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -434,10 +434,10 @@ export default { } }, computed: { - parentWidthOffset(){ - if(this.canvasId==='canvas-main'){ + parentWidthOffset() { + if (this.canvasId === 'canvas-main') { return 0 - }else{ + } else { return this.parentWidthTabOffset } }, @@ -677,7 +677,9 @@ export default { 'tabMoveInActiveId', 'tabActiveTabNameMap', 'mousePointShadowMap', - 'tabMoveOutComponentId' + 'tabMoveOutComponentId', + 'tabCollisionActiveId', + 'tabMoveInActiveId' ]) }, watch: { @@ -1495,14 +1497,14 @@ export default { const targetCanvasScale = this.curCanvasScaleMap['canvas-main'] // 按照阴影位置定位 this.element.style.left = (this.mousePointShadowMap.mouseX - (this.mousePointShadowMap.width)) / targetCanvasScale.scalePointWidth - this.element.style.top = (this.mousePointShadowMap.mouseY - (this.mousePointShadowMap.height / 2))/ targetCanvasScale.scalePointHeight - this.element.style.width = this.mousePointShadowMap.width/ targetCanvasScale.scalePointWidth - this.element.style.height = this.mousePointShadowMap.height/ targetCanvasScale.scalePointHeight + this.element.style.top = (this.mousePointShadowMap.mouseY - (this.mousePointShadowMap.height / 2)) / targetCanvasScale.scalePointHeight + this.element.style.width = this.mousePointShadowMap.width / targetCanvasScale.scalePointWidth + this.element.style.height = this.mousePointShadowMap.height / targetCanvasScale.scalePointHeight if (this.element.auxiliaryMatrix) { this.element.x = Math.round(this.element.style.left / targetCanvasScale.matrixStyleOriginWidth) + 1 this.element.y = Math.round(this.element.style.top / targetCanvasScale.matrixStyleOriginHeight) + 1 - this.element.sizex = Math.round(this.element.style.width /targetCanvasScale.matrixStyleOriginWidth) + this.element.sizex = Math.round(this.element.style.width / targetCanvasScale.matrixStyleOriginWidth) this.element.sizey = Math.round(this.element.style.height / targetCanvasScale.matrixStyleOriginHeight) this.recordMatrixCurShadowStyle(targetCanvasScale) } @@ -1922,8 +1924,8 @@ export default { const left = this.left const width = this.width const height = this.height - // tab 移入检测开启 - if (this.isTabMoveCheck) { + // tab 移入检测开启 tab组件不能相互移入另一个tab组件 + if (this.isTabMoveCheck && this.element.type !== 'de-tabs') { const nodes = this.$el.parentNode.childNodes // 获取当前父节点下所有子节点 for (const item of nodes) { if ( @@ -1953,7 +1955,7 @@ export default { const brAndBr = (collisionT + collisionH) >= (top + height) && (collisionL + collisionW) >= (left + width) if (tfAndTf && bfAndBf && trAndTr && brAndBr) { this.$store.commit('setTabCollisionActiveId', item.getAttribute('component-id')) - } else { + } else if (this.tabCollisionActiveId === item.getAttribute('component-id')) { this.$store.commit('setTabCollisionActiveId', null) } @@ -1974,7 +1976,7 @@ export default { const activeBrAndBr = (activeT + activeH) >= (top + height) && (activeL + activeW) >= (left + width) if (activeTfAndTf && activeBfAndBf && activeTrAndTr && activeBrAndBr) { this.$store.commit('setTabMoveInActiveId', item.getAttribute('component-id')) - } else { + } else if (this.tabMoveInActiveId === item.getAttribute('component-id')) { this.$store.commit('setTabMoveInActiveId', null) } diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue index 30dd77c57e..0b42e9dcc1 100644 --- a/frontend/src/components/canvas/DeCanvas.vue +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -268,7 +268,6 @@ export default { }) }, handleDragOver(e) { - // console.log("handleDragOver-"+this.canvasId) e.preventDefault() e.dataTransfer.dropEffect = 'copy' this.$refs[this.editorRefName].handleDragOver(e) diff --git a/frontend/src/components/canvas/components/Editor/DeEditor.vue b/frontend/src/components/canvas/components/Editor/DeEditor.vue index 04f8c99dec..1a4297e1a7 100644 --- a/frontend/src/components/canvas/components/Editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/Editor/DeEditor.vue @@ -1482,7 +1482,6 @@ export default { } }, handleDragOver(e) { - console.log('handleDragOver--x='+e.pageX+';y='+e.pageY) this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index da1c648dc1..0d72f45819 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -45,14 +45,6 @@ {{ $t('detabs.eidttitle') }} - - {{ $t('detabs.selectview') }} - - - - {{ $t('detabs.selectOthers') }} - - Date: Mon, 24 Oct 2022 14:59:32 +0800 Subject: [PATCH 10/53] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/src/components/amap-wx/js/util.js | 14 +++++++------- mobile/src/components/uni-link/uni-link.vue | 2 +- mobile/src/pages/tabBar/home/detail.nvue | 4 ++-- mobile/src/pages/tabBar/home/index.nvue | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mobile/src/components/amap-wx/js/util.js b/mobile/src/components/amap-wx/js/util.js index cceeee0552..ea6075f3bf 100644 --- a/mobile/src/components/amap-wx/js/util.js +++ b/mobile/src/components/amap-wx/js/util.js @@ -58,7 +58,7 @@ const util = { /** * 关键字颜色变化 */ - serachNmme(val, name) { + searchNmme(val, name) { let namestr = new RegExp(val); let nameresult = `
@@ -94,7 +94,7 @@ const util = { dataHandle(item, val) { // 改变字体颜色 if (val) { - item.nameNodes = util.serachNmme(val, item.name); + item.nameNodes = util.searchNmme(val, item.name); } else { item.nameNodes = `
${item.name}
`; @@ -130,9 +130,9 @@ const util = { setHistory(val) { let searchHistory = uni.getStorageSync('search:history'); if (!searchHistory) searchHistory = []; - let serachData = {}; + let searchData = {}; if (typeof(val) === 'string') { - serachData = { + searchData = { adcode: [], address: [], city: [], @@ -143,18 +143,18 @@ const util = { typecode: [] }; } else { - serachData = val + searchData = val } // 判断数组是否存在,如果存在,那么将放到最前面 for (var i = 0; i < searchHistory.length; i++) { - if (searchHistory[i].name === serachData.name) { + if (searchHistory[i].name === searchData.name) { searchHistory.splice(i, 1); break; } } - searchHistory.unshift(util.dataHandle(serachData)); + searchHistory.unshift(util.dataHandle(searchData)); uni.setStorage({ key: 'search:history', data: searchHistory, diff --git a/mobile/src/components/uni-link/uni-link.vue b/mobile/src/components/uni-link/uni-link.vue index 27c5468e1a..05f3618284 100644 --- a/mobile/src/components/uni-link/uni-link.vue +++ b/mobile/src/components/uni-link/uni-link.vue @@ -25,7 +25,7 @@ * @tutorial https://ext.dcloud.net.cn/plugin?id=1182 * @property {String} href 点击后打开的外部网页url * @property {String} text 显示的文字 - * @property {String} downlaod H5平台下载文件名 + * @property {String} download H5平台下载文件名 * @property {Boolean} showUnderLine 是否显示下划线 * @property {String} copyTips 在小程序端复制链接时显示的提示语 * @property {String} color 链接文字颜色 diff --git a/mobile/src/pages/tabBar/home/detail.nvue b/mobile/src/pages/tabBar/home/detail.nvue index 3c27d40dfc..82183a8d87 100644 --- a/mobile/src/pages/tabBar/home/detail.nvue +++ b/mobile/src/pages/tabBar/home/detail.nvue @@ -116,7 +116,7 @@ index: 1 }) this.loadStarStatus() - this.caclViewHeight() + this.calcViewHeight() }, @@ -194,7 +194,7 @@ }) }, - caclViewHeight() { + calcViewHeight() { let systemInfo = uni.getSystemInfoSync() const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight if(systemInfo.navigationBarHeight) { diff --git a/mobile/src/pages/tabBar/home/index.nvue b/mobile/src/pages/tabBar/home/index.nvue index a1cd90c05e..e58af9b0a4 100644 --- a/mobile/src/pages/tabBar/home/index.nvue +++ b/mobile/src/pages/tabBar/home/index.nvue @@ -113,9 +113,9 @@ } requestHome({type: index, lastTime: activeTab.lastTime}).then(res => { - var datas = res.data.listObject - if(datas.length > 0) { - datas.forEach(item => { + var data = res.data.listObject + if(data.length > 0) { + data.forEach(item => { item.article_type = 1 item.image_url = '../../../static/yibiaobans.png' if(item.nickName) { @@ -124,11 +124,11 @@ if(item.time) item.rightText = formatHistoryDate(item.time) }) - activeTab.lastTime = datas[datas.length - 1].time + activeTab.lastTime = data[data.length - 1].time if(replace) { - activeTab.data = datas + activeTab.data = data }else { - activeTab.data = activeTab.data.concat(datas) + activeTab.data = activeTab.data.concat(data) } } From 93776973d8475fbdfd5febb4f08ca2a64b82adac Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 24 Oct 2022 17:31:36 +0800 Subject: [PATCH 11/53] =?UTF-8?q?perf(=E5=B9=B3=E5=8F=B0=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?):=20=E4=BC=98=E5=8C=96=E9=A3=9E=E4=B9=A6=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/plugins/server/XLarksuiteServer.java | 2 +- frontend/src/views/login/index.vue | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java b/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java index 52223daff3..64d9506cfb 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XLarksuiteServer.java @@ -101,7 +101,7 @@ public class XLarksuiteServer { String email = StringUtils.isNotBlank(larkUserInfo.getEmail()) ? larkUserInfo.getEmail() : (username + "@larksuite.work"); sysUserService.validateExistUser(username, larkUserInfo.getName(), email); sysUserService.saveLarksuiteCUser(larkUserInfo, email); - sysUserEntity = authUserService.getUserByLarkId(username); + sysUserEntity = authUserService.getUserByLarksuiteId(username); } TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build(); String realPwd = sysUserEntity.getPassword(); diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index 56e1e88565..e5881db818 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -379,6 +379,11 @@ export default { this.switchCodeIndex(6) } this.clearLarkMsg() + + if (Cookies.get('LarksuiteError')) { + this.$error(Cookies.get('LarksuiteError')) + } + this.clearLarksuiteMsg() }, methods: { From 716328444e8b08217de92edaa3188387930990f6 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 24 Oct 2022 17:33:31 +0800 Subject: [PATCH 12/53] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20Tab?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=86=85=E7=9A=84=E8=BF=87=E6=BB=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BD=9C=E7=94=A8=E5=9F=9F=E4=BB=85=E9=99=90=E4=BA=8E?= =?UTF-8?q?=E5=BD=93=E5=89=8DTab=E9=A1=B5=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Editor/ComponentWrapper.vue | 6 +++++ .../canvas/components/Editor/DeEditor.vue | 14 +++++++---- .../canvas/components/Editor/Preview.vue | 5 +++- .../canvas/custom-component/UserView.vue | 4 ++++ .../src/components/dataease/DeOutWidget.vue | 5 ++++ .../src/components/widget/DeWidget/DeDate.vue | 5 ++++ .../widget/DeWidget/DeInputSearch.vue | 5 ++++ .../widget/DeWidget/DeNumberRange.vue | 5 ++++ .../components/widget/DeWidget/DeSelect.vue | 5 ++++ .../widget/DeWidget/DeSelectGrid.vue | 5 ++++ .../widget/DeWidget/DeSelectTree.vue | 5 ++++ frontend/src/store/index.js | 23 +++++++++++-------- 12 files changed, 71 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index 030ca7e218..cf18c101c3 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -41,12 +41,14 @@ :in-screen="inScreen" :edit-mode="'preview'" :h="config.style.height" + :canvas-id="canvasId" /> 0 ? newX : 1 newY = newY > 0 ? newY : 1 - console.log("moveTabCollisionActive="+this.moveTabCollisionActive) if (this.moveTabCollisionActive) { return } diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 8cbdc8b2ba..235c43e11b 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -43,6 +43,7 @@ :key="index" ref="viewWrapperChild" :config="item" + :canvas-id="canvasId" :source-config="componentData[index]" :search-count="searchCount" :in-screen="inScreen" @@ -440,7 +441,9 @@ export default { } else { this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height// 获取高度比 } - this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) }) + if(this.canvasId === 'canvas-main'){ + this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) }) + } this.handleScaleChange() }, resetID(data) { diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index a47f7cf719..9a0bd6ae43 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -216,6 +216,10 @@ export default { name: 'UserView', components: { UserViewDialog, DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 }, props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: null diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index 46aa53326e..4d567a5a60 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -39,6 +39,7 @@ :is="element.component" v-if="element.type==='custom'" :id="'component' + element.id" + :canvas-id="canvasId" ref="deOutWidget" class="component-custom" :out-style="element.style" @@ -64,6 +65,10 @@ export default { name: 'DeOutWidget', mixins: [inputStyleMixin], props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: () => {} diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index f054608404..f28e8f5807 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -35,6 +35,10 @@ import customInput from '@/components/widget/DeWidget/customInput' export default { mixins: [customInput], props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: null @@ -221,6 +225,7 @@ export default { }, getCondition() { const param = { + canvasId: this.canvasId, component: this.element, value: this.formatFilterValue(), operator: this.operator diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index c09179631f..e54b9e554e 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -27,6 +27,10 @@ import bus from '@/utils/bus' export default { props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: null @@ -104,6 +108,7 @@ export default { }, getCondition() { const param = { + canvasId: this.canvasId, component: this.element, value: !this.value ? [] : Array.isArray(this.value) ? this.value : [this.value], operator: this.operator diff --git a/frontend/src/components/widget/DeWidget/DeNumberRange.vue b/frontend/src/components/widget/DeWidget/DeNumberRange.vue index cbaca4a51d..d3340508dd 100644 --- a/frontend/src/components/widget/DeWidget/DeNumberRange.vue +++ b/frontend/src/components/widget/DeWidget/DeNumberRange.vue @@ -47,6 +47,10 @@ import bus from '@/utils/bus' export default { props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: null @@ -230,6 +234,7 @@ export default { }, getCondition() { const param = { + canvasId: this.canvasId, component: this.element, value: [this.form.min, this.form.max], operator: this.operator diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index e63f7bcb96..ea96a77484 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -52,6 +52,10 @@ export default { components: { ElVisualSelect }, mixins: [customInput], props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: () => {} @@ -311,6 +315,7 @@ export default { }, getCondition() { const param = { + canvasId: this.canvasId, component: this.element, value: this.formatFilterValue(), operator: this.operator diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index d4f4c57ec4..75e7758c6f 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -73,6 +73,10 @@ import { attrsMap, styleAttrs, textSelectGridWidget } from '@/components/widget/ export default { props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: null @@ -312,6 +316,7 @@ export default { }, getCondition() { const param = { + canvasId: this.canvasId, component: this.element, value: this.formatFilterValue(), operator: this.operator diff --git a/frontend/src/components/widget/DeWidget/DeSelectTree.vue b/frontend/src/components/widget/DeWidget/DeSelectTree.vue index 96232638f2..77950175d1 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectTree.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectTree.vue @@ -36,6 +36,10 @@ export default { components: { ElTreeSelect }, mixins: [customInput], props: { + canvasId: { + type: String, + required: true + }, element: { type: Object, default: () => {} @@ -298,6 +302,7 @@ export default { const val = this.formatFilterValue() const param = { + canvasId: this.canvasId, component: this.element, value: val, operator: this.operator, diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index d16d0ea15f..5b220ff0d7 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -164,7 +164,7 @@ const data = { ...snapshot.mutations, ...lock.mutations, - setTabActiveTabNameMap(state, tabActiveInfo){ + setTabActiveTabNameMap(state, tabActiveInfo) { state.tabActiveTabNameMap[tabActiveInfo.tabId] = tabActiveInfo.activeTabName }, @@ -288,6 +288,13 @@ const data = { const vValid = valueValid(condition) // 1.根据componentId过滤 const filterComponentId = condition.componentId + const canvasId = data.canvasId + + //过滤时 主画布的过滤组件可以过滤所有的视图 + const canvasViewIds = state.componentData.filter(item => item.type === 'view' && (canvasId === 'canvas-main' || item.canvasId === canvasId)).map((itemView) => { + return itemView.propValue.viewId + }) + const canvasViewIdMatch = (viewId) => canvasViewIds && canvasViewIds.length > 0 && canvasViewIds.includes(viewId) // 2.循环每个Component 得到 三种情况 a增加b删除c无操作 const viewIdMatch = (viewIds, viewId) => !viewIds || viewIds.length === 0 || viewIds.includes(viewId) @@ -317,7 +324,7 @@ const data = { } if (!element.type || element.type !== 'view') continue const currentFilters = element.filters || [] - const vidMatch = viewIdMatch(condition.viewIds, element.propValue.viewId) + const vidMatch = viewIdMatch(condition.viewIds, element.propValue.viewId) && canvasViewIdMatch(element.propValue.viewId) let j = currentFilters.length while (j--) { const filter = currentFilters[j] @@ -484,12 +491,8 @@ const data = { } } }, - - deleteComponent(state, index) { - if (index === undefined) { - index = state.curComponentIndex - } - state.componentData.splice(index, 1) + deleteComponent(state) { + this.commit('deleteComponentWithId',state.curComponent.id) }, setLinkageInfo(state, targetLinkageInfo) { state.linkageSettingStatus = true @@ -752,13 +755,13 @@ const data = { setTabMoveOutComponentId(state, componentId) { state.tabMoveOutComponentId = componentId }, - clearTabMoveInfo(state){ + clearTabMoveInfo(state) { state.tabMoveInActiveId = null state.tabCollisionActiveId = null state.tabMoveOutActiveId = null state.tabMoveOutComponentId = null }, - setMousePointShadowMap(state,mousePoint){ + setMousePointShadowMap(state, mousePoint) { state.mousePointShadowMap.mouseX = mousePoint.mouseX state.mousePointShadowMap.mouseY = mousePoint.mouseY state.mousePointShadowMap.width = mousePoint.width From 6348dc69333b6b4ed1c1b01fdac62c8b582821ec Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 24 Oct 2022 18:05:23 +0800 Subject: [PATCH 13/53] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=A7=86=E5=9B=BE=E9=BB=98=E8=AE=A4=E5=8A=A0?= =?UTF-8?q?=E5=88=B0=E4=B8=BB=E7=94=BB=E5=B8=83=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/edit/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index f14c8c6664..143359d895 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -1297,6 +1297,8 @@ export default { component.x = 1 component.y = 1 } + component['canvasId'] = 'canvas-main' + component['canvasPid'] = '0' component.id = newComponentId // 统一设置背景信息 component.commonBackground = deepCopy(COMMON_BACKGROUND) From bf92ddaa4edbfe8bf8edb3c83d2822d1d134639d Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 25 Oct 2022 13:44:53 +0800 Subject: [PATCH 14/53] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20Kylin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/db/migration/V42__1.16.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/main/resources/db/migration/V42__1.16.sql b/backend/src/main/resources/db/migration/V42__1.16.sql index 7644233454..4b3ab2f784 100644 --- a/backend/src/main/resources/db/migration/V42__1.16.sql +++ b/backend/src/main/resources/db/migration/V42__1.16.sql @@ -31,3 +31,5 @@ WHERE (`msg_type_id` = 6); ALTER TABLE `sys_user_assist` ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`; + +ALTER TABLE `dataset_table_field` CHANGE COLUMN `type` `type` VARCHAR(255) NOT NULL COMMENT '原始字段类型' ; From afa581c1d286b3e6d93eb7a2f4481c71ddfe9aa4 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 25 Oct 2022 14:28:43 +0800 Subject: [PATCH 15/53] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20Kylin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/db/migration/V42__1.16.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/main/resources/db/migration/V42__1.16.sql b/backend/src/main/resources/db/migration/V42__1.16.sql index 4b3ab2f784..db7fbd29ef 100644 --- a/backend/src/main/resources/db/migration/V42__1.16.sql +++ b/backend/src/main/resources/db/migration/V42__1.16.sql @@ -33,3 +33,8 @@ ALTER TABLE `sys_user_assist` ADD COLUMN `larksuite_id` VARCHAR(255) NULL DEFAULT NULL AFTER `lark_id`; ALTER TABLE `dataset_table_field` CHANGE COLUMN `type` `type` VARCHAR(255) NOT NULL COMMENT '原始字段类型' ; + +INSERT INTO `my_plugin` (`name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `creator`, `load_mybatis`, + `install_time`, `module_name`, `ds_type`) +VALUES ('Apache Kylin 数据源插件', 'default', '0', '0', 'datasource', 'Apache Kylin 数据源插件', '1.0-SNAPSHOT', 'DATAEASE', '0', + '1650765903630', 'kylin-backend', 'kylin'); \ No newline at end of file From 0f3c4b558028224f83e814bcfdbeeb7b55034b3a Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 25 Oct 2022 16:03:24 +0800 Subject: [PATCH 16/53] =?UTF-8?q?perf(=E8=A7=86=E5=9B=BE-=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE):=20=E5=88=86=E7=A6=BB=E6=B8=90=E5=8F=98=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/GradientColorSelector/base.js | 71 +++++++++++++- .../GradientColorSelector/index.vue | 97 +++++++++++++------ frontend/src/lang/en.js | 3 + frontend/src/lang/tw.js | 3 + frontend/src/lang/zh.js | 3 + 5 files changed, 149 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/GradientColorSelector/base.js b/frontend/src/components/GradientColorSelector/base.js index 557047a9a5..bf88a65f75 100644 --- a/frontend/src/components/GradientColorSelector/base.js +++ b/frontend/src/components/GradientColorSelector/base.js @@ -86,7 +86,7 @@ export const colorCases = [ export const gradientColorCases = [ { name: '渐变色1', - value: 'gradient1', + value: 'gradient1_continuous_gradient', colors: [ ['rgba(144,202,249,0.5)', 'rgba(1,87,155,0.9)'], ['rgba(127,222,234,1)', 'rgba(0,77,65,1)'], @@ -101,3 +101,72 @@ export const gradientColorCases = [ export const isGradientValue = value => { return value && gradientColorCases.some(item => item.value === value) } + +export const getColorType = value => { + if (value.endsWith('_split_gradient')) { + return 'split_gradient' + } + const cloneColorCases = JSON.parse(JSON.stringify(colorCases)) + if (cloneColorCases.some(item => item.value === value)) { + return 'simple' + } + return 'gradient' +} + +export const getMapColorCases = () => { + const cloneColorCases = JSON.parse(JSON.stringify(colorCases)) + return cloneColorCases.map(colorItem => { + const curColors = colorItem.colors + const len = curColors.length + const start = curColors[0] + const end = curColors[len - 1] + const itemResult = { + name: colorItem.name, + value: colorItem.value + '_split_gradient', + baseColors: [start, end], + colors: stepsColor(start, end, 9, 1) + } + return itemResult + }) +} + +export function stepsColor(start, end, steps, gamma) { + var i; var j; var ms; var me; var output = []; var so = [] + gamma = gamma || 1 + var normalize = function(channel) { + return Math.pow(channel / 255, gamma) + } + start = parseColor(start).map(normalize) + end = parseColor(end).map(normalize) + for (i = 0; i < steps; i++) { + ms = (steps - 1) === 0 ? 0 : (i / (steps - 1)) + me = 1 - ms + for (j = 0; j < 3; j++) { + so[j] = pad( + Math.round( + Math.pow(start[j] * me + end[j] * ms, 1 / gamma) * 255 + ).toString(16) + ) + } + output.push('#' + so.join('')) + } + function parseColor(hexStr) { + return hexStr.length === 4 + ? hexStr + .substr(1) + .split('') + .map(function(s) { + return 0x11 * parseInt(s, 16) + }) + : [hexStr.substr(1, 2), hexStr.substr(3, 2), hexStr.substr(5, 2)].map( + function(s) { + return parseInt(s, 16) + } + ) + } + function pad(s) { + return s.length === 1 ? '0' + s : s + } + return output +} + diff --git a/frontend/src/components/GradientColorSelector/index.vue b/frontend/src/components/GradientColorSelector/index.vue index 48da711b0d..6acae31b81 100644 --- a/frontend/src/components/GradientColorSelector/index.vue +++ b/frontend/src/components/GradientColorSelector/index.vue @@ -20,7 +20,7 @@ @@ -38,7 +38,7 @@
@@ -47,7 +47,7 @@ @tab-click="handleClick" > - + + @@ -132,7 +139,7 @@ diff --git a/frontend/src/components/canvas/components/Editor/DateFormat.vue b/frontend/src/components/canvas/components/Editor/DateFormat.vue index af04e16a9a..840b8c1154 100644 --- a/frontend/src/components/canvas/components/Editor/DateFormat.vue +++ b/frontend/src/components/canvas/components/Editor/DateFormat.vue @@ -130,7 +130,7 @@ export default { } }, computed: { - curCanvasScaleSelf(){ + curCanvasScaleSelf() { return this.curCanvasScaleMap[this.canvasId] }, ...mapState([ diff --git a/frontend/src/components/canvas/components/Editor/DeEditor.vue b/frontend/src/components/canvas/components/Editor/DeEditor.vue index 04f8c99dec..82c04bbbd2 100644 --- a/frontend/src/components/canvas/components/Editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/Editor/DeEditor.vue @@ -13,8 +13,15 @@ @scroll="canvasScroll" > - - + + - + - + - + [] }, canvasId: { type: String, @@ -890,18 +905,18 @@ export default { moveTabCollisionActive() { return this.tabCollisionActiveId }, - pointShadowShow(){ - return this.canvasId==='canvas-main' - && this.curComponent - && this.curComponent.canvasId !== 'canvas-main' - && this.tabMoveOutComponentId + pointShadowShow() { + return this.canvasId === 'canvas-main' && + this.curComponent && + this.curComponent.canvasId !== 'canvas-main' && + this.tabMoveOutComponentId }, shadowShow() { - return ((this.curComponent - && this.curComponent.auxiliaryMatrix - && this.curComponent.canvasId === this.canvasId - && (this.curComponent.optStatus.dragging || this.curComponent.optStatus.resizing)) - || (this.dragComponentInfo && this.dragComponentInfo.canvasId ===this.canvasId )) && !this.tabMoveInActive + return ((this.curComponent && + this.curComponent.auxiliaryMatrix && + this.curComponent.canvasId === this.canvasId && + (this.curComponent.optStatus.dragging || this.curComponent.optStatus.resizing)) || + (this.dragComponentInfo && this.dragComponentInfo.canvasId === this.canvasId)) && !this.tabMoveInActive }, tabMoveInActive() { return this.tabMoveInActiveId @@ -925,7 +940,9 @@ export default { } }, // 挤占式画布设计 + // eslint-disable-next-line coordinates() { + // eslint-disable-next-line return this.coordinates }, customStyle() { @@ -1482,7 +1499,7 @@ export default { } }, handleDragOver(e) { - console.log('handleDragOver--x='+e.pageX+';y='+e.pageY) + console.log('handleDragOver--x=' + e.pageX + ';y=' + e.pageY) this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth @@ -1628,7 +1645,7 @@ export default { let newY = Math.round((item.style.top * this.scalePointHeight) / this.matrixStyle.height) + 1 newX = newX > 0 ? newX : 1 newY = newY > 0 ? newY : 1 - console.log("moveTabCollisionActive="+this.moveTabCollisionActive) + console.log('moveTabCollisionActive=' + this.moveTabCollisionActive) if (this.moveTabCollisionActive) { return } diff --git a/frontend/src/components/canvas/components/Editor/EditBar.vue b/frontend/src/components/canvas/components/Editor/EditBar.vue index d111132bc2..1340650372 100644 --- a/frontend/src/components/canvas/components/Editor/EditBar.vue +++ b/frontend/src/components/canvas/components/Editor/EditBar.vue @@ -319,7 +319,7 @@ export default { miniWidth() { return this.mobileLayoutStatus ? 1 : 4 }, - curCanvasScaleSelf(){ + curCanvasScaleSelf() { return this.curCanvasScaleMap[this.canvasId] }, ...mapState([ diff --git a/frontend/src/components/canvas/components/Editor/PGrid.vue b/frontend/src/components/canvas/components/Editor/PGrid.vue index c2df81e89b..f1fba8b94c 100644 --- a/frontend/src/components/canvas/components/Editor/PGrid.vue +++ b/frontend/src/components/canvas/components/Editor/PGrid.vue @@ -6,8 +6,8 @@ class="outer-class" >
diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 8cbdc8b2ba..1cf1a3f83f 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -67,16 +67,14 @@ import { uuid } from 'vue-uuid' import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils' import eventBus from '@/components/canvas/utils/eventBus' import elementResizeDetectorMaker from 'element-resize-detector' -import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar' -import UserViewMobileDialog from '@/components/canvas/custom-component/UserViewMobileDialog' import bus from '@/utils/bus' import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil' import { hasDataPermission } from '@/utils/permission' const erd = elementResizeDetectorMaker() export default { - components: { UserViewMobileDialog, ComponentWrapper, UserViewDialog, CanvasOptBar }, + components: { ComponentWrapper, CanvasOptBar }, model: { prop: 'show', event: 'change' @@ -141,10 +139,10 @@ export default { }, data() { return { - previewDomId: 'preview-'+this.canvasId, - previewRefId: 'preview-ref-'+this.canvasId, - previewTempDomId: 'preview-temp-'+this.canvasId, - previewTempRefId: 'preview-temp-ref-'+this.canvasId, + previewDomId: 'preview-' + this.canvasId, + previewRefId: 'preview-ref-' + this.canvasId, + previewTempDomId: 'preview-temp-' + this.canvasId, + previewTempRefId: 'preview-temp-ref-' + this.canvasId, isShowPreview: false, panelId: '', needToChangeHeight: [ diff --git a/frontend/src/components/canvas/components/Editor/PreviewMobile.vue b/frontend/src/components/canvas/components/Editor/PreviewMobile.vue index 866a97716e..5a5eac8c9d 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewMobile.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewMobile.vue @@ -46,11 +46,10 @@ import { uuid } from 'vue-uuid' import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils' import eventBus from '@/components/canvas/utils/eventBus' import elementResizeDetectorMaker from 'element-resize-detector' -import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar' export default { - components: { ComponentWrapper, UserViewDialog, CanvasOptBar }, + components: { ComponentWrapper, CanvasOptBar }, model: { prop: 'show', event: 'change' diff --git a/frontend/src/components/canvas/components/TextAttr.vue b/frontend/src/components/canvas/components/TextAttr.vue index ab657a25fa..7e3b2e874e 100644 --- a/frontend/src/components/canvas/components/TextAttr.vue +++ b/frontend/src/components/canvas/components/TextAttr.vue @@ -319,7 +319,10 @@ style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;" > - +
@@ -601,7 +604,7 @@ export default { showVertical() { return !['textSelectGridWidget', 'numberSelectGridWidget'].includes(this.curComponent.serviceName) }, - curCanvasScaleSelf(){ + curCanvasScaleSelf() { return this.curCanvasScaleMap[this.canvasId] }, ...mapState([ diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 319232a686..d3ab9c2e14 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -136,7 +136,6 @@ export function panelDataPrepare(componentData, componentStyle, callback) { // 增加所属画布ID(canvasId)当前所在画布的父ID(canvasPid) 主画布ID为main-canvas, PID = 0 表示当前所属canvas为最顶层 item.canvasId = (item.canvasId || 'canvas-main') item.canvasPid = (item.canvasPid || '0') - }) // 初始化密度为最高密度 componentStyle.aidedDesign.matrixBase = 4 @@ -149,7 +148,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) { export function resetID(data) { if (data) { data.forEach(item => { - item.type !== 'custom' && item.type !== 'de-tabs'&& (item.id = uuid.v1()) + item.type !== 'custom' && item.type !== 'de-tabs' && (item.id = uuid.v1()) }) } return data @@ -229,6 +228,6 @@ export function imgUrlTrans(url) { } } -export function getNowCanvasComponentData(canvasId){ - return store.state.componentData.filter(item => item.canvasId===canvasId) +export function getNowCanvasComponentData(canvasId) { + return store.state.componentData.filter(item => item.canvasId === canvasId) } diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index 46aa53326e..d813136234 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -58,7 +58,6 @@ diff --git a/frontend/src/views/panel/appTemplate/component/AppTemplateApply.vue b/frontend/src/views/panel/appTemplate/component/AppTemplateApply.vue new file mode 100644 index 0000000000..2ab5d248a5 --- /dev/null +++ b/frontend/src/views/panel/appTemplate/component/AppTemplateApply.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/frontend/src/views/panel/appTemplate/component/TemplateItem.vue b/frontend/src/views/panel/appTemplate/component/TemplateItem.vue index b86fbee65c..fe456be986 100644 --- a/frontend/src/views/panel/appTemplate/component/TemplateItem.vue +++ b/frontend/src/views/panel/appTemplate/component/TemplateItem.vue @@ -12,7 +12,7 @@ alt="" >
-
+
- + - - {{ $t("commons.update") }} + + {{ $t('commons.update') }} - - {{ $t("commons.uninstall") }} + + {{ $t('commons.uninstall') }}
+ +
+ + + + {{ model.name }} + + + + {{ $t('panel.preview') }} + + {{ $t('panel.apply') }} + + + +
- diff --git a/frontend/src/views/panel/appTemplateMarket/component/AppMarketPreview.vue b/frontend/src/views/panel/appTemplateMarket/component/AppMarketPreview.vue new file mode 100644 index 0000000000..1a69620825 --- /dev/null +++ b/frontend/src/views/panel/appTemplateMarket/component/AppMarketPreview.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/frontend/src/views/panel/appTemplateMarket/index.vue b/frontend/src/views/panel/appTemplateMarket/index.vue index d259e822d7..ddee12aeba 100644 --- a/frontend/src/views/panel/appTemplateMarket/index.vue +++ b/frontend/src/views/panel/appTemplateMarket/index.vue @@ -1,12 +1,11 @@ @@ -143,12 +118,17 @@ import MarketPreview from '@/views/panel/appTemplateMarket/component/MarketPrevi import elementResizeDetectorMaker from 'element-resize-detector' import AppTemplateItem from '@/views/panel/appTemplateMarket/component/AppTemplateItem' import AppTemplateLog from '@/views/panel/appTemplateMarket/log' +import AppTemplate from '@/views/panel/appTemplate' +import AppTemplateContent from '@/views/panel/appTemplate/AppTemplateContent' +import AppMarketPreview from '@/views/panel/appTemplateMarket/component/AppMarketPreview' +import AppTemplateApply from '@/views/panel/appTemplate/component/AppTemplateApply' export default { name: 'AppTemplateMarket', - components: { AppTemplateLog, AppTemplateItem, MarketPreview }, + components: { AppTemplateApply, AppMarketPreview, AppTemplateContent, AppTemplate, AppTemplateLog, AppTemplateItem, MarketPreview }, data() { return { + previewItem: null, hasResult: true, templateMiniWidth: 330, templateCurWidth: 310, @@ -194,11 +174,8 @@ export default { } } }, - computed: { - - }, - watch: { - }, + computed: {}, + watch: {}, mounted() { this.initMarketTemplate() this.getGroupTree() @@ -215,6 +192,24 @@ export default { }) }, methods: { + applyNew(item) { + const datasourceInfo = JSON.parse(item.datasourceInfo)[0] + const param = { + datasourceType: datasourceInfo.type, + appTemplateId: item.id, + appTemplateName: item.name, + panelName: item.name, + datasetGroupName: item.name + } + this.$refs.templateApply.init(param) + }, + appApply(){ + this.applyNew(this.previewItem) + }, + previewApp(item){ + this.previewModel = true + this.previewItem = item + }, initMarketTemplate() { searchAppTemplate({ nodeType: 'folder' }).then(rsp => { this.currentAppShowList = rsp.data @@ -280,109 +275,120 @@ export default { diff --git a/frontend/src/views/panel/appTemplateMarket/log/index.vue b/frontend/src/views/panel/appTemplateMarket/log/index.vue index 5b0dbc0b45..a369b675a6 100644 --- a/frontend/src/views/panel/appTemplateMarket/log/index.vue +++ b/frontend/src/views/panel/appTemplateMarket/log/index.vue @@ -10,7 +10,8 @@ type="primary" icon="el-icon-plus" @click="applyNew()" - >{{ $t('commons.create') }} + >{{ $t('commons.create') }} +   {{ $t("user.filter") - }} + >{{ + $t('user.filter') + }} + @@ -45,8 +48,8 @@ class="filter-texts" > {{ paginationConfig.total }} - {{ $t("user.result_one") }} - + {{ $t('user.result_one') }} + {{ ele }} + class="el-icon-close" + @click="clearOneFilter(index)" + />

{{ $t("user.clear_filter") }} + >{{ $t('user.clear_filter') }} +
+ :label="$t('app_template.panel')" + > + + {{ scope.row.applyTime | timestampFormatDate }} + + +
@@ -132,6 +166,36 @@ @search="filterDraw" /> + + + + + + + + + {{$t('app_template.log_resource_delete_tips')}} + + + {{ $t('commons.cancel') }} + {{ $t('commons.confirm') }} + +
@@ -144,10 +208,14 @@ import { addOrder, formatOrders } from '@/utils/index' -import { logGrid } from '@/api/appTemplateMarket/log' +import { deleteLogAndResource, logGrid } from '@/api/appTemplateMarket/log' +import { findOneWithParent } from '@/api/panel/panel' +import AppTemplateApply from '@/views/panel/appTemplate/component/AppTemplateApply' +import { deepCopy } from '@/components/canvas/utils/utils' + export default { name: 'AppTemplateLog', - components: { GridTable, filterUser }, + components: { AppTemplateApply, GridTable, filterUser }, mixins: [keyEnter], props: { appTemplateId: { @@ -162,6 +230,11 @@ export default { }, data() { return { + deleteConfirmDialog: false, + deleteItemInfo: { + deleteResource: false + }, + operateWidth: 168, columns: [], paginationConfig: { currentPage: 1, @@ -194,6 +267,53 @@ export default { this.resizeObserver() }, methods: { + closeDel() { + this.deleteItemInfo = { + deleteResource: false + } + this.deleteConfirmDialog = false + }, + confirmDel() { + deleteLogAndResource(this.deleteItemInfo).then(()=>{ + this.closeDel() + this.search() + }) + }, + closeDraw() { + this.search() + }, + editApply(item) { + const param = { + datasourceType: item.datasourceType, + logId: item.id, + panelId: item.panelId, + panelGroupPid: item.panelGroupPid, + datasourceId: item.datasourceId, + datasetGroupPid: item.datasetGroupPid, + datasetGroupId: item.datasetGroupId, + datasetGroupName: item.datasetGroupName, + panelName: item.panelName + } + this.$refs.templateEditApply.init(param) + }, + goToDatasource(row) { + + }, + goPanel(row) { + findOneWithParent(row.panelId).then(rsp => { + this.$router.push({ name: 'panel', params: rsp.data }) + }) + }, + edit() { + + }, + del(item) { + this.deleteItemInfo = { + ...item, + deleteResource: false + } + this.deleteConfirmDialog = true + }, applyNew() { this.$emit('applyNew') }, @@ -302,4 +422,13 @@ export default { .table-container-filter { height: calc(100% - 110px); } + +.link-span { + color: #3370FF; + cursor: pointer; + + &:hover { + text-decoration: underline; + } +} diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 106a7dbb4a..25279cdd46 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -17,7 +17,7 @@ style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;" >
- +
- + {{ $t('panel.export_to_img') }} + {{ $t('panel.export_to_app') }} @@ -304,6 +308,7 @@ export default { }, data() { return { + canvasInfoTemp: 'preview-temp-canvas-main', canvasId: 'canvas-main', showMain: true, pdfTemplateSelectedIndex: 0, @@ -405,7 +410,7 @@ export default { saveToTemplate() { this.dataLoading = true setTimeout(() => { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + html2canvas(document.getElementById(this.canvasInfoTemp)).then(canvas => { this.templateSaveShow = true this.dataLoading = false const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量 @@ -430,7 +435,7 @@ export default { _this.dataLoading = true try { _this.findStaticSource(function(staticResource) { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + html2canvas(document.getElementById(_this.canvasInfoTemp)).then(canvas => { _this.dataLoading = false const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 if (snapshot !== '') { @@ -458,9 +463,9 @@ export default { _this.dataLoading = true try { _this.findStaticSource(function(staticResource) { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + html2canvas(document.getElementById(_this.canvasInfoTemp)).then(canvas => { _this.dataLoading = false - const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 + const snapshot = canvas.toDataURL('image/jpeg', 1) // 0.1是图片质量 if (snapshot !== '') { const panelInfo = { name: _this.$store.state.panel.panelInfo.name, @@ -528,7 +533,7 @@ export default { setTimeout(() => { this.exporting = true setTimeout(() => { - const canvasID = document.getElementById('canvasInfoTemp') + const canvasID = document.getElementById(this.canvasInfoTemp) const a = document.createElement('a') html2canvas(canvasID).then(canvas => { this.exporting = false @@ -559,7 +564,7 @@ export default { setTimeout(() => { this.exporting = true setTimeout(() => { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + html2canvas(document.getElementById(this.canvasInfoTemp)).then(canvas => { const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量 this.dataLoading = false this.exporting = false @@ -573,7 +578,7 @@ export default { }, refreshTemplateInfo() { this.templateInfo = {} - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + html2canvas(document.getElementById(this.canvasInfoTemp)).then(canvas => { const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.2是图片质量 if (snapshot !== '') { this.templateInfo = { @@ -623,7 +628,9 @@ export default { if (this.showType === 1 && this.shareUserId !== null) { const param = { userId: this.shareUserId } proxyInitPanelData(this.panelInfo.id, param, null) - } else { initPanelData(this.panelInfo.id, false) } + } else { + initPanelData(this.panelInfo.id, false) + } }, changePublishState() { if (this.panelInfo.status === 'publish') { @@ -642,72 +649,76 @@ export default { diff --git a/frontend/src/views/system/datasource/DsForm.vue b/frontend/src/views/system/datasource/DsForm.vue index 96ca0ac5f0..0382ad2bee 100644 --- a/frontend/src/views/system/datasource/DsForm.vue +++ b/frontend/src/views/system/datasource/DsForm.vue @@ -1,9 +1,9 @@ @@ -167,6 +283,10 @@ import PluginCom from '@/views/system/plugin/PluginCom' import { listDatasourceType, listDatasource } from '@/api/system/datasource' import deTextarea from '@/components/deCustomCm/deTextarea.vue' import msgCfm from '@/components/msgCfm' +import { dsGroupTree } from '@/api/dataset/dataset' +import { appApply, appEdit, groupTree } from '@/api/panel/panel' +import { deepCopy } from '@/components/canvas/utils/utils' + export default { name: 'DsForm', components: { @@ -175,8 +295,50 @@ export default { deTextarea }, mixins: [msgCfm], + props: { + referencePosition: { + type: String, + default: 'datasource' + }, + outerParams: { + type: Object, + request: false + } + }, data() { return { + attachRule: { + panelName: [ + { + required: true, + min: 2, + max: 25, + message: i18n.t('datasource.input_limit_2_25', [2, 25]), + trigger: 'blur' + } + ], + datasetGroupName: [ + { + required: true, + min: 2, + max: 25, + message: i18n.t('datasource.input_limit_2_25', [2, 25]), + trigger: 'blur' + } + ], + datasetGroupPid: [{ required: true, message: i18n.t('chart.select_group'), trigger: 'blur' }], + panelGroupPid: [{ required: true, message: i18n.t('chart.select_group'), trigger: 'blur' }] + }, + panelGroupList: [], + datasetGroupList: [], + attachForm: { + appTemplateId: '', + panelGroupPid: null, + panelName: '', + datasetGroupPid: null, + datasetGroupId: null, + datasetGroupName: '' + }, disabled: false, form: { configuration: { @@ -402,8 +564,29 @@ export default { async created() { await this.datasourceTypes() this.queryTreeData() - const { id, showModel, type, name } = this.$route.query + let { id, showModel, type, name } = this.$route.query this.params = this.$route.query + if (this.positionCheck('appMarket')) { + id = this.outerParams.datasourceId + showModel = this.outerParams.showModel + type = this.outerParams.datasourceType + name = this.outerParams.name + this.attachForm.appTemplateId = this.outerParams.appTemplateId + this.attachForm.panelGroupPid = this.outerParams.panelGroupPid + this.attachForm.panelId = this.outerParams.panelId + this.attachForm.panelName = this.outerParams.panelName + this.attachForm.datasetGroupPid = this.outerParams.datasetGroupPid ? this.outerParams.datasetGroupPid : '0' + this.attachForm.datasetGroupId = this.outerParams.datasetGroupId + this.attachForm.datasetGroupName = this.outerParams.datasetGroupName + this.params = { + id: this.outerParams.datasourceId, + showModel: this.outerParams.showModel, + type: this.outerParams.datasourceType, + name: this.outerParams.name + } + this.getPanelGroupTree() + this.getDatasetGroupTree() + } if (id) { await this.getDatasourceDetail(id, showModel) this.edit(this.params) @@ -420,6 +603,36 @@ export default { this.disabled = Boolean(id) && showModel === 'show' && !this.canEdit }, methods: { + normalizer(node) { + // 去掉children=null的属性 + if (node.children === null || node.children === 'null') { + delete node.children + } + }, + getDatasetGroupTree() { + dsGroupTree({ nodeType: 'group', excludedId: this.attachForm.datasetGroupId }).then(res => { + this.datasetGroupList = [{ + id: '0', + name: this.$t('dataset.dataset_group'), + label: this.$t('dataset.dataset_group'), + pid: '0', + privileges: 'grant,manage,use', + type: 'group', + children: res.data + }] + }) + }, + getPanelGroupTree() { + groupTree({ nodeType: 'folder' }).then(res => { + this.panelGroupList = res.data + if (!this.attachForm.panelGroupPid && this.panelGroupList && this.panelGroupList.length > 0) { + this.attachForm.panelGroupPid = this.panelGroupList[0].id + } + }) + }, + positionCheck(referencePosition) { + return this.referencePosition === referencePosition + }, datasourceTypes() { return listDatasourceType().then((res) => { this.dsTypes = res.data || [] @@ -569,7 +782,7 @@ export default { if ( configuration.host === this.form.configuration.host && configuration.dataBase === - this.form.configuration.dataBase && + this.form.configuration.dataBase && configuration.port === this.form.configuration.port ) { repeat = true @@ -584,7 +797,7 @@ export default { if ( configuration.host === this.form.configuration.host && configuration.dataBase === - this.form.configuration.dataBase && + this.form.configuration.dataBase && configuration.port === this.form.configuration.port && configuration.schema === this.form.configuration.schema ) { @@ -621,7 +834,7 @@ export default { configuration.schema === this.form.configuration.schema && configuration.host === this.form.configuration.host && configuration.dataBase === - this.form.configuration.dataBase && + this.form.configuration.dataBase && configuration.port === this.form.configuration.port ) { repeat = true @@ -631,7 +844,7 @@ export default { if ( configuration.host === this.form.configuration.host && configuration.dataBase === - this.form.configuration.dataBase && + this.form.configuration.dataBase && configuration.port === this.form.configuration.port ) { repeat = true @@ -656,11 +869,20 @@ export default { if (!status) { return } + if (this.positionCheck('appMarket')) { + this.$refs.attachParamsForm.validate(valid => { + if (!valid) { + return false + } + } + ) + } this.$refs.dsForm.validate((valid) => { if (!valid) { return false } - const method = this.formType === 'add' ? addDs : editDs + let method = this.formType === 'add' ? addDs : editDs + const form = JSON.parse(JSON.stringify(this.form)) if (form.type === 'api') { if (this.form.apiConfiguration.length < 1) { @@ -674,17 +896,29 @@ export default { } else { form.configuration = JSON.stringify(form.configuration) } + const isAppMarket = this.positionCheck('appMarket') + let appApplyForm + if (isAppMarket) { + if (typeof form.desc === 'object') { + form.desc = '' + } + appApplyForm = { + ...this.attachForm, + datasourceList: [deepCopy(form)] + } + method = this.formType === 'add' ? appApply : appEdit + } if ( this.formType === 'modify' && this.originConfiguration !== form.configuration ) { - if (repeat) { + if (repeat && !isAppMarket) { $confirm( i18n.t('datasource.repeat_datasource_msg') + - '[' + - repeatDsName.join(',') + - '], ' + - i18n.t('datasource.confirm_save'), + '[' + + repeatDsName.join(',') + + '], ' + + i18n.t('datasource.confirm_save'), () => { $confirm(i18n.t('datasource.edit_datasource_msg'), () => { this.method(method, form) @@ -693,27 +927,40 @@ export default { ) } else { $confirm(i18n.t('datasource.edit_datasource_msg'), () => { - this.method(method, form) + isAppMarket ? this.appApplyMethod(method, appApplyForm) : this.method(method, form) }) } return } - if (repeat) { + if (repeat && !isAppMarket) { $confirm( i18n.t('datasource.repeat_datasource_msg') + - '[' + - repeatDsName.join(',') + - '], ' + - i18n.t('datasource.confirm_save'), + '[' + + repeatDsName.join(',') + + '], ' + + i18n.t('datasource.confirm_save'), () => { this.method(method, form) } ) } else { - this.method(method, form) + isAppMarket ? this.appApplyMethod(method, appApplyForm) : this.method(method, form) } }) }, + appApplyMethod(method, form) { + this.formLoading = true + method(form).then((res) => { + this.$success(i18n.t('commons.save_success')) + if (this.formType === 'add') { + this.$router.push({ name: 'panel', params: res.data }) + } else { + this.closeDraw() + } + }).finally(() => { + this.formLoading = false + }) + }, method(method, form) { this.formLoading = true method(form).then((res) => { @@ -767,6 +1014,14 @@ export default { if (!status) { return } + if (this.positionCheck('appMarket')) { + this.$refs.attachParamsForm.validate(valid => { + if (!valid) { + return false + } + } + ) + } this.$refs.dsForm.validate((valid) => { if (valid) { const data = JSON.parse(JSON.stringify(this.form)) @@ -844,6 +1099,10 @@ export default { backToList() { this.$router.push('/datasource/index') }, + + closeDraw() { + this.$emit('closeDraw') + }, logOutTips() { const options = { title: 'role.tips', @@ -967,21 +1226,47 @@ export default { } }) }, - handleClick(tab, event) {} + handleClick(tab, event) { + } } } diff --git a/frontend/src/views/system/user/UserEditer.vue b/frontend/src/views/system/user/UserEditer.vue index 3442409cce..0e35c704c1 100644 --- a/frontend/src/views/system/user/UserEditer.vue +++ b/frontend/src/views/system/user/UserEditer.vue @@ -177,6 +177,7 @@ style="width: 100%" :disabled="formType !== 'add' && form.isAdmin" multiple + filterable :placeholder="$t('user.input_roles')" @remove-tag="deleteTag" @change="changeRole" From f70bc9152a2aee2a29d1eef5b6bc698945c4a84a Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 27 Oct 2022 15:56:38 +0800 Subject: [PATCH 45/53] =?UTF-8?q?refactor(=E8=A7=86=E5=9B=BE):=20=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E7=BA=BF=E3=80=81=E9=98=88=E5=80=BC=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2UI=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/senior/AssistLine.vue | 2 +- frontend/src/views/chart/components/senior/Threshold.vue | 4 ++-- .../views/chart/components/senior/dialog/AssistLineEdit.vue | 2 ++ .../chart/components/senior/dialog/TableThresholdEdit.vue | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/chart/components/senior/AssistLine.vue b/frontend/src/views/chart/components/senior/AssistLine.vue index b0eef1e46a..0b9c24af06 100644 --- a/frontend/src/views/chart/components/senior/AssistLine.vue +++ b/frontend/src/views/chart/components/senior/AssistLine.vue @@ -51,7 +51,7 @@ :title="$t('chart.assist_line')" :visible="editLineDialog" :show-close="false" - width="70%" + width="1000px" class="dialog-css" > @@ -274,7 +274,7 @@ :title="$t('chart.threshold')" :visible="editTableThresholdDialog" :show-close="false" - width="50%" + width="800px" class="dialog-css" append-to-body > diff --git a/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue b/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue index 21e133f793..655a2a4a7c 100644 --- a/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue +++ b/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue @@ -17,6 +17,7 @@ diff --git a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue index 073dfdee8b..119bd29ce7 100644 --- a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue +++ b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue @@ -100,6 +100,7 @@ v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'" v-model="item.value" class="value-item" + style="margin-left: 10px;" :placeholder="$t('chart.drag_block_label_value')" size="mini" clearable From 1c64abd5d1cae84fd400ddbe6fd388842573b2b3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 27 Oct 2022 16:00:45 +0800 Subject: [PATCH 46/53] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BE=E8=AE=A1=E6=96=B0=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Editor/ComponentWrapper.vue | 2 +- .../src/components/widget/DeWidget/DeTabs.vue | 19 +++++++++++++------ .../src/views/panel/edit/ComponentWait.vue | 2 +- frontend/src/views/panel/edit/index.vue | 1 + 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index cf18c101c3..50407a9c93 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -195,7 +195,7 @@ export default { return style }, componentActiveFlag() { - return (this.curComponent && this.config === this.curComponent && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing') + return !this.mobileLayoutStatus && ((this.curComponent && this.config === this.curComponent && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing')) }, curGap() { return (this.canvasStyleData.panel.gap === 'yes' && this.config.auxiliaryMatrix) ? this.componentGap : 0 diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index edb11049dd..b97cd577fd 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -56,7 +56,7 @@ -
+
item.canvasId === tabCanvasId) + } else { + return getNowCanvasComponentData(tabCanvasId) + } }, setContentThemeStyle() { this.element.options.tabList.forEach(tab => { diff --git a/frontend/src/views/panel/edit/ComponentWait.vue b/frontend/src/views/panel/edit/ComponentWait.vue index cc7ace5ece..3434a4b07a 100644 --- a/frontend/src/views/panel/edit/ComponentWait.vue +++ b/frontend/src/views/panel/edit/ComponentWait.vue @@ -6,7 +6,7 @@ Date: Thu, 27 Oct 2022 16:04:08 +0800 Subject: [PATCH 47/53] =?UTF-8?q?fix:=20cas=E6=9C=8D=E5=8A=A1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=B8=AD=E6=96=87=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/zh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 86e6efae90..851565d647 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -2630,6 +2630,6 @@ export default { }, logout: { oidc_logout_error: 'OIDC退出失败,是否继续退出DataEase?', - cas_logout_error: 'The CAS service is abnormal, please contact the administrator!' + cas_logout_error: 'CAS服务异常,请联系管理员!' } } From 2443b0177deeb062d058e6490a0c4f89dab2ca9c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw <67260074+fit2cloud-chenyw@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:04:53 +0800 Subject: [PATCH 48/53] =?UTF-8?q?fix:=20cas=E6=9C=8D=E5=8A=A1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E8=8B=B1=E6=96=87=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 2b396f403a..d3a53cec82 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -2629,6 +2629,6 @@ export default { }, logout: { oidc_logout_error: 'OIDC failed to exit, do you continue to exit DataEase?', - cas_logout_error: 'CAS服务异常,请联系管理员!' + cas_logout_error: 'The CAS service is abnormal, please contact the administrator!' } } From b19914ce6b7efc28da45ff1195da35a5467624e9 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 27 Oct 2022 16:08:21 +0800 Subject: [PATCH 49/53] =?UTF-8?q?fix(=E7=99=BB=E5=87=BA):=20=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5cas=E5=90=8E=E9=80=80=E5=87=BA=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=B7=B3=E8=BD=AC=E5=88=B0cas=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2issues/2909?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/service/impl/ShiroServiceImpl.java | 2 ++ .../io/dataease/plugins/server/CasServer.java | 9 +++++++++ frontend/src/api/user.js | 7 +++++++ frontend/src/views/login/index.vue | 20 +++++++++++++++---- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index b92517f050..0fd46ef9a9 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -86,6 +86,7 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON); filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON); + filterChainDefinitionMap.put("/api/auth/isOpenCas", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON); filterChainDefinitionMap.put("/api/auth/getPublicKey", ANON); filterChainDefinitionMap.put("/api/pluginCommon/component/*", ANON); @@ -106,6 +107,7 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/plugin/larksuite/bind*", ANON); filterChainDefinitionMap.put("/plugin/larksuite/getQrParam", ANON); filterChainDefinitionMap.put("/cas/reset/**", ANON); + filterChainDefinitionMap.put("/cas/loginPage", ANON); filterChainDefinitionMap.put("/unauth", ANON); filterChainDefinitionMap.put("/display/**", ANON); diff --git a/backend/src/main/java/io/dataease/plugins/server/CasServer.java b/backend/src/main/java/io/dataease/plugins/server/CasServer.java index c54639c1b3..9a68ebec93 100644 --- a/backend/src/main/java/io/dataease/plugins/server/CasServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/CasServer.java @@ -115,4 +115,13 @@ public class CasServer { return error; } } + + @GetMapping("/loginPage") + @ResponseBody + public String loginPage() { + String casServerUrlPrefix = systemParameterService.getValue("cas.login"); + String callBack = systemParameterService.getValue("cas.callBack"); + String result = casServerUrlPrefix + "?service=" + callBack; + return result; + } } diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 32d2067307..14faf86234 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -100,6 +100,13 @@ export function casStatus() { }) } +export function casLoginPage() { + return request({ + url: '/cas/loginPage', + method: 'get' + }) +} + export function wecomStatus() { return request({ url: '/api/auth/isOpenWecom', diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index e5881db818..6765a686eb 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -130,17 +130,17 @@ > @@ -210,7 +210,7 @@ diff --git a/frontend/src/components/canvas/custom-component/DeRichTextView.vue b/frontend/src/components/canvas/custom-component/DeRichTextView.vue index c91825be1e..61de151790 100644 --- a/frontend/src/components/canvas/custom-component/DeRichTextView.vue +++ b/frontend/src/components/canvas/custom-component/DeRichTextView.vue @@ -1,8 +1,5 @@