wangting
2024-08-30 b943775ef9b41a114c409e8a5d7a1f347b30fe1a
Source/plt-web/plt-web-ui/src/components/refer/vciWebReferClassify.vue
@@ -3,6 +3,7 @@
  <div>
    <el-dialog
      v-dialogDrag
      v-dialog-resize
      :title="title"
      :visible.sync="visible"
      :width="onlyTable?'60%': '80%'"
@@ -10,8 +11,8 @@
      class="avue-dialog avue-dialog--top"
      @close="dialogClose"
    >
      <el-container :style="{ 'height': height || '60vh' }">
        <el-aside width="300px" v-if="!onlyTable && classifys.length>0">
      <el-container :style="{ 'height': height }">
        <el-aside style="width:200px;height:100%" v-if="!onlyTable && classifys.length>0">
          <el-tabs type="border-card" style="height: 100%" @tab-click="tabClick"
                   v-model="tabName">
            <el-tab-pane
@@ -25,6 +26,7 @@
              <el-tree
                class="filter-tree"
                :style="'height: calc('+height+' - 100px);'"
                :data="treeItem.treeData"
                :lazy="lazy"
                :load="treeLoad"
@@ -37,7 +39,7 @@
            </el-tab-pane>
          </el-tabs>
        </el-aside>
        <el-main style="padding: 0 0 0 20px">
        <el-main style="padding: 0 0 0 20px;height:100%">
          <avue-crud
            ref="referCrud"
            v-model="formValue"
@@ -62,9 +64,9 @@
      </el-container>
      <div class="avue-dialog__footer">
        <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div>
        <el-button @click="escHandler">取 消</el-button>
        <el-button @click="clearValue">清 空</el-button>
        <el-button type="primary" @click="setValue">确 定</el-button>
        <el-button @click="clearValue">清 空</el-button>
        <el-button @click="escHandler">取 消</el-button>
      </div>
    </el-dialog>
@@ -113,7 +115,7 @@
    },
    height: {
      type: String,
      default:'500px'
      default:(document.body.clientHeight-400)+'px'
    },
    reloadFormKey: {
      type: String,
@@ -153,10 +155,11 @@
      lazy: this.referConfig.options.loadType == 'node',
      loadType: { all: "all", node: "node" },
      url: this.referConfig.options.url || "referGrid",
      query: {},
      query: {},//列表的搜索条件
      where:{},//列表的查询条件
      loading: false,
      page: {
        layout: "sizes,prev,pager,next,jumper,total",
        layout: "sizes,prev,pager,next,jumper,sizes,total",
        pageSize: 10,
        currentPage: 1,
        total: this.referConfig.options.data
@@ -168,7 +171,6 @@
      option: {
        addBtn: false,
        columnBtn: false,
        calcHeight: 30,
        tip: false,
        menu: false,
        searchShow: true,
@@ -180,6 +182,7 @@
        reserveSelection: true,
        dialogClickModal: false,
        highlightCurrentRow: true,
        height:parseInt(this.height)-150,
        rowKey: "id",
        rowParentKey: "parentId",
        column: [],
@@ -273,6 +276,19 @@
    tabClick:function (tab){
      this.currentTreeIndex= tab.index;
      this.filterText=this.classifys[tab.index].filterText;
      this.option.column.forEach(item => {
        if (item.hideInClassify) {
          let queryField = this.classifys[this.currentTreeIndex].queryField;
          let inClassifyArray = item.hideInClassify.split(",");
          if (inClassifyArray.find((value => value === queryField))) {
            item.hide = true;
            item.showColumn = false;
          } else {
            item.hide = false;
            item.showColumn = true;
          }
        }
      });
    },
    handleFocus() {
      if (!this.disabled) {
@@ -476,13 +492,13 @@
      this.$refs.referCrud.toggleSelection();
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
      this.onLoad(this.page);
    },
    onLoad(page, params = {}) {
      if (this.url) {
        this.loading = true;
        getList(
          Object.assign(params, this.params, this.query),
          Object.assign(params, this.params,this.where, this.query),
          page.currentPage,
          page.pageSize,
          this.url
@@ -558,13 +574,14 @@
      where[this.classifys[this.currentTreeIndex].queryField] = data.attributes[classifyValueField];
      this.url = this.classifys[this.currentTreeIndex].queryByClassifyUrl || this.options.url;
      this.page.currentPage=1;
      this.onLoad(this.page, where);
      this.where = where;
      this.onLoad(this.page,where);
    },
  },
};
</script>
<style scoped>
<style lang="scss" scoped>
.valueInfo {
  float: left;
  border: 1px solid #e9e7e7;
@@ -573,4 +590,7 @@
  padding: 6px 15px;
  line-height: 1;
}
.filter-tree{
  overflow-y: auto;
}
</style>