zhangzengfei
2022-12-30 804d59e162b72be684d0087a8cd74dbd6fecbf4d
src/pages/library/components/baseList.vue
@@ -193,25 +193,34 @@
        this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1
      );
    },
    async init() {
    async init(typ) {
      await this.BaseManageData.querySyncTables();
      this.syncTableList = this.BaseManageData.syncTables;
      this.defaultShow();
      if (typ) {
        this.$emit("getList");
      } else {
        this.defaultShow();
      }
      await this.BaseManageData.queryLocalTables();
      this.localTableList = this.BaseManageData.localTables;
      this.defaultShow();
      if (typ) {
        this.$emit("getList");
      } else {
        this.defaultShow();
      }
    },
    add(type) {
      this.$emit("changeShow", null, type);
    },
    clickLast(type) {
      this.$nextTick(() => {
        this.clickCategory(
          this.syncTableList.length - 1,
          type,
          this.syncTableList[this.syncTableList.length - 1]
        );
      });
      // this.$nextTick(() => {
      // });
      this.clickCategory(
        this.syncTableList.length - 1,
        type,
        this.syncTableList[this.syncTableList.length - 1]
      );
    },
    clickCategory(index, type, item) {
      this.categoryIndex = type + index;
@@ -223,10 +232,12 @@
    defaultShow() {
      if (this.syncTableList && this.syncTableList.length) {
        this.clickCategory(0, "sync", this.syncTableList[0]);
      } else {
      } else
        if (this.localTableList && this.localTableList.length) {
          this.clickCategory(0, "local", this.syncTableList[0]);
        }
      else {
        console.log("this.localTableList.length",this.localTableList.length)
      }
    },
    // 添加时间比较函数