xiangpei
2025-03-18 6c66123ec863c89a25b3e36e3e4059423beb0854
Merge branch 'dev'
3个文件已修改
73 ■■■■ 已修改文件
src/components/VisibilityToolbar/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/legalPerson.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/index.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/VisibilityToolbar/index.vue
@@ -23,10 +23,10 @@
        <span>信息显隐筛选</span>
      </div>
      <div slot="default" style="margin-left: 20px;margin-top: 20px">
        <el-table :data="getPage" style="width: 95%; height: 80%;;margin-bottom: 40px;">
        <el-table :row-key="row => { return row.id }" :data="getPage" style="width: 95%; height: 80%;;margin-bottom: 40px;" >
          <el-table-column prop="index" label="序号" width="80"></el-table-column>
          <el-table-column prop="label" label="数据名称"></el-table-column>
          <el-table-column prop="visible" label="是否显示">
          <el-table-column prop="visible" label="是否显示" >
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.visible"
@@ -37,9 +37,10 @@
              ></el-switch>
            </template>
          </el-table-column>
          <el-table-column prop="date" label="排序">
          <el-table-column prop="sort" label="排序">
            <template slot-scope="scope">
              <el-input-number v-model="scope.row.sort" :min="0" style="width: 120px" @change="sortChange(scope.row, $event)"></el-input-number>
              <el-input-number v-model="scope.row.sort" :min="0" style="width: 120px"
                               @change="sortChange(scope.row, $event)"></el-input-number>
            </template>
          </el-table-column>
        </el-table>
@@ -148,6 +149,7 @@
          this.saveList.push(row)
        }
      }
      console
      this.$emit('update:columns', row);
    },
    handlePageChange(page) {
src/views/projectEngineering/projectLibrary/component/legalPerson.vue
@@ -246,7 +246,7 @@
    }
    this.legalPersonForm.projectId = this.projectForm.id;
    this.handleBlur();
  },
  beforeDestroy() {
    if(Object.keys(this.legalPersonForm).length !==0)  localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm));
@@ -258,6 +258,7 @@
        this.options.forEach(item => {
          if (item.id === row) {
            this.legalPersonForm = item;
            this.legalPersonForm.id = null;
          }
        })
      }
@@ -265,7 +266,7 @@
    },
    //项目单位输入时触发
    handleBlur(query){
      console.log(query)
      this.legalPersonForm.projectUnit = query;
      if (this.legalPersonForm.projectUnit !== null && this.legalPersonForm.projectUnit !== '' && this.legalPersonForm.projectUnit !== undefined){
        getUnitRegistrationInfoByName(this.legalPersonForm).then(res =>{
src/views/projectEngineering/projectLibrary/index.vue
@@ -205,7 +205,6 @@
      <!-- 动态列 -->
      <el-table-column
        v-for="item in columnsNew"
        :key="item.columns"
        v-if="item.visible"
        :prop="item.columns"
        :label="item.label"
@@ -442,8 +441,8 @@
        //转换
         res.data.forEach((item,index)=>{
           item.index = index + 1;
           item.key = index;
           item.label = item.name;
          if(item.display === '0'){
            item.visible = false
          }else {
@@ -478,9 +477,7 @@
      //转换
      data.forEach((item,index)=>{
        item.index = index + 1;
        item.key = index;
        item.label = item.name;
        // item.slotName = item.columns;
        if(item.display === '0'){
          item.visible = false
        }else {
@@ -540,28 +537,28 @@
      localStorage.removeItem("documentsInfoForm")
    },
    save(){
      const list =current.map((item, index) => {
            item.name = item.label;
            item.sort = index + 1;
            item.columns = item.id;
            item.id = 0;
            if(item.slotName === undefined){
              item.slotName = null;
            }
            if(item.visible){
              item.display = "1";
            }else {
              item.display ="0";
            }
            return item;
          });
      console.log(list)
      addList(list).then(res=>{
        console.log(res.msg)
      })
    },
    // save(){
    //   const list =current.map((item, index) => {
    //         item.name = item.label;
    //         item.sort = index + 1;
    //         item.columns = item.id;
    //         item.id = 0;
    //         if(item.slotName === undefined){
    //           item.slotName = null;
    //         }
    //         if(item.visible){
    //           item.display = "1";
    //         }else {
    //           item.display ="0";
    //         }
    //         return item;
    //       });
    //   console.log(list)
    //   addList(list).then(res=>{
    //     console.log(res.msg)
    //   })
    //
    // },
    // 重置排序的方法
    handleResetSort() {
      this.hiddenColumnsList();
@@ -579,22 +576,25 @@
      });
    },
    //点击排序加减更新
    handleUpdateSort(row) {
      //替换表头元素
      this.columnsNew = this.columnsNew.map(item => {
        if (item.columns === row.columns) {
        if (item.id === row.id) {
          return row;
        }
        return item;
      });
      //替换传入显隐组件数据
      this.defaultColumns = this.defaultColumns.map(item => {
        if (item.columns === row.columns) {
        if (item.id === row.id) {
          return row;
        }
        return item;
      });
      this.defaultColumns = this.defaultColumns.sort((a, b) => a.sort - b.sort);
      //显隐排序
      this.defaultColumns.sort((a, b) => a.sort - b.sort);
      //主页表头数据排序
      this.columnsNew.sort((a, b) => a.sort - b.sort);
      //强制table渲染