ltao 3 år sedan
förälder
incheckning
703c892875

+ 1 - 0
src/App.vue

@@ -17,3 +17,4 @@ export default  {
     }
 }
 </script>
+

+ 6 - 3
src/api/regulations/fileinfo.js

@@ -18,11 +18,14 @@ export function getFileinfo(id) {
 }
 
 // 新增规章制度文件记录
-export function addFileinfo(data) {
+export function addFileinfo(data,file) {
   return request({
-    url: '/regulations/fileinfo',
+    url: `/regulations/fileinfo`,
     method: 'post',
-    data: data
+    data: data,file,
+    // headers: {
+    //   'Content-Type':'multipart/form-data'
+    // }
   })
 }
 

+ 18 - 1
src/assets/styles/global.css

@@ -617,4 +617,21 @@ background-color: #1d96ff;
       #chakan>.el-dialog .el-dialog__headerbtn .el-dialog__close {
       color: black;
      font-family: ui-serif;
-      }
+  }
+  /* table表格 */
+.el-dialog__wrapper .el-table th.el-table__cell{
+  background-color: transparent;
+  color: white;
+}
+.el-dialog__wrapper .el-table th.el-table__cell .cell{
+  text-align: center;
+}
+.el-dialog__wrapper .el-table .el-table__row .cell{
+  text-align: center;
+}
+.el-dialog__wrapper .el-table .el-table__row{
+  height: 60px !important;
+}
+.el-dialog__wrapper .el-table .el-table__row .el-progress{
+  margin-bottom: 0px !important;
+}

+ 27 - 13
src/components/FileUpload/index.vue

@@ -14,12 +14,12 @@
       ref="upload"
     >
       <!-- 上传按钮 -->
-      <el-button size="mini" type="primary" class="select_file">选取文件</el-button>
+      <el-button size="mini" type="primary" class="select_file" @blur.native="choose">选取文件</el-button>
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
-        <template v-if="fileSize"> 大小不超过 <b style="color: #13CE66 ">{{ fileSize }}MB</b> </template>
-        <template v-if="fileType"> 格式为 <b style="color: #13CE66">{{ fileType.join("/") }}</b> </template>
+        <template v-if="fileSize"> 大小不超过 <b style="color: #13CE66 ">{{ fileSize }}MB</b></template>
+        <template v-if="fileType"> 格式为 <b style="color: #13CE66">{{ fileType.join("/") }}</b></template>
         的文件
       </div>
     </el-upload>
@@ -28,7 +28,7 @@
     <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
       <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
         <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
-          <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
+          <span class="el-icon-document"> {{ file.name }}</span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
           <el-link :underline="false" @click="handleDelete(index)" type="danger" class="del"></el-link>
@@ -39,7 +39,7 @@
 </template>
 
 <script>
-import { getToken } from "@/utils/auth";
+import {getToken} from "@/utils/auth";
 
 export default {
   name: "FileUpload",
@@ -65,7 +65,9 @@ export default {
     isShowTip: {
       type: Boolean,
       default: true
-    }
+    },
+    // 文件名称
+    names: '',
   },
   data() {
     return {
@@ -75,6 +77,7 @@ export default {
         Authorization: "Bearer " + getToken(),
       },
       fileList: [],
+      faith: null
     };
   },
   watch: {
@@ -87,7 +90,7 @@ export default {
           // 然后将数组转为对象数组
           this.fileList = list.map(item => {
             if (typeof item === "string") {
-              item = { name: item, url: item };
+              item = {name: item, url: item};
             }
             item.uid = item.uid || new Date().getTime() + temp++;
             return item;
@@ -98,7 +101,7 @@ export default {
         }
       },
       deep: true,
-      immediate: true
+      immediate: true,
     }
   },
   computed: {
@@ -108,6 +111,10 @@ export default {
     },
   },
   methods: {
+    choose() {
+      console.log(this.names, 5555)
+      this.$emit("names", this.fileList)
+    },
     // 上传前校检格式和大小
     handleBeforeUpload(file) {
       // 校检文件类型
@@ -147,8 +154,9 @@ export default {
     // 上传成功回调
     handleUploadSuccess(res, file) {
       this.$message.success("上传成功");
-      this.fileList.push({ name: res.fileName, url: res.fileName });
-      this.$emit("input", this.listToString(this.fileList));
+      this.fileList.push({name: file.name, url: res.fileName,});
+      console.log(this.fileList)
+      this.$emit("input", this.fileList);
     },
     // 删除文件
     handleDelete(index) {
@@ -180,6 +188,7 @@ export default {
 .upload-file-uploader {
   margin-bottom: 5px;
 }
+
 .upload-file-list .el-upload-list__item {
   border: 1px solid #e4e7ed;
   line-height: 2;
@@ -187,28 +196,33 @@ export default {
   position: relative;
   display: flex;
 }
+
 .upload-file-list .ele-upload-list__item-content {
   display: flex;
   justify-content: space-between;
   align-items: center;
   color: inherit;
 }
+
 .ele-upload-list__item-content-action .el-link {
   margin-right: 10px;
 }
+
 // 选取文件
-.select_file{
+.select_file {
   width: 70px;
   height: 30px;
   display: flex;
   justify-content: center;
   align-items: center;
 }
-.el-upload__tip{
+
+.el-upload__tip {
   margin-left: -15px;
 }
+
 // 删除
-.del{
+.del {
   width: 23px;
   height: 23px;
   left: 40px;

+ 3 - 0
src/store/index.js

@@ -10,6 +10,9 @@ import getters from './getters'
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
+  state:{
+    fileName:""
+  },
   modules: {
     app,
     user,

+ 0 - 0
src/views/regulations/directoryinfo/index.vue → src/views/regulations/directoryinfo/index1.vue


+ 314 - 426
src/views/regulations/fileinfo/index.vue

@@ -3,186 +3,100 @@
     <!-- 文件区域 左边-->
     <div class="tablesfile">
       <div class="jichu">文件</div>
-      <!-- <table style="color: white" class="lefttable">
-        <tr class="child">
-          <td class="tdfirst">1</td>
-          <td class="tdsecound"> -->
-            <!-- 文件名称 fileName -->
-            <!-- <div>文件名称</div> -->
-            <!-- 上传人 createUser -->
-            <!-- 页数 theNumberPages-->
-            <!-- 时间 createTime -->
-            <!-- 阅读量 readVolume -->
-            <!-- <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >上传人:用户</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >页数:11页</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >时间:2022-03-05</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >阅读量:145</span
-            >
-          </td>
-          <td class="tdthird">
-            <div class="read">阅读</div>
-          </td>
-          <td class="tdfourth">
-            <a href="" download class="downloadfile">
-              <img src="../../../images/uploads.png" alt="" />
-              下载
-            </a>
-          </td>
-        </tr>
-        <tr class="child">
-          <td class="tdfirst">1</td>
-          <td class="tdsecound"> -->
-            <!-- 文件名称 fileName -->
-            <!-- <div>文件名称</div> -->
-            <!-- 上传人 createUser -->
-            <!-- 页数 theNumberPages-->
-            <!-- 时间 createTime -->
-            <!-- 阅读量 readVolume -->
-            <!-- <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >上传人:用户</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >页数:11页</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >时间:2022-03-05</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >阅读量:145</span
-            >
-          </td>
-          <td class="tdthird">
-            <div class="read">阅读</div>
-          </td>
-          <td class="tdfourth">
-            <a href="" download class="downloadfile">
-              <img src="../../../images/uploads.png" alt="" />
-              下载
-            </a>
-          </td>
-        </tr>
-      </table> -->
       <el-table
-          v-loading="loading1"
-          :data="list"
-          @selection-change="handleSelectionChange"
-          :header-cell-style="{ background: '#003C69', color: 'white' }"
+        v-loading="loading1"
+        :data="fileinfoList"
+        @selection-change="handleSelectionChange"
+        :header-cell-style="{ background: '#003C69', color: 'white' }"
+      >
+        <el-table-column label="序号" type="index" width="50">
+        </el-table-column>
+        <el-table-column
+          label="文件"
+          align="center"
+          width="600"
+          prop="directory"
+          class="fileNAME"
         >
-          <el-table-column label="序号" type="index" width="50">
-          </el-table-column>
-          <el-table-column label="文件" align="center" width="700" prop="directory" class="fileNAME" >
-              <template slot-scope="scope">
+          <template slot-scope="scope">
             <div>
-                <!-- 文件名称 fileName -->
-            <div style="text-align:start;text-indent:4em">文件名称{{scope.row.name}}</div>
-            <!-- 上传人 createUser -->
-            <!-- 页数 theNumberPages-->
-            <!-- 时间 createTime -->
-            <!-- 阅读量 readVolume -->
-          <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-                margin-left:-105px
-              "
-              >上传人:用户{{scope.row.createUser}}</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >页数:11页{{scope.row.theNumberPages}}</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >时间:2022-03-05{{scope.row.createTime}}</span
-            >
-            <span
-              style="
-                font-size: 14px;
-                color: rgba(204, 204, 204, 1);
-                margin-right: 30px;
-              "
-              >阅读量:145{{scope.row.readVolume}}</span
-            ></div> 
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="操作"
-            align="center"
-            class-name="small-padding fixed-width"
-          >
-            <template slot-scope="scope">
-              <el-button
-                size="read"
-                type="text"
-                @click="ViewRead(scope.row)"
+              <!-- 文件名称 fileName -->
+              <div style="text-align: start; text-indent: 4em">
+                {{ scope.row.fileName }}
+              </div>
+              <!-- 上传人 createUser -->
+              <!-- 页数 theNumberPages-->
+              <!-- 时间 createTime -->
+              <!-- 阅读量 readVolume -->
+              <span
+                style="
+                  font-size: 14px;
+                  color: rgba(204, 204, 204, 1);
+                  margin-right: 30px;
+                  margin-left: -105px;
+                "
+                >上传人:{{ scope.row.createUser }}</span
               >
-                <span>阅读</span>
-              </el-button>
-              <el-button size="reads" type="text" @click="handleupLoad(scope.row)">
-                <span class="chakan">
-                  <!-- <img src="../../../images/uploads.png" alt=""> -->
-                  <a :href="scope.row.file" download>下载</a>
+              <span
+                style="
+                  font-size: 14px;
+                  color: rgba(204, 204, 204, 1);
+                  margin-right: 30px;
+                "
+                >页数:{{ scope.row.theNumberPages }}</span
+              >
+              <span
+                style="
+                  font-size: 14px;
+                  color: rgba(204, 204, 204, 1);
+                  margin-right: 30px;
+                "
+                >时间:2022-03-05{{ scope.row.createTime }}</span
+              >
+              <span
+                style="
+                  font-size: 14px;
+                  color: rgba(204, 204, 204, 1);
+                  margin-right: 30px;
+                "
+                >阅读量:145{{ scope.row.readVolume }}</span
+              >
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button size="read" type="text" @click="ViewRead(scope.row)">
+              <span>
+                <!-- <iframe :src="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</iframe> -->
+                <a :href="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</a>
                 </span>
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
+            </el-button>
+            <el-button
+              size="reads"
+              type="text"
+              @click="handleupLoad(scope.row)"
+            >
+              <span class="chakan">
+                <a :href="scope.row.parentDirName" download>下载</a>
+              </span>
+            </el-button>
+            <el-button
+              size="dels"
+              type="text"
+              @click="handledels(scope.row)"
+            >
+              <span>
+                删除
+              </span>
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
       <pagination
         v-show="total > 0"
         :total="total"
@@ -192,14 +106,14 @@
       />
     </div>
     <!-- 右边 -->
-    <div style="rights">
+    <div class="rights">
       <!-- 目录 -->
       <div class="catalog">
         <div class="jichu">
           目录
-          <el-button size="turnback" @click="turnback">返回</el-button> 
-          <span class="uploadfilesbtn" @click="upload">上传文件</span
-          ><span class="manage" @click="mange">目录管理</span>
+          <el-button class="turnback" @click="turnback">返回</el-button>
+          <el-button class="uploadfilesbtn" @click="upload">上传文件</el-button
+          ><el-button class="manage" @click="mange">目录管理</el-button>
         </div>
         <el-table
           v-loading="loading"
@@ -209,9 +123,14 @@
         >
           <el-table-column label="序号" type="index" width="50">
           </el-table-column>
-          <el-table-column label="目录" align="center" prop="directory" >
+          <el-table-column label="目录" align="center" prop="directory">
             <template slot-scope="scope">
-              <div @click="mulus(scope.row)" :class="scope.row.subclassification==0? '' :'undeline'">{{scope.row.directory}}</div>
+              <div
+                @click="mulus(scope.row)"
+                :class="scope.row.subclassification == 0 ? '' : 'undeline'"
+              >
+                {{ scope.row.directory }}
+              </div>
             </template>
           </el-table-column>
           <el-table-column
@@ -228,26 +147,30 @@
           >
             <template slot-scope="scope">
               <el-button
-                size="btu"
+                size="add"
                 type="text"
                 @click="ViewProgress(scope.row)"
               >
                 <span>添加</span>
               </el-button>
-              <el-button size="btd" type="text" @click="handleDelete(scope.row)">
+              <el-button
+                size="del"
+                type="text"
+                @click="handleDelete(scope.row)"
+              >
                 <span class="chakan">删除</span>
               </el-button>
             </template>
           </el-table-column>
         </el-table>
         <pagination
-        class="pagination"
-        v-show="total1 > 0"
-        :total="total1"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="ListDirectoryinfo"
-      />
+          class="pagination"
+          v-show="total1 > 0"
+          :total="total1"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="ListDirectoryinfo"
+        />
       </div>
       <!-- 排行 -->
       <div class="Ranking">
@@ -301,7 +224,7 @@
                 class="choose"
               >
                 <el-option
-                 v-for="item in directory"
+                  v-for="item in directory"
                   :key="item.id"
                   :label="item.directory"
                   :value="item.directory"
@@ -321,17 +244,31 @@
                 clearable
                 size="small"
               >
-                <el-option 
-                 v-for="item in subclassification"
+                <el-option
+                  v-for="item in subclassification"
                   :key="item.id"
                   :label="item.directory"
                   :value="item.directory"
                   @click.native="soncategory(item.id)"
-                  ></el-option>
+                ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item style="margin-left: 30px; margin-top: 30px">
-              <span class="uploadfilesbtn"  @click="uoloadfiles">上传文件</span>
+              <FileUpload v-model="form.file" @names="namess(name)" />
+              <!-- <div>
+                <label for="fileInput">
+                  <i aria-hidden="true" class="cursor">上传文件</i>
+                </label>
+                <input
+                  v-show="false"
+                  type="file"
+                  id="fileInput"
+                  @change="handleFileChange"
+                  name="file"
+                  ref="file"
+                />
+              </div> -->
+              <!-- <input type="file" id="people-export" ref="inputer" @change="fileUpload"/> -->
             </el-form-item>
           </el-form>
           <div slot="footer" class="dialog-footer">
@@ -340,52 +277,6 @@
           </div>
         </el-dialog>
       </div>
-      <!-- 上传文件 -->
-      <!-- 用户导入对话框 -->
-    <el-dialog
-      :title="upload1.title"
-      :visible.sync="upload1.open"
-      width="400px"
-      append-to-body
-    >
-      <el-upload
-        ref="upload1"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :headers="upload1.headers"
-        :action="upload1.url + '?updateSupport=' + upload1.updateSupport"
-        :disabled="upload1.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
-        <i class="el-icon-upload"></i>
-        <div class="el-upload__text">
-          将文件拖到此处,或
-          <em>点击上传</em>
-        </div>
-        <div class="el-upload__tip text-center" slot="tip">
-          <div class="el-upload__tip" slot="tip">
-            <!-- <el-checkbox
-              v-model="upload1.updateSupport"
-            /> -->
-          </div>
-          <span class="imports">仅允许导入xls、xlsx格式文件。</span>
-          <!-- <el-link
-            type="primary"
-            :underline="false"
-            style="font-size: 12px; vertical-align: baseline"
-            @click="importTemplate"
-            >下载模板</el-link
-          > -->
-        </div>
-      </el-upload>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitFileForm">确 定</el-button>
-        <el-button @click="open4 = false">取 消</el-button>
-      </div>
-    </el-dialog>
       <!-- 新建分类弹框 -->
       <el-dialog
         style="color: pink"
@@ -460,6 +351,7 @@ import {
   updateFileinfo,
   exportFileinfo,
 } from "@/api/regulations/fileinfo";
+import FileUpload from "../../../components/FileUpload/index.vue"
 import {
   listDirectoryinfo,
   addDirectoryinfo,
@@ -470,6 +362,7 @@ export default {
   name: "Fileinfo",
   data() {
     return {
+      props:["name"],
       list: [
         {
           id: 1,
@@ -501,7 +394,7 @@ export default {
         },
       ],
       total: 10,
-      total1:"",
+      total1: "",
       queryParams: {
         pageNum: 1,
         pageSize: 5,
@@ -537,124 +430,91 @@ export default {
       // 目录
       directory: [],
       // 父节点id
-      parentId:"",
+      parentId: "",
       // 遮罩层
       loading: true,
       // 导出遮罩层
       exportLoading: false,
       // 子分类
-      subclassification:[],
+      subclassification: [],
       // 刷新
-      loading1:false,
-      //  用户导入参数
-       upload1: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/regulations/fileinfo/importData"
-      },
+      loading1: false,
+      // 文件
+      file: {},
     };
   },
+  components:{
+    FileUpload
+  },
   created() {
     this.getList();
     // 获取目录接口
-    this.ListDirectoryinfo()
+    this.ListDirectoryinfo();
   },
   methods: {
-    soncategory(id){
-      this.form.directoryId=id
-      console.log(id)
+    handledels(row){
+      console.log(row.id)
+    },
+    namess(name){
+      console.log(name)
+    },
+    // 子分类id
+    soncategory(id) {
+      this.form.directoryId = id;
+      console.log(id);
     },
-    ListDirectoryinfo(){
+    // 获取目录列表
+    ListDirectoryinfo() {
       this.loading = true;
-      this.queryParams.common="1"
-      listDirectoryinfo(this.queryParams).then(res=>{
+      this.queryParams.common = "1";
+      listDirectoryinfo(this.queryParams).then((res) => {
         this.directory = res.rows;
-        this.total1=res.rows.length
+        this.total1 = res.rows.length;
         this.loading = false;
         console.log(this.directory);
-      })
+      });
     },
-    // ListDirectoryinfo1(){
-    //   this.loading = true;
-    //   listDirectoryinfo(this.queryParams).then(res=>{
-    //     this.directory = res.rows;
-    //     this.total1=res.rows.length
-    //     this.loading = false;
-    //     console.log(this.directory);
-    //   })
-    // },
     // 点击目录
-    mulus(row){
-      console.log(row.id)
-      this.parentId=row.id
-      listDirectoryinfo({parentId:this.parentId}).then(res=>{
-        console.log(res)
-        if(res.rows[0].subclassification==0){
-          this.directory=res.rows
-        }else{
-          return
-        }
-      })
+    mulus(row) {
+      console.log(row.id);
+      this.parentId = row.id;
+      listDirectoryinfo({ parentId: this.parentId }).then((res) => {
+        console.log(res.rows);
+        res.rows.forEach((item)=>{
+            if(item.subclassification==0){
+              this.directory=res.rows
+            }else{
+              return
+            }
+        })
+        // if (res.rows[0].subclassification == 0) {
+        //   this.directory = res.rows;
+        // } else {
+        //   return;
+        // }
+      });
       // 绑定的数据 directory
     },
-    // 上传文件
-    uoloadfiles(){
-      this.upload1.title="上传文件"
-      this.upload1.open=true
-    },
-    // /** 下载模板操作 */
-    // importTemplate() {
-    //   importTemplate().then(response => {
-    //     this.$download.name(response.msg);
-    //   });
-    // },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload1.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload1.open = false;
-      this.upload1.isUploading = false;
-      this.$refs.upload1.clearFiles();
-      console.log(this.$refs.upload1)
-      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
-      // this.getList();
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload1.submit()
-    },
     // 返回目录
-    turnback(){
-      this.ListDirectoryinfo()
+    turnback() {
+      this.ListDirectoryinfo();
     },
     // 选中父目录之后
-    chooseDirect(id){
+    chooseDirect(id) {
       // this.form.subclassification=""
-      this.subclassification=[]
-      this.parentId=id
+      this.subclassification = [];
+      this.parentId = id;
       // 获取到父目录id了
-      listDirectoryinfo({parentId:this.parentId}).then(res=>{
-        this.subclassification=res.rows
-      })
+      listDirectoryinfo({ parentId: this.parentId }).then((res) => {
+        this.subclassification = res.rows;
+      });
     },
     /** 查询规章制度文件记录列表 */
     getList() {
       this.loading = true;
       listFileinfo(this.queryParams).then((response) => {
         this.fileinfoList = response.rows;
-        // this.form=response.rows
-        // console.log(this.fileinfoList)
+        console.log(this.fileinfoList)
         this.total = response.total;
         this.loading = false;
       });
@@ -718,27 +578,16 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         console.log(this.form);
-        // this.directory.forEach((item)=>{
-        //   if(item.directory==this.form.directory){
-        //     // 目录id
-        //     this.form.parentId=item.id
-            if (valid) {
-              addFileinfo(this.form).then((response) => {
-              this.$modal.msgSuccess("上传成功");
-              this.open = false;
-              this.listDirectoryinfo();
-            });
-            }
-        //     // console.log(this.form)
-        //   }
-        // })
-        // if (valid) {
-        //   addFileinfo(this.form).then((response) => {
-        //     this.$modal.msgSuccess("上传成功");
-        //     this.open = false;
-        //     this.listDirectoryinfo();
-        //   });
-        // }
+        if (valid) {
+          this.form.fileName=this.form.file[0].name
+          this.form.parentDirName=this.form.file[0].url
+          addFileinfo(this.form, this.file).then((response) => {
+            this.$modal.msgSuccess("上传成功");
+            this.open = false;
+             this.getList()
+            // this.listDirectoryinfo();
+          });
+        }
       });
     },
     // 新建分类
@@ -749,9 +598,9 @@ export default {
         if (valid) {
           addDirectoryinfo(this.form1).then((response) => {
             this.$modal.msgSuccess("新增成功");
-            this.ListDirectoryinfo(); 
-             this.open1 = false;
-             this.form1={}
+            this.ListDirectoryinfo();
+            this.open1 = false;
+            this.form1 = {};
             //  this.reset()
           });
         }
@@ -765,7 +614,7 @@ export default {
           addDirectoryinfo(this.form2).then((response) => {
             this.$modal.msgSuccess("上传子分类成功");
             this.open2 = false;
-            this.form2={}
+            this.form2 = {};
             this.ListDirectoryinfo();
           });
         }
@@ -773,10 +622,10 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id 
-      console.log(ids)
+      const ids = row.id;
+      console.log(ids);
       this.$modal
-        .confirm('是否确认删除?')
+        .confirm("是否确认删除?")
         .then(function () {
           return delDirectoryinfo(ids);
         })
@@ -806,7 +655,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = "上传文件";
-      this.ListDirectoryinfo()
+      this.ListDirectoryinfo();
     },
     // 目录管理
     mange() {
@@ -830,36 +679,17 @@ export default {
       this.comstatus = 0;
       this.reset();
     },
-    // // 阅读获取id
-    // readread() {
-    //   var child = document.getElementsByClassName("child");
-    //   console.log(child)
-    //   for (var i = 0; i < child.length; i++) {
-    //     var a = child[i];
-    //     a.index = i; //给每个className为child的元素添加index属性;
-    //     a.onclick = function () {
-    //       console.log(1)
-    //         // alert(this.index)
-    //     }
-    //   }
-    // },
     // 阅读按钮操作
-    ViewRead(){
-
+    ViewRead() {
+      // window.open("www.baidu.com","_self");
     },
     // 下载按钮操作
-    handleupLoad(){
-
-    }
+    handleupLoad() {},
   },
 };
 </script>
+
 <style scoped>
-.flexlayout {
-  width: 100vw;
-  height: 100vh;
-  /* background-color: pink; */
-}
 .jichu {
   color: white;
   width: 100%;
@@ -870,47 +700,49 @@ export default {
 }
 /* 文件表格 */
 .tablesfile {
-  width: 1090px;
-  height: 840px;
+  width: 50%;
+  height: 100vh;
   background: #00365f;
-  margin-left: 10px;
-  /* height: auto; */
+  margin-left: 30px;
 }
 /* 弹性布局 */
 .flexlayout {
   display: flex;
   justify-content: space-around;
   align-items: flex-start;
-  width: 100%;
   height: 100%;
+  width: 100vw;
+  position: fixed;
 }
 /* 目录 */
 .catalog {
-  width: 700px;
-  height: 410px;
+  width: 43vw;
+  height: 45vh;
   position: relative;
-  /* height: auto; */
-  /* display: flex; */
-  margin-left: 10px;
   background-color: #00365f;
 }
-.pagination{
+.dialog-footer .el-button{
+  width: 60px;
+  height: 30px;
+}
+.pagination {
   position: absolute;
   bottom: 20px;
   right: 10px;
 }
 /* 排行 */
 .Ranking {
-  width: 700px;
-  height: 410px;
-  margin-left: 10px;
+  width: 43vw;
+  height: 45vh;
+  right: 12%;
+  top: 45%;
   background-color: #00365f;
-  margin-top: 20px;
+  margin-top: 10px;
 }
 /* 下载按钮 */
 /* .downloadfile { */
-  /* background-image: url("../../../images/uploads.png"); */
-  /* background: rgba(29, 150, 255, 1);
+/* background-image: url("../../../images/uploads.png"); */
+/* background: rgba(29, 150, 255, 1);
   display: inline-block;
   width: 67px;
   height: 30px;
@@ -922,21 +754,22 @@ export default {
   /* margin-r */
 /* }  */
 .rights {
-  margin-left: 20px;
+  width: 50%;
+  height: 100vh;
+  margin-left: 30px;
 }
 /* 阅读 */
-.el-button--read {  
+.el-button--read {
   color: #ffffff;
   width: 50px;
   height: 30px;
   background-color: #1d96ff;
   border-radius: 4px;
   font-size: 14px;
-  /* text-align: center; */
   line-height: 5px;
   margin-right: 10px;
 }
-.el-button--reads{
+.el-button--reads {
   color: #ffffff;
   width: 67px;
   height: 30px;
@@ -950,7 +783,20 @@ export default {
   line-height: 5px;
   margin-right: 10px;
 }
-.el-button--reads .chakan{
+.el-button--dels {
+  color: #ffffff;
+  width: 60px;
+  height: 30px;
+  background-color: #ff4949;
+  border-radius: 4px;
+  font-size: 14px;
+  background-repeat: no-repeat;
+  background-position: 8px 6px;
+  /* text-align: center; */
+  line-height: 5px;
+  margin-right: 10px;
+}
+.el-button--reads .chakan {
   margin-left: 7px;
 }
 /* 表格 */
@@ -1007,6 +853,7 @@ tr {
 }
 table {
   border-collapse: collapse;
+  width: 100%;
 }
 /* 左边表格 */
 .lefttable tr {
@@ -1016,25 +863,24 @@ table {
 }
 /* 上传文件 */
 .uploadfilesbtn {
-  display: inline-block;
-  width: 86px;
-  height: 36px;
-  line-height: 36px;
+  width: 80px;
+  height: 33px;
+  line-height: 33px;
   background-color: #1d96ff;
   color: white;
   border-radius: 4px;
   font-size: 14px;
   text-align: center;
-  margin-left: 360px;
-  padding-right: 10px;
+  margin-left: 480px;
 }
 /* 目录管理 */
 .manage {
-  display: inline-block;
-  width: 86px;
-  height: 36px;
-  line-height: 36px;
+  /* display: inline-block; */
+  width: 80px;
+  height: 33px;
+  line-height: 33px;
   background-color: #1d96ff;
+  color: white;
   font-size: 14px;
   border-radius: 4px;
   margin-left: 10px;
@@ -1099,39 +945,81 @@ table {
 ::v-deep .el-select-dropdown__wrap .el-scrollbar__view {
   background-color: white !important;
 }
-::v-deep .pagination-container{
+::v-deep .pagination-container {
   display: block !important;
 }
 /* 返回目录按钮 */
-.el-button--turnback{
+.turnback {
   color: #ffffff;
-  width: 60px;
-  height: 34px;
+  width: 50px;
+  height: 30px;
   background-color: #1d96ff;
   border-radius: 4px;
   font-size: 14px;
-  line-height: 5px;
+  line-height: 30px;
   margin-left: 30px;
-  padding-left: 14px;
+  text-align: center;
+}
+/* 添加按钮 */
+.el-button--add {
+  width: 46px !important;
+  border: 1px solid transparent;
+  padding: 3px 8px;
+  font-size: 14px;  
+  line-height: 1.5;
+  border-radius: 3px;
+  color: #fff;
+  background-color: #13ce66;
 }
-.undeline{
+/* 删除按钮 */
+.el-button--del {
+  width: 46px !important;
+  border: 1px solid transparent;
+  padding: 3px 8px;
+  font-size: 14px;  
+  line-height: 1.5;
+  border-radius: 3px;
+  color: #fff;
+  background-color: #ff4949;
+}
+/* 下划线 */
+.undeline {
   text-decoration: underline;
   color: #1d96ff;
   cursor: pointer;
 }
 /* 序号居中 */
-::v-deep .el-table_1_column_1{
+::v-deep .el-table_1_column_1 {
   text-align: center;
 }
-::v-deep .el-table_2_column_4{
+::v-deep .el-table_2_column_4 {
   text-align: center;
 }
 /* 导入按钮 */
-.imports{
- color: skyblue;
- display: inline-block;
- margin-top: 30px;
- margin-right: 150px;
- /* padding-top: 10px; */
+.imports {
+  color: skyblue;
+  display: inline-block;
+  margin-top: 30px;
+  margin-right: 150px;
+  /* padding-top: 10px; */
+}
+.is-ready li {
+  width: 300px !important;
+}
+.cursor {
+  cursor: pointer;
+  color: #409eff;
+  font-size: 16px;
+}
+* {
+  padding: 0;
+  margin: 0;
+}
+html,
+body,
+#app {
+    height: 100%;
+    margin: 0;
+    padding: 0;
 }
 </style>

+ 41 - 18
src/views/workingArrangements/planTask/index.vue

@@ -253,7 +253,7 @@
         :inline="true"
       >
         <div class="jiben">基本信息</div>
-        <el-form-item label="计划名称" prop="executorName">
+        <el-form-item label="计划名称" prop="name">
           <el-input
             label="计划名称"
             v-model="form.name"
@@ -270,7 +270,7 @@
           >
           </el-input>
         </el-form-item>
-        <el-form-item label="发布单位" prop="unitName">
+        <el-form-item label="发布单位" prop="adminId">
           <treeselect
             v-model="form.adminId"
             :options="part"
@@ -279,7 +279,7 @@
             class="threeselects"
           />
         </el-form-item>
-        <el-form-item label="执行单位" prop="unitName2">
+        <el-form-item label="执行单位" prop="unitId">
           <treeselect
             v-model="form.unitId"
             :options="users"
@@ -611,7 +611,7 @@
           <!-- <a :href="moreTable.file" download title="下载" style="color:white;margin-left:10px">下载附件</a> -->
           <el-input
             label="附件名称"
-            v-model="singleTable.fileName"
+            v-model="moreTable.fileName"
             style="width: 820px"
           />
           <!-- <div>{{singleTableb.fileName}}</div> -->
@@ -776,13 +776,16 @@ export default {
         peopleName: [
           { required: true, message: "执行人不能为空", trigger: "blur" },
         ],
-        // unitName:{required:true,message:"发布单位不能为空",trigger:"blur"},
-        // unitName2:{required:true,message:"执行单位不能为空",trigger:"blur"},
-        // name:[{required:true,message:"计划名称不能为空",trigger:"blur"}]
+        name:[{ required: true, message: "不能为空", trigger: "blur" }],
+        adminId:{required:true,message:"发布单位不能为空",trigger:"blur"},
+        unitId:{required:true,message:"执行单位不能为空",trigger:"blur"},
+        type :{required:true,message:"计划类型不能为空",trigger:"blur"},
+        startTime :{required:true,message:"开始时间不能为空",trigger:"blur"},
+        endTime  :{required:true,message:"结束时间不能为空",trigger:"blur"},
       },
       rules1: {
         planProgress: [
-          { required: true, message: "请输入完成进度", trigger: "blur" },
+          { required: true, message: "请输入完成进度", trigger: "blur" }
         ],
       },
       // 获取部门列表
@@ -841,7 +844,7 @@ export default {
     this.chooseplan();
     getDeptList().then((res) => {
       this.getdeptList = res.data;
-      console.log(this.getdeptList);
+      // console.log(this.getdeptList);
     });
   },
   methods: {
@@ -922,6 +925,7 @@ export default {
         taskProgress: null,
         releaseUnit: null,
         executableUnit: null,
+        comstatus:null
       };
       this.Progress = {
         schedule: "",
@@ -982,6 +986,7 @@ export default {
       this.title = "进度查看";
       // 获取当前行的id
       singProgress(row.id).then((res) => {
+        console.log(res)
         this.singleTable = res.data;
         this.singleTable.planProgresses =
           this.singleTable.planProgress.schedule;
@@ -997,13 +1002,13 @@ export default {
       this.title = "进度查看";
       // 获取当前行的id
       // console.log(row.id)
+      
       moreProgress(row.id).then((res) => {
+        console.log(res)
+        this.comstatus=0
         this.moreTable = res.data;
-        console.log(this.moreTable);
         this.moreTable.planProgresses.forEach((item) => {
-          this.comstatus +=
-            item.schedule / this.moreTable.planProgresses.length;
-          // this.comstatus=0
+          this.comstatus +=item.schedule / this.moreTable.planProgresses.length;
         });
       });
     },
@@ -1020,6 +1025,7 @@ export default {
         this.form = response.data;
         // this.getDept2()
         this.getZhuChi(this.form.unitId);
+        console.log(this.form)
         this.form.peopleName = this.form.peopleName.split(",").map(Number);
         this.open = true;
         this.title = "修改工作计划";
@@ -1052,6 +1058,7 @@ export default {
     unit3Format(row, column) {
       var deptName = "";
       // console.log(this.planTaskList[0])
+      console.log(this.getdeptList)
       if (
         parseInt(this.planTaskList[0].common) == 1 ||
         this.planTaskList[0].common == 2
@@ -1062,12 +1069,18 @@ export default {
           }
         });
       } else if (parseInt(this.planTaskList[0].common) == 0) {
-        console.log(this.part);
-        this.part[0].children.map((item) => {
-          if (item.id == row.adminId) {
-            deptName = item.label;
+        this.getdeptList.map((item) => {
+          if (item.deptId == row.adminId) {
+            deptName = item.deptName;
           }
         });
+        // console.log(this.part)
+        // console.log(this.part);
+        // this.part[0].children.map((item) => {
+        //   if (item.id == row.adminId) {
+        //     deptName = item.label;
+        //   }
+        // });
       }
       return deptName;
     },
@@ -1082,6 +1095,9 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      console.log(this.form)
+      this.form.fileName=this.form.file[0].name
+      this.form.file=this.form.file[0].url
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.adminId === this.form.unitId) {
@@ -1108,6 +1124,9 @@ export default {
       });
     },
     submitForm1() {
+      console.log(this.Progress)
+      this.Progress.fileName=this.Progress.file[0].name
+      this.Progress.file=this.Progress.file[0].url
       this.$refs["Progress"].validate((valid) => {
         if (valid) {
           console.log(this.jinduId);
@@ -1363,7 +1382,7 @@ export default {
   border: 1px solid #fff;
   border-radius: 4px;
   height: auto;
-  line-height: 36px;
+  min-height: 35px;
   text-indent: 1em;
   margin-bottom: 20px;
   /* margin: auto; */
@@ -1439,4 +1458,8 @@ export default {
   text-overflow: ellipsis;
   white-space: nowrap;
 }
+/* table表格 */
+::v-deep .el-table th.el-table__cell{
+  background-color: pink !important;
+}
 </style>

+ 27 - 8
src/views/workingArrangements/workTask/index.vue

@@ -248,7 +248,7 @@
           >
           </el-input>
         </el-form-item>
-        <el-form-item label="发布单位" prop="unitName2">
+        <el-form-item label="发布单位" prop="adminId">
           <treeselect
             v-model="form.adminId"
             :options="part"
@@ -257,7 +257,7 @@
             class="threeselects"
           />
         </el-form-item>
-        <el-form-item label="执行单位" prop="unitName">
+        <el-form-item label="执行单位" prop="unitId">
           <treeselect
             v-model="form.unitId"
             :options="users"
@@ -537,7 +537,7 @@
           <!-- <a :href="moreTable.file" download title="下载" style="color:white;margin-left:10px">下载附件</a> -->
           <el-input
             label="附件名称"
-            v-model="singleTable.fileName"
+            v-model="moreTable.fileName"
             style="width: 820px"
           />
           <!-- <div>{{singleTableb.fileName}}</div> -->
@@ -684,6 +684,15 @@ export default {
       // 表单校验
       rules: {
         number: [{ required: true, message: "编号不能为空", trigger: "blur" }],
+        peopleName: [
+          { required: true, message: "执行人不能为空", trigger: "blur" },
+        ],
+        name:[{ required: true, message: "不能为空", trigger: "blur" }],
+        adminId:{required:true,message:"发布单位不能为空",trigger:"blur"},
+        unitId:{required:true,message:"执行单位不能为空",trigger:"blur"},
+        type :{required:true,message:"计划类型不能为空",trigger:"blur"},
+        startTime :{required:true,message:"开始时间不能为空",trigger:"blur"},
+        endTime  :{required:true,message:"结束时间不能为空",trigger:"blur"},
       },
       rules1: {
         planProgress: [
@@ -754,12 +763,15 @@ export default {
       this.open2 = true;
       this.title = "进度查看";
       // 获取当前行的id
-      console.log(row.id);
+      // console.log(row.id);
       singProgress(row.id).then((res) => {
+        console.log(res)
         this.singleTable = res.data;
         this.singleTable.planProgresses =
           this.singleTable.workProgress.schedule;
         this.Progress.id = this.singleTable.workProgress.id;
+        this.singleTable.fileName=this.singleTable.workProgress.fileName
+        console.log(this.singleTable.fileName)
         // console.log(this.Progress.id);
         // this.singleTable.jindu=singleTable.planProgress.schedule
         // console.log(this.singleTable)
@@ -772,6 +784,8 @@ export default {
       this.title = "进度查看";
       // 获取当前行的id
       moreProgress(row.id).then((res) => {
+        console.log(res)
+        this.comstatus=0
         this.moreTable = res.data;
         console.log(this.moreTable);
         this.moreTable.workProgresses.forEach((item) => {
@@ -933,9 +947,9 @@ export default {
           }
         });
       } else if (parseInt(this.workTaskList[0].common) == 0) {
-        this.part[0].children.map((item) => {
-          if (item.id == row.adminId) {
-            deptName = item.label;
+         this.getdeptList.map((item) => {
+          if (item.deptId == row.adminId) {
+            deptName = item.deptName;
           }
         });
       }
@@ -957,6 +971,8 @@ export default {
     /** 提交按钮 */
     submitForm() {
       console.log(this.form);
+       this.form.fileName=this.form.file[0].name
+      this.form.file=this.form.file[0].url
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.adminId === this.form.unitId) {
@@ -1004,13 +1020,15 @@ export default {
       // });
     },
     submitForm1() {
+      // console.log(this.Progress)
       this.$refs["Progress"].validate((valid) => {
         if (valid) {
           this.Progress.taskId = this.jinduId;
           this.Progress.schedule = this.Progress.planProgress;
+          this.Progress.fileName=this.Progress.file[0].name
+          this.Progress.file=this.Progress.file[0].url
           console.log(this.Progress);
           uploadProgress(this.Progress).then((res1) => {
-            console.log(res1);
             this.$modal.msgSuccess("上传成功");
             // this.Progress
             this.reset();
@@ -1263,6 +1281,7 @@ export default {
   width: 940px;
   border: 1px solid #fff;
   border-radius: 4px;
+  min-height: 35px;
   height: auto !important;
   line-height: 36px;
   text-indent: 1em;