zhangh 3 жил өмнө
parent
commit
444e556bfa

+ 131 - 112
src/page/index/index.vue

@@ -1,143 +1,162 @@
 <template>
-  <div class="avue-contail" :class="{'avue--collapse':isCollapse}">
+  <div
+    class="avue-contail"
+    :class="{'avue--collapse':isCollapse}"
+  >
     <div class="avue-header">
       <!-- 顶部导航栏 -->
-      <top ref="top"/>
+      <top ref="top" />
     </div>
     <div class="avue-layout">
       <div class="avue-left">
         <!-- 左侧导航栏 -->
-        <sidebar/>
+        <sidebar />
       </div>
       <div class="avue-main">
         <!-- 顶部标签卡 -->
-        <tags/>
+        <tags />
         <transition name="fade-scale">
-          <search class="avue-view" v-show="isSearch"></search>
+          <search
+            class="avue-view"
+            v-show="isSearch"
+          ></search>
         </transition>
         <!-- 主体视图层 -->
-        <div style="height:100%;overflow-y:auto;overflow-x:hidden;" id="avue-view" v-show="!isSearch">
+        <div
+          style="height:100%;overflow-y:auto;overflow-x:hidden;"
+          id="avue-view"
+          v-show="!isSearch"
+        >
           <keep-alive>
-            <router-view class="avue-view" v-if="$route.meta.keepAlive"/>
+            <router-view
+              class="avue-view"
+              v-if="$route.meta.keepAlive"
+            />
           </keep-alive>
-          <router-view class="avue-view" v-if="!$route.meta.keepAlive"/>
+          <router-view
+            class="avue-view"
+            v-if="!$route.meta.keepAlive"
+          />
         </div>
       </div>
     </div>
-    <div class="avue-shade" @click="showCollapse"></div>
+    <div
+      class="avue-shade"
+      @click="showCollapse"
+    ></div>
   </div>
 </template>
 
 <script>
-  import {mapGetters} from "vuex";
-  import tags from "./tags";
-  import search from "./search";
-  import top from "./top/";
-  import sidebar from "./sidebar/";
-  import admin from "@/util/admin";
-  import {validatenull} from "@/util/validate";
-  import {calcDate} from "@/util/date.js";
-  import {getStore} from "@/util/store.js";
+import { mapGetters } from "vuex";
+import tags from "./tags";
+import search from "./search";
+import top from "./top/";
+import sidebar from "./sidebar/";
+import admin from "@/util/admin";
+import { validatenull } from "@/util/validate";
+import { calcDate } from "@/util/date.js";
+import { getStore } from "@/util/store.js";
 
-  export default {
-    components: {
-      top,
-      tags,
-      search,
-      sidebar
+export default {
+  components: {
+    top,
+    tags,
+    search,
+    sidebar
+  },
+  name: "index",
+  provide () {
+    return {
+      index: this
+    };
+  },
+  data () {
+    return {
+      //搜索控制
+      isSearch: false,
+      //刷新token锁
+      refreshLock: false,
+      //刷新token的时间
+      refreshTime: ""
+    };
+  },
+  created () {
+    //实时检测刷新token
+    this.refreshToken();
+  },
+  mounted () {
+    this.init();
+  },
+  computed: mapGetters(["isMenu", "isLock", "isCollapse", "website", "menu"]),
+  props: [],
+  methods: {
+    showCollapse () {
+      this.$store.commit("SET_COLLAPSE");
     },
-    name: "index",
-    provide() {
-      return {
-        index: this
+    // 初始化
+    init () {
+      this.$store.commit("SET_SCREEN", admin.getScreen());
+      window.onresize = () => {
+        setTimeout(() => {
+          this.$store.commit("SET_SCREEN", admin.getScreen());
+        }, 0);
       };
+      this.$store.dispatch("FlowRoutes").then(() => {
+      });
     },
-    data() {
-      return {
-        //搜索控制
-        isSearch: false,
-        //刷新token锁
-        refreshLock: false,
-        //刷新token的时间
-        refreshTime: ""
-      };
-    },
-    created() {
-      //实时检测刷新token
-      this.refreshToken();
-    },
-    mounted() {
-      this.init();
-    },
-    computed: mapGetters(["isMenu", "isLock", "isCollapse", "website", "menu"]),
-    props: [],
-    methods: {
-      showCollapse() {
-        this.$store.commit("SET_COLLAPSE");
-      },
-      // 初始化
-      init() {
-        this.$store.commit("SET_SCREEN", admin.getScreen());
-        window.onresize = () => {
-          setTimeout(() => {
-            this.$store.commit("SET_SCREEN", admin.getScreen());
-          }, 0);
-        };
-        this.$store.dispatch("FlowRoutes").then(() => {
-        });
-      },
-      //打开菜单
-      openMenu(item = {}) {
-        this.$store.dispatch("GetMenu", item.id).then(data => {
-          if (data.length !== 0) {
-            this.$router.$avueRouter.formatRoutes(data, true);
-          }
-          //当点击顶部菜单后默认打开第一个菜单
-          /*if (!this.validatenull(item)) {
-            let itemActive = {},
-              childItemActive = 0;
-            if (item.path) {
-              itemActive = item;
+    //打开菜单
+    openMenu (item = {}) {
+      this.$store.dispatch("GetMenu", item.id).then(data => {
+        if (data.length !== 0) {
+          this.$router.$avueRouter.formatRoutes(data, true);
+        }
+        //当点击顶部菜单后默认打开第一个菜单
+        /*if (!this.validatenull(item)) {
+          let itemActive = {},
+            childItemActive = 0;
+          if (item.path) {
+            itemActive = item;
+          } else {
+            if (this.menu[childItemActive].length === 0) {
+              itemActive = this.menu[childItemActive];
             } else {
-              if (this.menu[childItemActive].length === 0) {
-                itemActive = this.menu[childItemActive];
-              } else {
-                itemActive = this.menu[childItemActive].children[childItemActive];
-              }
+              itemActive = this.menu[childItemActive].children[childItemActive];
             }
-            this.$store.commit('SET_MENU_ID', item);
-            this.$router.push({
-              path: this.$router.$avueRouter.getPath({
-                name: (itemActive.label || itemActive.name),
-                src: itemActive.path
-              }, itemActive.meta)
-            });
-          }*/
-
-        });
-      },
-      // 定时检测token
-      refreshToken() {
-        this.refreshTime = setInterval(() => {
-          const token = getStore({
-            name: "token",
-            debug: true
-          }) || {};
-          const date = calcDate(token.datetime, new Date().getTime());
-          if (validatenull(date)) return;
-          if (date.seconds >= this.website.tokenTime && !this.refreshLock) {
-            this.refreshLock = true;
-            this.$store
-              .dispatch("refreshToken")
-              .then(() => {
-                this.refreshLock = false;
-              })
-              .catch(() => {
-                this.refreshLock = false;
-              });
           }
-        }, 10000);
-      }
+          this.$store.commit('SET_MENU_ID', item);
+          this.$router.push({
+            path: this.$router.$avueRouter.getPath({
+              name: (itemActive.label || itemActive.name),
+              src: itemActive.path
+            }, itemActive.meta)
+          });
+        }*/
+
+      });
+    },
+    // 定时检测token
+    refreshToken () {
+      this.refreshTime = setInterval(() => {
+        const token = getStore({
+          name: "token",
+          debug: true
+        }) || {};
+        const date = calcDate(token.datetime, new Date().getTime());
+        if (validatenull(date)) return;
+        if (date.seconds >= this.website.tokenTime && !this.refreshLock) {
+          this.refreshLock = true;
+          this.$store
+            .dispatch("refreshToken")
+            .then(() => {
+              this.refreshLock = false;
+            })
+            .catch(() => {
+              this.refreshLock = false;
+            });
+        }
+      }, 10000);
     }
-  };
+  }
+};
 </script>

+ 166 - 147
src/page/index/tags.vue

@@ -1,38 +1,56 @@
 <template>
-  <div class="avue-tags"
-       v-if="showTag">
+  <div
+    class="avue-tags"
+    v-if="showTag"
+  >
     <!-- tag盒子 -->
-    <div v-if="contextmenuFlag"
-         class="avue-tags__contentmenu"
-         :style="{left:contentmenuX+'px',top:contentmenuY+'px'}">
-      <div class="item"
-           @click="clearCacheTags">{{$t('tagsView.clearCache')}}
+    <div
+      v-if="contextmenuFlag"
+      class="avue-tags__contentmenu"
+      :style="{left:contentmenuX+'px',top:contentmenuY+'px'}"
+    >
+      <div
+        class="item"
+        @click="clearCacheTags"
+      >{{$t('tagsView.clearCache')}}
       </div>
-      <div class="item"
-           @click="closeOthersTags">{{$t('tagsView.closeOthers')}}
+      <div
+        class="item"
+        @click="closeOthersTags"
+      >{{$t('tagsView.closeOthers')}}
       </div>
-      <div class="item"
-           @click="closeAllTags">{{$t('tagsView.closeAll')}}
+      <div
+        class="item"
+        @click="closeAllTags"
+      >{{$t('tagsView.closeAll')}}
       </div>
     </div>
-    <div class="avue-tags__box"
-         :class="{'avue-tags__box--close':!website.isFirstPage}">
-      <el-tabs v-model="active"
-               type="card"
-               @contextmenu.native="handleContextmenu"
-               :closable="tagLen!==1"
-               @tab-click="openTag"
-               @edit="menuTag">
-        <el-tab-pane :key="item.value"
-                     v-for="item in tagList"
-                     :label="generateTitle(item)"
-                     :name="item.value">
+    <div
+      class="avue-tags__box"
+      :class="{'avue-tags__box--close':!website.isFirstPage}"
+    >
+      <el-tabs
+        v-model="active"
+        type="card"
+        @contextmenu.native="handleContextmenu"
+        :closable="tagLen!==1"
+        @tab-click="openTag"
+        @edit="menuTag"
+      >
+        <el-tab-pane
+          :key="item.value"
+          v-for="item in tagList"
+          :label="generateTitle(item)"
+          :name="item.value"
+        >
         </el-tab-pane>
 
       </el-tabs>
       <el-dropdown class="avue-tags__menu">
-        <el-button type="primary"
-                   size="mini">
+        <el-button
+          type="primary"
+          size="mini"
+        >
           {{$t('tagsView.menu')}}
           <i class="el-icon-arrow-down el-icon--right"></i>
         </el-button>
@@ -48,139 +66,140 @@
   </div>
 </template>
 <script>
-  import {mapGetters, mapState} from "vuex";
-  import {clearCache} from "@/api/user";
+import { mapGetters, mapState } from "vuex";
+import { clearCache } from "@/api/user";
 
-  export default {
-    name: "tags",
-    data() {
-      return {
-        active: "",
-        contentmenuX: "",
-        contentmenuY: "",
-        contextmenuFlag: false
-      };
-    },
-    created() {
-    },
-    mounted() {
+export default {
+  name: "tags",
+  data () {
+    return {
+      active: "",
+      contentmenuX: "",
+      contentmenuY: "",
+      contextmenuFlag: false
+    };
+  },
+  created () {
+  },
+  mounted () {
+    this.setActive();
+  },
+  watch: {
+    tag () {
       this.setActive();
     },
-    watch: {
-      tag() {
-        this.setActive();
-      },
-      contextmenuFlag() {
-        window.addEventListener("mousedown", this.watchContextmenu);
+    contextmenuFlag () {
+      window.addEventListener("mousedown", this.watchContextmenu);
+    }
+  },
+  computed: {
+    ...mapGetters(["tagWel", "tagList", "tag", "website"]),
+    ...mapState({
+      showTag: state => state.common.showTag
+    }),
+    tagLen () {
+      return this.tagList.length || 0;
+    }
+  },
+  methods: {
+    generateTitle (item) {
+      console.log(this.$router.$avueRouter);
+      return this.$router.$avueRouter.generateTitle(
+        item.label,
+        (item.meta || {}).i18n
+      );
+    },
+    watchContextmenu (event) {
+      if (!this.$el.contains(event.target) || event.button !== 0) {
+        this.contextmenuFlag = false;
       }
+      window.removeEventListener("mousedown", this.watchContextmenu);
     },
-    computed: {
-      ...mapGetters(["tagWel", "tagList", "tag", "website"]),
-      ...mapState({
-        showTag: state => state.common.showTag
-      }),
-      tagLen() {
-        return this.tagList.length || 0;
+    handleContextmenu (event) {
+      let target = event.target;
+      // 解决 https://github.com/d2-projects/d2-admin/issues/54
+      let flag = false;
+      if (target.className.indexOf("el-tabs__item") > -1) flag = true;
+      else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
+        target = target.parentNode;
+        flag = true;
+      }
+      if (flag) {
+        event.preventDefault();
+        event.stopPropagation();
+        this.contentmenuX = event.clientX;
+        this.contentmenuY = event.clientY;
+        this.tagName = target.getAttribute("aria-controls").slice(5);
+        this.contextmenuFlag = true;
       }
     },
-    methods: {
-      generateTitle(item) {
-        return this.$router.$avueRouter.generateTitle(
-          item.label,
-          (item.meta || {}).i18n
-        );
-      },
-      watchContextmenu(event) {
-        if (!this.$el.contains(event.target) || event.button !== 0) {
-          this.contextmenuFlag = false;
-        }
-        window.removeEventListener("mousedown", this.watchContextmenu);
-      },
-      handleContextmenu(event) {
-        let target = event.target;
-        // 解决 https://github.com/d2-projects/d2-admin/issues/54
-        let flag = false;
-        if (target.className.indexOf("el-tabs__item") > -1) flag = true;
-        else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
-          target = target.parentNode;
-          flag = true;
-        }
-        if (flag) {
-          event.preventDefault();
-          event.stopPropagation();
-          this.contentmenuX = event.clientX;
-          this.contentmenuY = event.clientY;
-          this.tagName = target.getAttribute("aria-controls").slice(5);
-          this.contextmenuFlag = true;
-        }
-      },
-      //激活当前选项
-      setActive() {
-        this.active = this.tag.value;
-      },
-      menuTag(value, action) {
-        if (action === "remove") {
-          let {tag, key} = this.findTag(value);
-          this.$store.commit("DEL_TAG", tag);
-          if (tag.value === this.tag.value) {
-            tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个
-            this.openTag(tag);
-          }
+    //激活当前选项
+    setActive () {
+      this.active = this.tag.value;
+    },
+    menuTag (value, action) {
+      if (action === "remove") {
+        let { tag, key } = this.findTag(value);
+        this.$store.commit("DEL_TAG", tag);
+        if (tag.value === this.tag.value) {
+          tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个
+          this.openTag(tag);
         }
-      },
-      openTag(item) {
-        let tag;
-        if (item.name) {
-          tag = this.findTag(item.name).tag;
-        } else {
+      }
+    },
+    openTag (item) {
+      let tag;
+      if (item.name) {
+        tag = this.findTag(item.name).tag;
+      } else {
+        tag = item;
+      }
+      this.$router.push({
+        path: this.$router.$avueRouter.getPath({
+          name: tag.label,
+          src: tag.value
+        }, tag.meta),
+        query: tag.query
+      });
+    },
+    closeOthersTags () {
+      this.contextmenuFlag = false;
+      this.$store.commit("DEL_TAG_OTHER");
+    },
+    findTag (value) {
+      let tag, key;
+      this.tagList.map((item, index) => {
+        if (item.value === value) {
           tag = item;
+          key = index;
         }
-        this.$router.push({
-          path: this.$router.$avueRouter.getPath({
-            name: tag.label,
-            src: tag.value
-          }, tag.meta),
-          query: tag.query
-        });
-      },
-      closeOthersTags() {
-        this.contextmenuFlag = false;
-        this.$store.commit("DEL_TAG_OTHER");
-      },
-      findTag(value) {
-        let tag, key;
-        this.tagList.map((item, index) => {
-          if (item.value === value) {
-            tag = item;
-            key = index;
-          }
-        });
-        return {tag: tag, key: key};
-      },
-      closeAllTags() {
-        this.contextmenuFlag = false;
-        this.$store.commit("DEL_ALL_TAG");
-        this.$router.push({
-          path: this.$router.$avueRouter.getPath({
-            src: this.tagWel.value
-          }),
-          query: this.tagWel.query
-        });
-      },
-      clearCacheTags() {
-        this.$confirm("是否需要清除缓存?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          clearCache().then(() => {
-            this.contextmenuFlag = false;
-            this.$message.success('清除完毕');
-          })
-        });
-      }
+      });
+      return { tag: tag, key: key };
+    },
+    closeAllTags () {
+      this.contextmenuFlag = false;
+      this.$store.commit("DEL_ALL_TAG");
+      this.$router.push({
+        path: this.$router.$avueRouter.getPath({
+          src: this.tagWel.value
+        }),
+        query: this.tagWel.query
+      });
+    },
+    clearCacheTags () {
+      this.$confirm("是否需要清除缓存?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        clearCache().then(() => {
+          this.contextmenuFlag = false;
+          this.$message.success('清除完毕');
+        })
+      });
     }
-  };
+  }
+};
 </script>
 
 

+ 18 - 4
src/views/exctab/ElementIdentification/index.vue

@@ -11,8 +11,11 @@
           lazy
         ></el-tree>
       </el-col>
-      <el-col :span="19">
-        <div>模板名称</div>
+      <el-col
+        :span="19"
+        v-if="excelSrc"
+      >
+        <div>{{from.extension}}</div>
         <el-row
           class="martop20"
           :gutter="20"
@@ -89,6 +92,14 @@
                   ></el-input>
                 </template>
               </el-table-column>
+              <el-table-column label="操作">
+                <template slot-scope="scope">
+                  <el-link
+                    type="danger"
+                    @click="deleteTableData(scope.$index)"
+                  >删除</el-link>
+                </template>
+              </el-table-column>
             </el-table>
             <el-button
               type="success"
@@ -292,7 +303,7 @@ export default {
   },
   methods: {
     //#region 
-    handleNodeClick (data) {
+    handleNodeClick (data) {//树节点点击事件
       console.log(data);
       if (data.hasChildren) {
         this.detailExcel(data.id)
@@ -320,11 +331,14 @@ export default {
         eAllowDeviation: ''
       })
     },
+    deleteTableData (key) {//删除
+      this.tableData.splice(key, 1)
+    },
     async getColByTabId () {//获取字段信息
       const { data: res } = await getColByTabId({ tabId: this.from.id })
       console.log(res);
       if (res.code === 200) {
-        // this.tableData = res.data
+        this.tableData = res.data
       }
     },
     //#endregion

+ 13 - 9
src/views/exctab/excelmodel/excelmodel.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="box flexBetween">
+    <div class="box flexBetween" >
       <!-- 左侧树结构 -->
       <div :style="{'width':threessW+'px'}">
         <div
@@ -11,7 +11,7 @@
             <basic-container style="width:100%;">
               <!-- 树结构 -->
               <avue-tree
-                style="width:100%;"
+                :style="{width:'100%',height:heightss +'px'}"
                 :permission="getPermission"
                 :loading="loading"
                 :option="option"
@@ -55,9 +55,9 @@
         </div>
       </div>
       <!-- 右侧 -->
-      <div class="rightBox box">
-        <el-scrollbar>
-          <basic-container>
+      <div class="rightBox box" style="height: 100%;" ref="rulesss">
+        <el-scrollbar style="height: 100%;" >
+          <basic-container style="height: 100%;" >
             <!-- 上传、删除、下载操作栏 -->
             <div
               class="rightHeader"
@@ -119,9 +119,8 @@
               v-show="!from.checkd"
               description="该目录为根目录没有EXCEL文件"
             ></el-empty>
-            <div
-              style="height:700px;margin-top:20px;"
-              v-if="from.fileUrl"
+            <div v-if="from.fileUrl"
+              :style="{ 'margin-top': '20px', 'height':heightss+'px'}"
             >
               <iframe
                 :src="excelSrc"
@@ -294,11 +293,12 @@ export default {
         y: '',
       },//结束
       //#endregion
-
+      heightss:'',//
       loading: false,//懒加载
       option: {
         filter: false,
         lazy: true,
+        menu:false,
         treeLoad: (async (node, resolve) => {
           console.log(node);
           console.log(resolve);
@@ -339,6 +339,7 @@ export default {
       option2: {
         filter: false,
         lazy: true,
+        menu: false,
         treeLoad: (async (node, resolve) => {
           if (node.data.hasChildren) {
             const { data: res } = await wbstree({ parentId: node.data.id, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
@@ -747,6 +748,9 @@ export default {
     this.excelType()//清表类型
     this.tabLazytree(0, this.$route.params.id)//获取清表树
   },
+  mounted () {
+    this.heightss=this.$refs.rulesss.clientHeight-100
+  }
 }
 </script>
 

+ 2 - 0
src/views/manager/archivetree.vue

@@ -446,6 +446,8 @@ export default {
           val.hasChildren = !val.hasChildren
         });
         return res.data
+      } else if (res.code == 200 && res.msg == "未查询到信息") {
+        return []
       }
     },
     addtree (data) {//添加树

+ 3 - 2
src/views/manager/projectinfo/tree.vue

@@ -303,8 +303,9 @@
                 >编辑元素</el-link>
                 <el-link
                   class="mg-l-10"
-                  type="primary"
-                  @click="Associationlist(scope)"
+                  type="primary"         
+                  :disabled='scope.row.fileType!=3'
+                  @click="Associationlist(scope)" 
                 >关联清表</el-link>
                 <el-link
                   class="mg-l-10"