From de474e3b2eb81f2d8b106e15c142312f8eff71c3 Mon Sep 17 00:00:00 2001 From: ks3356143 <314298729@qq.com> Date: Thu, 17 Aug 2023 15:33:05 +0800 Subject: [PATCH] 123 --- cdTMP/src/api/system/dict.js | 92 +++++++++++ cdTMP/src/components/ma-crud/index.vue | 2 +- cdTMP/src/router/routes/modules/datamanage.js | 28 ++++ cdTMP/src/store/project/treeData.js | 1 - .../views/datamanage/dictmanage/dataList.vue | 144 ++++++++++++++++++ .../src/views/datamanage/dictmanage/index.vue | 114 ++++++++++++++ cdTMP/src/views/project/round/index.vue | 55 +++++-- .../src/views/testmanage/projmanage/index.vue | 7 +- 8 files changed, 428 insertions(+), 15 deletions(-) create mode 100644 cdTMP/src/api/system/dict.js create mode 100644 cdTMP/src/router/routes/modules/datamanage.js create mode 100644 cdTMP/src/views/datamanage/dictmanage/dataList.vue create mode 100644 cdTMP/src/views/datamanage/dictmanage/index.vue diff --git a/cdTMP/src/api/system/dict.js b/cdTMP/src/api/system/dict.js new file mode 100644 index 0000000..a94d7e5 --- /dev/null +++ b/cdTMP/src/api/system/dict.js @@ -0,0 +1,92 @@ +import { request } from "@/api/request" + +export default { + /** + * 请求dict全部数据 + * @returns dict全部数据 + */ + getDictIndex(params = {}) { + return request({ + url: `system/dataDict/index`, + method: "get", + params + }) + }, + /** + * 切换字典状态 + * @returns 切换成功或失败标志 + */ + changeStatus(data = {}) { + return request({ + url: "system/dataDict/changeStatus", + method: "put", + data + }) + }, + /** + * 获取字典详情列表 + * @returns 字典详情列表 + */ + getDictItemAll(params = {}) { + return request({ + url: "system/dataDict/dictItemAll", + method: "get", + params + }) + }, + /** + * 数字运算操作 + * @returns + */ + numberOperation(data = {}) { + return request({ + url: "system/dataDict/numberOperation", + method: "put", + data + }) + }, + /** + * 切换字典item状态 + * @returns 切换成功或失败标志 + */ + changeItemStatus(data = {}) { + return request({ + url: "system/dataDict/changeItemStatus", + method: "put", + data + }) + }, + /** + * 添加字典Item数据 + * @returns + */ + saveDictItem(data = {}) { + return request({ + url: "system/dataDict/saveitem", + method: "post", + data + }) + }, + /** + * 更新dictItem数据 + * @returns + */ + updateDictItemData(id, data = {}) { + return request({ + url: "system/dataDict/update/" + id, + method: "put", + data + }) + }, + /** + * 真实删除 + * @returns + */ + realDeleteItem(data) { + return request({ + url: "system/dictType/realDeleteItem", + method: "delete", + data + }) + } +} diff --git a/cdTMP/src/components/ma-crud/index.vue b/cdTMP/src/components/ma-crud/index.vue index 4b8d14d..e2717c8 100644 --- a/cdTMP/src/components/ma-crud/index.vue +++ b/cdTMP/src/components/ma-crud/index.vue @@ -473,7 +473,7 @@ const requestHandle = async () => { tableData.value = response } } else { - console.error(`ma-crud error:crud.api not is Function.`) + console.error(`ma-crud error:crud.api 不是一个 Function.`) } isFunction(options.value.afterRequest) && options.value.afterRequest(tableData.value) loading.value = false diff --git a/cdTMP/src/router/routes/modules/datamanage.js b/cdTMP/src/router/routes/modules/datamanage.js new file mode 100644 index 0000000..d22cc20 --- /dev/null +++ b/cdTMP/src/router/routes/modules/datamanage.js @@ -0,0 +1,28 @@ +import { DEFAULT_LAYOUT } from "../base" + +const DATAMANAGE = { + path: "/datamanage", + name: "Datamanage", + component: DEFAULT_LAYOUT, // () => import("@/layout/default-layout.vue") + meta: { + requiresAuth: true, + icon: "icon-storage", + order: 99, + locale: "数据管理" + }, + children: [ + { + path: "dictmanage", + name: "Dictmanage", + component: () => import("@/views/datamanage/dictmanage/index.vue"), + meta: { + requiresAuth: true, + roles: ["*"], + locale: "字典管理", + icon: "icon-book" + } + } + ] +} + +export default DATAMANAGE diff --git a/cdTMP/src/store/project/treeData.js b/cdTMP/src/store/project/treeData.js index cde5875..a69c255 100644 --- a/cdTMP/src/store/project/treeData.js +++ b/cdTMP/src/store/project/treeData.js @@ -26,7 +26,6 @@ const useTreeDataStore = defineStore("treeDataStore", { }, // 新增删除dut后更新树状显示 async updateDutTreeData(data, projrctId) { - console.log(data); let temp = data.key.split("-") temp.pop(-1) let roundKey = temp[0] diff --git a/cdTMP/src/views/datamanage/dictmanage/dataList.vue b/cdTMP/src/views/datamanage/dictmanage/dataList.vue new file mode 100644 index 0000000..e0e66b7 --- /dev/null +++ b/cdTMP/src/views/datamanage/dictmanage/dataList.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/cdTMP/src/views/datamanage/dictmanage/index.vue b/cdTMP/src/views/datamanage/dictmanage/index.vue new file mode 100644 index 0000000..7c33143 --- /dev/null +++ b/cdTMP/src/views/datamanage/dictmanage/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/cdTMP/src/views/project/round/index.vue b/cdTMP/src/views/project/round/index.vue index 7d5fd72..58ab1a2 100644 --- a/cdTMP/src/views/project/round/index.vue +++ b/cdTMP/src/views/project/round/index.vue @@ -41,7 +41,7 @@ - diff --git a/cdTMP/src/views/testmanage/projmanage/index.vue b/cdTMP/src/views/testmanage/projmanage/index.vue index 13f5ffe..dee5009 100644 --- a/cdTMP/src/views/testmanage/projmanage/index.vue +++ b/cdTMP/src/views/testmanage/projmanage/index.vue @@ -218,7 +218,7 @@ const crudColumns = ref([ { title: "测试级别", dataIndex: "test_level", - commonRules: [{ required: true, message: "请至少选择一个" }], + commonRules: [{ required: true, message: "请至少选择一个测试级别" }], addDefaultValue: ["6"], hide: true, formType: "checkbox", @@ -227,9 +227,10 @@ const crudColumns = ref([ { title: "平台类型", dataIndex: "plant_type", - addDefaultValue: "4", + commonRules: [{ required: true, message: "请至少选择一个平台类型" }], + addDefaultValue: ["3"], hide: true, - formType: "radio", + formType: "checkbox", dict: { name: "plant_type", props: { label: "title", value: "key" } } }, {