From ca416b44cb38646f673024b0cbd1ea85dd307d46 Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Tue, 7 Feb 2023 17:45:18 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=9E=E9=AA=8C=E5=AE=A4=E6=A3=80=E6=9F=A5?= =?UTF-8?q?formJSON=E6=95=B0=E6=8D=AE=202.upload=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=81=94=E8=B0=83=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...14\345\256\244\346\243\200\346\237\245.js" | 178 ++++++++++++++++++ src/components/Upload/index.vue | 16 +- 2 files changed, 185 insertions(+), 9 deletions(-) create mode 100644 "src/components/FormComponents/CustomForm/\345\256\236\351\252\214\345\256\244\346\243\200\346\237\245.js" diff --git "a/src/components/FormComponents/CustomForm/\345\256\236\351\252\214\345\256\244\346\243\200\346\237\245.js" "b/src/components/FormComponents/CustomForm/\345\256\236\351\252\214\345\256\244\346\243\200\346\237\245.js" new file mode 100644 index 0000000..1d454d1 --- /dev/null +++ "b/src/components/FormComponents/CustomForm/\345\256\236\351\252\214\345\256\244\346\243\200\346\237\245.js" @@ -0,0 +1,178 @@ +let formJson = { + column: [], + labelPosition: "right", + labelSuffix: ":", + labelWidth: 180, + gutter: 0, + menuBtn: true, + submitBtn: true, + submitText: "下一步", + emptyBtn: false, + emptyText: "清空", + nextTabBtn: true, + nextTabText: "下一页", + menuPosition: "center", + prevBtn: true, + group: [ + { + label: "实验室检查", + prop: "1669789802778_28648", + arrow: true, + collapse: true, + display: true, + labelWidth: 8, + column: [ + { + type: "input", + display: true, + importantField: false, + styles: {}, + prop: "G_17", + label: "胃泌素17", + fieldType: "varchar", + fieldLength: "255", + tableName: "实验室检查", + tableCode: "gas_exam", + tableId: "1597466741234040833", + notFilter: false, + cType: "", + subfield: false, + autoRequired: 0, + personalRequired: 0, + required: true, + rules: [{ required: true, message: "胃泌素17必须填写" }], + }, + { + type: "input", + display: true, + importantField: false, + styles: {}, + prop: "PG_I", + label: "胃蛋白酶原I(PG I)", + fieldType: "varchar", + fieldLength: "255", + tableName: "实验室检查", + tableCode: "gas_exam", + tableId: "1597466741234040833", + notFilter: false, + cType: "", + subfield: false, + rules: [{ required: true, message: "胃蛋白酶原I(PG I)必须填写" }], + required: true, + }, + { + type: "input", + display: true, + importantField: false, + styles: {}, + prop: "PG_II", + label: "胃蛋白酶原II(PG II)", + fieldType: "varchar", + fieldLength: "255", + tableName: "实验室检查", + tableCode: "gas_exam", + tableId: "1597466741234040833", + notFilter: false, + cType: "", + subfield: false, + rules: [{ required: true, message: "胃蛋白酶原II(PG II)必须填写" }], + required: true, + }, + { + type: "radio", + display: true, + importantField: false, + styles: {}, + prop: "IgG", + label: "Hp抗体(IgG)检测", + fieldType: "varchar", + fieldLength: "255", + tableName: "实验室检查", + tableCode: "gas_exam", + tableId: "1597466741234040833", + notFilter: false, + cType: "", + subfield: false, + dicData: [ + { + label: "阳性", + value: "2", + id: "1598150992287858689", + parentId: "", + }, + { + label: "阴性", + value: "1", + id: "1598150963816923138", + parentId: "", + }, + ], + dynamicshSet: [], + dicType: "hp_antibody", + props: { label: "label", value: "value" }, + disabled: false, + required: true, + rules: [{ required: true, message: "请选择Hp抗体(IgG)检测" }], + }, + { + type: "upload", + display: true, + importantField: false, + styles: {}, + prop: "patient_avatar", + label: "血检报告单", + fieldType: "varchar", + fieldLength: "10", + showFileList: true, + multiple: true, + bucketName: "pacs", + limit: 5, + dicType: "", + tableName: "附件", + tableCode: "gas_attachment", + tableId: "1595978031963398145", + notFilter: false, + cType: "", + subfield: false, + autoRequired: 0, + personalRequired: 0, + listType: "picture-card", + required: true, + rules: [{ required: true, message: "血检报告单必须填写" }], + lg: 24, + width: 24, + xs: 24, + sm: 24, + span: 24, + md: 24, + }, + { + type: "upload", + display: true, + importantField: true, + styles: {}, + autoRequired: 0, + personalRequired: 0, + prop: "exam_img", + label: "实验室报告", + required: true, + rules: [{ required: true, message: "实验室报告必须填写" }], + showFileList: true, + multiple: true, + bucketName: "exam", + limit: 5, + dicType: "", + listType: "picture-card", + fieldType: "varchar", + fieldLength: "255", + tableName: "附件", + tableCode: "gas_attachment", + tableId: "1595978031963398145", + notFilter: false, + cType: "", + subfield: false, + }, + ], + }, + ], +} diff --git a/src/components/Upload/index.vue b/src/components/Upload/index.vue index bfa9cd3..10bb6df 100644 --- a/src/components/Upload/index.vue +++ b/src/components/Upload/index.vue @@ -116,7 +116,7 @@ export default { return this.value.map((_) => { return ( _.url || - `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}` + `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` ) }) }, @@ -129,7 +129,7 @@ export default { this.fileList = newValue.map((_) => { return { name: _.file_name, - url: `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}`, + url: `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`, } }) }, @@ -171,7 +171,7 @@ export default { handleSuccess(res, file, fileList) { const { data } = res if (data) { - this.value.push({ ...data, url: file.url }) + this.value.push({ ...data }) } else { this.$message.warning(res.msg) this.$refs.upload.clearFiles() @@ -187,22 +187,20 @@ export default { }, // 移除 - handleRemove({ url }, fileList) { - let arr = url.split("/") - let uuidName = arr[arr.length - 1] - const i = this.value.findIndex((_) => uuidName == _.uuidName) + handleRemove({ uuid_name }, fileList) { + const i = this.value.findIndex((_) => uuid_name == _.uuidName) if (i > -1) this.value.splice(i, 1) console.log("删了", this.value) }, - // 查看 + // 查看/下载 handlePreview(file) { const name = file.fileName || file.name this.title = name let responseUrl if (file.response) { const _ = file.response.data - responseUrl = `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}` + responseUrl = `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` } try { if (name.match(/\.(png|jpg|jpeg)/)) { -- 2.22.0