linwe
2023-12-14 0213c6b37748e96570125bc7a12bf2e7cc5a500f
数据管理优化
8 files modified
487 ■■■■■ changed files
src/api/userHouse/list/house.js 8 ●●●●● patch | view | raw | blame | history
src/api/userHouse/list/houseHold.js 9 ●●●●● patch | view | raw | blame | history
src/api/userHouse/list/userHouseList.js 14 ●●●●● patch | view | raw | blame | history
src/views/article/article.vue 153 ●●●●● patch | view | raw | blame | history
src/views/place/index.vue 8 ●●●●● patch | view | raw | blame | history
src/views/userHouse/houseHoldList.vue 114 ●●●● patch | view | raw | blame | history
src/views/userHouse/houseList.vue 177 ●●●● patch | view | raw | blame | history
vue.config.js 4 ●●●● patch | view | raw | blame | history
src/api/userHouse/list/house.js
@@ -58,6 +58,14 @@
  })
}
export const getDetatils = (params) => {
  return request({
    url: '/api/blade-house/house/getHouseDetail',
    method: 'get',
    params: params
  })
}
export const saveOrUpdateHouseLabel = (ids, type) => {
  return request({
    url: '/api/blade-house/house/saveOrUpdateHouseLabel',
src/api/userHouse/list/houseHold.js
@@ -59,6 +59,15 @@
    }
  })
}
export const getDetatils = (id) => {
  return request({
    url: '/api/blade-household/household/getDetail',
    method: 'get',
    params: {
      id
    }
  })
}
export const saveOrUpdateHouseLabel = (ids, type) => {
  return request({
src/api/userHouse/list/userHouseList.js
@@ -70,3 +70,17 @@
    }
  })
}
export const saveOrUpdateHouseholdLabel = (row) => {
  return request({
    url: '/api/blade-householdLabel/householdLabel/saveOrUpdateHouseholdLabel',
    method: 'post',
    data: row
  })
}
export const removeHouseholdLabel = (row) => {
  return request({
    url: '/api/blade-householdLabel/householdLabel/removeHouseholdLabel',
    method: 'post',
    data: row
  })
}
src/views/article/article.vue
@@ -49,7 +49,7 @@
      <span slot="title" class="dialog-footer">
        {{discussForm.ontitle}}
      </span>
      <div id="" v-if="discussForm.eventType == 2">
      <div id="" v-if="discussForm.eventType == 1">
        <avue-form @submit="handleSubmit" :option="optionDiscuss" v-model="discussForm"></avue-form>
      </div>
@@ -59,15 +59,6 @@
      </div>
    </el-dialog>
    <!-- <el-dialog title="用户数据导入" append-to-body :visible.sync="dialogVisibles" width="555px">
      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
        <template slot="excelTemplate">
          <el-button type="primary" @click="handleTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog> -->
@@ -340,7 +331,7 @@
              }
            }, {
              labelWidth: 100,
              label: '开启投票',
              label: '开启',
              prop: 'openFlag',
              type: 'radio',
              button: true,
@@ -354,52 +345,7 @@
                value: 1
              }]
            },
            {
              labelWidth: 100,
              label: '人数限制',
              prop: 'numberRestrictions',
              type: 'number',
              button: true,
              row: true,
              min: 0,
              max: 99999999,
              controlsPosition: '',
              step: 10,
              offset: 6,
            }, {
              labelWidth: 100,
              label: '投票限制',
              prop: 'voteRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '一人一票',
                value: 0
              }, {
                label: '一户一票',
                value: 1
              }]
            }, {
              labelWidth: 100,
              label: '用户限制',
              prop: 'userRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '不限制',
                value: 0
              }, {
                label: '必须绑定手机',
                value: 1
              }, {
                label: '必须绑定房屋',
                value: 2
              }]
            },
            {
              label: "截止时间",
              row: true,
@@ -414,14 +360,12 @@
        optionDiscuss: {
          column: [{
              label: "",
              // labelWidth: 20,
              type: 'title',
              prop: "title",
              span: 24,
              row: true,
              offset: 2,
              styles: {
                // color: 'red',
                fontSize: '24px'
              }
            }, {
@@ -441,72 +385,18 @@
              }]
            }, {
              labelWidth: 100,
              label: '多房屋可重复',
              prop: 'repeatVote',
              label: '开启签名',
              prop: 'signatureFlag',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '不可以',
                label: '开启',
                value: 0
              }, {
                label: '可以',
                label: '不开启',
                value: 1
              }]
            }, {
              labelWidth: 100,
              label: '投票限制',
              prop: 'voteRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '一人一票',
                value: 0
              }, {
                label: '一户一票',
                value: 1
              }]
            }, {
              labelWidth: 100,
              label: '用户限制',
              prop: 'userRestrictions',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '不限制',
                value: 0
              }, {
                label: '必须绑定手机',
                value: 1
              }, {
                label: '必须绑定房屋',
                value: 2
              }]
            }, {
              labelWidth: 100,
              label: '票数公开',
              prop: 'voteNumberPublic',
              type: 'radio',
              button: true,
              row: true,
              offset: 6,
              dicData: [{
                label: '全程公开',
                value: 0
              }, {
                label: '投票后公开',
                value: 1
              }, {
                label: '投票结束后公开',
                value: 2
              }, {
                label: '不公开',
                value: 3
              }]
            },
            {
@@ -518,35 +408,6 @@
              format: "yyyy-MM-dd hh:mm:ss",
              valueFormat: "timestamp",
            },
            // {
            //   labelWidth: 100,
            //   label: '人数限制',
            //   prop: 'numberRestrictions',
            //   type: 'number',
            //   button: true,
            //   row: true,
            //   min: 0,
            //   max: 99999999,
            //   controlsPosition: '',
            //   step: 10,
            //   offset: 6,
            // },
            // {
            //   labelWidth: 100,
            //   label: '指定用户',
            //   prop: 'appointUser',
            //   type: 'radio',
            //   button: true,
            //   row: true,
            //   offset: 6,
            //   dicData: [{
            //     label: '不限制',
            //     value: 0
            //   }, {
            //     label: '指定用户可见',
            //     value: 1
            //   }]
            // },
          ]
        },
        districtTree: [],
src/views/place/index.vue
@@ -17,16 +17,18 @@
    </avue-crud>
    <el-dialog title="场所维护" append-to-body :visible.sync="roleBox" center>
      <h3>基本信息:</h3>
      <avue-form :option="optionDetail" v-model="placeForm"></avue-form>
      <h3>从业人员:</h3>
      <avue-crud :option="placeOption" :search.sync="search" :table-loading="loading" :data="placeExt" ref="crud"
        v-model="houseHoldForm" :permission="permissionList" @row-del="houseHoldRowDel" @row-update="houseHoldRowUpdate"
        @row-save="houseHoldRowSave" :page.sync="holdPage" @current-change="currentChange" @size-change="sizeChange">
      </avue-crud>
      <avue-form :option="optionDetail" v-model="placeForm"></avue-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="roleBox = false">取 消</el-button>
        <el-button type="primary" @click="submitRole">确 定</el-button>
        <el-button type="primary" @click="submitRole">提 交</el-button>
      </span>
    </el-dialog>
src/views/userHouse/houseHoldList.vue
@@ -22,10 +22,6 @@
            <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
              @click="manageLabel(scope.row)">标签
            </el-button>
            <!--  <el-button type="success" size="small" plain icon="el-icon-upload2" @click="handleImport">导入
            </el-button>
            <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
            </el-button> -->
          </template>
          <template slot-scope="{row}" slot="tenantName">
            <el-tag>{{ row.tenantName }}</el-tag>
@@ -53,17 +49,18 @@
        </el-dialog>
        <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center   width="600px">
          <div id="" v-for="(item1,index1) in labelData">
          <div id="" v-for="(item,index) in labelData">
            <el-row>
              <el-col :span="24">
                <div>
                  <el-divider content-position="left">{{item1.name}}</el-divider>
                  <el-divider content-position="left">{{item.name}}</el-divider>
                </div>
              </el-col>
            </el-row>
            <div id="" class="grid-container2" v-if="item1.children">
            <div id="" class="grid-container2" v-if="item.children">
              
                <div class="grid-item"  v-for="(item2,index2) in item1.children "    @click="changLabel(item2)">
              <div class="grid-item" :style="{ backgroundColor: item2.color}" v-for="(item2,index2) in item.children "
                @click="changLabel(item2)">
                  {{item2.name}}
                </div>
            </div>
@@ -77,11 +74,12 @@
        </el-dialog>
        <el-dialog :title="'编辑标签' +  currentLabel.name" append-to-body :visible.sync="editLabelFlge" width="655px">
          <avue-form :option="labelOption" v-model="excelForm">
            <template slot="excelTemplate">
            </template>
          <avue-form :option="labelOption" v-model="labelForm" :submit="onsubmit">
          </avue-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="editLabelFlge = false">取 消</el-button>
            <el-button type="primary" @click="onsubmit">确 定</el-button>
          </span>
        </el-dialog>
@@ -105,8 +103,13 @@
    remove,
    add,
    update,
    getDetatil
    getDetatil,
    getDetatils
  } from "@/api/userHouse/list/houseHold.js";
  import {
    removeHouseholdLabel,
    saveOrUpdateHouseholdLabel
  } from "@/api/userHouse/list/userHouseList.js";
  import {
    getLabelList,
  } from '@/api/label/label'
@@ -222,30 +225,38 @@
        data: [],
        excelForm: {},
        labelForm: {},
        labelOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
            label: '级别',
            prop: 'radio',
            prop: 'color',
            type: 'radio',
            button: true,
            row: true,
            dicData: [{
              label: '撤销',
              value: -1
              value: '#EBEDF0'
            }, {
              label: '绿',
              value: 0
              value: '#30D17C'
            }, {
              label: '黄',
              value: 1
              value: '#FFB42B'
            }, {
              label: '红',
              value: ''
              value: '#EA1F1F'
            }],
            rules: [{
              required: true,
              message: "请选择",
              trigger: "blur"
            }]
          }, {
            row: true,
            label: '备注',
            prop: 'input',
            prop: 'remark',
            type: 'input'
          }]
        },
@@ -296,7 +307,9 @@
            }
          ]
        },
        currentLabel:""
        currentLabel: {},
        currentRow: {},
        householdLabelList: [],
      };
    },
    watch: {},
@@ -314,19 +327,74 @@
    mounted() {},
    methods: {
      onsubmit() {
        if (this.labelForm.color === '#EBEDF0') {
          let params = {
            householdId: this.currentRow.id,
            labelId: this.currentLabel.id
          }
          removeHouseholdLabel(params).then(res => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
          })
        } else {
          this.labelForm.houseCode = this.currentRow.houseCode
          this.labelForm.householdId = this.currentRow.id
          this.labelForm.labelId = this.currentLabel.id
          this.labelForm.lableType = 1
          saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
          })
        }
      },
      changLabel(item) {
        this.editLabelFlge = true
        this.currentLabel = item;
        this.labelForm.color = item.color
        this.labelForm.remark = item.remark
      },
      manageLabel() {
      manageLabel(item) {
        this.currentRow = item
        this.labelFlag = true
        let params = {
          parentId: 1000
        }
        // 查询标签
        getLabelList(Object.assign(params)).then(res => {
          const data = res.data.data;
          this.labelData = data;
          // this.labelData = data;
          this.loading = false;
          // 查询详情
          getDetatils(item.id).then(res => {
            this.householdLabelList = res.data.data.householdLabelList;
            this.loading = false;
            // 将细类放到一起
            data.forEach(e => {
              e.children.forEach(f => {
                if (this.householdLabelList.length > 0) {
                  this.householdLabelList.forEach(h => {
                    if (Number(f.id) == h.labelId) {
                      f['color'] = h.color
                      f['remark'] = h.remark
                    }
                  })
                }
              })
            })
            this.labelData = data;
          });
        });
      },
      rowSave(row, done, loading) {
@@ -492,6 +560,7 @@
    flex-wrap: wrap;
    padding-bottom:20px;
  }
  .grid-item{
    padding:8px 14px;
    border:1px solid #dcdfe6;
@@ -499,6 +568,7 @@
    margin-bottom:10px;
    border-radius: 20px;
  }
  .grid-item:hover{
    background-color: #e8f4ff;
    color:#017BFC;
src/views/userHouse/houseList.vue
@@ -2,8 +2,8 @@
  <el-row>
    <el-col :span="24">
      <basic-container>
        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form"
          :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
          v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
          :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
          @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
          @refresh-change="refreshChange" @on-load="onLoad">
@@ -22,7 +22,11 @@
            <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
              @click="handleHouseholdManager(scope.row)">住户管理
            </el-button>
            <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
              @click="manageLabel(scope.row)">标签
            </el-button>
          </template>
          <template slot-scope="{row}" slot="tenantName">
            <el-tag>{{ row.tenantName }}</el-tag>
          </template>
@@ -47,6 +51,29 @@
            <el-button type="primary" @click="submitRole">确 定</el-button>
          </span>
        </el-dialog>
        <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center width="600px">
          <div id="" class="grid-container2">
            <div class="grid-item" :style="{ backgroundColor: item.color}" v-for="(item,index) in labelData "
              @click="changLabel(item)">
              {{item.name}}
            </div>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-button @click="labelFlag = false">取 消</el-button>
            <el-button type="primary" @click="submitRole">确 定</el-button>
          </span>
        </el-dialog>
        <el-dialog :title="'编辑标签   ' +  currentLabel.name" append-to-body :visible.sync="editLabelFlge" width="655px">
          <avue-form :option="labelOption" v-model="labelForm" :submit="onsubmit">
          </avue-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="editLabelFlge = false">取 消</el-button>
            <el-button type="primary" @click="onsubmit">确 定</el-button>
          </span>
        </el-dialog>
        <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
            <template slot="excelTemplate">
@@ -70,8 +97,16 @@
  remove,
  add,
  update,
  getDetatil
    getDetatil,
    getDetatils
} from "@/api/userHouse/list/house.js";
  import {
    removeHouseholdLabel,
    saveOrUpdateHouseholdLabel
  } from "@/api/userHouse/list/userHouseList.js";
  import {
    getLabelList,
  } from '@/api/label/label'
import {
  exportBlob
} from "@/api/common";
@@ -99,6 +134,46 @@
  },
  data() {
    return {
        labelData: [],
        labelForm: {},
        userHouseLabelVOList: [],
        currentLabel: {},
        labelOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
            label: '级别',
            prop: 'color',
            type: 'radio',
            button: true,
            row: true,
            dicData: [{
              label: '撤销',
              value: '#EBEDF0'
            }, {
              label: '绿',
              value: '#30D17C'
            }, {
              label: '黄',
              value: '#FFB42B'
            }, {
              label: '红',
              value: '#EA1F1F'
            }],
            rules: [{
              required: true,
              message: "请选择",
              trigger: "blur"
            }]
          }, {
            row: true,
            label: '备注',
            prop: 'remark',
            type: 'input'
          }]
        },
        editLabelFlge: false,
        labelFlag: false,
      householdManagerVisible:false,
      form: {},
      search: {},
@@ -141,24 +216,20 @@
          label: "小区",
          prop: "districtName",
          search: true,
          rules: [
            {
              rules: [{
              required: true,
              message: "请选择小区",
              trigger: "blur",
            },
          ],
              }, ],
        },
        {
          label: "手机",
          prop: "phone",
          rules: [
            {
              rules: [{
              required: true,
              message: "请输入绑定手机",
              trigger: "blur",
            },
          ],
              }, ],
        },
        {
          label: "幢",
@@ -179,13 +250,11 @@
          label: "楼层",
          prop: "floor",
          type: "number",
          rules: [
            {
              rules: [{
              required: true,
              message: "请输入楼层",
              trigger: "blur",
            },
          ],
              }, ],
        },
        {
          label: "面积",
@@ -257,8 +326,7 @@
      }
    };
  },
  watch: {
  },
    watch: {},
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
@@ -270,9 +338,80 @@
      };
    }
  },
  mounted() {
  },
    mounted() {},
  methods: {
      onsubmit() {
        if (this.labelForm.color === '#EBEDF0') {
          let params = {
            householdId: this.currentRow.id,
            labelId: this.currentLabel.id
          }
          removeHouseholdLabel(params).then(res => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
          })
        } else {
          this.labelForm.houseCode = this.currentRow.houseCode
          this.labelForm.householdId = this.currentRow.id
          this.labelForm.labelId = this.currentLabel.id
          this.labelForm.lableType = 2
          saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
          })
        }
      },
      changLabel(item) {
        this.editLabelFlge = true
        this.currentLabel = item;
        this.labelForm.color = item.color
        this.labelForm.remark = item.remark
      },
      manageLabel(item) {
        this.currentRow = item
        this.labelFlag = true
        let params = {
          parentId: 1001
        }
        // 查询标签
        getLabelList(Object.assign(params)).then(res => {
          const data = res.data.data;
          this.loading = false;
          // 查询详情
          getDetatils({
            houseCode: item.houseCode
          }).then(res => {
            if (res.data.data) {
              this.userHouseLabelVOList = res.data.data.userHouseLabelVOList;
              this.loading = false;
              // 将细类放到一起
              data.forEach(f => {
                if (this.userHouseLabelVOList.length > 0) {
                  this.userHouseLabelVOList.forEach(h => {
                    if (Number(f.id) == h.labelId) {
                      f['color'] = h.color
                      f['remark'] = h.remark
                    }
                  })
                }
              })
            }
            this.labelData = data;
          });
        });
      },
    handleHouseholdManager(row){
      var that = this
      this.householdManagerVisible = true
vue.config.js
@@ -26,8 +26,8 @@
    proxy: {
      '/api': {
        //本地服务接口地址
        // target: 'http://localhost:9528',
        target: 'http://192.168.0.102:9528',
        target: 'http://localhost:9528',
        // target: 'http://192.168.0.102:9528',
        //远程演示服务地址,可用于直接启动项目
        //target: 'https://saber.bladex.cn/api',
        changeOrigin: true,