ソースを参照

增加用例选项

郭超 3 年 前
コミット
4ec23b0b45
2 ファイル変更24 行追加1 行削除
  1. 14 1
      src/components/task/Task.vue
  2. 10 0
      src/components/task/TaskCreate.vue

+ 14 - 1
src/components/task/Task.vue

@@ -53,6 +53,14 @@
               <span v-if="!isModifyMode">{{ task.endPoint.collaborativeType ? '非协同' : '协同' }}</span>
             </el-form-item>
 
+            <el-form-item label="用例生成" prop="needTestcase" style="width:700px;">
+              <el-radio-group v-model="task.needTestcase" v-if="isModifyMode" @change="$forceUpdate()">
+                <el-radio :label="0">否</el-radio>
+                <el-radio :label="1">是</el-radio>
+              </el-radio-group>
+              <span v-if="!isModifyMode">{{ task.needTestcase ? '是' : '否' }}</span>
+            </el-form-item>
+
             <el-form-item label="任务可见性" prop="resource">
               <div v-if="!isModifyMode">
                 <!--<div v-if="task.resource=='1'">{{updateLocation(task.location)}}</div>-->
@@ -382,6 +390,7 @@ export default {
         desc: '',
         serviceType: '',
         resource: '',
+        needTestcase: '',
         location: {},
         institution: 0,
         datetime: '',
@@ -451,6 +460,7 @@ export default {
             }, trigger: 'blur'
           },
         ],
+        needTestcase: [{required: true, message: '请选择是否需要自动生成测试用例', trigger: 'blur'}],
 
         'endPoint.threePageUrl': [
           {
@@ -698,6 +708,7 @@ export default {
       this.task.institution = res.crowdTaskVO.institution
       this.task.datetime = new Date(res.crowdTaskVO.datetime)
       this.task.quotePrice = res.crowdTaskVO.quotePrice
+      this.task.needTestcase = res.crowdTaskVO.needTestcase
       this.task.agencyName = res.crowdTaskVO.agencyName
       this.task.acceptedPassword = res.crowdTaskVO.acceptedPassword
       this.task.acceptedCount = res.crowdTaskVO.acceptedCount
@@ -782,13 +793,14 @@ export default {
             location: this.task.location == null ? {} : getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
             institution: this.task.institution ? this.task.institution : null,
             datetime: this.task.datetime,
+            needTestcase: this.task.needTestcase,
             quotePrice: this.task.quotePrice,
             fixedPrice: this.task.fixedPrice,
             requirementFile: this.task.requireDocUrl,
             participantCount: this.task.participantCount,
             endPoint: this.task.endPoint
           }
-          //console.log(newTask)
+          console.log(newTask)
           updateTask(this.projectId, this.taskId, newTask, this.updateTaskSuccess, this.updateTaskFail)
         } else {
           notify('error', '表单填写有误!')
@@ -807,6 +819,7 @@ export default {
       this.task.title = res.crowdTaskVO.title
       this.task.description = res.crowdTaskVO.description
       this.task.serviceType = res.crowdTaskVO.serviceType
+      this.task.needTestcase = res.crowdTaskVO.needTestcase
       this.task.resource = res.crowdTaskVO.resource.toString()
       this.task.location = res.crowdTaskVO.location == null ? {
         provinceCode: 3200,

+ 10 - 0
src/components/task/TaskCreate.vue

@@ -35,6 +35,13 @@
           </el-radio-group>
         </el-form-item>
 
+        <el-form-item label="用例生成" prop="needTestcase" style="width:700px;">
+          <el-radio-group v-model="task.needTestcase">
+            <el-radio :label="0">否</el-radio>
+            <el-radio :label="1">是</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
         <el-form-item label="任务可见性" prop="resource" style="width:1000px;">
           <el-tabs :tab-position="tabPosition" v-model="task.resource">
             <el-tab-pane v-if="currType.type==0" :label="resourceType[0]" name="0">
@@ -181,6 +188,7 @@ export default {
         resource: '', //如果是广场不用管Location和institution ,定向看institution,区域看location
         // location: {provinceCode: '3200', cityCode: '3201'},
         institution: '',
+        needTestcase: '',
         datetime: '',
         quotePrice: '',
         fixedPrice: '',
@@ -228,6 +236,7 @@ export default {
           {required: true, message: '测试类型不可为空'},
         ],
         desc: [{required: true, message: '请填写描述', trigger: 'blur'}],
+        needTestcase: [{required: true, message: '请选择是否自动生成测试用例', trigger: 'blur'}],
 
         'endPoint.threePageUrl': [
           {
@@ -361,6 +370,7 @@ export default {
             name: this.task.name,
             desc: this.task.desc,
             type: this.task.type,
+            needTestcase: this.task.needTestcase,
             resource: this.task.resource,
             // location: this.task.resource == '0' ? getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode):null,
             institution: this.task.resource == '0' ? this.task.institution.id : null,