From 40d680b6c6b5dac066a95f88301b1dbe82f28630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Fri, 20 Dec 2024 15:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BE=8B=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jichuang/model.js | 42 ++++++ src/components/FileUpload/index.vue | 41 ++--- src/views/jichuang/case/index.vue | 226 +++++++++++++++++++++++----- src/views/jichuang/case/table.vue | 65 +++++++- vite.config.js | 5 - 5 files changed, 301 insertions(+), 78 deletions(-) create mode 100644 src/api/jichuang/model.js diff --git a/src/api/jichuang/model.js b/src/api/jichuang/model.js new file mode 100644 index 0000000..07c6c1b --- /dev/null +++ b/src/api/jichuang/model.js @@ -0,0 +1,42 @@ +import request from "@/utils/request"; + +// 查询菜单列表 +export function getList(query) { + return request({ + url: "/jcModel", + method: "get", + params: query, + }); +} +// 新增 +export function add(data) { + return request({ + url: "/jcModel", + method: "post", + data: data, + }); +} +//删除 +export function del(ids) { + return request({ + url: "/jcModel/delete/" + ids, + method: "post", + }); +} + +//修改 +export function updata(data) { + return request({ + url: "/jcModel", + method: "put", + data: data, + }); +} + +//详情 +export function getInfo(id) { + return request({ + url: "/jcModel/" + id, + method: "get", + }); +} diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 8203a21..107b3b5 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -35,7 +35,7 @@ tag="ul" >
  • @@ -53,13 +53,12 @@
  • - diff --git a/src/views/jichuang/case/table.vue b/src/views/jichuang/case/table.vue index ddd878a..89586f4 100644 --- a/src/views/jichuang/case/table.vue +++ b/src/views/jichuang/case/table.vue @@ -9,8 +9,24 @@ - + + + + + + + @@ -48,11 +64,19 @@ - + + + + - +
    import { ref, reactive, onMounted } from "vue"; const { proxy } = getCurrentInstance(); -let $emit = defineEmits(["childSub"]); +let $emit = defineEmits(); import { v4 as uuidv4 } from "uuid"; const data = reactive({ form: {}, @@ -115,13 +139,39 @@ const data = reactive({ trigger: "change", }, ], + link: [ + { + required: true, + message: "请填写项目链接", + trigger: "blur", + }, + ], }, formListJson: [{ userName: "", passWord: "" }], }); +let title = ref(""); const { form, rules, formListJson } = toRefs(data); +const props = defineProps({ + modelValue: [Array], +}); + let itemGather = reactive([]); let innerVisible = ref(false); +const baseUrl = import.meta.env.VITE_APP_BASE_API; +watch( + () => props.modelValue, + (val) => { + if (val) { + // 首先将值转为数组 + const list = Array.isArray(val) ? val : []; + itemGather = list; + } else { + return []; + } + }, + { deep: true, immediate: true } +); const addUserandPass = () => { formListJson.value.push({ userName: "", passWord: "" }); }; @@ -132,6 +182,7 @@ const closeUserandPass = (index) => { const handleUpdate = (row) => { form.value = row; formListJson.value = form.value.userData; + title.value = "修改项目集合"; innerVisible.value = true; }; @@ -159,7 +210,8 @@ const submitDataScope = () => { itemGather.push(form.value); } innerVisible.value = false; - $emit("childSub", itemGather); + + $emit("update:modelValue", itemGather); } }); }; @@ -169,6 +221,7 @@ const cancelDataScope = () => { const handlerAdd = () => { form.value = {}; formListJson.value = [{ userName: "", passWord: "" }]; + title.value = "新增项目集合"; innerVisible.value = true; }; diff --git a/vite.config.js b/vite.config.js index 8d7240e..676c736 100644 --- a/vite.config.js +++ b/vite.config.js @@ -37,11 +37,6 @@ export default defineConfig(({ mode, command }) => { rewrite: (p) => p.replace(/^\/dev-api/, ""), }, }, - headers: { - // 目的是为了消除浏览器报错: SharedArrayBufferis not defined - "Cross-Origin-Opener-Policy": "same-origin", - "Cross-Origin-Embedder-Policy": "require-corp", - }, }, //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file css: {