From f2d0e624b308edb4617f9c9da8a55b94629bf1ad Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 27 Feb 2026 20:44:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?[=E6=9A=82=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/CustomTable.vue | 114 ++++++++++++--------- src/components/Template/HandleFormItem.vue | 3 + .../business/comps/template/comps/yp/YP003.vue | 21 +++- vue.config.js | 4 +- 4 files changed, 90 insertions(+), 52 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index d4459ea..59e34d4 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -1,6 +1,6 @@ -
({{ - headerSelectFields[col.headerSelectKey] }})
+
({{ + headerSelectFields[col.headerSelectKey] }})
@@ -42,7 +43,7 @@
-
+
{{ $t(col.label) }}
@@ -54,7 +55,7 @@ @change="onBodyValueChange(rowIndex, colIndex, $event)" :error="hasError(rowIndex, colIndex, col.prop)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" - @beforeSaveRecord = "(data,callback)=>beforeSaveRecord(data,callback,rowIndex, col,row)" + @beforeSaveRecord="(data, callback) => beforeSaveRecord(data, callback, rowIndex, col, row)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> @@ -75,7 +76,7 @@ :fieldItemLabel="fieldItemLabel" type="select" class="body-select" @blur="onBlur(rowIndex, col.prop, $event)" :item="getBodyItem(col, rowIndex)" v-model="row[col.prop]" - @change="onBodyValueChange(rowIndex, colIndex, $event,row,'select')" + @change="onBodyValueChange(rowIndex, colIndex, $event, row, 'select')" :error="hasError(rowIndex, colIndex, col.prop)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> @@ -93,14 +94,13 @@ @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
-
+
@@ -130,14 +130,14 @@ :orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" />
-
+
+
-
+
@@ -300,14 +306,17 @@ export default { this.oldLocalDataSource = []; }, methods: { - beforeSaveRecord(data,callback,rowIndex, col,row){ - this.$emit("beforeSaveRecord", {inputData:data, callback,rowIndex, key:col.prop, rowData:row,dataSource:this.localDataSource}) + handleClickButton(e, data, key, rowIndex, colIndex) { + this.$emit("clickButton", key, rowIndex, colIndex, e, data,) + }, + beforeSaveRecord(data, callback, rowIndex, col, row) { + this.$emit("beforeSaveRecord", { inputData: data, callback, rowIndex, key: col.prop, rowData: row, dataSource: this.localDataSource }) }, - getCellWidth(col){ - const {templateFillType} = this; + getCellWidth(col) { + const { templateFillType } = this; let width = col.width ? col.width + 'px' : 'auto'; - if(templateFillType !== "actFill" && templateFillType !== "preFill"){ - width = (col.showWidth)?col.showWidth + 'px' :(col.width ? col.width + 'px' : 'auto') + if (templateFillType !== "actFill" && templateFillType !== "preFill") { + width = (col.showWidth) ? col.showWidth + 'px' : (col.width ? col.width + 'px' : 'auto') } return { width } }, @@ -348,18 +357,18 @@ export default { } this.$emit("clickable", col, rowIndex, row) }, - onBeforeReagentSubmit(data, callback, col, row){ + onBeforeReagentSubmit(data, callback, col, row) { if (this.templateFillType !== 'actFill') { return } - this.$emit("beforeReagentSubmit", {selectData:data, callback, key:col.prop, rowData:row}) + this.$emit("beforeReagentSubmit", { selectData: data, callback, key: col.prop, rowData: row }) }, - onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row){ + onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row) { if (this.templateFillType !== 'actFill') { return } - this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:inputValue}) - this.$emit("onRegentSubmit", {selectInfo:data,key:col.prop, col, rowIndex, colIndex, rowData:row}) + this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: inputValue }) + this.$emit("onRegentSubmit", { selectInfo: data, key: col.prop, col, rowIndex, colIndex, rowData: row }) }, isShowAddRos() { if (this.showAddRow !== undefined) { @@ -374,7 +383,7 @@ export default { if (this.isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {//没有值就不用复制了 return } - this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:this.localDataSource[rowIndex][col.copyFrom]},"clickable") + this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: this.localDataSource[rowIndex][col.copyFrom] }, "clickable") this.onBlur(rowIndex, col.prop, this.localDataSource[rowIndex][col.prop]); } }, @@ -526,7 +535,7 @@ export default { this.headerSelectFields[col.headerSelectTo] = value; } this.headerSelectFields[col.headerSelectKey] = value; - this.$emit('headerSelectChange', {key:col.headerSelectKey, headerSelectFields:this.headerSelectFields,dataSource:this.localDataSource}); + this.$emit('headerSelectChange', { key: col.headerSelectKey, headerSelectFields: this.headerSelectFields, dataSource: this.localDataSource }); // 输入时清除对应表单项的错误状态 this.formErrors = this.formErrors.filter(error => !(error.rowIndex === -1 && @@ -588,7 +597,7 @@ export default { }, // 表体值变化 - onBodyValueChange(rowIndex, colIndex, value,row,type) { + onBodyValueChange(rowIndex, colIndex, value, row, type) { const col = this.columns[colIndex]; this.localDataSource[rowIndex][col.prop] = value; @@ -601,12 +610,12 @@ export default { error.colIndex === colIndex && error.field === col.prop) ); - if(type === "select"){ - this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.prop,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields}); + if (type === "select") { + this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.prop, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields }); } }, // 表体子值变化 - onBodySubValueChange(rowIndex, colIndex, value,row,type) { + onBodySubValueChange(rowIndex, colIndex, value, row, type) { const col = this.columns[colIndex]; this.localDataSource[rowIndex][col.bodySubKey] = value; @@ -629,8 +638,8 @@ export default { error.colIndex === colIndex && error.field === col.bodySubKey) ); - if(type === "select"){ - this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.bodySubKey,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields}); + if (type === "select") { + this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.bodySubKey, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields }); } }, getHeaderItem(col) { @@ -651,13 +660,20 @@ export default { copyFrom: col.copyFrom || "", compareTo: col.compareTo, // 添加 compareTo 字段 type: col.bodyType || "input", - filledCodes:col.filledCodes, + filledCodes: col.filledCodes, }; if (col.bodyDisabled) { item.disabled = col.bodyDisabled; } return item }, + getBodyButtonItem(col,) { + return { + buttonName: col.bodySubButtonName, + fillType: col.bodySubFillType, + type: "button", + } + }, getBodySubItem(col) { const item = { fillType: col.bodySubFillType, @@ -719,7 +735,7 @@ export default { targetStartSolutionVolumePrecision: 3,//小数点精度默认为3 }); }, - + // 添加行 addRow(row = {}) { this.localDataSource.push(row); @@ -779,7 +795,7 @@ export default { } } - this.$emit("blur", { rowIndex, colKey, value,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields, item: this.localDataSource[rowIndex] }); + this.$emit("blur", { rowIndex, colKey, value, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields, item: this.localDataSource[rowIndex] }); }, onSubBlur(rowIndex, colKey, value) { // 查找对应的列配置 @@ -810,13 +826,16 @@ export default { font-size: 14px; color: #606266; margin-top: 20px; + &.no-border { box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 5px 5px; border: none; + .custom-table-cell { border-right: none; } + .custometable-row { display: flex; border-bottom: none; @@ -885,7 +904,7 @@ export default { text-align: left; vertical-align: middle; border-right: 1px solid #ebeef5; - page-break-inside: avoid; + page-break-inside: avoid; box-sizing: border-box; } @@ -897,15 +916,15 @@ export default { color: #909399; background-color: #f5f7fa; font-size: 12px; - word-break: break-word; - white-space: normal; + word-break: break-word; + white-space: normal; } .body-cell { color: #606266; - page-break-inside: avoid; + page-break-inside: avoid; background-color: #fff; } @@ -980,14 +999,17 @@ export default { .body-span { text-align: center; } + .item-center { display: flex; align-items: center; } -.mr-5{ + +.mr-5 { margin-right: 5px; } -.sort-cell{ + +.sort-cell { text-align: center; width: 100px; } diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index a80ba0b..9eb6b5b 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -927,6 +927,9 @@ export default { } if(this.type === "button"){ this.$emit('clickButton', this.item,this.inputValue,data); + if(this.templateFillType === "preFill"){ + return; + } } //用户输入密码并点击确定,保存修改 this.oldValue = value; // 更新旧值 diff --git a/src/views/business/comps/template/comps/yp/YP003.vue b/src/views/business/comps/template/comps/yp/YP003.vue index f5d02af..f31748e 100644 --- a/src/views/business/comps/template/comps/yp/YP003.vue +++ b/src/views/business/comps/template/comps/yp/YP003.vue @@ -19,6 +19,7 @@ :formData="formData" :prefixKey = "`table`" fieldItemLabel = "template.common.operationSteps" + @clickButton="handleClickButton" :showOperation="fillType === 'preFill'" > @@ -166,8 +164,13 @@ export default { },{ label: 'template.yp.yp003.dwbh', prop: 'dwbh', - bodyType: 'input', + bodyType: 'checkboxTag', bodyFillType: 'actFill', + bodySubType:"button", + bodySubFillType:"preFill", + bodySubButtonName:"template.common.importTemplate", + bodySubKey:"exportBtn", + showBodySub:true, width: 280, },{ label: 'template.yp.yp003.ypsl', @@ -181,11 +184,19 @@ export default { data() { return { formData: {}, + currentRowIndex: -1, }; }, mounted() { }, methods: { + // 点击按钮 + handleClickButton(key,rowIndex,colIndex,e,data){ + if(key === "exportBtn"){ + this.currentRowIndex = rowIndex; + this.$refs.ImportExcelDialog.show() + } + }, //获取已填写的表单数据 getFilledFormData() { return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]) @@ -221,6 +232,8 @@ export default { }, onLoadExcelData(excelData) { console.log(excelData) + const data = excelData.splice(1); + this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex,data); this.$refs.ImportExcelDialog.cancel() }, downloadExcelTemplate(arr){ diff --git a/vue.config.js b/vue.config.js index 56dd747..bf3ddf1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -34,8 +34,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://localhost:8080`, - // target: `http://39.99.251.173:8080`, + // target: `http://localhost:8080`, + target: `http://39.99.251.173:8080`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' From 408d4e6dbadd5add148194a0a79a79b54505f5b6 Mon Sep 17 00:00:00 2001 From: lslaiwy <1209768238@qq.com> Date: Fri, 27 Feb 2026 21:59:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:[=E8=A1=A8=E5=8D=95=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=E6=96=B0=E5=A2=9EDL020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/dl.js | 11 +- src/lang/zh/template/dl.js | 11 +- .../business/comps/template/TemplateTable.vue | 27 ++- .../business/comps/template/comps/dl/DL016.vue | 208 ++++++++++++++++++++ .../business/comps/template/comps/dl/DL020.vue | 209 +++++++++++++++++++++ 5 files changed, 462 insertions(+), 4 deletions(-) create mode 100644 src/views/business/comps/template/comps/dl/DL016.vue create mode 100644 src/views/business/comps/template/comps/dl/DL020.vue diff --git a/src/lang/en/template/dl.js b/src/lang/en/template/dl.js index 34e72c6..a94bb0f 100644 --- a/src/lang/en/template/dl.js +++ b/src/lang/en/template/dl.js @@ -1,4 +1,13 @@ //毒理 export default { - dl001: {} + dl001: {}, + dl020: { + swdljlbxx: '毒理记录表信息', + xbxx:'细胞信息', + sydd:'实验地点', + czsj:'操作时间', + qxbd: '前序表单', + dlbz: '备注', + czbz: '操作步骤', + } } diff --git a/src/lang/zh/template/dl.js b/src/lang/zh/template/dl.js index 34e72c6..a94bb0f 100644 --- a/src/lang/zh/template/dl.js +++ b/src/lang/zh/template/dl.js @@ -1,4 +1,13 @@ //毒理 export default { - dl001: {} + dl001: {}, + dl020: { + swdljlbxx: '毒理记录表信息', + xbxx:'细胞信息', + sydd:'实验地点', + czsj:'操作时间', + qxbd: '前序表单', + dlbz: '备注', + czbz: '操作步骤', + } } diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue index ab926c6..d8ab6e3 100644 --- a/src/views/business/comps/template/TemplateTable.vue +++ b/src/views/business/comps/template/TemplateTable.vue @@ -77,6 +77,9 @@ import YP005 from "./comps/yp/YP005.vue"; //毒理 // DL001-SYWZPZJHB // DL002-使用SP001 +import DL016 from "./comps/dl/DL016.vue"; +import DL020 from "./comps/dl/DL020.vue"; + export default { name: "TemplateTable", @@ -103,6 +106,25 @@ export default { YP003, YP004, YP005, + //毒理 + DL016, + DL020 + }, + data() { + return { + componentMap: null, + } + }, + methods: { + getTemplateComponent() { + if (!this.sn) return 'Demo'; + let componentName = this.componentMap[this.sn] || 'Demo'; + return componentName; + }, + handleEditSignCancel(e) { + EventBus.$emit('edit-sign-cancel', e); + }, + }, props: { sn: { @@ -193,7 +215,8 @@ export default { 'YP005': 'YP005', //毒理 //DL001-SYWZPZJHB - 'DL002': 'SP001', + 'DL016': 'DL016', + 'DL020': 'DL020', } } return this.componentMap || "Demo" @@ -380,4 +403,4 @@ export default { padding: 10px 10px; width: 100%; } - \ No newline at end of file + diff --git a/src/views/business/comps/template/comps/dl/DL016.vue b/src/views/business/comps/template/comps/dl/DL016.vue new file mode 100644 index 0000000..a219d68 --- /dev/null +++ b/src/views/business/comps/template/comps/dl/DL016.vue @@ -0,0 +1,208 @@ + + + + + diff --git a/src/views/business/comps/template/comps/dl/DL020.vue b/src/views/business/comps/template/comps/dl/DL020.vue new file mode 100644 index 0000000..eb37a62 --- /dev/null +++ b/src/views/business/comps/template/comps/dl/DL020.vue @@ -0,0 +1,209 @@ + + + + + From ecb1a1fa72b73a93da73a676e2426089b934024c Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 27 Feb 2026 22:06:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?[=E6=9A=82=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/BaseInfoFormPackage.vue | 13 +++ src/components/Template/CustomTable.vue | 25 ++++- src/components/Template/HandleFormItem.vue | 124 ++++++++++++++++++++- .../business/comps/template/comps/yp/YP003.vue | 9 +- 4 files changed, 162 insertions(+), 9 deletions(-) diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index 0a0252c..7d17fa5 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -114,6 +114,13 @@ @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem" :value="formFields[key]" />
+
+ +
+
+ +
-