Hua 3 luni în urmă
părinte
comite
f5ab92fcb1

+ 7 - 0
ruoyi-ui/src/api/service/info.js

@@ -273,4 +273,11 @@ export function delTask(id) {
     url: '/flow/dispatch/' + id,
     method: 'delete'
   })
+}
+export function getBatchDataTable(query) {
+  return request({
+    url: "/flow/dispatch/getBatchDataTable",
+    method: "get",
+    params: query,
+  });
 }

+ 100 - 26
ruoyi-ui/src/views/dpp/calculateDev/index.vue

@@ -65,11 +65,12 @@
     <el-tabs
       v-model="activeName"
       type="card"
+      
       class="demo-tabs"
       style="margin-left: 1%;width: 84%;"
-      @tab-click="handleClick"
+      @tab-click="getTaskReturn"
     >
-      <el-tab-pane label="任务详情" name="first">
+      <el-tab-pane :disabled="!parMdid" label="任务详情" name="first">
         <el-button :disabled="!parMdid" @click="addTask" style="margin-top: 0%;margin-right: 1%;float:right;" type="primary" size="mini" plain>新增</el-button>
         <div style="width: 100%;margin-left: 0%;padding-top: 0%;" class="tab-container">
         <div>
@@ -108,7 +109,7 @@
             </el-table-column>
           </el-table>
           <el-pagination
-            v-if="total>12"
+            v-if="total>20"
             small
             background
             style="margin-top: 0.8%;float: right;margin-right: 1%;"
@@ -455,7 +456,7 @@
         </el-dialog>
     </div>
       </el-tab-pane>
-      <el-tab-pane label="执行结果" name="second">
+      <el-tab-pane label="执行结果" name="second" :disabled="!parMdid">
         <div style="display: flex;width: 98%;align-items: center;margin-left: 1%;">
             <!-- <div>
                 组名称
@@ -481,19 +482,24 @@
                 状态
             </div>
             <el-select
-            v-model="jobStatus"
+            v-model="taskBatchStatus"
             class="noBorSel"
             placeholder=""
             style="width: 10%;margin-left: 1%;"
             >
-                <el-option label="启用" :value="0" />
-                <el-option label="禁用" :value="1" />
+                <el-option label="待处理" :value="1" />
+                <el-option label="运行中" :value="2" />
+                <el-option label="处理成功" :value="3" />
+                <el-option label="处理失败" :value="4" />
+                <el-option label="任务停止" :value="5" />
+                <el-option label="取消" :value="6" />
+
             </el-select>
             <!-- <el-button type="" @click="" size="mini" style="margin-left:auto;" :icon="RefreshRight">重置 </el-button> -->
-            <el-button type="primary" @click="getTable" size="mini" style="margin-left:auto;" :icon="Search">搜索 </el-button>
+            <el-button type="primary" @click="getTaskReturn" size="mini" style="margin-left:auto;" :icon="Search">搜索 </el-button>
         </div>
         <el-table 
-          :data="tableData" 
+          :data="tableDataDatareturn" 
           style="width: 98%;margin-left: 1%;margin-top: 1.5%;;height: 73vh;"
           :cell-style="{ padding:'5px' }"
           :header-cell-style="{height: heightAll*0.01+'px',}"
@@ -506,36 +512,65 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="name" label="任务名称"  width="200">
-            <template #default="scope">
-              <div style="color: #409EFF;cursor: pointer;" @click="showDe(scope.row)">
-                {{scope.row.name}}
-              </div>
-            </template>
+          <el-table-column prop="jobName" label="任务名称"  width="200">
           </el-table-column>
-          <el-table-column prop="type" label="建模方案"  width="300">
-            </el-table-column>
-          <el-table-column prop="type" label="任务类型" >
+          <el-table-column prop="chargeBy" label="责任人" >
           </el-table-column>
-          <el-table-column prop="type" label="开始执行时间"  >
+          <el-table-column prop="taskType" label="任务类型" >
+            <template #default="scope">
+                <div style="display: flex;">
+                  <div v-if="scope.row.taskType===1">集群</div>
+                  <div v-else-if="scope.row.taskType===2">广播</div>
+                  <div v-else-if="scope.row.taskType===3">Sharding</div>
+                  <div v-else-if="scope.row.taskType===4">Map</div>
+                  <div v-else-if="scope.row.taskType===5">MapReduce</div>
+                </div>
+            </template>
           </el-table-column>
-          <el-table-column prop="type" label="执行时长(秒)"  >
+          <el-table-column prop="createDt" label="开始执行时间" width="220">
           </el-table-column>
-          <el-table-column prop="type" label="状态"  >
+          <el-table-column prop="executionAt" label="执行时长(秒)"  >
           </el-table-column>
-          <el-table-column prop="type" label="操作原因"  >
+          <el-table-column prop="taskBatchStatus" label="状态">
+            <template #default="scope">
+                <div style="display: flex;">
+                  <div v-if="scope.row.taskBatchStatus===1" style="color: #E6A23C;">待处理</div>
+                  <div v-else-if="scope.row.taskBatchStatus===2" style="color: #409EFF;">运行中</div>
+                  <div v-else-if="scope.row.taskBatchStatus===3" style="color: #67C23A;">处理成功</div>
+                  <div v-else-if="scope.row.taskBatchStatus===4" style="color: red;">处理失败</div>
+                  <div v-else-if="scope.row.taskBatchStatus===5" style="color: red;">任务停止</div>
+                  <div v-else-if="scope.row.taskBatchStatus===6" style="color: red;">取消</div>
+                </div>
+            </template>
           </el-table-column>
-          <el-table-column prop="type" label="创建时间" >
+          <el-table-column prop="operationReason" label="操作原因"  >
+            <template #default="scope">
+                <div style="display: flex;">
+                  <div v-if="scope.row.operationReason===0" style="color: red;">无</div>
+                  <div v-else-if="scope.row.operationReason===1" style="color: #409EFF;">有</div>
+                </div>
+            </template>
           </el-table-column>
-          <el-table-column prop="address" label="操作" width="150">
+          <!-- <el-table-column prop="address" label="操作" width="150">
               <template #default="scope">
                   <div style="display: flex;">
                     <el-button @click="getEdit(scope.row)" type="primary" text size="mini" style="margin-left: 0%;">编辑</el-button>
                     <el-button @click="delTaskDe(scope.row)" type="danger" text size="mini" style="margin-left: 0%;">删除</el-button>
                   </div>
               </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
+        <el-pagination
+          v-if="total1>20"
+          small
+          background
+          style="margin-top: 0.4%;float: right;margin-right: 1%;"
+          layout="prev, pager, next"
+          :total="total1"
+          v-model="pageNum1"
+          @change="changePage1"
+          class="mt-4"
+        />
       </el-tab-pane>
     </el-tabs>
     
@@ -546,7 +581,7 @@ import {getCatalog} from "@/api/service/catalog";
 import { Plus,Search,Filter,Promotion,Check  } from '@element-plus/icons-vue'
 import { reactive } from 'vue'
 import {getModellist} from '@/api/standardization/modeling'
-import { modelTreeSelect,getSerDe,addService,addServiceParam,delService,addTree,editTask,getDataRen,getTaskDe,delTask,flowDispatch } from "@/api/service/info";
+import { modelTreeSelect,getSerDe,addService,addServiceParam,delService,getBatchDataTable,editTask,getDataRen,getTaskDe,delTask,flowDispatch } from "@/api/service/info";
 import { ref, onMounted, onUnmounted, nextTick,onBeforeMount } from 'vue';
 import JsonViewer from 'vue-json-viewer'
 import 'vue-json-viewer/style.css' 
@@ -562,11 +597,16 @@ const JsonAdd= ref(JSON.stringify({ data: "初始值1" }))
 const exampleAdd = ref('')
 const dialogVisibleLevel = ref(false)
 const dialogVisibleDe = ref(false)
+const total1 = ref(0)
+const pageNum1 = ref(1)
 const detail = ref({
   name:'',
   rqtype:'',
   rptype:''
 })
+const createTime = ref([])
+const taskBatchStatus = ref('')
+const jobName = ref('')
 const tableDataLog = ref([])
 const show1Lev = ref(true)
 const inputNode =ref('')
@@ -638,6 +678,7 @@ const optionsRqtype = ref([
     value:'POST'
     },
 ])
+const tableDataDatareturn = ref([])
 const optionsType=  ref([
     {label:'RESTful',
     value:'RESTful'
@@ -813,6 +854,10 @@ async function changejobStatus(row){
     }
   })
 }
+function changePage1(val){
+  pageNum1.value = val
+  getTaskReturn()
+}
 function saveEdit(){
   formRefJi.value.validate((valid) => {
     if (valid) {
@@ -1038,6 +1083,35 @@ async function handleNodeClick(node,data,event){
       total.value = res.total
     }
   })
+  
+}
+function getAbsoluteTimeDifference(dateTimeString, otherTimestamp) {
+  // 将日期字符串转换为毫秒时间戳
+  const targetTimestamp = new Date(dateTimeString).getTime();
+  
+  // 计算与另一个时间戳的绝对差值
+  return Math.abs(targetTimestamp - otherTimestamp);
+}
+function getTaskReturn(){
+    var par = {
+      appId:parMdid.value,
+      pageNum:pageNum1.value,
+      pageSize:20,
+      jobName:jobName.value,
+      taskBatchStatus:taskBatchStatus.value,
+      beginTime:createTime.value.length>1?createTime.value[0]:'',
+      endTime:createTime.value.length>1?createTime.value[1]:''
+    }
+    getBatchDataTable(par).then(res=>{
+      if(res.rows){
+        tableDataDatareturn.value = res.rows
+        tableDataDatareturn.value.forEach(item=>{
+          item.type = titleTest.value
+          item.executionAt = getAbsoluteTimeDifference(item.createDt, item.executionAt)*0.001
+        })
+        total1.value = res.total
+      }
+    })
 }
 async function getTreeLeft(){
   var par = {

+ 1 - 1
ruoyi-ui/src/views/register/componentReg/index.vue

@@ -833,7 +833,7 @@ const dialogVisibleDetail = ref(true)
 const dialogVisible = ref(false)
 const dialogVisibleDe = ref(false)
 const dialogVisiblePei = ref(false)
-const active = ref(0)
+const active = ref(1)
 const isEdit = ref(true)
 const name = ref('')
 const isAdd = ref(true)