From 95d477fc70f334c02ed03967b04874dde9e534a5 Mon Sep 17 00:00:00 2001 From: yuanwei Date: Tue, 9 Jan 2024 15:26:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=99=A8=E6=A2=B0?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/anno/anncmntDev.js | 32 + src/api/system/sysCustomConfig.js | 41 ++ src/api/system/sysCustomConfigDetail.js | 32 + src/utils/customConfig.js | 100 +++ src/views/anno/anncmntDev/index.vue | 320 +++++++++ src/views/anno/anncmntDev/indexDialog.vue | 203 ++++++ .../system/customConfig/configDetail.vue | 616 ++++++++++++++++++ .../system/customConfig/configFromDetail.vue | 517 +++++++++++++++ .../system/customConfig/configQueryDetail.vue | 475 ++++++++++++++ src/views/system/customConfig/index.vue | 324 +++++++++ 10 files changed, 2660 insertions(+) create mode 100644 src/api/anno/anncmntDev.js create mode 100644 src/api/system/sysCustomConfig.js create mode 100644 src/api/system/sysCustomConfigDetail.js create mode 100644 src/utils/customConfig.js create mode 100644 src/views/anno/anncmntDev/index.vue create mode 100644 src/views/anno/anncmntDev/indexDialog.vue create mode 100644 src/views/system/customConfig/configDetail.vue create mode 100644 src/views/system/customConfig/configFromDetail.vue create mode 100644 src/views/system/customConfig/configQueryDetail.vue create mode 100644 src/views/system/customConfig/index.vue diff --git a/src/api/anno/anncmntDev.js b/src/api/anno/anncmntDev.js new file mode 100644 index 0000000..b8118d5 --- /dev/null +++ b/src/api/anno/anncmntDev.js @@ -0,0 +1,32 @@ +import axios from "@/utils/request"; + +export function list(query) { + return axios({ + url: "/anno/anncmnt/dev/list", + method: "get", + params: query + }); +} + + +// 保存 +export function savegg(data, formName, method = "post") { + let url = + formName !== "edit" + ? "/anno/anncmnt/dev/save" + : "/anno/anncmnt/dev/edit"; + return axios({ + url: url, + method: method, + data: data + }); +} + +// 删除 +export function deletegg(data) { + return axios({ + url: "/anno/anncmnt/dev/delete", + method: "post", + data: data + }); +} diff --git a/src/api/system/sysCustomConfig.js b/src/api/system/sysCustomConfig.js new file mode 100644 index 0000000..396f492 --- /dev/null +++ b/src/api/system/sysCustomConfig.js @@ -0,0 +1,41 @@ +import axios from "@/utils/request"; + +export function list(query) { + return axios({ + url: "/system/custom/config/list", + method: "get", + params: query + }); +} + + +// 保存 +export function saveCustomConfig(data, formName, method = "post") { + let url = + formName !== "edit" + ? "/system/custom/config/save" + : "/system/custom/config/edit"; + return axios({ + url: url, + method: method, + data: data + }); +} + +// 删除 +export function devCustomConfig(data) { + return axios({ + url: "/system/custom/config/delete", + method: "post", + data: data + }); +} + + +export function getConfigs(query) { + return axios({ + url: "/system/custom/config/getConfigs", + method: "post", + data: query + }); +} diff --git a/src/api/system/sysCustomConfigDetail.js b/src/api/system/sysCustomConfigDetail.js new file mode 100644 index 0000000..28505ea --- /dev/null +++ b/src/api/system/sysCustomConfigDetail.js @@ -0,0 +1,32 @@ +import axios from "@/utils/request"; + +export function list(query) { + return axios({ + url: "/system/custom/configDetail/list", + method: "get", + params: query + }); +} + + +// 保存 +export function saveCustomConfig(data, formName, method = "post") { + let url = + formName !== "edit" + ? "/system/custom/configDetail/save" + : "/system/custom/configDetail/edit"; + return axios({ + url: url, + method: method, + data: data + }); +} + +// 删除 +export function devCustomConfig(data) { + return axios({ + url: "/system/custom/configDetail/delete", + method: "post", + data: data + }); +} diff --git a/src/utils/customConfig.js b/src/utils/customConfig.js new file mode 100644 index 0000000..ea087af --- /dev/null +++ b/src/utils/customConfig.js @@ -0,0 +1,100 @@ +import {getConfigs} from "@/api/system/sysCustomConfig"; +import {Message} from "element-ui"; +function getColer(item,value){ + const colorRule = item.colorRule; + if(colorRule && colorRule.indexOf(",") != -1){ + var arr = colorRule.split("|"); + var reColor = ""; + arr.some(s => { + var arrTemp = s.split(","); + const type = arrTemp[0] + const valueT = arrTemp[1] + const color = arrTemp[2] + if(type == "=" && value == valueT){ + reColor = color; + }else if(type == ">=" && value >= valueT){ + reColor = color; + }else if(type == ">" && value > valueT){ + reColor = color; + }else if(type == "<" && value < valueT){ + reColor = color; + }else if(type == "<=" && value <= valueT){ + reColor = color; + } else if(type == "0"){ + reColor = color; + } + }) + return reColor; + }else{ + return colorRule; + } +} + + +export async function getHead(businessType,type){ + try { + var subData = {}; + subData.businessType = businessType; + subData.type = type; + const re = await getConfigs(subData); + if(re.code != 20000){ + Message.error("获取配置失败"); + } + return re; + } catch (error) { + console.error(error); + } +} + + +export function executeFuc(_this,row,type,clickFuc,obj){ + // 0 列表点击事件 1 列表页按钮事件 2 编辑页表单事件 3 列表页复选框事件 4列表页颜色方法 5列表查询框方法 + if("1" == type){ + //列表页按钮事件 + return callModelFun(_this,clickFuc,row); + }else if("4" == type){ + //列表页颜色方法 + if(clickFuc) { + return getColer(clickFuc, obj); + } + }else if("5" == type){ + //列表查询条件查询input方法 + if(clickFuc){ + return callModelFun(_this,clickFuc,row); + }else{ + return false; + } + }else if("2" == type){ + if(clickFuc){ + //编辑页表单事件 + return callModelFun(_this,clickFuc,row); + }else{ + return true; + } + }else if("3" == type){ + //列表页复选框事件 + if(clickFuc){ + return callModelFun(_this,clickFuc,row); + }else{ + return true; + } + }else if("0" == type){ + //表单点击事件 + if(clickFuc){ + return callModelFun(_this,clickFuc,row); + } + return true; + } +} + + +/** + * 根据方法名称调用方法 + */ +function callModelFun(_this,funcName,row) { + let methods = _this.$options.methods; + // 解释说明一下, this需要传入目标方法, 否则,在目标方法中修改data中的值, 将不会重新渲染dom, 跟v-if结合使用的过程中需要注意 + return methods[funcName](_this,row); +} + + diff --git a/src/views/anno/anncmntDev/index.vue b/src/views/anno/anncmntDev/index.vue new file mode 100644 index 0000000..3080191 --- /dev/null +++ b/src/views/anno/anncmntDev/index.vue @@ -0,0 +1,320 @@ + + + + + + + diff --git a/src/views/anno/anncmntDev/indexDialog.vue b/src/views/anno/anncmntDev/indexDialog.vue new file mode 100644 index 0000000..cd759a2 --- /dev/null +++ b/src/views/anno/anncmntDev/indexDialog.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/src/views/system/customConfig/configDetail.vue b/src/views/system/customConfig/configDetail.vue new file mode 100644 index 0000000..072f332 --- /dev/null +++ b/src/views/system/customConfig/configDetail.vue @@ -0,0 +1,616 @@ + + + diff --git a/src/views/system/customConfig/configFromDetail.vue b/src/views/system/customConfig/configFromDetail.vue new file mode 100644 index 0000000..9d23b72 --- /dev/null +++ b/src/views/system/customConfig/configFromDetail.vue @@ -0,0 +1,517 @@ + + + diff --git a/src/views/system/customConfig/configQueryDetail.vue b/src/views/system/customConfig/configQueryDetail.vue new file mode 100644 index 0000000..8483b4c --- /dev/null +++ b/src/views/system/customConfig/configQueryDetail.vue @@ -0,0 +1,475 @@ + + + diff --git a/src/views/system/customConfig/index.vue b/src/views/system/customConfig/index.vue new file mode 100644 index 0000000..1f0ef6b --- /dev/null +++ b/src/views/system/customConfig/index.vue @@ -0,0 +1,324 @@ + + + From 63a5c2e60d32098f1b77d579f7afa3296f9b8c45 Mon Sep 17 00:00:00 2001 From: yuanwei Date: Wed, 10 Jan 2024 11:59:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=99=A8=E6=A2=B0?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/anno/anncmntDev/index.vue | 76 +++- src/views/anno/anncmntDev/indexDialog.vue | 417 +++++++++++++++------- 2 files changed, 353 insertions(+), 140 deletions(-) diff --git a/src/views/anno/anncmntDev/index.vue b/src/views/anno/anncmntDev/index.vue index 3080191..6c27f96 100644 --- a/src/views/anno/anncmntDev/index.vue +++ b/src/views/anno/anncmntDev/index.vue @@ -1,7 +1,7 @@