diff --git a/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java b/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java index 4de2848a3e..d6fc4ca263 100644 --- a/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java +++ b/backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java @@ -19,7 +19,6 @@ import io.dataease.plugins.common.base.domain.Datasource; import io.dataease.service.datasource.DatasourceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; diff --git a/backend/src/main/java/io/dataease/dto/DatasourceDTO.java b/backend/src/main/java/io/dataease/dto/DatasourceDTO.java index 47d39bd4cf..8b3c8dcf30 100644 --- a/backend/src/main/java/io/dataease/dto/DatasourceDTO.java +++ b/backend/src/main/java/io/dataease/dto/DatasourceDTO.java @@ -19,6 +19,7 @@ public class DatasourceDTO extends Datasource { @ApiModelProperty("权限") private String privileges; private List apiConfiguration; + private String apiConfigurationStr; private String typeDesc; private DatasourceCalculationMode calculationMode; } diff --git a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml index 2a12627b5e..c4d4d4ad46 100644 --- a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml @@ -608,6 +608,7 @@ id, table_id, chart_id, + origin_name, `name`, dataease_name, group_type, @@ -624,6 +625,7 @@ uuid() AS id, chart_view_field.table_id, chart_view_field.pv_copy.chart_view_id AS chart_id, + chart_view_field.origin_name, chart_view_field.`name`, chart_view_field.dataease_name, chart_view_field.group_type, diff --git a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java index 71e32cb73f..31a1b0511f 100644 --- a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java +++ b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java @@ -1014,7 +1014,7 @@ public class ChartDataBuild { if (StringUtils.isEmpty(originStr) || originStr.length() <= columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) { desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X")); } else { - desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1); + desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM()) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN() - 1, originStr.length() - 1); } break; case RetainMToN: diff --git a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java index c60c17f22a..585a5a085f 100644 --- a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java +++ b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java @@ -108,7 +108,7 @@ public class DatasourceService { if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(datasource.getType())) { throw new Exception("Datasource type not supported."); } - + datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration()))); Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType()); datasourceProvider.checkConfiguration(datasource); @@ -212,6 +212,14 @@ public class DatasourceService { } } } + if(StringUtils.isNotEmpty(datasourceDTO.getConfiguration())){ + datasourceDTO.setConfiguration(new String(java.util.Base64.getEncoder().encode(datasourceDTO.getConfiguration().getBytes()))); + } + if(CollectionUtils.isNotEmpty(datasourceDTO.getApiConfiguration())){ + String config = new Gson().toJson(datasourceDTO.getApiConfiguration()); + datasourceDTO.setApiConfigurationStr(new String(java.util.Base64.getEncoder().encode(config.getBytes()))); + datasourceDTO.setApiConfiguration(null); + } } public DatasourceDTO getDataSourceDetails(String datasourceId){ @@ -253,6 +261,7 @@ public class DatasourceService { if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(updataDsRequest.getType())) { throw new Exception("Datasource type not supported."); } + updataDsRequest.setConfiguration(new String(java.util.Base64.getDecoder().decode(updataDsRequest.getConfiguration()))); checkName(updataDsRequest.getName(), updataDsRequest.getType(), updataDsRequest.getId()); Datasource datasource = new Datasource(); datasource.setName(updataDsRequest.getName()); @@ -284,6 +293,7 @@ public class DatasourceService { } public ResultHolder validate(Datasource datasource) throws Exception { + datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration()))); DatasourceDTO datasourceDTO = new DatasourceDTO(); BeanUtils.copyBean(datasourceDTO, datasource); try { @@ -372,6 +382,7 @@ public class DatasourceService { } public List getSchema(Datasource datasource) throws Exception { + datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration()))); Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType()); DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(datasource); diff --git a/frontend/src/api/chart/chart.js b/frontend/src/api/chart/chart.js index a10bb2534a..c58409d9cc 100644 --- a/frontend/src/api/chart/chart.js +++ b/frontend/src/api/chart/chart.js @@ -8,11 +8,12 @@ export function post(url, data, loading = false) { data }) } + export function tableField(id) { return request({ url: '/dataset/table/getWithPermission/' + id, method: 'post', - loading: true, + loading: false, hideMsg: true, timeout: 60000 }) @@ -34,6 +35,7 @@ export function chartCopy(id, panelId) { loading: false }) } + export function chartBatchCopy(params, panelId) { return request({ url: '/chart/view/chartBatchCopy/' + panelId, @@ -42,6 +44,7 @@ export function chartBatchCopy(params, panelId) { loading: false }) } + export function chartGroupTree(data) { return request({ url: '/chart/group/tree', @@ -116,6 +119,7 @@ export function resetViewCacheCallBack(viewId, panelId, callback) { callback(rep) }) } + export function resetViewCache(viewId, panelId) { return request({ url: '/chart/view/resetViewCache/' + viewId + '/' + panelId, diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue index 04d33ce7ef..59e9220595 100644 --- a/frontend/src/components/canvas/components/editor/Preview.vue +++ b/frontend/src/components/canvas/components/editor/Preview.vue @@ -6,6 +6,7 @@ @scroll="canvasScroll" > { + const method = this.userId ? proxyUserLoginInfo : userLoginInfo + method(this.userId).then(res => { this.userInfo = res.data activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen) }) diff --git a/frontend/src/components/deDrag/index.vue b/frontend/src/components/deDrag/index.vue index 3ec4ea4362..44cd7a11b2 100644 --- a/frontend/src/components/deDrag/index.vue +++ b/frontend/src/components/deDrag/index.vue @@ -17,8 +17,8 @@ }, className ]" - @mousedown="elementMouseDown" @touchstart="elementTouchDown" + @mousedown="outerElementMouseDown" @mouseenter="enter" @mouseleave="leave" > @@ -66,20 +66,24 @@ @mousedown.stop.prevent="handleDown(handlei, $event)" @touchstart.stop.prevent="handleTouchDown(handlei, $event)" > - +
+
+
+
+
- +
@@ -863,6 +867,18 @@ export default { eventsFor = events.touch this.elementDown(e) }, + outerElementMouseDown(e) { + // private 设置当前组件数据及状态 + this.$store.commit('setClickComponentStatus', true) + if (this.element.component !== 'user-view' && this.element.component !== 'de-frame' && this.element.component !== 'v-text' && this.element.component !== 'de-rich-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range' && this.element.component !== 'de-date') { + e.preventDefault() + } + // 阻止冒泡事件 + e.stopPropagation() + this.$nextTick(() => { + this.$store.commit('setCurComponent', { component: this.element, index: this.index }) + }) + }, elementMouseDown(e) { // private 设置当前组件数据及状态 this.$store.commit('setClickComponentStatus', true) @@ -2131,4 +2147,42 @@ export default { .drag-on-tab-collision { z-index: 1000 !important; } + +.de-drag-area { + position: absolute; + z-index: 10; +} + +.de-drag-area:hover { + cursor: move; +} + +.de-drag-top { + left: 0; + top: 0; + height: 12px; + width: 100%; +} + +.de-drag-right { + right: 0; + top: 0; + width: 16px; + height: 100%; +} + +.de-drag-bottom { + left: 0; + bottom: 0; + height: 12px; + width: 100%; +} + +.de-drag-left { + left: 0; + top: 0; + width: 16px; + height: 100%; +} + diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 9440cd6056..fa9c821dfc 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -79,7 +79,7 @@ :canvas-style-data="canvasStyleData" :canvas-id="element.id+'-'+item.name" :panel-info="panelInfo" - :in-screen="true" + :in-screen="inScreen" :show-position="showPosition" /> @@ -232,6 +232,11 @@ export default { name: 'DeTabs', components: { TextAttr, Preview, DeCanvasTab, TabUseList, ViewSelect, DataeaseTabs }, props: { + inScreen: { + type: Boolean, + required: false, + default: true + }, canvasId: { type: String, default: 'canvas-main' diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index d7f22e6962..53001b665e 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1932,6 +1932,7 @@ export default { back_parent: 'Back to previous' }, panel: { + unpublished_tips: 'After unpublishing, the panel cannot be viewed. Are you sure you want to cancel publishing? ', position_adjust_component: 'Position adjust', active_font_size: 'Selected font size', carousel: 'Carousel', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 1a173d03b4..df4a800dd1 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1926,6 +1926,7 @@ export default { back_parent: '返回上一級' }, panel: { + unpublished_tips: '取消發布後,該儀表板不能被查看。確定要取消發布?', position_adjust_component: '位置調整', active_font_size: '选中字體大小', carousel: '輪播', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 16a158bedd..ff4cf390f9 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1926,6 +1926,7 @@ export default { back_parent: '返回上一级' }, panel: { + unpublished_tips: '取消发布后,该仪表板不能被查看。确定要取消发布?', position_adjust_component: '位置调整', active_font_size: '选中字体大小', carousel: '轮播', diff --git a/frontend/src/utils/conditionUtil.js b/frontend/src/utils/conditionUtil.js index 5cbd3ecbea..3b3e0f1240 100644 --- a/frontend/src/utils/conditionUtil.js +++ b/frontend/src/utils/conditionUtil.js @@ -1,6 +1,6 @@ - import { Condition } from '@/components/widget/bean/Condition' import { ApplicationContext } from '@/utils/ApplicationContext' +import store from '@/store' /** * 判断两个conditions数组是否相同 @@ -70,7 +70,11 @@ export const buildViewKeyMap = panelItems => { } export const buildViewKeyFilters = (panelItems, result) => { - panelItems.forEach((element, index) => { + if (!(panelItems && panelItems.length > 0)) { + return result + } + const buildItems = panelItems[0].canvasId === 'canvas-main' ? panelItems : store.state.componentData + buildItems.forEach((element, index) => { if (element.type !== 'custom') { return true } diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 728f7469d4..98cf7ed868 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -449,7 +449,8 @@ export const DEFAULT_FUNCTION_CFG = { export const DEFAULT_THRESHOLD = { gaugeThreshold: '', labelThreshold: [], - tableThreshold: [] + tableThreshold: [], + textLabelThreshold: [] } export const DEFAULT_SCROLL = { open: false, diff --git a/frontend/src/views/chart/components/dragItem/utils.js b/frontend/src/views/chart/components/dragItem/utils.js index 2fb419f6f8..f7395b33fa 100644 --- a/frontend/src/views/chart/components/dragItem/utils.js +++ b/frontend/src/views/chart/components/dragItem/utils.js @@ -69,3 +69,15 @@ export function getOriginFieldName(dimensionList, quotaList, field) { } return originName } + +export function resetValueFormatter(item) { + if (item) { + item.formatterCfg = { + type: 'auto', // auto,value,percent + unit: 1, // 换算单位 + suffix: '', // 单位后缀 + decimalCount: 2, // 小数位数 + thousandSeparator: true// 千分符 + } + } +} diff --git a/frontend/src/views/chart/components/normal/LabelNormal.vue b/frontend/src/views/chart/components/normal/LabelNormal.vue index 6723b15d8f..52aab307f2 100644 --- a/frontend/src/views/chart/components/normal/LabelNormal.vue +++ b/frontend/src/views/chart/components/normal/LabelNormal.vue @@ -157,7 +157,7 @@ export default { this.$nextTick(function() { if (that.$refs.tableContainer) { const currentHeight = that.$refs.tableContainer.offsetHeight - const contentHeight = currentHeight - that.$refs.title.offsetHeight - 16 + const contentHeight = currentHeight - that.$refs.title.offsetHeight - 8 that.height = contentHeight + 'px' that.content_class.height = that.height } diff --git a/frontend/src/views/chart/components/normal/LabelNormalText.vue b/frontend/src/views/chart/components/normal/LabelNormalText.vue index 1e133d08d0..eb9a6967b4 100644 --- a/frontend/src/views/chart/components/normal/LabelNormalText.vue +++ b/frontend/src/views/chart/components/normal/LabelNormalText.vue @@ -184,7 +184,7 @@ export default { this.$nextTick(function() { if (that.$refs.tableContainer) { const currentHeight = that.$refs.tableContainer.offsetHeight - const contentHeight = currentHeight - that.$refs.title.offsetHeight - 16 + const contentHeight = currentHeight - that.$refs.title.offsetHeight - 8 that.height = contentHeight + 'px' that.content_class.height = that.height } @@ -195,7 +195,8 @@ export default { const customAttr = JSON.parse(this.chart.customAttr) if (customAttr.color) { this.label_class.color = customAttr.color.dimensionColor - this.label_content_class.color = customAttr.color.quotaColor + // color threshold + this.colorThreshold(customAttr.color.quotaColor) } if (customAttr.size) { this.dimensionShow = customAttr.size.dimensionShow @@ -303,6 +304,57 @@ export default { }, initRemark() { this.remarkCfg = getRemark(this.chart) + }, + colorThreshold(valueColor) { + if (this.chart.senior) { + const senior = JSON.parse(this.chart.senior) + if (senior.threshold && senior.threshold.textLabelThreshold && senior.threshold.textLabelThreshold.length > 0) { + const value = this.chart.data.series[0].data[0] + for (let i = 0; i < senior.threshold.textLabelThreshold.length; i++) { + let flag = false + const t = senior.threshold.textLabelThreshold[i] + const tv = t.value + if (t.term === 'eq') { + if (value === tv) { + this.label_content_class.color = t.color + flag = true + } + } else if (t.term === 'not_eq') { + if (value !== tv) { + this.label_content_class.color = t.color + flag = true + } + } else if (t.term === 'like') { + if (value.includes(tv)) { + this.label_content_class.color = t.color + flag = true + } + } else if (t.term === 'not like') { + if (!value.includes(tv)) { + this.label_content_class.color = t.color + flag = true + } + } else if (t.term === 'null') { + if (value === null || value === undefined || value === '') { + this.label_content_class.color = t.color + flag = true + } + } else if (t.term === 'not_null') { + if (value !== null && value !== undefined && value !== '') { + this.label_content_class.color = t.color + flag = true + } + } + if (flag) { + break + } else if (i === senior.threshold.textLabelThreshold.length - 1) { + this.label_content_class.color = valueColor + } + } + } else { + this.label_content_class.color = valueColor + } + } } } } diff --git a/frontend/src/views/chart/components/senior/Threshold.vue b/frontend/src/views/chart/components/senior/Threshold.vue index a9f7b7958b..3d7e0a5bf3 100644 --- a/frontend/src/views/chart/components/senior/Threshold.vue +++ b/frontend/src/views/chart/components/senior/Threshold.vue @@ -41,6 +41,64 @@ + + + + + + + + {{ $t('chart.filter_eq') }} + {{ $t('chart.filter_not_eq') }} + {{ $t('chart.filter_like') }} + {{ $t('chart.filter_not_like') }} + {{ $t('chart.filter_null') }} + {{ $t('chart.filter_not_null') }} + + + {{ item.value }} +   + + + + + + + + + @@ -236,6 +294,37 @@ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 46db1c4479..8e65f66030 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -998,7 +998,7 @@ >
@@ -1037,7 +1037,7 @@ {{ $t('chart.analyse_cfg') }} diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 27c14f0d62..bfb9fa9dcb 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -165,12 +165,12 @@ v-show=" show &&showIndex===1" :canvas-id="canvasId" /> - - + +
- + - + {{ panelInfo.name }} @@ -205,7 +205,7 @@ class="this_mobile_canvas_main" :style="mobileCanvasStyle" > - + - + - + @@ -268,7 +268,7 @@ />
- +
@@ -287,7 +287,7 @@ >{{ $t('panel.position_adjust') }} - +
{ - const userInfo = res.data - activeWatermark(this.panelInfo.watermarkInfo.settingContent, userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen) + this.$nextTick(() => { + if (this.userInfo) { + activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen) + } else { + userLoginInfo().then(res => { + this.userInfo = res.data + activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen) + }) + } }) } }, diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index 6c000cf16b..374822249f 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -328,10 +328,13 @@ export default { created() { this.attrs = this.controlAttrs - if (this.widget.isTimeWidget && this.widget.isTimeWidget()) { + if (this.widget.isTimeWidget) { this.showParams = true this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget() } + if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) { + this.showParams = true + } }, methods: { changeDynamicParams(val, name) { diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 5f4dcd59be..79345d2456 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;" >
- +
- + this.updatePublishStatus('unpublished') + } + this.handlerConfirm(options, this.$t('commons.confirm')) } else { - this.panelInfo.status = 'publish' + this.updatePublishStatus('publish') } + }, + updatePublishStatus(newStatus) { + this.panelInfo.status = newStatus updatePanelStatus(this.panelInfo.id, { 'status': this.panelInfo.status }) this.$emit('editPanelBashInfo', { 'operation': 'status', diff --git a/frontend/src/views/system/datasource/DsAppForm.vue b/frontend/src/views/system/datasource/DsAppForm.vue index 01a5af6a2c..accd44632f 100644 --- a/frontend/src/views/system/datasource/DsAppForm.vue +++ b/frontend/src/views/system/datasource/DsAppForm.vue @@ -216,6 +216,7 @@ import PluginCom from '@/views/system/plugin/PluginCom' import { groupTree, appApply } from '@/api/panel/panel' import { dsGroupTree } from '@/api/dataset/dataset' import { deepCopy } from '@/components/canvas/utils/utils' +import { Base64 } from 'js-base64' export default { name: 'DsForm', components: { @@ -707,9 +708,9 @@ export default { if (valid) { const data = JSON.parse(JSON.stringify(this.form)) if (data.type === 'api') { - data.configuration = JSON.stringify(data.apiConfiguration) + data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration)) } else { - data.configuration = JSON.stringify(data.configuration) + data.configuration = Base64.encode(JSON.stringify(data.configuration)) } if (data.showModel === 'show' && !this.canEdit) { validateDsById(data.id).then(res => { diff --git a/frontend/src/views/system/datasource/DsFormContent.vue b/frontend/src/views/system/datasource/DsFormContent.vue index cd3634b941..1c61d82349 100644 --- a/frontend/src/views/system/datasource/DsFormContent.vue +++ b/frontend/src/views/system/datasource/DsFormContent.vue @@ -226,10 +226,7 @@ >{{ $t('commons.cancel') }} {{ $t('commons.validate') }} @@ -307,6 +304,7 @@ import { dsGroupTree } from '@/api/dataset/dataset' import { appApply, appEdit, groupTree } from '@/api/panel/panel' import { deepCopy } from '@/components/canvas/utils/utils' import { hasDataPermission } from '@/utils/permission' +import { Base64 } from 'js-base64' export default { name: 'DsForm', @@ -710,6 +708,12 @@ export default { getDatasourceDetail(id, showModel) { this.$emit('update:formLoading', true) return getDatasourceDetail(id).then((res) => { + if(res.data.configuration){ + res.data.configuration = Base64.decode(res.data.configuration) + } + if(res.data.apiConfigurationStr){ + res.data.apiConfiguration = JSON.parse(Base64.decode(res.data.apiConfigurationStr)) + } this.params = { ...res.data, showModel } this.$emit('setParams', { ...this.params }) }).finally(() => { @@ -729,6 +733,12 @@ export default { const newArr = [] for (let index = 0; index < array.length; index++) { const element = array[index] + if(element.configuration){ + element.configuration = Base64.decode(element.configuration) + } + if(element.apiConfigurationStr){ + element.apiConfiguration = Base64.decode(element.apiConfigurationStr) + } if (this.msgNodeId) { if (element.id === this.msgNodeId) { element.msgNode = true @@ -967,9 +977,9 @@ export default { form.apiConfiguration.forEach((item) => { delete item.status }) - form.configuration = JSON.stringify(form.apiConfiguration) + form.configuration = Base64.encode(JSON.stringify(form.apiConfiguration)) } else { - form.configuration = JSON.stringify(form.configuration) + form.configuration = Base64.encode(JSON.stringify(form.configuration)) } const isAppMarket = this.positionCheck('appMarket') let appApplyForm @@ -1051,7 +1061,7 @@ export default { this.$refs.dsForm.validate((valid) => { if (valid) { const data = JSON.parse(JSON.stringify(this.form)) - data.configuration = JSON.stringify(data.configuration) + data.configuration = Base64.encode(JSON.stringify(data.configuration)) getSchema(data).then((res) => { this.schemas = res.data this.openMessageSuccess('commons.success') @@ -1102,9 +1112,9 @@ export default { if (valid) { const data = JSON.parse(JSON.stringify(this.form)) if (data.type === 'api') { - data.configuration = JSON.stringify(data.apiConfiguration) + data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration)) } else { - data.configuration = JSON.stringify(data.configuration) + data.configuration = Base64.encode(JSON.stringify(data.configuration)) } if (data.showModel === 'show' && !this.canEdit) { validateDsById(data.id).then((res) => { diff --git a/frontend/src/views/system/datasource/DsTree.vue b/frontend/src/views/system/datasource/DsTree.vue index 23c25f6675..de2a068049 100644 --- a/frontend/src/views/system/datasource/DsTree.vue +++ b/frontend/src/views/system/datasource/DsTree.vue @@ -316,6 +316,7 @@