8
0

3 Коммиты 68fb494094 ... 4725cc2c79

Автор SHA1 Сообщение Дата
  ximinghao 4725cc2c79 Merge branch 'master' of http://47.103.92.60:3003/skyversation/qp_onemap_ui 3 недель назад
  ximinghao d089a3d99b 添加一个导航项 3 недель назад
  ximinghao 5ea415c2b9 适配task新字段 3 недель назад
2 измененных файлов с 109 добавлено и 14 удалено
  1. 1 1
      src/api/count.js
  2. 108 13
      src/views/rwgl/Index.vue

+ 1 - 1
src/api/count.js

@@ -6,7 +6,7 @@ const dmsPath = systemConfig.dmsDataProxy
 
 const oauthPath = systemConfig.oauthServiceUrl
 
-const multiSearch = "http://127.0.0.1:10081/dms" + "/content/multipleFormsOfJointInvestigation"
+const multiSearch = dmsPath + "/content/multipleFormsOfJointInvestigation"
 
 const oauthCountUser = oauthPath + "/user/countUser"
 const oauthCountPermission = oauthPath + "/permission/countPermission"

+ 108 - 13
src/views/rwgl/Index.vue

@@ -9,8 +9,8 @@
                         全部
                     </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>
@@ -19,14 +19,14 @@
             <div class="row">
                 <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>
+                <el-button type="primary" @click="reset(), pullTaskData(1)">重置</el-button>
             </div>
         </div>
         <div class="lighter-container">
             查询到{{ taskNum }}条任务
-            <el-table table-layout="fixed" :data="taskData" class="table">
+            <el-table table-layout="fixed" row-key="main_id" :data="taskData" class="table">
                 <el-table-column prop="main_c_name" label="名称" />
-                <el-table-column prop="main_c_comment" label="描述" />
+                <el-table-column prop="main_c_user_name" label="用户" />
                 <el-table-column prop="main_c_state" label="状态">
                     <template #default="scope">
                         <el-tag effect="dark" :type="statusStaticInfo[scope.row.main_c_state]?.tagType ?? ''"
@@ -54,9 +54,9 @@
                 </el-table-column>
                 <el-table-column label="操作" width="360">
                     <template #default="scope">
-                        <!-- <el-button  type="primary">
+                        <el-button type="primary" @click="() => { dialog = true; focusTask = scope.row }">
                             查看详情
-                        </el-button> -->
+                        </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)">
@@ -72,9 +72,74 @@
             </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">
+            <template #header>
+                <div class="my-header">
+                    <span class="second-title">{{ focusTask.main_c_name }}</span>
+                </div>
+            </template>
+            <el-descriptions class="margin-top" label-width="128" :column="1" border>
+                <el-descriptions-item label="任务名称">
+                    {{ focusTask.main_c_name }}
+                </el-descriptions-item>
+                <el-descriptions-item label="任务描述">
+                    {{ focusTask.main_c_comment }}
+                </el-descriptions-item>
+                <el-descriptions-item label="用户名">
+                    {{ focusTask.main_c_user_name }}
+                </el-descriptions-item>
+                <el-descriptions-item label="用户id">
+                    {{ 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>
+                </el-descriptions-item>
+                <el-descriptions-item label="任务开始时间">
+                    {{ timeFormatter(focusTask.main_c_start_time) }}
+                </el-descriptions-item>
+                <el-descriptions-item label="任务结束时间">
+                    {{ timeFormatter(focusTask.main_c_end_time) }}
+                </el-descriptions-item>
+                <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)">
+                            下载结果
+                        </el-button>
+                        <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">
+                        {{ focusTask.main_c_source_file_name }}
+                        <el-button type="primary" size="small"
+                            @click="downloadWithBlob(focusTask.main_c_source_file, focusTask.main_c_source_file_name)">
+                            下载结果
+                        </el-button>
+                        <el-button type="primary" size="small" @click="preView(focusTask.main_c_source_file)">
+                            预览结果
+                        </el-button>
+                        <br />
+                    </template>
+                    <template v-if="focusTask.main_c_source_data != null">
+                        <div class="hide-scrollbar long-text">
+
+                            {{ truncateText(focusTask.main_c_source_data, 10000) }}
+                        </div>
+                    </template>
+                </el-descriptions-item>
+            </el-descriptions>
+        </el-dialog>
     </div>
 </template>
 
@@ -103,6 +168,8 @@ export default {
                     tagType: "danger"
                 },
             },
+            focusTask: {},
+            dialog: false,
             page: 1
         }
     },
@@ -140,7 +207,7 @@ export default {
             }
         },
         async pullTaskData(page) {
-            if(page!=null)this.page = page
+            if (page != null) this.page = page
             let res = await getTasks(this.page, 10, this.searcher, this.getCheckedStatus())
             this.taskNum = res.count
             this.taskData = res.data
@@ -154,7 +221,10 @@ export default {
             }
         },
         timeFormatter(time) {
+            if(time==null) return;
+            
             let date = new Date(time)
+            
             return date.toLocaleString()
         },
         async downloadWithBlob(url, filename) {
@@ -174,13 +244,20 @@ export default {
                 console.error('下载失败:', error);
             }
         },
-        reset(){
-            this.focusTaskStatus= ["all"]
+        reset() {
+            this.focusTaskStatus = ["all"]
             this.searcher = ""
         },
-        preView(url){
-            window.open("fileView?url="+systemConfig.dmsDataProxy+url,'_blank')
+        preView(url) {
+            window.open("fileView?url=" + systemConfig.dmsDataProxy + url, '_blank')
+        },
+        truncateText(text, maxLength = 40) {
+            if (typeof text !== 'string' || text.length <= maxLength) {
+                return text;
+            }
+            return text.substring(0, maxLength) + '…';
         }
+
     }
 }
 </script>
@@ -210,6 +287,24 @@ link {
     color: #fff;
 }
 
+.hide-scrollbar {
+    -ms-overflow-style: none;
+    /* IE和Edge */
+    scrollbar-width: none;
+    /* Firefox */
+}
+
+.hide-scrollbar::-webkit-scrollbar {
+    display: none;
+    /* Chrome, Safari和Opera */
+}
+
+.long-text {
+    width: 100%;
+    height: 200px;
+    overflow: scroll;
+}
+
 .icon {
     color: #fff;
     fill: currentColor;