From 56fd2b7251964cbfad33bc55df12ad1402fcfbd5 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期五, 02 八月 2024 23:11:53 +0800
Subject: [PATCH] 数采新需求调整-完成
---
src/components/do/b6-device-management/b6-data-acquisition-config.vue | 112 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 90 insertions(+), 22 deletions(-)
diff --git a/src/components/do/b6-device-management/b6-data-acquisition-config.vue b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
index 322ba4d..c8ae3ed 100644
--- a/src/components/do/b6-device-management/b6-data-acquisition-config.vue
+++ b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -87,23 +87,9 @@
<el-form-item class="fomItemInput1">
<template v-slot="label">
鍏紡锛�
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶澶у�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MAX(A1,B2)" placement="top">
- <label>MAX()</label>
- </el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶灏忓�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MIN(A1,B2)" placement="top">
- <label>MIN()</label>
- </el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚拰锛屽弬鏁颁釜鏁版渶灏戜袱涓紝濡傦細SUM(A1,B2)" placement="top">
- <label>SUM()</label>
- </el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傜粷瀵瑰�硷紝鍙傛暟涓暟鏈�灏戜竴涓紝濡傦細ABS(A1)" placement="top">
- <label>ABS()</label>
- </el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚钩鍧囧�硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛欰VERAGE(A1,B2)" placement="top">
- <label>AVERAGE()</label>
- </el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹備腑鍊硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛歁EDIAN(A1,B2)" placement="top">
- <label>MEDIAN()</label>
+ <el-tooltip v-for="formula in formulas" class="itemFomItem" effect="dark" :content="formula.content"
+ placement="top">
+ <label>{{ formula.label }}()</label>
</el-tooltip>
<el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}" ze placeholder="璇疯緭鍏ュ唴瀹�"
v-model="configForm.formula" @change="evalResult">
@@ -184,6 +170,32 @@
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
+ formulas: [
+ {
+ label: "MAX",
+ content: "姹傚弬鏁版渶澶у�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MAX(A1,B2)"
+ },
+ {
+ label: "MIN",
+ content: "姹傚弬鏁版渶灏忓�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MIN(A1,B2)"
+ },
+ {
+ label: "SUM",
+ content: "姹傚拰锛屽弬鏁颁釜鏁版渶灏戜袱涓紝濡傦細SUM(A1,B2)"
+ },
+ {
+ label: "ABS",
+ content: "姹傜粷瀵瑰�硷紝鍙傛暟涓暟鏈�灏戜竴涓紝濡傦細ABS(A1)"
+ },
+ {
+ label: "AVERAGE",
+ content: "姹傚钩鍧囧�硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛欰VERAGE(A1,B2)"
+ },
+ {
+ label: "MEDIAN",
+ content: "姹備腑鍊硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛歁EDIAN(A1,B2)"
+ },
+ ],
dialogVisible4: false,
tableList: [],
page: {
@@ -192,7 +204,12 @@
},
dialogVisible3: false,
configForm: {
- formula: ""
+ formula: "",
+ collectUrl: "",
+ storageUrl: "",
+ entrustCode: "",
+ sampleCode: "",
+ dbFileName: ""
},
domains: [
{
@@ -338,6 +355,21 @@
this.$set(this.configForm, "collectUrl", this.tableList[0].collectUrl);
this.$set(this.configForm, "storageUrl", this.tableList[0].storageUrl);
this.$set(this.configForm, "ip", this.tableList[0].ip);
+ this.$set(
+ this.configForm,
+ "entrustCode",
+ this.tableList[0].entrustCode
+ );
+ this.$set(
+ this.configForm,
+ "sampleCode",
+ this.tableList[0].sampleCode
+ );
+ this.$set(
+ this.configForm,
+ "dbFileName",
+ this.tableList[0].dbFileName
+ );
}
},
init() {
@@ -352,7 +384,17 @@
.then(res => {
this.tableList = res.data;
this.tableList.forEach(i => {
- // replace(/=/g, ' ')
+ let isIncludes = false
+ if (i.formula && i.formula != "") {
+ this.formulas.forEach(j => {
+ if (i.formula.includes(j.label)) {
+ isIncludes = true
+ }
+ })
+ }
+ if (!isIncludes && i.formula) {
+ i.formula = i.formula.slice(1, -1)
+ }
i.sample = i.sample
.replace(/"/g, "")
.replace(/],/g, "锛�")
@@ -457,7 +499,7 @@
)
.then(res => {
if (res.code == 200) {
- this.tableList = res.data;
+ // this.tableList = res.data;
this.dialogVisible4 = false;
this.init();
this.$message.success("鎿嶄綔鎴愬姛");
@@ -492,7 +534,21 @@
const data = res.data;
if (data[0]) {
this.domains.splice(0, 1);
- this.$set(this.configForm, "formula", data[0].formula);
+ let formula = data[0].formula
+ let isIncludes = false
+ if (formula && formula != "") {
+ for (let key in this.formulas) {
+ if (formula.includes(this.formulas[key].label)) {
+ isIncludes = true
+ }
+ }
+ }
+ if (!isIncludes && formula) {
+ let formulaValue = formula.slice(1, -1)
+ this.$set(this.configForm, "formula", formulaValue);
+ } else {
+ this.$set(this.configForm, "formula", data[0].formula);
+ }
data.forEach(i => {
this.domains.push({
referx: i.referx,
@@ -516,7 +572,19 @@
}
});
this.domains.forEach((i, index) => {
- i.formula = this.configForm.formula;
+ let isIncludes = false
+ if (this.configForm.formula && this.configForm.formula != "") {
+ for (let formula in this.formulas) {
+ if (this.configForm.formula.includes(this.formulas[formula].label)) {
+ isIncludes = true
+ }
+ }
+ }
+ if (isIncludes === false) {
+ i.formula = "(" + this.configForm.formula + ")";
+ } else {
+ i.formula = this.configForm.formula;
+ }
i.deviceId = this.deviceId;
i.inspectionItem = this.configForm.inspectionItem;
i.inspectionItemSubclass = this.configForm.inspectionItemSubclass;
--
Gitblit v1.9.3