From 4003113b5a7ab4bd9bd42f501420f3eb4353a864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E7=BB=AA=E5=A3=AE?= <2235602974@qq.com> Date: Fri, 25 Mar 2022 21:32:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:sparkles:=20=E5=8F=82=E6=95=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/util.js b/src/util/util.js index a31e8e36..f8b61cb6 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -104,8 +104,7 @@ export const setTheme = name => { */ export const encryption = params => { let {data, type, param, key} = params; - let result = JSON.parse(JSON.stringify(data)); - if(type==="MD5") result = CryptoJS.MD5(data) + const result = JSON.parse(JSON.stringify(data)); if (type === "Base64") { param.forEach(ele => { result[ele] = btoa(result[ele]); -- Gitee From c0f462c1c2dc990c3e1e216815796c85ded4d294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E7=BB=AA=E5=A3=AE?= <2235602974@qq.com> Date: Tue, 29 Mar 2022 11:06:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:sparkles:=20=E5=AD=97=E5=85=B8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/util.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/util/util.js b/src/util/util.js index f8b61cb6..487310d8 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -2,6 +2,40 @@ import {validatenull} from "./validate"; import request from "@/router/axios"; import * as CryptoJS from "crypto-js"; +// 数据合并 +export function mergeRecursive(source, target) { + for (let index in target) { + try { + if (target[index].constructor === Object) { + source[index] = mergeRecursive(source[index], target[index]); + } else { + source[index] = target[index]; + } + } catch (e) { + source[index] = target[index]; + } + } + return source; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + if (value === undefined) { + return ""; + } + let actions = []; + Object.keys(datas).some((key) => { + if (datas[key].value === ('' + value)) { + actions.push(datas[key].label); + return true; + } + }) + if (actions.length === 0) { + actions.push(value); + } + return actions.join(''); +} + // 表单序列化 export const serialize = data => { let list = []; -- Gitee From 664df75d1ec17215c8a82a9fdb620d9af105d2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E7=BB=AA=E5=A3=AE?= <2235602974@qq.com> Date: Tue, 29 Mar 2022 11:45:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:bug:=20=E6=96=B0=E5=A2=9E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/gen/datasource.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/gen/datasource.vue b/src/views/gen/datasource.vue index 07607e5e..b48b97e2 100755 --- a/src/views/gen/datasource.vue +++ b/src/views/gen/datasource.vue @@ -93,13 +93,15 @@ handleSave: function (row, done,loading) { addObj(row).then(res => { if (res.data.data){ - done() - this.$message.success('添加成功') + this.$message.success("添加成功"); + done(); + this.getDsList(this.dsPage); }else { + this.$message.error("添加失败,数据源不可访问"); loading() - this.$message.error('添加失败,数据源不可访问') } - this.getDsList(this.dsPage) + }).catch(()=>{ + loading() }) }, getDsList(page, params) { -- Gitee