Explorar o código

fix:场景评价ruleid && 场景上传评价脚本字段取值

linchengzhe hai 1 ano
pai
achega
7fdc0ecd80

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 6 - 1607
src/views/demo.vue


+ 57 - 66
src/views/sceneLibrary/gradingRuleDetail.vue

@@ -121,7 +121,7 @@ export default {
         ruleDetails: '',
         ruleType: '',
         // scriptName: '',
-        localPath:'',
+        localPath: '',
       },
       ruleTypeDisabled: false,
       fileList: [], // 文件上传列表
@@ -149,83 +149,74 @@ export default {
       this.scriptUpdate = true
     },
     save(isAdd) {
-      let ruleDetails = null
+      if (this.isScore) {
+        this.saveFn()
+      } else {
+        let ruleDetails = null
 
-      if (!this.isScore) {
-        ruleDetails = this.$refs.editor.editor.getText().trim()
-        this.form.ruleDetails = ruleDetails
-      }
-      // 调用save时,应写成save(),给不给参数均可,不写小括号的话,isAdd会是事件源,则为true
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          if (!this.isScore && ruleDetails && ruleDetails.length > 1000000) {
-            this.$message.error('规则详情长度不得超过100万!')
-            return
-          }
+        if (!this.isScore) {
+          ruleDetails = this.$refs.editor.editor.getText().trim()
+          this.form.ruleDetails = ruleDetails
+        }
+        // 调用save时,应写成save(),给不给参数均可,不写小括号的话,isAdd会是事件源,则为true
+        this.$refs.form.validate((valid) => {
+          if (valid) {
+            if (!this.isScore && ruleDetails && ruleDetails.length > 1000000) {
+              this.$message.error('规则详情长度不得超过100万!')
+              return
+            }
 
-          if (isAdd || !this.$route.query.rulesId) {
-            // 另存为或新增页面
-            this.form.rulesId = ''
-            this.form.share = '0'
-          }
+            if (isAdd || !this.$route.query.rulesId) {
+              // 另存为或新增页面
+              this.form.rulesId = ''
+              this.form.share = '0'
+            }
 
-          if (this.form.rulesId) {
-            this.$axios({
-              method: 'post',
-              url: this.$api.sceneLibrary.queryCsbById,
-              data: {
-                rulesId: this.form.rulesId,
-              },
-            }).then((res) => {
-              if (res.code === 200) {
-                if (res.info === 0) {
-                  this.saveFn()
-                  return
+            if (this.form.rulesId) {
+              this.$axios({
+                method: 'post',
+                url: this.$api.sceneLibrary.queryCsbById,
+                data: {
+                  rulesId: this.form.rulesId,
+                },
+              }).then((res) => {
+                if (res.code === 200) {
+                  if (res.info === 0) {
+                    this.saveFn()
+                    return
+                  }
+
+                  this.$confirm(
+                    '该评分规则已经被场景测试包引用,保存后同步更新场景测试包中的评分规则,是否确认保存?',
+                    '提示',
+                    {
+                      confirmButtonText: '确定',
+                      cancelButtonText: '取消',
+                      type: 'warning',
+                    }
+                  ).then(() => {
+                    this.saveFn()
+                  })
+                } else {
+                  this.$message.error(
+                    res.message || '获取该评分规则是否被场景测试包引用失败'
+                  )
                 }
+              })
+              return
+            }
 
-                this.$confirm(
-                  '该评分规则已经被场景测试包引用,保存后同步更新场景测试包中的评分规则,是否确认保存?',
-                  '提示',
-                  {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning',
-                  }
-                ).then(() => {
-                  this.saveFn()
-                })
-              } else {
-                this.$message.error(
-                  res.message || '获取该评分规则是否被场景测试包引用失败'
-                )
-              }
-            })
-            return
+            this.saveFn()
           }
-
-          this.saveFn()
-        }
-      })
+        })
+      }
     },
     saveFn() {
       if (this.isScore) {
-        // let formData = new FormData()
-        // let source = { ...this.form }
-        // source['ruleId'] = source.rulesId
-        // delete source.rulesId
-        // const json = JSON.stringify({
-        //   ...source,
-        //   uploadNewFile: this.scriptUpdate,
-        // })
-        // const blob = new Blob([json], {
-        //   type: 'application/json',
-        // })
-        // formData.append('content', blob)
-        // this.scriptUpdate && formData.append('file', this.fileList[0])
         this.$axios({
           method: 'post',
           url: this.$api.sceneLibrary.queryScoringRulesInfo,
-          data: {...this.form,scriptUpdate:true},
+          data: { ...this.form,ruleId:this.form.rulesId, uploadNewFile: true },
           withCredentials: true,
           headers: {
             'Content-type': 'application/json',

+ 1 - 1
src/views/systemManagement/sceneUploadList.vue

@@ -393,7 +393,7 @@ export default {
           sceneEvaluationType: ["1"]},
       }).then(res=>{
         const arr = (res.info[1] || []).map(item=>{
-          item.label = item.scriptName
+          item.label = item.ruleName
           item.value = item.ruleId
           return item
         })

+ 10 - 1
src/views/workManagement/projectInfo.vue

@@ -143,7 +143,16 @@
                                 仿真云测试报告
                             </div>
                         </div>
-                        <button @click="jumpReport">跳转</button>
+                        <div v-if="info.reportForReferenceLib"  class="cbox" @click="jumpReport" style="margin-left: 20px">
+                            <img src="../../assets/common/image/others/hasDoc.png" width="100%" v-bind:class="{
+                                cursor: true,
+                            }" />
+                            <div v-bind:class="{
+                                cursor: true,
+                            }">
+                                标准化测试报告
+                            </div>
+                        </div>
                     </div>
                 </div>
             </div>

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio