From 31695268fe5caa9f9881ae3452f01047910d8d07 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 20 Jun 2024 13:27:05 +0800
Subject: [PATCH 01/26] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E5=AF=8C=E6=96=87?=
=?UTF-8?q?=E6=9C=AC=E6=94=AF=E6=8C=81=E9=98=88=E5=80=BC=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=20#9371=20#9627?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../rich-text/DeRichTextView.vue | 52 ++++++++++++++++---
.../js/panel/charts/others/rich-text.ts | 5 +-
.../js/panel/common/common_table.ts | 2 +-
3 files changed, 50 insertions(+), 9 deletions(-)
diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
index 6c418c4c40..daca1536e7 100644
--- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
+++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
@@ -59,6 +59,8 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import ChartError from '@/views/chart/components/views/components/ChartError.vue'
import { useEmitt } from '@/hooks/web/useEmitt'
import { valueFormatter } from '@/views/chart/components/js/formatter'
+import { parseJson } from '@/views/chart/components/js/util'
+import { mappingColor } from '@/views/chart/components/js/panel/common/common_table'
const snapshotStore = snapshotStoreWithOut()
const errMsg = ref('')
const dvMainStore = dvMainStoreWithOut()
@@ -103,6 +105,7 @@ const { element, editMode, active, disabled, showPosition } = toRefs(props)
const state = reactive({
data: null,
+ viewDataInfo: null,
totalItems: 0
})
const dataRowSelect = ref({})
@@ -216,16 +219,18 @@ const initCurFieldsChange = () => {
const assignment = content => {
const on = content.match(/\[(.+?)\]/g)
if (on) {
+ const thresholdStyleInfo = conditionAdaptor(state.viewDataInfo)
on.forEach(itm => {
if (dataRowFiledName.value.includes(itm)) {
const ele = itm.slice(1, -1)
if (initReady.value) {
- content = content.replace(
- itm,
- dataRowNameSelect.value[ele] !== undefined
- ? dataRowNameSelect.value[ele]
- : '[未获取字段值]'
- )
+ const thresholdStyle = thresholdStyleInfo[ele]
+ let value =
+ dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
+ if (value && thresholdStyle) {
+ value = `${value}`
+ }
+ content = content.replace(itm, !!value ? value : '[未获取字段值]')
} else {
content = content.replace(
itm,
@@ -359,6 +364,7 @@ const calcData = (view: Chart, callback) => {
errMsg.value = res.msg
} else {
state.data = res?.data
+ state.viewDataInfo = res
state.totalItems = res?.totalItems
const curViewInfo = canvasViewInfo.value[element.value.id]
curViewInfo['curFields'] = res.data.fields
@@ -449,6 +455,40 @@ const renderChart = () => {
initCurFieldsChange()
}
+const conditionAdaptor = (chart: Chart) => {
+ if (!chart) {
+ return
+ }
+ const { threshold } = parseJson(chart.senior)
+ if (!threshold.enable) {
+ return
+ }
+ const res = {}
+ const conditions = threshold.tableThreshold ?? []
+ if (conditions?.length > 0) {
+ for (let i = 0; i < conditions.length; i++) {
+ const field = conditions[i]
+ let defaultValueColor = 'none'
+ let defaultBgColor = 'none'
+ res[field.field.name] = {
+ color: mappingColor(
+ dataRowNameSelect.value[field.field.name],
+ defaultValueColor,
+ field,
+ 'color'
+ ),
+ backgroundColor: mappingColor(
+ dataRowNameSelect.value[field.field.name],
+ defaultBgColor,
+ field,
+ 'backgroundColor'
+ )
+ }
+ }
+ }
+ return res
+}
+
onMounted(() => {
viewInit()
})
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/rich-text.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/rich-text.ts
index 60bf5e236c..3b54e11a33 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/rich-text.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/rich-text.ts
@@ -6,9 +6,10 @@ const { t } = useI18n()
* 富文本图表
*/
export class RichTextChartView extends AbstractChartView {
- properties: EditorProperty[] = ['background-overall-component']
+ properties: EditorProperty[] = ['background-overall-component', 'threshold']
propertyInner: EditorPropertyInner = {
- 'background-overall-component': ['all']
+ 'background-overall-component': ['all'],
+ threshold: ['tableThreshold']
}
axis: AxisType[] = ['xAxis', 'yAxis', 'filter']
axisConfig: AxisConfig = {
diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts
index 205e7095a5..f2abee3199 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts
@@ -458,7 +458,7 @@ export function getConditions(chart: Chart) {
return res
}
-function mappingColor(value, defaultColor, field, type) {
+export function mappingColor(value, defaultColor, field, type) {
let color
for (let i = 0; i < field.conditions.length; i++) {
let flag = false
From fb4903e887cabe14dd4241ad17b20de26a35979b Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 20 Jun 2024 14:49:19 +0800
Subject: [PATCH 02/26] =?UTF-8?q?chore:=20sourcemap=E8=B0=83=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
core/core-frontend/config/base.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/core-frontend/config/base.ts b/core/core-frontend/config/base.ts
index 61513f83d1..ddb203e13c 100644
--- a/core/core-frontend/config/base.ts
+++ b/core/core-frontend/config/base.ts
@@ -26,6 +26,6 @@ export default {
}
}
},
- sourcemap: false
+ sourcemap: true
}
}
From 40ecd125b49388c95aa70629d26f984071340b5d Mon Sep 17 00:00:00 2001
From: junjun
Date: Thu, 20 Jun 2024 15:41:06 +0800
Subject: [PATCH 03/26] =?UTF-8?q?pref:=20=E6=95=B0=E6=8D=AE=E6=BA=90?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../datasource/provider/Provider.java | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/Provider.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/Provider.java
index e564f6c5d2..1617e237f6 100644
--- a/core/core-backend/src/main/java/io/dataease/datasource/provider/Provider.java
+++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/Provider.java
@@ -1,7 +1,28 @@
package io.dataease.datasource.provider;
+import io.dataease.api.dataset.dto.DatasetTableDTO;
+import io.dataease.api.ds.vo.TableField;
+import io.dataease.datasource.dao.auto.entity.CoreDatasource;
+import io.dataease.datasource.request.DatasourceRequest;
+import io.dataease.exception.DEException;
+
+import java.sql.Connection;
+import java.util.List;
+import java.util.Map;
+
/**
* @Author Junjun
*/
public abstract class Provider {
+ public abstract List getSchema(DatasourceRequest datasourceRequest);
+
+ public abstract List getTables(DatasourceRequest datasourceRequest);
+
+ public abstract Connection getConnection(CoreDatasource coreDatasource) throws DEException;
+
+ public abstract String checkStatus(DatasourceRequest datasourceRequest) throws Exception;
+
+ public abstract Map fetchResultField(DatasourceRequest datasourceRequest) throws DEException;
+
+ public abstract List fetchTableField(DatasourceRequest datasourceRequest) throws DEException;
}
From 106cdf920b1167889e6f2d758d603dc194c5e8e8 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 20 Jun 2024 16:16:36 +0800
Subject: [PATCH 04/26] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=AF=8C?=
=?UTF-8?q?=E6=96=87=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../rich-text/DeRichTextView.vue | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
index daca1536e7..fc0c37b228 100644
--- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
+++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
@@ -29,7 +29,7 @@
+
+
+
+
+
+
+ {{ tick.label }}
+
+
+
+
+
+
diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue
index 0a8b62b65c..a7cf5d8277 100644
--- a/core/core-frontend/src/views/data-visualization/index.vue
+++ b/core/core-frontend/src/views/data-visualization/index.vue
@@ -39,6 +39,7 @@ import { Base64 } from 'js-base64'
import CanvasCacheDialog from '@/components/visualization/CanvasCacheDialog.vue'
import { deepCopy } from '@/utils/utils'
import DvPreview from '@/views/data-visualization/DvPreview.vue'
+import DeRuler from '@/custom-component/common/DeRuler.vue'
const interactiveStore = interactiveStoreWithOut()
const embeddedStore = useEmbedded()
const { wsCache } = useCache()
@@ -100,9 +101,6 @@ const contentStyle = computed(() => {
}
} else {
return {
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
width: width * 1.5 + 'px',
height: height * 1.5 + 'px'
}
@@ -400,15 +398,17 @@ eventBus.on('handleNew', handleNew)
@mousedown="handleMouseDown"
@mouseup="deselectCurComponent"
>
-
+
+
+
@@ -535,4 +535,12 @@ eventBus.on('handleNew', handleNew)
height: 1px;
background: #000;
}
+
+.canvas-dv-inner {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
From 8dd8e2e3886fc69265f020795f6ec717841a8114 Mon Sep 17 00:00:00 2001
From: fit2cloud-chenyw
Date: Fri, 21 Jun 2024 15:51:01 +0800
Subject: [PATCH 19/26] =?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=BF=E5=88=86=E4=BA=AB=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0ticket=E8=AE=BE=E7=BD=AE=20#9835?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../io/dataease/MybatisPlusGenerator.java | 8 +-
.../share/dao/auto/entity/XpackShare.java | 16 +-
.../dao/auto/mapper/XpackShareMapper.java | 2 +-
.../dao/ext/mapper/XpackShareExtMapper.java | 4 +
.../share/manage/XpackShareManage.java | 12 +-
.../main/resources/db/migration/V2.8__ddl.sql | 5 +-
.../src/assets/svg/edit-done.svg | 3 +
.../src/views/share/share/ShareHandler.vue | 27 +-
.../src/views/share/share/ShareTicket.vue | 335 ++++++++++++++----
.../src/views/share/share/option.ts | 1 +
.../api/xpack/share/ShareTicketApi.java | 29 ++
.../xpack/share/request/TicketCreator.java | 22 ++
.../xpack/share/request/TicketDelRequest.java | 14 +
.../share/request/TicketSwitchRequest.java | 16 +
.../share/request/XpackShareProxyRequest.java | 2 +
.../dataease/api/xpack/share/vo/TicketVO.java | 27 ++
.../api/xpack/share/vo/TicketValidVO.java | 18 +
.../api/xpack/share/vo/XpackShareProxyVO.java | 2 +
.../api/xpack/share/vo/XpackShareVO.java | 2 +
19 files changed, 467 insertions(+), 78 deletions(-)
create mode 100644 core/core-frontend/src/assets/svg/edit-done.svg
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/ShareTicketApi.java
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/request/TicketCreator.java
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/request/TicketDelRequest.java
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/request/TicketSwitchRequest.java
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/TicketVO.java
create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/TicketValidVO.java
diff --git a/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java b/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java
index e648e87858..2c7d9c5aa8 100644
--- a/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java
+++ b/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java
@@ -14,18 +14,18 @@ public class MybatisPlusGenerator {
* 第一 我嫌麻烦
* 第二 后面配置会放到nacos读起来更麻烦了
*/
- private static final String url = "jdbc:mysql://localhost:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false";
+ private static final String url = "jdbc:mysql://localhost:3306/de_standalone?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false";
private static final String username = "root";
- private static final String password = "123456";
+ private static final String password = "Password123@mysql";
/**
* 业务模块例如datasource,dataset,panel等
*/
- private static final String busi = "visualization";
+ private static final String busi = "share";
/**
* 这是要生成代码的表名称
*/
- private static final String TABLE_NAME = "data_visualization_info";
+ private static final String TABLE_NAME = "xpack_share";
/**
* 下面两个配置基本上不用动
diff --git a/core/core-backend/src/main/java/io/dataease/share/dao/auto/entity/XpackShare.java b/core/core-backend/src/main/java/io/dataease/share/dao/auto/entity/XpackShare.java
index 22861cab29..d4fb7720b7 100644
--- a/core/core-backend/src/main/java/io/dataease/share/dao/auto/entity/XpackShare.java
+++ b/core/core-backend/src/main/java/io/dataease/share/dao/auto/entity/XpackShare.java
@@ -9,7 +9,7 @@ import java.io.Serializable;
*
*
* @author fit2cloud
- * @since 2024-04-07
+ * @since 2024-06-21
*/
@TableName("xpack_share")
public class XpackShare implements Serializable {
@@ -66,6 +66,11 @@ public class XpackShare implements Serializable {
*/
private Boolean autoPwd;
+ /**
+ * ticket必须
+ */
+ private Boolean ticketRequire;
+
public Long getId() {
return id;
}
@@ -146,6 +151,14 @@ public class XpackShare implements Serializable {
this.autoPwd = autoPwd;
}
+ public Boolean getTicketRequire() {
+ return ticketRequire;
+ }
+
+ public void setTicketRequire(Boolean ticketRequire) {
+ this.ticketRequire = ticketRequire;
+ }
+
@Override
public String toString() {
return "XpackShare{" +
@@ -159,6 +172,7 @@ public class XpackShare implements Serializable {
", oid = " + oid +
", type = " + type +
", autoPwd = " + autoPwd +
+ ", ticketRequire = " + ticketRequire +
"}";
}
}
diff --git a/core/core-backend/src/main/java/io/dataease/share/dao/auto/mapper/XpackShareMapper.java b/core/core-backend/src/main/java/io/dataease/share/dao/auto/mapper/XpackShareMapper.java
index b2ecd60bb4..ffea74deac 100644
--- a/core/core-backend/src/main/java/io/dataease/share/dao/auto/mapper/XpackShareMapper.java
+++ b/core/core-backend/src/main/java/io/dataease/share/dao/auto/mapper/XpackShareMapper.java
@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
*
*
* @author fit2cloud
- * @since 2024-04-07
+ * @since 2024-06-21
*/
@Mapper
public interface XpackShareMapper extends BaseMapper {
diff --git a/core/core-backend/src/main/java/io/dataease/share/dao/ext/mapper/XpackShareExtMapper.java b/core/core-backend/src/main/java/io/dataease/share/dao/ext/mapper/XpackShareExtMapper.java
index 140f0b0a1a..fa437945f4 100644
--- a/core/core-backend/src/main/java/io/dataease/share/dao/ext/mapper/XpackShareExtMapper.java
+++ b/core/core-backend/src/main/java/io/dataease/share/dao/ext/mapper/XpackShareExtMapper.java
@@ -6,6 +6,7 @@ import io.dataease.share.dao.ext.po.XpackSharePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
@Mapper
public interface XpackShareExtMapper {
@@ -28,4 +29,7 @@ public interface XpackShareExtMapper {
@Select("select type from data_visualization_info where id = #{id}")
String visualizationType(@Param("id") Long id);
+
+ @Update("update core_share_ticket set uuid = #{ticketUuid} where uuid = #{originUuid}")
+ void updateTicketUuid(@Param("originUuid") String originUuid, @Param("ticketUuid") String ticketUuid);
}
diff --git a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java
index 9df28b897a..9392461ac8 100644
--- a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java
+++ b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java
@@ -7,6 +7,7 @@ import io.dataease.api.visualization.request.VisualizationWorkbranchQueryRequest
import io.dataease.api.xpack.share.request.XpackShareProxyRequest;
import io.dataease.api.xpack.share.request.XpackSharePwdValidator;
import io.dataease.api.xpack.share.request.XpackShareUuidEditor;
+import io.dataease.api.xpack.share.vo.TicketValidVO;
import io.dataease.api.xpack.share.vo.XpackShareGridVO;
import io.dataease.api.xpack.share.vo.XpackShareProxyVO;
import io.dataease.auth.bo.TokenUserBO;
@@ -28,6 +29,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
@@ -46,6 +48,9 @@ public class XpackShareManage {
@Resource(name = "xpackShareExtMapper")
private XpackShareExtMapper xpackShareExtMapper;
+ @Resource
+ private ShareTicketManage shareTicketManage;
+
public XpackShare queryByResource(Long resourceId) {
Long userId = AuthUtils.getUser().getUserId();
QueryWrapper queryWrapper = new QueryWrapper<>();
@@ -54,10 +59,12 @@ public class XpackShareManage {
return xpackShareMapper.selectOne(queryWrapper);
}
+ @Transactional
public void switcher(Long resourceId) {
XpackShare originData = queryByResource(resourceId);
if (ObjectUtils.isNotEmpty(originData)) {
xpackShareMapper.deleteById(originData.getId());
+ shareTicketManage.deleteByShare(originData.getUuid());
return;
}
TokenUserBO user = AuthUtils.getUser();
@@ -74,6 +81,7 @@ public class XpackShareManage {
xpackShareMapper.insert(xpackShare);
}
+ @Transactional
public String editUuid(XpackShareUuidEditor editor) {
Long resourceId = editor.getResourceId();
String uuid = editor.getUuid();
@@ -98,6 +106,7 @@ public class XpackShareManage {
if (!matcher.matches()) {
return "仅支持8-16位(字母数字),请重新输入!";
}
+ shareTicketManage.updateByUuidChange(originData.getUuid(), uuid);
originData.setUuid(uuid);
xpackShareMapper.updateById(originData);
return "";
@@ -196,7 +205,8 @@ public class XpackShareManage {
response.addHeader(AuthConstant.LINK_TOKEN_KEY, linkToken);
Integer type = xpackShare.getType();
String typeText = (ObjectUtils.isNotEmpty(type) && type == 1) ? "dashboard" : "dataV";
- return new XpackShareProxyVO(xpackShare.getResourceId(), xpackShare.getCreator(), linkExp(xpackShare), pwdValid(xpackShare, request.getCiphertext()), typeText, inIframeError);
+ TicketValidVO validVO = shareTicketManage.validateTicket(request.getTicket(), xpackShare);
+ return new XpackShareProxyVO(xpackShare.getResourceId(), xpackShare.getCreator(), linkExp(xpackShare), pwdValid(xpackShare, request.getCiphertext()), typeText, inIframeError, validVO);
}
private boolean linkExp(XpackShare xpackShare) {
diff --git a/core/core-backend/src/main/resources/db/migration/V2.8__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.8__ddl.sql
index 369bac5301..dc361259ef 100644
--- a/core/core-backend/src/main/resources/db/migration/V2.8__ddl.sql
+++ b/core/core-backend/src/main/resources/db/migration/V2.8__ddl.sql
@@ -17,4 +17,7 @@ CREATE TABLE `xpack_plugin`
`module_name` varchar(255) NOT NULL COMMENT '模块名称',
`jar_name` varchar(255) NOT NULL COMMENT 'Jar包名称',
PRIMARY KEY (`id`)
-) COMMENT ='插件表';
\ No newline at end of file
+) COMMENT ='插件表';
+
+ALTER TABLE `xpack_share`
+ ADD COLUMN `ticket_require` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'ticket必须' AFTER `auto_pwd`;
\ No newline at end of file
diff --git a/core/core-frontend/src/assets/svg/edit-done.svg b/core/core-frontend/src/assets/svg/edit-done.svg
new file mode 100644
index 0000000000..e2049b6b67
--- /dev/null
+++ b/core/core-frontend/src/assets/svg/edit-done.svg
@@ -0,0 +1,3 @@
+
diff --git a/core/core-frontend/src/views/share/share/ShareHandler.vue b/core/core-frontend/src/views/share/share/ShareHandler.vue
index 043501118c..c68c07d22f 100644
--- a/core/core-frontend/src/views/share/share/ShareHandler.vue
+++ b/core/core-frontend/src/views/share/share/ShareHandler.vue
@@ -16,7 +16,10 @@
-
+
{{ item.name }}{{ item.desensitized && '(已脱敏)' }}{{ item.name }}{{ item.desensitized ? '(已脱敏)' : '' }}
diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue
index 5bca98c389..5256db3634 100644
--- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue
+++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue
@@ -68,7 +68,7 @@ const toolTip = computed(() => {
return props.themes === 'dark' ? 'ndark' : 'dark'
})
watch(
- [() => props.quotaData, () => props.item],
+ [() => props.quotaData, () => props.item, () => props.chart.type],
() => {
getItemTagType()
},
@@ -310,7 +310,7 @@ onMounted(() => {
{{ item.chartShowName ? item.chartShowName : item.name
- }}{{ item.desensitized && '(已脱敏)' }}
({{ t('chart.' + item.summary) }})
diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue b/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue
index b4af5ee9bc..80c1bfec5a 100644
--- a/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue
+++ b/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue
@@ -1,5 +1,5 @@
@@ -77,7 +91,7 @@ const createFilter = (queryString: string) => {
-
+
{
show-word-limit
/>
-
+
+
+
+
+
{
/>
-
+
+
diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
index 9566f685aa..fa007b0c6a 100644
--- a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
+++ b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue
@@ -6,11 +6,12 @@ import EmptyBackground from '@/components/empty-background/src/EmptyBackground.v
import { cloneDeep } from 'lodash-es'
import ApiHttpRequestDraw from './ApiHttpRequestDraw.vue'
import type { Configuration, ApiConfiguration, SyncSetting } from './option'
+import { fieldType, fieldTypeText } from '@/utils/attr'
import { Icon } from '@/components/icon-custom'
import { getSchema } from '@/api/datasource'
import { Base64 } from 'js-base64'
import { CustomPassword } from '@/components/custom-password'
-import { ElForm, ElMessage } from 'element-plus-secondary'
+import { ElForm, ElMessage, ElMessageBox } from 'element-plus-secondary'
import Cron from '@/components/cron/src/Cron.vue'
import { ComponentPublicInstance } from 'vue'
const { t } = useI18n()
@@ -324,9 +325,11 @@ const addApiItem = item => {
: 0
}
nextTick(() => {
- editApiItem.value.initApiItem(apiItem, form.value.apiConfiguration)
+ editApiItem.value.initApiItem(apiItem, form.value.apiConfiguration, activeName.value)
})
}
+
+const activeName = ref('third')
const showPriority = ref(false)
const deleteItem = (item, idx) => {
@@ -470,7 +473,149 @@ const apiRule = {
}
]
}
+const dialogEditParams = ref(false)
+const dialogRenameApi = ref(false)
+const activeParamsName = ref('')
+const apiParams = ref([
+ {
+ id: 1,
+ name: '接口1'
+ }
+])
+const paramsObj = ref({
+ name: '',
+ id: 1,
+ deType: 0
+})
+const apiObj = ref({
+ name: '',
+ id: 1
+})
+const paramsObjRules = {
+ name: [
+ {
+ required: true,
+ message: '请输入参数名称',
+ trigger: 'change'
+ },
+ {
+ min: 2,
+ max: 64,
+ message: '参数名称限制2~64字符',
+ trigger: 'blur'
+ }
+ ]
+}
+
+const apiObjRules = {
+ name: [
+ {
+ required: true,
+ message: '请输入接口名称',
+ trigger: 'change'
+ },
+ {
+ min: 2,
+ max: 64,
+ message: '接口名称限制2~64字符',
+ trigger: 'blur'
+ }
+ ]
+}
+const setActiveName = val => {
+ activeParamsName.value = val.name
+}
+
+const paramsObjRef = ref()
+const apiObjRef = ref()
+
+const saveParamsObj = () => {
+ paramsObjRef.value.validate(result => {
+ if (result) {
+ gridData.value.forEach(ele => {
+ if (ele.id === paramsObj.value.id) {
+ ele.name = paramsObj.value.name
+ }
+ })
+ }
+ })
+}
+
+const saveApiObj = () => {
+ apiObjRef.value.validate(result => {
+ if (result) {
+ apiParams.value.forEach(ele => {
+ if (ele.id === apiObj.value.id) {
+ ele.name = apiObj.value.name
+ }
+ })
+ }
+ })
+}
+
+const paramsResetForm = () => {
+ dialogEditParams.value = false
+}
+
+const apiResetForm = () => {
+ dialogRenameApi.value = false
+}
+
+const gridData = ref([
+ {
+ name: 'name',
+ deType: 0,
+ id: 0
+ }
+])
+const handleApiParams = (cmd: string, data) => {
+ if (cmd === 'rename') {
+ dialogRenameApi.value = true
+ paramsObj.value.name = data.name
+ }
+ if (cmd === 'delete') {
+ ElMessageBox.confirm('确定删除吗?', {
+ confirmButtonType: 'danger',
+ type: 'warning',
+ autofocus: false,
+ showClose: false
+ }).then(() => {
+ apiParams.value.splice(0, 1)
+ })
+ }
+
+ if (cmd === 'edit') {
+ addApiItem(data)
+ }
+}
+
+const editParams = data => {
+ dialogEditParams.value = true
+}
+
+const delParams = data => {
+ ElMessageBox.confirm('确定删除吗?', {
+ confirmButtonType: 'danger',
+ type: 'warning',
+ autofocus: false,
+ showClose: false
+ }).then(() => {
+ apiParams.value.splice(0, 1)
+ })
+}
+const datasetTypeList = [
+ {
+ label: '重命名',
+ svgName: 'icon_rename_outlined',
+ command: 'rename'
+ },
+ {
+ label: '删除',
+ svgName: 'icon_delete-trash_outlined',
+ command: 'delete'
+ }
+]
defineExpose({
submitForm,
resetForm,
@@ -522,7 +667,10 @@ defineExpose({
@@ -1037,8 +1311,44 @@ defineExpose({
margin: 24px 0 16px 0;
}
+ .left-api_params {
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+ border: 1px solid #bbbfc4;
+ width: 300px;
+ padding: 16px;
+ .name-copy {
+ display: none;
+ line-height: 24px;
+ margin-left: 4px;
+ }
+
+ .list-item_primary:hover {
+ .name-copy {
+ display: inline;
+ }
+
+ .label {
+ width: 74% !important;
+ }
+ }
+ }
+
+ .right-api_params {
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border: 1px solid #bbbfc4;
+ border-left: none;
+ width: calc(100% - 200px);
+ }
+
.table-info-mr {
margin: 28px 0 12px 0;
+ .api-tabs {
+ :deep(.ed-tabs__nav-wrap::after) {
+ display: none;
+ }
+ }
}
.info-update {
From d1466f511cdee980a847cb5d52ec59699bf490fc Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Fri, 21 Jun 2024 18:47:45 +0800
Subject: [PATCH 22/26] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?=
=?UTF-8?q?):=20=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E5=88=BB=E5=BA=A6=E5=B0=BA=E6=8C=87=E7=A4=BA=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?,=E4=BC=98=E5=8C=96=E6=A8=AA=E5=90=91=E6=A0=87=E5=B0=BA?=
=?UTF-8?q?=E5=AE=9A=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/custom-component/common/DeRuler.vue | 86 ++++++++++++-------
.../src/views/data-visualization/index.vue | 13 ++-
2 files changed, 69 insertions(+), 30 deletions(-)
diff --git a/core/core-frontend/src/custom-component/common/DeRuler.vue b/core/core-frontend/src/custom-component/common/DeRuler.vue
index cd2a1fdb2b..e0a4116c4f 100644
--- a/core/core-frontend/src/custom-component/common/DeRuler.vue
+++ b/core/core-frontend/src/custom-component/common/DeRuler.vue
@@ -1,59 +1,87 @@
-
-
-
-
-
{{ tick.label }}
+
diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue
index 8bd5e7314a..b184c4ca81 100644
--- a/core/core-frontend/src/views/data-visualization/index.vue
+++ b/core/core-frontend/src/views/data-visualization/index.vue
@@ -65,6 +65,7 @@ const contextmenuStore = contextmenuStoreWithOut()
const composeStore = composeStoreWithOut()
const canvasCacheOutRef = ref(null)
const deWRulerRef = ref(null)
+const deHRulerRef = ref(null)
const {
fullscreenFlag,
@@ -82,6 +83,7 @@ const canvasInner = ref(null)
const leftSidebarRef = ref(null)
const dvLayout = ref(null)
const canvasCenterRef = ref(null)
+const mainHeight = ref(300)
const state = reactive({
datasetTree: [],
scaleHistory: null,
@@ -179,9 +181,9 @@ const initScroll = () => {
nextTick(() => {
const { width, height } = canvasStyleData.value
const mainWidth = canvasCenterRef.value.clientWidth
- const mainHeight = canvasCenterRef.value.clientHeight
+ mainHeight.value = canvasCenterRef.value.clientHeight
const scrollX = (1.5 * width - mainWidth) / 2
- const scrollY = (1.5 * height - mainHeight) / 2 + 20
+ const scrollY = (1.5 * height - mainHeight.value) / 2 + 20
// 设置画布初始滚动条位置
canvasOut.value.scrollTo(scrollX, scrollY)
})
@@ -361,7 +363,9 @@ const viewsPropertiesShow = computed(
const scrollCanvas = e => {
deWRulerRef.value.rulerScroll(e)
+ deHRulerRef.value.rulerScroll(e)
}
+
eventBus.on('handleNew', handleNew)
@@ -393,7 +397,13 @@ eventBus.on('handleNew', handleNew)
+
+
+
+
+
+
From 7058c97b9814ebbb0076259cfd51619fb1b10b93 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Sun, 23 Jun 2024 23:41:27 +0800
Subject: [PATCH 26/26] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?=
=?UTF-8?q?):=20=E5=A2=9E=E5=8A=A0=E5=BD=93=E5=89=8D=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=88=BB=E5=BA=A6=E5=B0=BA=E5=AE=9A=E4=BD=8D?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/custom-component/common/DeRuler.vue | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/core/core-frontend/src/custom-component/common/DeRuler.vue b/core/core-frontend/src/custom-component/common/DeRuler.vue
index 0624526f2f..a12441b9ae 100644
--- a/core/core-frontend/src/custom-component/common/DeRuler.vue
+++ b/core/core-frontend/src/custom-component/common/DeRuler.vue
@@ -21,12 +21,43 @@ const props = defineProps({
const labelInterval = 5
-const { canvasStyleData } = storeToRefs(dvMainStore)
+const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
const rulerSize = computed(() =>
props.direction === 'horizontal' ? canvasStyleData.value.width : canvasStyleData.value.height
)
+const curComponentSize = computed(() => {
+ if (curComponent.value) {
+ return (
+ ((props.direction === 'horizontal'
+ ? curComponent.value.style.width
+ : curComponent.value.style.height) *
+ canvasStyleData.value.scale) /
+ 100
+ )
+ } else {
+ return 0
+ }
+})
+
+const curComponentShadow = computed(() => {
+ if (curComponent.value) {
+ return {
+ left:
+ (props.direction === 'horizontal'
+ ? curComponent.value.style.left
+ : curComponent.value.style.top) + 'px',
+ width:
+ (props.direction === 'horizontal'
+ ? curComponent.value.style.width
+ : curComponent.value.style.height) + 'px'
+ }
+ } else {
+ return {}
+ }
+})
+
const ticks = computed(() => {
const result = []
let currentValue = 0
@@ -84,6 +115,7 @@ defineExpose({