فهرست منبع

vue 20241219 训练任务 修改

贾小兵 5 ماه پیش
والد
کامیت
05f6b4708d
2فایلهای تغییر یافته به همراه46 افزوده شده و 24 حذف شده
  1. 11 0
      ruoyi-ui/src/api/sim/sim.js
  2. 35 24
      ruoyi-ui/src/views/peoples/task/index.vue

+ 11 - 0
ruoyi-ui/src/api/sim/sim.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+// 查询教师列表
+export function listSim(query) {
+  return request({
+    url: '/sim/sim/list',
+    method: 'get',
+    params: query
+  })
+}
+

+ 35 - 24
ruoyi-ui/src/views/peoples/task/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-row>
       <!--用户数据-->
-        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
           <el-form-item label="任务名称" prop="userName">
             <el-input
               v-model="queryParams.userName"
@@ -12,15 +12,23 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="型号" prop="userName">
-            <el-input
-              v-model="queryParams.userName"
-              placeholder="请输入模拟器型号"
+          <el-form-item label="模拟器型号" prop="simType">
+            <el-select
+              v-model="queryParams.simType"
+              placeholder="模拟器型号"
               clearable
-              style="width: 200px"
+              style="width: 240px"
               @keyup.enter.native="handleQuery"
-            />
+            >
+              <el-option
+                v-for="dict in dict.type.sim_sim_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
           </el-form-item>
+
           <el-form-item label="创建时间">
             <el-date-picker
               v-model="dateRange"
@@ -105,7 +113,12 @@
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column label="编号" align="center" key="taskId" prop="taskId" v-if="columns[0].visible" />
           <el-table-column label="任务名称" align="center" key="name" prop="name" v-if="columns[1].visible" :show-overflow-tooltip="true" />
-          <el-table-column label="模拟器型号" align="center" key="simType" prop="simType" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+          <el-table-column label="模拟器型号" align="center" key="simType" prop="simType" v-if="columns[2].visible" :show-overflow-tooltip="true" >
+            <template slot-scope="scope">
+                <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.simType"/>
+            </template>
+          </el-table-column>
+
           <el-table-column label="故障现象数量" align="center" key="xianxiang" prop="xianxiang" v-if="columns[3].visible" :show-overflow-tooltip="true" />
           <el-table-column label="故障部位数量" align="center" key="buwei" prop="buwei" v-if="columns[4].visible" :show-overflow-tooltip="true" />
           <el-table-column label="创建者" align="center" key="createBy" prop="createBy" v-if="columns[5].visible" :show-overflow-tooltip="true" />
@@ -150,11 +163,11 @@
 
     <!-- 添加或修改用户配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="型号" prop="simType">
-              <el-select v-model="form.simType"  placeholder="请选择模拟器型号" @change="selectSimType">
+            <el-form-item label="模拟器型号" prop="simType">
+              <el-select v-model="form.simType"  placeholder="请选择模拟器型号" @change="selectSimType" style="width: 85%;">
                 <el-option
                   v-for="dict in dict.type.sim_sim_type"
                   :key="dict.value"
@@ -205,16 +218,16 @@
 
     <!-- 任务详情配置对话框 -->
     <el-dialog :title="title" :visible.sync="openview" width="70%" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="型号" prop="simType">
-              <el-select v-model="selectedEquip"  placeholder="请选择模拟器型号">
+            <el-form-item label="模拟器型号" prop="simType">
+              <el-select  v-model="form.simType" placeholder="请选择模拟器型号" style="width: 85%;" :disabled='true'>
                 <el-option
                   value="请选择"
                 >请选择</el-option>
                 <el-option
-                  v-for="dict in dict.type.sim_equip_type"
+                  v-for="dict in dict.type.sim_sim_type"
                   :key="dict.value"
                   :label="dict.label"
                   :value="dict.value"
@@ -223,17 +236,12 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="任务名称" prop="userName">
-              <el-input  placeholder="请输入任务名称" maxlength="30" />
+            <el-form-item label="任务名称" prop="name">
+              <el-input  placeholder="请输入任务名称" v-model="form.name" disabled/>
             </el-form-item>
           </el-col>
-          <div style="text-align: right;">
-            <el-button @click="toggleSelection(tableData)">选择全部</el-button>
-            <el-button @click="toggleSelection()">取消选择</el-button>
-          </div>
         </el-row>
 
-
         <el-table
           :data="tableData" border ref="multipleTable" @selection-change="handleSelectionRow"
           :span-method="objectSpanMethod"
@@ -257,7 +265,6 @@
         </el-table>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -2591,6 +2598,7 @@ export default {
         arr['name'] = '1.电源开关';
         console.log(arr);
         console.log(JSON.stringify(arr));
+        console.log('JSON.stringify(arr)');
         this.tableData = arr;
       });
 
@@ -2751,6 +2759,7 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
+      this.openview = false;
       this.zijianopen = false;
       this.reset();
     },
@@ -2760,6 +2769,7 @@ export default {
         taskId: undefined,
         name: undefined,
         simType:undefined,
+        taskType:1,
         // postIds: [],
         // roleIds: []
       };
@@ -2834,7 +2844,7 @@ export default {
     handleView(row) {
       this.reset();
       const taskId = row.taskId || this.ids;
-      getUser(taskId).then(response => {
+      getTask(taskId).then(response => {
         this.form = response.data;
         this.openview = true;
         this.title = "任务详情";
@@ -2851,6 +2861,7 @@ export default {
               this.getList();
             });
           } else {
+            console.log(this.form);
             addTask(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;