|  | @@ -5,7 +5,7 @@
 | 
	
		
			
				|  |  |          <div>
 | 
	
		
			
				|  |  |            <el-form-item label="CST阶数:" :label-width="formLabelWidth200">
 | 
	
		
			
				|  |  |              <el-input-number
 | 
	
		
			
				|  |  | -              v-model="cstnum"
 | 
	
		
			
				|  |  | +              v-model="cstn"
 | 
	
		
			
				|  |  |                :step="1"
 | 
	
		
			
				|  |  |                :min="0"
 | 
	
		
			
				|  |  |                :max="20"
 | 
	
	
		
			
				|  | @@ -27,7 +27,7 @@
 | 
	
		
			
				|  |  |                  :max="1000"
 | 
	
		
			
				|  |  |                  controls-position="right"
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  | -                <template #prefix>N1</template>
 | 
	
		
			
				|  |  | +                <template #prefix>N1:</template>
 | 
	
		
			
				|  |  |                </el-input>
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |              <el-form-item
 | 
	
	
		
			
				|  | @@ -41,7 +41,7 @@
 | 
	
		
			
				|  |  |                  :max="1000"
 | 
	
		
			
				|  |  |                  controls-position="right"
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  | -                <template #prefix>N1</template>
 | 
	
		
			
				|  |  | +                <template #prefix>N1:</template>
 | 
	
		
			
				|  |  |                </el-input>
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |            </div>
 | 
	
	
		
			
				|  | @@ -57,7 +57,7 @@
 | 
	
		
			
				|  |  |                  :max="1000"
 | 
	
		
			
				|  |  |                  controls-position="right"
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  | -                <template #prefix>N2</template>
 | 
	
		
			
				|  |  | +                <template #prefix>N2:</template>
 | 
	
		
			
				|  |  |                </el-input>
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |              <el-form-item
 | 
	
	
		
			
				|  | @@ -71,7 +71,7 @@
 | 
	
		
			
				|  |  |                  :max="1000"
 | 
	
		
			
				|  |  |                  controls-position="right"
 | 
	
		
			
				|  |  |                >
 | 
	
		
			
				|  |  | -                <template #prefix>N2</template>
 | 
	
		
			
				|  |  | +                <template #prefix>N2:</template>
 | 
	
		
			
				|  |  |                </el-input>
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |            </div>
 | 
	
	
		
			
				|  | @@ -86,7 +86,7 @@
 | 
	
		
			
				|  |  |                :label="item.label"
 | 
	
		
			
				|  |  |              >
 | 
	
		
			
				|  |  |                <template #default="{ row }">
 | 
	
		
			
				|  |  | -                <el-input v-model="row[item.prop]" @change="handleEdit(row)" />
 | 
	
		
			
				|  |  | +                <el-input v-model="row[item.prop]" />
 | 
	
		
			
				|  |  |                </template>
 | 
	
		
			
				|  |  |              </el-table-column>
 | 
	
		
			
				|  |  |            </el-table>
 | 
	
	
		
			
				|  | @@ -102,13 +102,20 @@ import myheader from "@/components/header.vue"
 | 
	
		
			
				|  |  |  import { request, uploadFile } from "@/utils/request"
 | 
	
		
			
				|  |  |  import { ElMessage, ElButton, ElDialog, ElSelect } from "element-plus"
 | 
	
		
			
				|  |  |  import { Edit, CaretBottom } from "@element-plus/icons-vue"
 | 
	
		
			
				|  |  | -import { cs } from "element-plus/es/locale/index.mjs"
 | 
	
		
			
				|  |  | +import { cs, ta } from "element-plus/es/locale/index.mjs"
 | 
	
		
			
				|  |  |  let formLabelWidth3 = ref(100)
 | 
	
		
			
				|  |  |  let formLabelWidth200 = ref(200)
 | 
	
		
			
				|  |  | -let cstnum = ref("")
 | 
	
		
			
				|  |  | +let cstn = ref("")
 | 
	
		
			
				|  |  | +let pid = ref("")
 | 
	
		
			
				|  |  | +let cstid = ref("")
 | 
	
		
			
				|  |  |  let cstvalue = ref({
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +  uppern1: "",
 | 
	
		
			
				|  |  | +  lowern1: "",
 | 
	
		
			
				|  |  | +  uppern2: "",
 | 
	
		
			
				|  |  | +  lowern2: "",
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  | +let upperb = ref("")
 | 
	
		
			
				|  |  | +let lowerb = ref("")
 | 
	
		
			
				|  |  |  let tableDatacst = ref([{ date: "上表面CST参数" }, { date: "下表面CST参数" }])
 | 
	
		
			
				|  |  |  let tablecstHeaders = ref([])
 | 
	
		
			
				|  |  |  // cst时间
 | 
	
	
		
			
				|  | @@ -117,7 +124,7 @@ const clickblur = () => {
 | 
	
		
			
				|  |  |    tablecstHeaders.value = []
 | 
	
		
			
				|  |  |    let arrheader = []
 | 
	
		
			
				|  |  |    let tablearr = []
 | 
	
		
			
				|  |  | -  let num = Number(cstnum.value)
 | 
	
		
			
				|  |  | +  let num = Number(cstn.value)
 | 
	
		
			
				|  |  |    if (num == 0 || num == undefined || num == null) {
 | 
	
		
			
				|  |  |    } else {
 | 
	
		
			
				|  |  |      for (let i = 1; i <= num + 1; i++) {
 | 
	
	
		
			
				|  | @@ -141,9 +148,38 @@ const clickblur = () => {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +// 获取upperb和lowerb
 | 
	
		
			
				|  |  | +const getupperlower = () => {
 | 
	
		
			
				|  |  | +  const upperRow = tableDatacst.value[0];
 | 
	
		
			
				|  |  | +  const lowerRow = tableDatacst.value[1];
 | 
	
		
			
				|  |  | +  let upperbValues = [];
 | 
	
		
			
				|  |  | +  let lowerbValues = [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  // 处理第一行数据
 | 
	
		
			
				|  |  | +  for (let key in upperRow) {
 | 
	
		
			
				|  |  | +      if (key !== "date") {
 | 
	
		
			
				|  |  | +        upperbValues.push(upperRow[key]);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  // 将拼接后的值存储在 upperb 中
 | 
	
		
			
				|  |  | +  upperb.value = upperbValues.join(",");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  // 处理第二行数据
 | 
	
		
			
				|  |  | +  for (let key in lowerRow) {
 | 
	
		
			
				|  |  | +      if (key !== "date") {
 | 
	
		
			
				|  |  | +        lowerbValues.push(lowerRow[key]);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  // 将拼接后的值存储在 lowerb 中
 | 
	
		
			
				|  |  | +  lowerb.value = lowerbValues.join(",");
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  //查询cst 
 | 
	
		
			
				|  |  |  const getcst = (id) => {
 | 
	
		
			
				|  |  |    pid.value=id;
 | 
	
		
			
				|  |  | +  console.log('getcst:',pid.value)
 | 
	
		
			
				|  |  |    const params = {
 | 
	
		
			
				|  |  |      transCode: 'MDO0040',
 | 
	
		
			
				|  |  |      pid: pid.value,
 | 
	
	
		
			
				|  | @@ -151,20 +187,38 @@ const getcst = (id) => {
 | 
	
		
			
				|  |  |    request(params)
 | 
	
		
			
				|  |  |      .then((res) => {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      if (res.hasOwnProperty('eid')) {
 | 
	
		
			
				|  |  | +      if (res.hasOwnProperty('cstid')) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        eid.value = res.eid;
 | 
	
		
			
				|  |  | -        youhua.value.algorithm = res.algorithm
 | 
	
		
			
				|  |  | -        youhua.value.popsize = Number(res.popsize); // 将id属性转换为数字
 | 
	
		
			
				|  |  | -        youhua.value.epoch = Number(res.epoch);
 | 
	
		
			
				|  |  | -        youhua.value.probcrossover = Number(res.probcrossover);
 | 
	
		
			
				|  |  | -        youhua.value.probmut = Number(res.probmut);
 | 
	
		
			
				|  |  | -        youhua.value.probscale = Number(res.probscale);
 | 
	
		
			
				|  |  | -        youhua.value.proboperator = res.proboperator;
 | 
	
		
			
				|  |  | -        youhua.value.strategy = res.strategy;
 | 
	
		
			
				|  |  | -        youhua.value.operator = res.operator;
 | 
	
		
			
				|  |  | -        youhua.value.gpu = res.gpu;
 | 
	
		
			
				|  |  | +        cstid.value = res.cstid;
 | 
	
		
			
				|  |  | +        cstn.value = res.cstn;
 | 
	
		
			
				|  |  | +        cstvalue.value.uppern1 = res.uppern1;
 | 
	
		
			
				|  |  | +        cstvalue.value.lowern1 = res.lowern1;
 | 
	
		
			
				|  |  | +        cstvalue.value.uppern2 = res.uppern2;
 | 
	
		
			
				|  |  | +        cstvalue.value.lowern2 = res.lowern2;
 | 
	
		
			
				|  |  | +        // upperb.value = res.upperb;
 | 
	
		
			
				|  |  | +        // lowerb.value = res.lowerb;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        // 解析 upperb 和 lowerb
 | 
	
		
			
				|  |  | +        let upperbValues = res.upperb ? res.upperb.split(",") : [];
 | 
	
		
			
				|  |  | +        let lowerbValues = res.lowerb ? res.lowerb.split(",") : [];
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        tableDatacst.value.forEach((row, rowIndex) => {
 | 
	
		
			
				|  |  | +          if (rowIndex === 0) {
 | 
	
		
			
				|  |  | +            // 第一行赋值 upperb
 | 
	
		
			
				|  |  | +            tablecstHeaders.value.forEach((header, index) => {
 | 
	
		
			
				|  |  | +              if (index < upperbValues.length) {
 | 
	
		
			
				|  |  | +                row[header.prop] = upperbValues[index]; // 赋值对应列
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +          } else if (rowIndex === 1) {
 | 
	
		
			
				|  |  | +            // 第二行赋值 lowerb
 | 
	
		
			
				|  |  | +            tablecstHeaders.value.forEach((header, index) => {
 | 
	
		
			
				|  |  | +              if (index < lowerbValues.length) {
 | 
	
		
			
				|  |  | +                row[header.prop] = lowerbValues[index]; // 赋值对应列
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |          // youhua=res;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        } else {
 | 
	
	
		
			
				|  | @@ -177,6 +231,34 @@ const getcst = (id) => {
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +//cst 保存
 | 
	
		
			
				|  |  | +const getcstsave = () => {
 | 
	
		
			
				|  |  | +  getupperlower();
 | 
	
		
			
				|  |  | +  const params = {
 | 
	
		
			
				|  |  | +    transCode: 'MDO0041',
 | 
	
		
			
				|  |  | +    pid: pid.value,
 | 
	
		
			
				|  |  | +    cstn: cstn.value,
 | 
	
		
			
				|  |  | +    uppern1: cstvalue.value.uppern1,
 | 
	
		
			
				|  |  | +    lowern1: cstvalue.value.lowern1,
 | 
	
		
			
				|  |  | +    uppern2: cstvalue.value.uppern2,
 | 
	
		
			
				|  |  | +    lowern2: cstvalue.value.lowern2,
 | 
	
		
			
				|  |  | +    upperb: upperb.value,
 | 
	
		
			
				|  |  | +    lowerb: lowerb.value,
 | 
	
		
			
				|  |  | +    checked:1
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  request(params)
 | 
	
		
			
				|  |  | +    .then((res) => {
 | 
	
		
			
				|  |  | +      ElMessage({
 | 
	
		
			
				|  |  | +        message: res.returnMsg,
 | 
	
		
			
				|  |  | +        type: 'success',
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    .catch((err) => {
 | 
	
		
			
				|  |  | +      ElMessage.error(err.returnMsg)
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +defineExpose({getcst,getcstsave});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 |