heyujie
2022-04-01 85841ef9441aff46d80c7458c928e085e78911a1
src/views/personalCenter/components/SubAccount.vue
@@ -23,8 +23,8 @@
      </div>
      <div class="right">
        <div class="button searchBtn" @click="searchingBtn">搜索</div>
        <div class="button resetBtn" @click="clearSearch">重置</div>
        <div class="button searchBtn" @click="save">搜索</div>
        <div class="button resetBtn" @click="save">重置</div>
      </div>
    </div>
@@ -67,29 +67,7 @@
        <el-table-column prop="userType" label="用户类型"></el-table-column>
        <el-table-column prop="duration" label="授权时长"></el-table-column>
        <el-table-column prop="authList" label="权限"></el-table-column>
        <!-- <el-table-column label="安装时间" >
          <template slot-scope="scope">
            <div v-if="scope.row.installTime.length > 1">
              <div>{{ scope.row.installTime[0] }}</div>
              <div>{{ scope.row.installTime[1] }}</div>
            </div>
            <div v-else>--</div>
          </template>
        </el-table-column> -->
        <!-- <el-table-column label="首次使用时间" >
          <template slot-scope="scope">
            <div v-if="scope.row.firstUseTime.length > 1">
              <div>{{ scope.row.firstUseTime[0] }}</div>
              <div>{{ scope.row.firstUseTime[1] }}</div>
            </div>
            <div v-else>--</div>
          </template>
        </el-table-column>
        <el-table-column label="所属集群" show-overflow-tooltip >
          <template> -- </template>
        </el-table-column> -->
        <el-table-column label="状态">
          <template slot-scope="scope">
            <div v-if="scope.row.isBind == 1" class="status green">已绑定</div>
@@ -103,7 +81,6 @@
            <span class="iconfont option" @click="joinCluster(scope.row)"
              >&#xe640;</span
            >
            <!-- 解绑 -->
            <span class="iconfont option" @click="Untying(scope.row)"
              >&#xe617;</span
@@ -151,7 +128,7 @@
    ></JoinClusterBox>
  </div>
  <div class="sub-account" v-else-if="isShowAdd">
    <div class="add-title" @click="isShowAdd = false">
    <div class="add-title" @click="isShowAdd=false">
      <span class="iconfont">&#xe614;</span>
      <span>添加子账户</span>
    </div>
@@ -212,8 +189,8 @@
      
    </el-form>
    <div class="right">
      <div class="button searchBtn" @click="searchingBtn">搜索</div>
      <div class="button resetBtn" @click="clearSearch">重置</div>
      <div class="button searchBtn" @click="save">搜索</div>
      <div class="button resetBtn" @click="save">重置</div>
    </div>
  </div>
  <div class="sub-account" v-else-if="isShowRelate">
@@ -230,8 +207,6 @@
</template>
<script>
import { findDevList } from "@/api/device";
// import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox";
import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox";
import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox";
import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox";
@@ -452,6 +427,7 @@
  },
  methods: {
    goback() {
      this.isShowAdd=false
      this.isShowRelate = false;
      this.activeIndex = 0;
    },
@@ -484,42 +460,17 @@
    },
    // 查询列表
    searchingBtn() {
      let param = {
        page: this.page,
        size: this.size,
        // startTime: this.searchTime[0],
        // endTime: this.searchTime[1],
        inputText: this.inputText,
      };
      findDevList(param)
        .then((res) => {
          this.dataList = res.data.list;
          //时间分行显示
    save(){
          this.dataList.forEach((item) => {
            item.installTime = item.installTime.split(" ");
            item.firstUseTime = item.firstUseTime.split(" ");
          });
          this.total = res.data.total;
          if (res.data.total <= this.size) {
            this.page = 1;
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //分页功能
    handleSizeChange(size) {
      this.size = size;
      this.searchingBtn();
    },
    //分页功能
    refrash(page) {
      this.page = page;
      this.searchingBtn();
    },
    //解绑按钮
@@ -559,13 +510,11 @@
    //解绑成功回调
    reflash() {
      this.isShowUnbind = false;
      this.searchingBtn();
    },
    clearSearch() {
      this.searchTime = this.getDateInit();
      this.inputText = "";
      this.searchingBtn();
    },
    //退出集群
@@ -581,8 +530,7 @@
    },
  },
  mounted() {
    this.searchTime = this.getDateInit();
    this.searchingBtn();
  },
};
</script>