Ver Fonte

优化一些页面布局

ximinghao há 2 semanas atrás
pai
commit
074b35a1fa
1 ficheiros alterados com 55 adições e 105 exclusões
  1. 55 105
      src/views/rwgl/Index.vue

+ 55 - 105
src/views/rwgl/Index.vue

@@ -4,53 +4,33 @@
       <div class="left-row">
         <div>
           <div>状态:</div>
-          <el-tag
-            size="large"
-            :effect="focusTaskStatus.includes('all') ? 'dark' : ''"
-            type="primary"
-            @click="changeTaskStatus()"
-          >
+          <el-tag size="large" :effect="focusTaskStatus.includes('all') ? 'dark' : ''" type="primary"
+            @click="changeTaskStatus()">
             全部
           </el-tag>
           <template v-for="status in taskStatus" :key="status.index">
-            <el-tag
-              size="large"
-              :effect="focusTaskStatus.includes(status.index) ? 'dark' : ''"
-              type="primary"
-              @click="changeTaskStatus(status)"
-            >
+            <el-tag size="large" :effect="focusTaskStatus.includes(status.index) ? 'dark' : ''" type="primary"
+              @click="changeTaskStatus(status)">
               {{ status.name }}
             </el-tag>
           </template>
         </div>
         <div>
           <div>类别:</div>
-          <el-tag
-            size="large"
-            :effect="focusTaskType.includes('all') ? 'dark' : ''"
-            type="primary"
-            @click="changeTaskType()"
-          >
+          <el-tag size="large" :effect="focusTaskType.includes('all') ? 'dark' : ''" type="primary"
+            @click="changeTaskType()">
             全部
           </el-tag>
           <template v-for="type in taskType" :key="type.index">
-            <el-tag
-              size="large"
-              :effect="focusTaskType.includes(type.index) ? 'dark' : ''"
-              type="primary"
-              @click="changeTaskType(type)"
-            >
+            <el-tag size="large" :effect="focusTaskType.includes(type.index) ? 'dark' : ''" type="primary"
+              @click="changeTaskType(type)">
               {{ type.name }}
             </el-tag>
           </template>
         </div>
       </div>
       <div class="row">
-        <el-input
-          class="searcher"
-          v-model="searcher"
-          placeholder="请输入任务名称相关关键字"
-        />
+        <el-input class="searcher" v-model="searcher" placeholder="请输入任务名称相关关键字" />
         <el-button type="primary" @click="pullTaskData(1)">搜索</el-button>
         <el-button type="primary" @click="reset(), pullTaskData(1)">重置</el-button>
       </div>
@@ -62,23 +42,16 @@
         <el-table-column prop="main_c_user_name" label="用户" />
         <el-table-column prop="main_c_state" label="类型">
           <template #default="scope">
-            <el-tag
-              effect="dark"
-              v-show="getType(scope.row.main_c_type) != null"
-              disable-transitions
-              >{{ getType(scope.row.main_c_type)?.name ?? "" }}
+            <el-tag effect="dark" v-show="getType(scope.row.main_c_type) != null" disable-transitions>{{
+              getType(scope.row.main_c_type)?.name ?? "" }}
             </el-tag>
           </template>
         </el-table-column>
         <el-table-column prop="main_c_state" label="状态">
           <template #default="scope">
-            <el-tag
-              effect="dark"
-              v-show="getStatus(scope.row.main_c_state) != null"
-              :type="statusStaticInfo[scope.row.main_c_state]?.tagType ?? ''"
-              disable-transitions
-              >{{ getStatus(scope.row.main_c_state)?.name ?? "" }}</el-tag
-            >
+            <el-tag effect="dark" v-show="getStatus(scope.row.main_c_state) != null"
+              :type="statusStaticInfo[scope.row.main_c_state]?.tagType ?? ''" disable-transitions>{{
+                getStatus(scope.row.main_c_state)?.name ?? "" }}</el-tag>
           </template>
         </el-table-column>
         <el-table-column prop="main_c_start_time" label="任务开始时间">
@@ -93,37 +66,26 @@
         </el-table-column>
         <el-table-column prop="main_c_file_name" label="结果">
           <template #default="scope">
-            <span
-              class="link"
-              v-if="scope.row.main_c_file != null && scope.row.main_c_file_name != null"
-              @click="downloadWithBlob(scope.row.main_c_file, scope.row.main_c_file_name)"
-            >
+            <span class="link" v-if="scope.row.main_c_file != null && scope.row.main_c_file_name != null"
+              @click="downloadWithBlob(scope.row.main_c_file, scope.row.main_c_file_name)">
               {{ scope.row.main_c_file_name }}
             </span>
           </template>
         </el-table-column>
         <el-table-column label="操作" width="360">
           <template #default="scope">
-            <el-button
-              type="primary"
-              @click="
-                () => {
-                  dialog = true;
-                  focusTask = scope.row;
-                }
-              "
-            >
+            <el-button type="primary" @click="
+              () => {
+                dialog = true;
+                focusTask = scope.row;
+              }
+            ">
               查看详情
             </el-button>
-            <template
-              v-if="scope.row.main_c_file != null && scope.row.main_c_file_name != null"
-            >
-              <el-button
-                type="primary"
-                @click="
-                  downloadWithBlob(scope.row.main_c_file, scope.row.main_c_file_name)
-                "
-              >
+            <template v-if="scope.row.main_c_file != null && scope.row.main_c_file_name != null">
+              <el-button type="primary" @click="
+                downloadWithBlob(scope.row.main_c_file, scope.row.main_c_file_name)
+                ">
                 下载结果
               </el-button>
               <el-button type="primary" @click="preView(scope.row.main_c_file)">
@@ -135,11 +97,7 @@
       </el-table>
       <div class="between-row">
         <div><!--empty div--></div>
-        <el-pagination
-          layout="prev, pager, next"
-          :total="taskNum"
-          @change="(page) => pullTaskData(page)"
-        />
+        <el-pagination layout="prev, pager, next" :total="taskNum" @change="(page) => pullTaskData(page)" />
       </div>
     </div>
     <el-dialog v-model="dialog" :show-close="true" width="750">
@@ -156,11 +114,8 @@
           {{ focusTask.main_c_comment }}
         </el-descriptions-item>
         <el-descriptions-item label="任务类型">
-          <el-tag
-            effect="dark"
-            v-show="getType(focusTask.main_c_type) != null"
-            disable-transitions
-            >{{ getType(focusTask.main_c_type)?.name ?? "" }}
+          <el-tag effect="dark" v-show="getType(focusTask.main_c_type) != null" disable-transitions>{{
+            getType(focusTask.main_c_type)?.name ?? "" }}
           </el-tag>
         </el-descriptions-item>
         <el-descriptions-item label="用户名">
@@ -170,11 +125,8 @@
           {{ focusTask.main_c_user_id }}
         </el-descriptions-item>
         <el-descriptions-item label="状态">
-          <el-tag
-            effect="dark"
-            :type="statusStaticInfo[focusTask.main_c_state]?.tagType ?? ''"
-            disable-transitions
-            >{{ getStatus(focusTask.main_c_state)?.name ?? "" }}
+          <el-tag effect="dark" :type="statusStaticInfo[focusTask.main_c_state]?.tagType ?? ''" disable-transitions>{{
+            getStatus(focusTask.main_c_state)?.name ?? "" }}
           </el-tag>
         </el-descriptions-item>
         <el-descriptions-item label="任务开始时间">
@@ -186,32 +138,21 @@
         <el-descriptions-item label="结果文件">
           {{ focusTask.main_c_file_name }}
 
-          <template
-            v-if="focusTask.main_c_file != null && focusTask.main_c_file_name != null"
-          >
-            <el-button
-              type="primary"
-              size="small"
-              @click="downloadWithBlob(focusTask.main_c_file, focusTask.main_c_file_name)"
-            >
+          <template v-if="focusTask.main_c_file != null && focusTask.main_c_file_name != null">
+            <el-button type="primary" size="small"
+              @click="downloadWithBlob(focusTask.main_c_file, focusTask.main_c_file_name)">
               下载结果
             </el-button>
-            <el-button
-              type="primary"
-              size="small"
-              @click="preView(focusTask.main_c_file)"
-            >
+            <el-button type="primary" size="small" @click="preView(focusTask.main_c_file)">
               预览结果
             </el-button>
           </template>
         </el-descriptions-item>
         <el-descriptions-item label="原始数据">
-          <template
-            v-if="
-              focusTask.main_c_source_file_name != null &&
-              focusTask.main_c_source_file != null
-            "
-          >
+          <template v-if="
+            focusTask.main_c_source_file_name != null &&
+            focusTask.main_c_source_file != null
+          ">
             {{ focusTask.main_c_source_file_name }}
             <br />
           </template>
@@ -301,7 +242,16 @@ export default {
       }
     },
     async pullTaskType() {
-      this.taskType = (await getCName("yzt_task_type")).sort((a, b) => a.index - b.index);
+      let taskType = (await getCName("yzt_task_type")).sort((a, b) => a.index - b.index);
+      for (let i = 0; i < taskType.length; i++) {
+        const e = taskType[i]; 
+        if (e.index === 100) { 
+          const otherItem = taskType.splice(i, 1)[0];
+          taskType.push(otherItem);
+          break; 
+        }
+      }
+      this.taskType = taskType
     },
     changeTaskType(types) {
       if (types == null) {
@@ -346,7 +296,7 @@ export default {
       this.taskData = res.data;
     },
     timeFormatter(time) {
-      if (time == null) return;
+      if (time == null) return "";
 
       let date = new Date(time);
 
@@ -357,7 +307,6 @@ export default {
         const response = await fetch(systemConfig.dmsDataProxy + url);
         const blob = await response.blob();
         const blobUrl = window.URL.createObjectURL(blob);
-
         const link = document.createElement("a");
         link.href = blobUrl;
         link.download = filename || "file";
@@ -448,7 +397,7 @@ link {
   margin-left: 0;
   padding-left: 90px;
   padding-right: 90px;
-  min-height: 600px;
+  min-height: 80vh
 }
 
 .darkblue-background {
@@ -524,7 +473,8 @@ body {
 .left-row {
   justify-content: flex-start;
 }
-.left-row > * {
+
+.left-row>* {
   margin-right: 15px;
 }
 
@@ -546,8 +496,8 @@ body {
   flex-direction: column-reverse;
 }
 
-.dense-col > *,
-.start-reverse-col > * {
+.dense-col>*,
+.start-reverse-col>* {
   margin: 10px;
 }