From 587acdce2e2581b361b54c72cd572b9f0c9dc2cb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 30 Jan 2024 14:43:05 +0800 Subject: [PATCH 01/28] =?UTF-8?q?fix(X-Pack):=20=E6=97=A5=E5=BF=97aop?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=96=B0=E5=A2=9E=E7=BB=84=E7=BB=87=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/layout/components/ToolboxCfg.vue | 2 +- de-xpack | 2 +- .../java/io/dataease/api/permissions/org/dto/OrgCreator.java | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/layout/components/ToolboxCfg.vue b/core/core-frontend/src/layout/components/ToolboxCfg.vue index 28fadec780..3ed1672fa4 100644 --- a/core/core-frontend/src/layout/components/ToolboxCfg.vue +++ b/core/core-frontend/src/layout/components/ToolboxCfg.vue @@ -44,7 +44,7 @@ onMounted(() => { popper-class="toolbox-top-popover" placement="bottom-end" width="208" - trigger="click" + trigger="hover" > Date: Tue, 30 Jan 2024 15:41:00 +0800 Subject: [PATCH 02/28] =?UTF-8?q?feat(*):=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=9F=A5=E7=9C=8B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/visualization/server/DataVisualizationServer.java | 1 + de-xpack | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java b/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java index 539c3cda64..7397c82bea 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java @@ -101,6 +101,7 @@ public class DataVisualizationServer implements DataVisualizationApi { } } + @DeLog(id = "#p0", ot = LogOT.READ, stExp = "#p1") @Override @XpackInteract(value = "dataVisualizationServer", original = true) public DataVisualizationVO findById(Long dvId, String busiFlag) { diff --git a/de-xpack b/de-xpack index cf7956cd83..2fb8964e44 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit cf7956cd832cddfe23e7888b34075be3ffcb99da +Subproject commit 2fb8964e44718005146bd9af3855eaf39e2e9332 From 72866386b82c06712fbee89686e4d7b57abb474c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 30 Jan 2024 16:14:36 +0800 Subject: [PATCH 03/28] =?UTF-8?q?fix:=20=E5=B5=8C=E5=85=A5=E5=BC=8F?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core-frontend/src/views/share/share/ShareHandler.vue | 9 +++++++-- .../src/views/share/share/ShareVisualHead.vue | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/share/share/ShareHandler.vue b/core/core-frontend/src/views/share/share/ShareHandler.vue index 0d2892c9dd..eefb40c500 100644 --- a/core/core-frontend/src/views/share/share/ShareHandler.vue +++ b/core/core-frontend/src/views/share/share/ShareHandler.vue @@ -186,8 +186,13 @@ const enableSwitcher = () => { } const formatLinkAddr = () => { - const href = window.location.href - const prefix = href.substring(0, href.indexOf('#') + 1) + let prefix = '/' + if (window.DataEaseBi?.baseUrl) { + prefix = window.DataEaseBi.baseUrl + '#' + } else { + const href = window.location.href + prefix = href.substring(0, href.indexOf('#') + 1) + } linkAddr.value = prefix + SHARE_BASE + state.detailInfo.uuid } diff --git a/core/core-frontend/src/views/share/share/ShareVisualHead.vue b/core/core-frontend/src/views/share/share/ShareVisualHead.vue index 5de4706a9c..95c47cff67 100644 --- a/core/core-frontend/src/views/share/share/ShareVisualHead.vue +++ b/core/core-frontend/src/views/share/share/ShareVisualHead.vue @@ -190,8 +190,13 @@ const enableSwitcher = () => { } const formatLinkAddr = () => { - const href = window.location.href - const prefix = href.substring(0, href.indexOf('#') + 1) + let prefix = '/' + if (window.DataEaseBi?.baseUrl) { + prefix = window.DataEaseBi.baseUrl + '#' + } else { + const href = window.location.href + prefix = href.substring(0, href.indexOf('#') + 1) + } linkAddr.value = prefix + SHARE_BASE + state.detailInfo.uuid } From c3737f47511e82dcae665b070ac2b0b7409e36dd Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 30 Jan 2024 16:29:18 +0800 Subject: [PATCH 04/28] =?UTF-8?q?fix:=20=E5=88=86=E4=BA=AB=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=A1=AB=E5=86=99=E5=AF=86=E7=A0=81=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=89=8D=E7=AB=AF=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/share/link/pwd.vue | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/core/core-frontend/src/views/share/link/pwd.vue b/core/core-frontend/src/views/share/link/pwd.vue index 327c71d8a1..a9ad6eb164 100644 --- a/core/core-frontend/src/views/share/link/pwd.vue +++ b/core/core-frontend/src/views/share/link/pwd.vue @@ -30,7 +30,7 @@
- {{ + {{ t('pblink.sure_bt') }}
@@ -71,20 +71,30 @@ const rule = reactive({ ] }) -const refresh = () => { - const curLocation = window.location.href - const paramIndex = curLocation.indexOf('?') - const uuidIndex = curLocation.indexOf('de-link/') + 8 - const uuid = curLocation.substring(uuidIndex, paramIndex !== -1 ? paramIndex : curLocation.length) - const pwd = form.value.password - const text = uuid + pwd - const ciphertext = rsaEncryp(text) - request.post({ url: '/share/validate', data: { ciphertext } }).then(res => { - if (res.data) { - wsCache.set(`link-${uuid}`, ciphertext) - window.location.reload() +const refresh = async (formEl: FormInstance | undefined) => { + if (!formEl) return + await formEl.validate((valid, fields) => { + if (valid) { + const curLocation = window.location.href + const paramIndex = curLocation.indexOf('?') + const uuidIndex = curLocation.indexOf('de-link/') + 8 + const uuid = curLocation.substring( + uuidIndex, + paramIndex !== -1 ? paramIndex : curLocation.length + ) + const pwd = form.value.password + const text = uuid + pwd + const ciphertext = rsaEncryp(text) + request.post({ url: '/share/validate', data: { ciphertext } }).then(res => { + if (res.data) { + wsCache.set(`link-${uuid}`, ciphertext) + window.location.reload() + } else { + msg.value = '密码错误' + } + }) } else { - msg.value = '密码错误' + console.error('error submit!', fields) } }) } From 4ffbfde76b571f3c4e13a7974e6c8d698e5c8025 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 30 Jan 2024 16:39:53 +0800 Subject: [PATCH 05/28] =?UTF-8?q?fix(X-Pack):=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2=E6=A1=86=E6=96=87=E6=A1=88?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 2fb8964e44..a177d2aafe 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 2fb8964e44718005146bd9af3855eaf39e2e9332 +Subproject commit a177d2aafe0a2dc871fc4b8d202ebc4edbb75f6a From cb237f246e9340044661dea2e5dc55b19571ef34 Mon Sep 17 00:00:00 2001 From: wisonic Date: Tue, 30 Jan 2024 17:40:25 +0800 Subject: [PATCH 06/28] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E9=80=8F=E8=A7=86?= =?UTF-8?q?=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D=E4=B8=BB=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=BD=BF=E7=94=A8=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=A7=86=E5=9B=BE=E6=B8=B2=E6=9F=93=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/table/table-pivot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index 06664323b7..69bd521738 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -319,13 +319,13 @@ function customCalcFunc(query, data, totalCfgMap) { const result = minBy(data, n => { return n[query[EXTRA_FIELD]] }) - return result[query[EXTRA_FIELD]] + return result?.[query[EXTRA_FIELD]] } case 'MAX': { const result = maxBy(data, n => { return n[query[EXTRA_FIELD]] }) - return result[query[EXTRA_FIELD]] + return result?.[query[EXTRA_FIELD]] } default: { return data.reduce((p, n) => { From 546d44bcc188fa5bf086d3ff21ede0f86feaf684 Mon Sep 17 00:00:00 2001 From: xuwei-fit2cloud Date: Tue, 30 Jan 2024 18:30:17 +0800 Subject: [PATCH 07/28] =?UTF-8?q?refactor:=20installer=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=80=82=E9=85=8DUbuntu=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/bin/dataease/dataease.service | 54 +++++-------------- installer/install.sh | 29 +++++----- installer/uninstall.sh | 19 +++++-- 3 files changed, 42 insertions(+), 60 deletions(-) diff --git a/installer/dataease/bin/dataease/dataease.service b/installer/dataease/bin/dataease/dataease.service index 6364c0a46c..2752d16200 100644 --- a/installer/dataease/bin/dataease/dataease.service +++ b/installer/dataease/bin/dataease/dataease.service @@ -1,43 +1,17 @@ -#!/bin/bash -# chkconfig: 2345 10 90 -# description: DATAEASE service +[Unit] +Description=DataEase Service +After=docker.service +Requires=docker.service -function startDATAEASE -{ - dectl start -} +[Service] +User=root +Group=root -function stopDATAEASE -{ - dectl stop -} +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/dectl start +ExecStop=/usr/bin/dectl stop +ExecReload=/usr/bin/dectl reload -function restartDATAEASE -{ - stopDATAEASE - startDATAEASE -} - -function statusDATAEASE -{ - dectl status -} - -export HOSTNAME=$HOSTNAME -case "$1" in - start) - startDATAEASE - ;; - stop) - stopDATAEASE - ;; - restart) - restartDATAEASE - ;; - status) - statusDATAEASE - ;; - *) - echo "Usage: $0 {start|stop|restart|status}" - ;; -esac +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/installer/install.sh b/installer/install.sh index 7111eff777..f49a596679 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -28,7 +28,7 @@ if [ -f /usr/bin/dectl ]; then fi set -a -if [[ $DE_BASE ]] && [[ -f $DE_BASE/dataease2.0/.env ]]; then +if [[ -d $DE_BASE ]] && [[ -f $DE_BASE/dataease2.0/.env ]]; then source $DE_BASE/dataease2.0/.env INSTALL_TYPE='upgrade' else @@ -48,7 +48,7 @@ DE_RUN_BASE=$DE_BASE/dataease2.0 conf_folder=${DE_RUN_BASE}/conf templates_folder=${DE_RUN_BASE}/templates -if [[ $DE_RUN_BASE ]];then +if [[ -d $DE_RUN_BASE ]];then for image in $(grep "image: " $DE_RUN_BASE/docker*.yml | awk -F 'image:' '{print $2}'); do image_path=$(eval echo $image) image_name=$(echo $image_path | awk -F "[/]" '{print $3}') @@ -122,7 +122,7 @@ else cp docker/bin/* /usr/bin/ cp docker/service/docker.service /etc/systemd/system/ chmod +x /usr/bin/docker* - chmod 754 /etc/systemd/system/docker.service + chmod 644 /etc/systemd/system/docker.service log "... 启动 docker" systemctl enable docker; systemctl daemon-reload; service docker start 2>&1 | tee -a ${CURRENT_DIR}/install.log else @@ -203,21 +203,17 @@ else cd - fi -log "配置 dataease Service" -cp ${DE_RUN_BASE}/bin/dataease/dataease.service /etc/init.d/dataease -chmod a+x /etc/init.d/dataease if which chkconfig;then - chkconfig --add dataease + chkconfig --del dataease fi - -if [ -f /etc/rc.d/rc.local ];then - dataeaseService=$(grep "service dataease start" /etc/rc.d/rc.local | wc -l) - if [ "$dataeaseService" -eq 0 ]; then - echo "sleep 10" >> /etc/rc.d/rc.local - echo "service dataease start" >> /etc/rc.d/rc.local - fi - chmod +x /etc/rc.d/rc.local +if [[ -f /etc/init.d/dataease ]];then + rm -f /etc/init.d/dataease fi +log "配置 dataease Service" +cp ${DE_RUN_BASE}/bin/dataease/dataease.service /etc/systemd/system/ +chmod 644 /etc/systemd/system/dataease.service +log "配置开机自启动" +systemctl enable dataease; systemctl daemon-reload 2>&1 | tee -a ${CURRENT_DIR}/install.log if [[ $(grep "vm.max_map_count" /etc/sysctl.conf | wc -l) -eq 0 ]];then sysctl -w vm.max_map_count=2000000 @@ -251,8 +247,7 @@ if [[ $http_code == 200 ]];then fi log "启动服务" -dectl start | tee -a ${CURRENT_DIR}/install.log -dectl status 2>&1 | tee -a ${CURRENT_DIR}/install.log +systemctl start dataease 2>&1 | tee -a ${CURRENT_DIR}/install.log access_port=$DE_PORT if [[ $DE_INSTALL_MODE != "community" ]];then diff --git a/installer/uninstall.sh b/installer/uninstall.sh index 433f478122..f28e1cbf0a 100644 --- a/installer/uninstall.sh +++ b/installer/uninstall.sh @@ -18,14 +18,27 @@ case $input in ;; esac +echo "停止 DataEase 服务" +service dataease stop + +echo "移除 DataEase 服务" +if which chkconfig;then + chkconfig --del dataease +fi + +if [ -f /etc/systemd/system/dataease.service ];then + systemctl disable dataease + rm -f /etc/systemd/system/dataease.service + systemctl daemon-reload +elif [[ -f /etc/init.d/dataease ]];then + rm -f /etc/init.d/dataease +fi + if [ -f /usr/bin/dectl ]; then # 获取已安装的 DataEase 的运行目录 DE_BASE=$(grep "^DE_BASE=" /usr/bin/dectl | cut -d'=' -f2) fi -echo "停止 DataEase 服务" -dectl stop - # 清理 DataEase 相关镜像 if test ! -z "$(docker images -f dangling=true -q)"; then echo "清理虚悬镜像" From 5eefb53ef6105615339e115f818787045f8ba922 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 30 Jan 2024 18:46:06 +0800 Subject: [PATCH 08/28] =?UTF-8?q?feat(X-Pack):=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/locales/zh-CN.ts | 3 ++- .../system/parameter/basic/BasicEdit.vue | 27 ++++++++++++++++++- .../system/parameter/basic/BasicInfo.vue | 1 - de-xpack | 2 +- .../setting/api/PerSettingApi.java | 5 ++++ .../constant/XpackSettingConstants.java | 1 + .../io/dataease/utils/SystemSettingUtils.java | 2 +- 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index c05b5b2057..fbb30aba60 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2133,7 +2133,8 @@ export default { autoCreateUser: '第三方自动创建用户', dsIntervalTime: '数据源检测时间间隔', dsExecuteTime: '数据源检测频率', - frontTimeOut: '请求超时时间(秒)' + frontTimeOut: '请求超时时间(秒)', + logLiveTime: '日志保留时间(天)' }, template_manage: { name_already_exists_type: '分类名称已存在', diff --git a/core/core-frontend/src/views/system/parameter/basic/BasicEdit.vue b/core/core-frontend/src/views/system/parameter/basic/BasicEdit.vue index be9875c849..f992312be3 100644 --- a/core/core-frontend/src/views/system/parameter/basic/BasicEdit.vue +++ b/core/core-frontend/src/views/system/parameter/basic/BasicEdit.vue @@ -102,6 +102,15 @@ const closeLoading = () => { const edit = list => { state.settingList = list.map(item => { const pkey = item.pkey + if (pkey === 'basic.logLiveTime') { + rule[pkey.split('.')[1]] = [ + { + required: true, + message: t('common.require'), + trigger: ['blur', 'change'] + } + ] + } item['label'] = `setting_${pkey}` item['pkey'] = pkey.split('.')[1] let pval = item.pval @@ -171,13 +180,26 @@ defineExpose({ v-model="state.form.frontTimeOut" autocomplete="off" step-strictly - class="text-left" + class="text-left edit-all-line" :min="1" :placeholder="t('common.inputText')" controls-position="right" type="number" /> +
+ +
@@ -215,6 +237,9 @@ defineExpose({ .is-error { margin-bottom: 40px !important; } + .edit-all-line { + width: 552px !important; + } } .setting-hidden-item { display: none !important; diff --git a/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue b/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue index 91c30d073d..4c89aee153 100644 --- a/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue +++ b/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue @@ -45,7 +45,6 @@ const search = cb => { item.pval = item.pval } item.pkey = 'setting_' + item.pkey - console.log(item.pkey) state.templateList.push(item) } cb && cb() diff --git a/de-xpack b/de-xpack index a177d2aafe..f57ed3cd02 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit a177d2aafe0a2dc871fc4b8d202ebc4edbb75f6a +Subproject commit f57ed3cd02aee601d47a755a44358ced6c504b5e diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/setting/api/PerSettingApi.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/setting/api/PerSettingApi.java index 6244cae083..c90ab08465 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/setting/api/PerSettingApi.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/setting/api/PerSettingApi.java @@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -22,4 +23,8 @@ public interface PerSettingApi { @Operation(summary = "保存设置") @PostMapping("/baisc/save") void saveBasic(@RequestBody List settings); + + @Hidden + @GetMapping("/baisc/single/{key}") + String singleValue(@PathVariable("key") String key); } diff --git a/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java b/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java index 6b8b760a6d..dc99d7a94a 100644 --- a/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java +++ b/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java @@ -3,5 +3,6 @@ package io.dataease.constant; public class XpackSettingConstants { public static final String AUTO_CREATE_USER = "basic.autoCreateUser"; + public static final String LOG_LIVE_TIME = "basic.logLiveTime"; public static final String Front_Time_Out = "basic.frontTimeOut"; } diff --git a/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java b/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java index 9629897394..9c9f699d90 100644 --- a/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java +++ b/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java @@ -8,7 +8,7 @@ public class SystemSettingUtils { public static boolean xpackSetting(String pkey) { - List xpackSettingList = List.of(XpackSettingConstants.AUTO_CREATE_USER); + List xpackSettingList = List.of(XpackSettingConstants.AUTO_CREATE_USER, XpackSettingConstants.LOG_LIVE_TIME); return xpackSettingList.contains(pkey); } } From 66cb0e3a3f0b0dda40165192bbc87b3ca29fd0ae Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 31 Jan 2024 11:08:07 +0800 Subject: [PATCH 09/28] =?UTF-8?q?fix(X-Pack):=20=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=90=8E=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index f57ed3cd02..f6fb683914 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit f57ed3cd02aee601d47a755a44358ced6c504b5e +Subproject commit f6fb6839143be6f0741f228453d446363e3f542c From 90c1f095c0747ba5f4f331856955c8307b502dc3 Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 31 Jan 2024 13:29:16 +0800 Subject: [PATCH 10/28] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=8D=A1=E5=AD=97=E4=BD=93=E9=A2=9C=E8=89=B2=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=B7=9F=E9=9A=8F=E9=85=8D=E8=89=B2=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicator/DeIndicator.vue | 28 ++++++++++++++-- .../editor/editor-style/ChartStyle.vue | 19 +++++++++-- .../components/IndicatorNameSelector.vue | 28 ++++++++++++++-- .../components/IndicatorValueSelector.vue | 33 +++++++++++++++++-- .../views/chart/components/editor/index.vue | 20 ++++++++--- .../chart/components/editor/util/chart.ts | 6 ++-- 6 files changed, 116 insertions(+), 18 deletions(-) diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue index 4242a34d4b..5b37c41ced 100644 --- a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue +++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue @@ -12,6 +12,7 @@ import { DEFAULT_INDICATOR_STYLE } from '@/views/chart/components/editor/util/chart' import { valueFormatter } from '@/views/chart/components/js/formatter' +import { hexColorToRGBA } from '@/views/chart/components/js/util' const props = defineProps({ view: { @@ -222,15 +223,21 @@ const renderChart = async view => { if (!view) { return } + + const TEMP_DEFAULT_CHART = cloneDeep(BASE_VIEW_CONFIG) + delete TEMP_DEFAULT_CHART.customAttr.basicStyle.alpha + const chart = deepCopy({ - ...defaultsDeep(view, cloneDeep(BASE_VIEW_CONFIG)), + ...defaultsDeep(view, TEMP_DEFAULT_CHART), data: chartData.value }) + recursionTransObj(customAttrTrans, chart.customAttr, scale.value, terminal.value) recursionTransObj(customStyleTrans, chart.customStyle, scale.value, terminal.value) if (chart.customAttr) { const customAttr = chart.customAttr + if (customAttr.indicator) { switch (customAttr.indicator.hPosition) { case 'left': @@ -254,6 +261,15 @@ const renderChart = async view => { } indicatorColor.value = customAttr.indicator.color + let suffixColor = customAttr.indicator.suffixColor + + if (customAttr.basicStyle && customAttr.basicStyle.alpha !== undefined) { + indicatorColor.value = hexColorToRGBA( + customAttr.basicStyle.colors[0], + customAttr.basicStyle.alpha + ) + suffixColor = hexColorToRGBA(customAttr.basicStyle.colors[1], customAttr.basicStyle.alpha) + } indicatorClass.value = { color: thresholdColor.value, @@ -270,7 +286,7 @@ const renderChart = async view => { } indicatorSuffixClass.value = { - color: customAttr.indicator.suffixColor, + color: suffixColor, 'font-size': customAttr.indicator.suffixFontSize + 'px', 'font-family': defaultTo( CHART_CONT_FAMILY_MAP[customAttr.indicator.suffixFontFamily], @@ -287,9 +303,15 @@ const renderChart = async view => { suffixContent.value = defaultTo(customAttr.indicator.suffix, '') } if (customAttr.indicatorName && customAttr.indicatorName.show) { + let nameColor = customAttr.indicatorName.color + + if (customAttr.basicStyle && customAttr.basicStyle.alpha !== undefined) { + nameColor = hexColorToRGBA(customAttr.basicStyle.colors[2], customAttr.basicStyle.alpha) + } + indicatorNameShow.value = true indicatorNameClass.value = { - color: customAttr.indicatorName.color, + color: nameColor, 'font-size': customAttr.indicatorName.fontSize + 'px', 'font-family': defaultTo( CHART_CONT_FAMILY_MAP[customAttr.indicatorName.fontFamily], diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 54707fee91..956efabf42 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -1,6 +1,6 @@