From 68fdf6fda6ba911b54522fe4bd85b257f924587c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com>
Date: Fri, 31 Mar 2023 15:12:19 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E5=AD=97=E5=85=B8=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E8=AE=BE=E7=BD=AE=E6=96=B0=E5=A2=9E=E8=80=97=E6=9D=90?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/param/systemParamConfig.vue | 2 +
.../userManage/param/basicProductConfig.vue | 196 +++++++++++++++++-
2 files changed, 197 insertions(+), 1 deletion(-)
diff --git a/src/views/system/param/systemParamConfig.vue b/src/views/system/param/systemParamConfig.vue
index 2b0706b..6a7e49e 100644
--- a/src/views/system/param/systemParamConfig.vue
+++ b/src/views/system/param/systemParamConfig.vue
@@ -136,6 +136,7 @@ export default {
paramStatus: 1,
page: 1,
limit: 20,
+ paramType: 0,
},
list: [],
total: 0,
@@ -169,6 +170,7 @@ export default {
paramStatus: 1,
page: 1,
limit: 20,
+ paramType: 0,
};
this.getList();
},
diff --git a/src/views/userManage/param/basicProductConfig.vue b/src/views/userManage/param/basicProductConfig.vue
index edb9499..b7d5b1c 100644
--- a/src/views/userManage/param/basicProductConfig.vue
+++ b/src/views/userManage/param/basicProductConfig.vue
@@ -44,7 +44,6 @@
-
+
+
+
+
+
+
+
+
+
+ {{ scope.row.paramExplain }}
+
+
+
+
+ 设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -62,6 +149,18 @@ import {
filterList,
modifySetup
} from "@/api/param/basicProductConfig";
+import { systemParamConfigList, systemParamConfigSave } from '@/api/system/param/systemParamConfig'
+
+const formJson = {
+ id: "",
+ parentId: "",
+ paramName: "",
+ paramKey: "",
+ paramValue: "",
+ paramStatus: 1,
+ paramType: 1,
+ paramExplain: "",
+};
export default {
data() {
@@ -70,13 +169,37 @@ export default {
page: 1,
limit: 20
},
+ systemQuery: {
+ page: 1,
+ limit: 20,
+ paramType:2,
+ paramStatus: 1,
+ },
+ formRules: {
+ paramValue: [{required: true, message: "请输入参数值", trigger: "blur"}],
+ // ,
+ // paramStatus: [
+ // {required: true, message: "请选择参数状态", trigger: "change"}
+ // ]
+ },
list: [],
+ formLoading: false,
+ systemList:[],
total: 0,
+ formData: formJson,
+ formName: null,
+ systemTotal: 0,
loading: true,
+ systemLoading:true,
+ formVisible: false,
enableMap: {
true: "是",
false: "否",
},
+ formMap: {
+ add: "新增运行参数",
+ update: "运行参数设置",
+ },
};
},
methods: {
@@ -111,6 +234,76 @@ export default {
this.total = 0;
});
},
+ // 显示表单
+ handleForm(index, row) {
+ this.formVisible = true;
+ this.formData = JSON.parse(JSON.stringify(formJson));
+ if (row !== null) {
+ this.formData = Object.assign({}, row);
+ }
+ this.formName = "add";
+ if (index !== null) {
+ this.index = index;
+ this.formName = "update";
+ }
+ },
+ hideForm() {
+ // 更改值
+ this.formVisible = !this.formVisible;
+ return true;
+ },
+ getSystemList() {
+ this.systemLoading = true;
+ systemParamConfigList(this.systemQuery)
+ .then((response) => {
+ this.systemLoading = false;
+ this.systemList = response.data.list || [];
+ this.systemTotal = response.data.total || 0;
+ })
+ .catch(() => {
+ this.systemLoading = false;
+ this.systemList = [];
+ this.systemTotal = 0;
+ });
+ },
+ formSubmit() {
+ // if (!Number.isInteger(parseInt(this.formData.paramValue))) {
+ // this.$message.warning("参数值必须为数字");
+ // return;
+ // }
+ this.$refs["dataForm"].validate((valid) => {
+ if (valid) {
+ this.formLoading = true;
+ let data = Object.assign({}, this.formData);
+ data.paramValue = data.paramValue.trim();
+ systemParamConfigSave(data, this.formName)
+ .then((response) => {
+ this.formLoading = false;
+ if (response.code != 20000) {
+ this.$message.error(response.message);
+ return false;
+ }
+ this.$message.success("操作成功");
+ this.formVisible = false;
+ if (this.formName === "add") {
+ // 向头部添加数据
+ if (response.data && response.data.id) {
+ data.id = response.data.id;
+ this.list.unshift(data);
+ }
+ } else {
+ this.list.splice(this.index, 1, data);
+ }
+ // 刷新表单
+ this.resetForm();
+ this.getSystemList();
+ })
+ .catch(() => {
+ this.formLoading = false;
+ });
+ }
+ });
+ },
handleSave(index, row) {
this.currentCheckIndex = -1;
modifySetup(row).then((res) => {
@@ -129,6 +322,7 @@ export default {
created() {
// 加载表格数据
this.getList();
+ this.getSystemList();
}
};