From e4c84d44e70e09ec6d69716bd6c722a953f980da Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 25 九月 2025 20:31:28 +0800
Subject: [PATCH] 顶部提示0时隐藏,工控网任务页面

---
 src/views/tasks/machinereturnfileop.vue  |   22 ++
 src/views/dataex/programonmachineimp.vue |    2 
 src/page/index/top/top-menu.vue          |   32 +---
 src/views/tasks/machinebacktask.vue      |  285 ++++++++++++++++++++++++++++++++++++++++
 src/views/tasks/machinereturnfiles.vue   |    2 
 src/views/dataex/mdmprogramimp.vue       |    2 
 src/views/wel/shemi.vue                  |    4 
 src/views/wel/gongkong.vue               |   71 +++++++++
 8 files changed, 381 insertions(+), 39 deletions(-)

diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index 9f84e01..a1c65b7 100644
--- a/src/page/index/top/top-menu.vue
+++ b/src/page/index/top/top-menu.vue
@@ -1,20 +1,18 @@
 <template>
   <el-menu class="top-menu" :default-active="activeIndex" mode="horizontal" text-color="#333">
-    <el-menu-item index="0" @click="openHome(itemHome)">
+    <el-menu-item index="0"  @click="openHome(itemHome)">
       <template #title>
         <i :class="itemHome.source" style="padding-right: 5px"></i>
         <span>{{ itemHome.name }}</span>
       </template>
     </el-menu-item>
 
-    <el-menu-item index="0" @click="openTodo(itemHome)">
+    <el-menu-item index="1"  @click="openTodo(itemHome)">
       
       <template #title>
-           
-               
            <el-dropdown>
             <span class="el-dropdown-link">
-                 <el-badge ref="topbadge" :value="remindCount" :max="99" :offset="[10, 0]" :class="{'blink-badge':this.remindCount>0}">
+                 <el-badge ref="topbadge" v-if="this.remindCount>0" :value="remindCount" :max="99" :offset="[10, 0]" :class="{'blink-badge':this.remindCount>0}">
                     <el-tooltip
                     class="box-item"
                     effect="dark"
@@ -26,27 +24,14 @@
                   </el-badge>
               </span>
               <template #dropdown>
-                <el-dropdown-menu>
-
-                  <el-dropdown-item v-for="item in remindItems" @click.native="handleRemindClick(item)">{{item.text}}</el-dropdown-item>
-
-                </el-dropdown-menu>
+                <el-dropdown-menu  v-if="this.remindCount>0">
+                    <el-dropdown-item v-for="item in remindItems" @click.native="handleRemindClick(item)">{{item.text}}</el-dropdown-item>
+                  </el-dropdown-menu>
               </template>
              
             </el-dropdown>
+       
       </template>
-      <!--
-      <el-dropdown>
-        <template #dropdown>
-          <el-dropdown-menu>
-            <el-dropdown-item>Action 1</el-dropdown-item>
-            <el-dropdown-item>Action 2</el-dropdown-item>
-          </el-dropdown-menu>
-        </template>
-      </el-dropdown>
-    -->
-
-
     </el-menu-item>
 
     <template v-for="(item, index) in items" :key="index">
@@ -130,8 +115,9 @@
       }
     },
     openTodo() {
+      if(this.remindCount>0){
         this.$router.push({ path: '/flow/todoindex' });
-        //this.box = false;
+      } 
     },
     
     getCount() {
diff --git a/src/views/dataex/mdmprogramimp.vue b/src/views/dataex/mdmprogramimp.vue
index 4746303..2adcbda 100644
--- a/src/views/dataex/mdmprogramimp.vue
+++ b/src/views/dataex/mdmprogramimp.vue
@@ -12,7 +12,7 @@
         <div style="display: flex;">
           <el-button type="primary" size="default" icon="el-icon-upload" @click="importData">瀵煎叆</el-button>
           <el-button type="warning" size="default" icon="el-icon-delete" @click="clearList">娓呯┖</el-button>
-          <el-button type="primary" size="default" icon="el-icon-check" plain @click="handleWarehouse" style="margin-left: 12px;">涓嬩紶</el-button>
+          <el-button type="primary" size="default" icon="el-icon-check" :disabled="selection.length==0" plain @click="handleWarehouse" style="margin-left: 12px;">涓嬩紶</el-button>
         </div>
       </template>
     </avue-crud>
diff --git a/src/views/dataex/programonmachineimp.vue b/src/views/dataex/programonmachineimp.vue
index 0134a3a..3a12724 100644
--- a/src/views/dataex/programonmachineimp.vue
+++ b/src/views/dataex/programonmachineimp.vue
@@ -15,7 +15,7 @@
                 <el-button type="primary" size="default" icon="el-icon-circle-plus" @click="importData">瀵煎叆</el-button>
             </template>
         </avue-crud>
-        <el-dialog title="瀵煎叆鐜板満缂栧埗璁板綍" append-to-body v-model="excelBox" width="305px">
+        <el-dialog title="瀵煎叆鐜板満缂栧埗璁板綍" append-to-body v-model="excelBox" width="350px">
           <avue-form :option="formOption" v-model="form" :upload-after="uploadAfter">
           </avue-form>
     </el-dialog>
diff --git a/src/views/tasks/machinebacktask.vue b/src/views/tasks/machinebacktask.vue
new file mode 100644
index 0000000..696da71
--- /dev/null
+++ b/src/views/tasks/machinebacktask.vue
@@ -0,0 +1,285 @@
+<template>
+  <basic-container>
+    <avue-crud
+      :addBtn="false"
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      ref="crud"
+      v-model:search="search"
+      v-model:page="mypage"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @selection-change="selectionChange"
+      @on-load="onLoad"
+    >
+      <template #menu-left>
+        <!-- el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button> 
+        <el-button type="primary" v-if="this.search.dirType!='REC'" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">鎺ユ敹宸查��</el-button>
+-->
+      </template>
+      <!--
+      <template #menu="scope">
+        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
+        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-add" @click.stop="acceptBtn(scope.row, scope.index)">鎺ユ敹</el-button>
+      </template>
+      -->
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { ElMessage } from 'element-plus';
+import { exportBlob } from '@/api/common';
+import { downloadXls ,getQueryString} from '@/utils/util';
+
+import { getToken } from '@/utils/auth';
+import NProgress from 'nprogress';
+import 'nprogress/nprogress.css';
+export default {
+  data() {
+    return {
+      selection: [],
+      search: {
+        status: 1, //榛樿鏈畬鎴�
+        machineCode: "",
+      },
+      loading: true,
+      treeData: [],
+      
+      mypage: {
+        size: 10,
+        current: 1,
+        total: 0,
+      },
+      option: {
+        //size:'small',
+        index: true,
+        //selection: true,
+        //selectionWidth:30,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        labelWidth: 120,
+        emptyBtn: false,
+        searchLabelWidth: "80",
+        searchSpan: 4,
+        menu:false,
+        width:'100%',
+        column: [
+		    {
+            label: '绋嬪簭鍚嶇О',
+            prop: 'programName',
+            search:true,
+            searchSpan:6,
+            showOverflowTooltip:true,
+          },
+          {
+            label: '鏈哄簥缂栧彿',
+            prop: 'machineCode',
+            search:true,
+            searchSpan:6,
+            showOverflowTooltip:true,
+          },
+          {
+            label: '涓存椂鏇存敼鍗�',
+            prop: 'deviation',
+          },
+          /*{
+            label: '涓存椂鏇存敼鍗曞簭鍙�',
+            prop: 'deviationSerial',
+          },*/
+          {
+            label: '绋嬪簭娈垫暟',
+            prop: 'segCount',
+            render: ({ row,value }) => {
+              return row.segCount == 0 ?'鏈畾':row.segCount;
+            }
+          },
+          
+          {
+            label: '浠诲姟鐘舵��',
+            prop: 'status',
+            search:true,
+            searchType:'select',
+            searchSpan:6,
+            dicData:[
+              {
+                label:'鏈畬鎴�',
+                value:1
+              },
+              {
+                label:'宸插畬鎴�',
+                value:2
+              }
+            ],
+            render: ({ row,value }) => {
+              var txt = '鏈煡';
+              switch(row.status){
+                case 1:
+                  txt = '鏈畬鎴�';
+                  break;
+                case 2:
+                  txt = '宸插畬鎴�';
+                  break;
+              }
+              return txt;
+            }
+          },
+          {
+            label: '涓嬪彂鏃堕棿',
+            prop: 'createTime',
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  methods: {
+    selectionChange(selection) {
+      this.selection = selection;
+    },
+
+    receiveAll() {
+      //鎺ユ敹绗﹀悎鏉′欢鐨勬墍鏈夋暟鎹�
+      this.$confirm('纭畾瑕佹帴鏀剁鍚堟潯浠剁殑鎵�鏈夋枃浠跺悧?', {  //鍚屾帴鏀舵帴鍙g浉鍚�
+        confirmButtonText: '鏄�',
+        cancelButtonText: '鍚�',
+        type: 'warning',
+      }).then(() => {
+        //璋冪敤鎺ュ彛
+        this.loading = true;
+        axios({
+          url: '/blade-mdm/machinefile/file/temp-accept-all',
+          method: 'post',
+          params: {}
+        }).then(
+          res => {
+            this.loading = false;
+            this.onLoad();
+          }
+        );
+      })
+    },
+
+    receiveBtn() {
+      if(this.selection.length == 0) {
+        ElMessage({message: '璇烽�夋嫨鏁版嵁',type: 'error'})
+      }
+      var ids = [];
+      this.selection.forEach(item=> {
+        ids.push(item.id);
+      })
+      this.$confirm('纭畾瑕佹帴鏀跺悧?', {  //鍚屾帴鏀舵帴鍙g浉鍚�
+        confirmButtonText: '鏄�',
+        cancelButtonText: '鍚�',
+        type: 'warning',
+      }).then(() => {
+        //璋冪敤鎺ュ彛
+        this.loading = true;
+        axios({
+          url: '/blade-mdm/machinefile/collect/temp-accept',
+          method: 'post',
+          params: {ids: ids.join(',')},
+        }).then(
+          res => {
+            this.loading = false;
+            this.onLoad();
+          }
+        );
+      })
+    },
+    
+    searchReset() {
+      //this.onLoad(this.mypage);
+    },
+    searchChange(params, done) {
+      this.mypage.current = 1;
+      this.onLoad();
+      done();
+    },
+    currentChange(current) {
+      this.mypage.current = current;
+      this.onLoad();
+    },
+    sizeChange(size) {
+      this.mypage.size = size;
+      this.onLoad();
+    },
+    refreshChange() {
+      
+    },
+    onLoad() {
+      this.loading = true;
+      var obj = {
+        programName: this.search.programName,
+        current: this.mypage.current,
+        size: this.mypage.size,
+        machineCode: this.search.machineCode,
+        status:this.search.status
+      }
+      //console.log('myupage',this.mypage)
+      axios({
+        url: '/blade-mdm/gkw/machinebacktask/page',
+        method: 'get',
+        params: obj,
+      }).then(
+        res => {
+          var screenHeight = window.innerHeight;
+          this.option.maxHeight = (screenHeight - 390) + 'px';
+          const data = res.data.data;
+          this.mypage.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+        },
+        error => {
+            
+        }
+      );
+
+    },
+    
+  },
+  mounted() {
+    
+  }
+};
+</script>
+<style lang="scss">
+.gongkongMain {
+  display: flex;
+  padding: 0px;
+  margin: 0px 7px 10px 7px;
+  background-color: #fff;
+  border-top: 1px solid #ccc;
+  > div {
+    padding: 12px;
+  }
+}
+.gongkongMain > div:nth-child(1) {
+  width:17%;
+  border-right: 1px solid #ccc;
+}
+.gongkongMain div:nth-child(2) {
+  flex: 1;
+}
+.paginationTree {
+  margin-top: 12px;
+  display: flex;
+  justify-content: flex-end;
+}
+/*
+.Avue-crud{
+  :deep(.el-table) {
+    .el-table__body-wrapper,
+    .el-table__fixed-body-wrapper {
+      max-height:calc(100vh - 630px)!important;
+      overflow-y: auto;
+    }
+  }
+}
+*/
+</style>
\ No newline at end of file
diff --git a/src/views/tasks/machinereturnfileop.vue b/src/views/tasks/machinereturnfileop.vue
index ea61970..b616e48 100644
--- a/src/views/tasks/machinereturnfileop.vue
+++ b/src/views/tasks/machinereturnfileop.vue
@@ -10,7 +10,7 @@
             @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
             @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange">
             <template #menu-left>
-                <el-button type="primary" :disabled="this.selectedList.length==0" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button>
+                <el-button type="primary" :disabled="this.selectedList.length==0" @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button>
                 <!--<el-button type="primary" plain @click="reassign">鎸傝浇杞﹀簥绋嬪簭搴�</el-button>-->
                 <el-button type="primary" :disabled="this.selectedList.length==0" plain @click="exportExcel">瀵煎嚭鍒癊XCEL</el-button>
             </template>
@@ -77,6 +77,18 @@
                         search:true,
                         type:'select',
                         searchSpan:4,
+                        render: ({ row,value }) => {
+                            var txt = '鏈煡';
+                            switch(row.status){
+                                case 1:
+                                    txt = '鏈鍑�';
+                                    break;
+                                case 2:
+                                    txt = '宸插鍑�';
+                                    break;
+                            }
+                            return txt;
+                        },
                         dicData:[
                             {
                                 label: '鏈鍑�',
@@ -98,14 +110,14 @@
                         render: ({ row,value }) => {
                             var txt = '鏈煡';
                             switch(row.programStatus){
-                                case 1:
+                                case 'SQ':
                                 txt = '璇曞垏';
                                 break;
-                                case 2:
+                                case 'GH':
                                 txt = '鍥哄寲';
                                 break;
-                                case 3:
-                                txt = '鍋忕';
+                                case 'LG':
+                                txt = '涓存椂鏇存敼鍗�';
                                 break;
                                 default:
                                 txt = '鏈煡';
diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
index 1cda364..b52aab9 100644
--- a/src/views/tasks/machinereturnfiles.vue
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -70,7 +70,7 @@
         total: 0,
       },
       option: {
-        size:'mini',
+        size:'small',
         index: true,
         selection: true,
         selectionWidth:30,
diff --git a/src/views/wel/gongkong.vue b/src/views/wel/gongkong.vue
index 1d39320..a96580d 100644
--- a/src/views/wel/gongkong.vue
+++ b/src/views/wel/gongkong.vue
@@ -39,12 +39,13 @@
         <el-table-column prop="name" label="鍚嶇О"/>
 		    <el-table-column prop="fileModifyTime" label="鍒涘缓鏃ユ湡"  width="160"/>
         <el-table-column prop="fileModifyTime" label="淇敼鏃ユ湡"   width="160"/>
-        <el-table-column prop="fileSizeDisplay" label="澶у皬" width="80"/>
+        <el-table-column prop="fileSizeDisplay" label="澶у皬" width="100"/>
         <el-table-column fixed="right" label="鎿嶄綔" min-width="110">
           <template #default="scope">
             <el-button link type="primary" size="small" @click="fileView(scope.row)">鏌ョ湅</el-button>
-            <el-button link type="primary" size="small" @click="fileEdit(scope.row)">缂栬緫</el-button>
-            <el-button type="primary" text size="small" @click.stop="viewHistory(scope.row, scope.index)">淇敼璁板綍</el-button>
+            <el-button link type="primary" v-if="scope.row.dirType!='PROGRAM'" size="small" @click="fileEdit(scope.row)">缂栬緫</el-button>
+            <el-button type="primary" v-if="scope.row.dirType!='PROGRAM'" text size="small" @click.stop="viewHistory(scope.row, scope.index)">淇敼璁板綍</el-button>
+            <el-button type="primary" v-if="scope.row.dirType=='REC'" text size="small" @click.stop="changeName(scope.row)">鏀瑰悕</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -80,12 +81,20 @@
             <code-diff :old-string="this.content1" :new-string="this.content2" output-format="side-by-side" :hideStat="true" :filename="codeDiffFileName1" :newFilename="codeDiffFileName2"/>
         </div>
     </el-drawer>
+
+    <el-dialog title="淇敼鏂囦欢鍚�" width="400" append-to-body v-model="changeNameModel">
+       <avue-form :option="changeNameOption" v-model="changeNameForm" @submit="changeNameSubmit">
+        
+       </avue-form>
+     
+    </el-dialog>
 </template>
 <script>
 import {
   getFileChangeList
 } from '@/api/wel/changehis';
 import { pageHeaderEmits } from 'element-plus';
+import qs from 'qs';
 export default {
   name: 'OrganizationTree',
   components: {},
@@ -96,6 +105,19 @@
       filterData: [], // 杩囨护鍚庣殑鏁版嵁
       activeNode: null,
 
+      changeNameModel:false,
+      changeNameForm : {},
+      changeNameOption:{
+        labelWidth:80,
+        size:'mini',
+        column:[
+          {
+            span:22,
+            label:'鏂囦欢鍚�',
+            prop:"name"
+          }
+        ]
+      },
       defaultKeys: [],
       fileOptionTitle: "",
       fileContent: "",
@@ -209,7 +231,11 @@
     },
     fileView(row) {
       this.fileOptionTitle = "鏌ョ湅";
-      this.getFileContent(row);
+      if(row.dirType != 'PROGRAM'){
+        this.getFileContent(row);
+      }else{
+        this.getProgramDirFileContent(row);
+      }
     },
     fileEdit(row) {
       this.fileOptionTitle = "缂栬緫";
@@ -217,12 +243,31 @@
       this.getFileContent(row);
     },
     viewHistory(row){
-      console.log(row);
       this.viewHisModel = true;
       this.queryHis.machineFileId = row.id;
       this.onLoadHis();
     },
 
+    changeName(row){
+      //alert(row.id)
+      this.changeNameForm.id = row.id;
+      this.changeNameForm.name = row.name;
+      this.changeNameModel = true;
+    },
+    changeNameSubmit(form,done){
+      axios.post('/blade-mdm/gkw/node/change-file-name',qs.stringify(form)).then(res=>{
+          if (res.data.code == 200) {
+            this.$message.success('鎿嶄綔鎴愬姛!');
+            this.changeNameModel = false;
+          } else {
+              this.$message({ type: 'error', message: res.data.msg });
+          }
+      }).catch(error => {
+          this.$message.error(res.data.msg );
+      });
+     
+       done();
+    },
     searchChangeHis(params, done) {
       let data = {}
       console.log(params)
@@ -252,7 +297,7 @@
     },
     hisCompare(row){
         //鏂囦欢姣斿
-        this.loading = true;
+      this.loading = true;
       axios({
         url: '/blade-mdm/gkw/node/his-compare',
         method: 'get',
@@ -282,6 +327,20 @@
         }
       );
     },
+    getProgramDirFileContent(row) {
+      this.loading = true;
+      axios({
+        url: '/blade-mdm/ossfile/file-content',
+        method: 'get',
+        params: {ossFileName:row.ossName},
+      }).then(
+        res => {
+          this.loading = false;
+          this.fileDialogVisible = true;
+          this.fileContent = res.data.data;
+        }
+      );
+    },
     onQuery() {
       this.size = 10;
       this.searchTable(this.TreeNode);
diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index d5013df..a567a3f 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -43,7 +43,7 @@
        
         <template #name="{ row }">
           <span>{{ row.name }}</span>
-          <el-tag v-if="row.nodeType == 60" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
+          <el-tag v-if="row.nodeType == 60" style="margin-left:5px" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
           <el-button icon="el-icon-download" @click="handleDownload(row)" class="treebtn" v-if="row.nodeType == 70" :size="size" text title="涓嬭浇"></el-button>
           <el-button class="treebtn" :size="size" text v-if="permission.replace_button && row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
             icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
@@ -102,7 +102,7 @@
       </template> -->
         <template #name="{ row }">
           <span>{{ row.name }}</span>
-          <el-tag v-if="row.nodeType == 60" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
+          <el-tag v-if="row.nodeType == 60" style="margin-left:5px" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
           <el-button icon="el-icon-download" @click="handleDownload(row)" class="treebtn" v-if="row.nodeType == 70" :size="size" text title="涓嬭浇"></el-button>
           <!-- 鏇挎崲  v-if="permission.auto_dispatch"-->
           <el-button class="treebtn" :size="size" text v-if="permission.replace_button && row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"

--
Gitblit v1.9.3