8
0

5 Revīzijas f5e6cee25c ... df2747f6d7

Autors SHA1 Ziņojums Datums
  ximinghao df2747f6d7 Merge branch 'master' of http://47.103.92.60:3003/skyversation/qp_onemap_ui 1 nedēļu atpakaļ
  ximinghao 44e361d03d 类型数据适用缓存 1 nedēļu atpakaļ
  ximinghao 14ee90b672 提取配置项 1 nedēļu atpakaļ
  ximinghao 603b82f154 Merge branch 'master' of http://47.103.92.60:3003/skyversation/qp_onemap_ui 2 nedēļas atpakaļ
  ximinghao 074b35a1fa 优化一些页面布局 2 nedēļas atpakaļ
2 mainītis faili ar 75 papildinājumiem un 108 dzēšanām
  1. 3 2
      src/api/rwgl.js
  2. 72 106
      src/views/rwgl/Index.vue

+ 3 - 2
src/api/rwgl.js

@@ -6,8 +6,9 @@ import content from './content'
 
 const dmsPath = systemConfig.dmsDataProxy
 const multiSearch = dmsPath + "/content/multipleFormsOfJointInvestigation"
+const taskSearch = "oneMap/task/getTask"
 
-const taskDmsId = 1662
+const taskDmsId = systemConfig.columnIds[6]
 
 export function getCName(cName) {
     return resolveResult(content.getCategoryDetail({
@@ -31,7 +32,7 @@ export function getTasks(page, pageSize, name, status,type) {
         ]),
     }
 
-    return resolveDmsMultiTableResult(postform("oneMap/task/getTask", data));
+    return resolveDmsMultiTableResult(postform(taskSearch, data));
 }
 
 function getEqualChecker(value,param) {

+ 72 - 106
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>
@@ -265,7 +206,15 @@ export default {
   },
   methods: {
     async pullTaskStatus() {
-      this.taskStatus = (await getCName("task_status")).sort((a, b) => a.index - b.index);
+      let oData = this.$getDmsTypes("task_status");
+      let newData = [];
+      for (const key of Object.keys(oData)) {
+        newData.push({
+          index: Number(key),
+          name: oData[key]
+        })
+      }
+      this.taskStatus = newData.sort((a, b) => a.index - b.index);
     },
     changeTaskStatus(status) {
       if (status == null) {
@@ -301,7 +250,24 @@ export default {
       }
     },
     async pullTaskType() {
-      this.taskType = (await getCName("yzt_task_type")).sort((a, b) => a.index - b.index);
+      let oData = this.$getDmsTypes("yzt_task_type");
+      let newData = [];
+      for (const key of Object.keys(oData)) {
+        newData.push({
+          index: Number(key),
+          name: oData[key]
+        })
+      }
+      let taskType = newData.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 +312,7 @@ export default {
       this.taskData = res.data;
     },
     timeFormatter(time) {
-      if (time == null) return;
+      if (time == null) return "";
 
       let date = new Date(time);
 
@@ -357,7 +323,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 +413,7 @@ link {
   margin-left: 0;
   padding-left: 90px;
   padding-right: 90px;
-  min-height: 600px;
+  min-height: 80vh
 }
 
 .darkblue-background {
@@ -524,7 +489,8 @@ body {
 .left-row {
   justify-content: flex-start;
 }
-.left-row > * {
+
+.left-row>* {
   margin-right: 15px;
 }
 
@@ -546,8 +512,8 @@ body {
   flex-direction: column-reverse;
 }
 
-.dense-col > *,
-.start-reverse-col > * {
+.dense-col>*,
+.start-reverse-col>* {
   margin: 10px;
 }