shuishen
2023-12-18 fed36d52707c61dbff16bf75fceb6370cca54ea2
住房管理和房屋管理更改
4 files modified
280 ■■■■■ changed files
src/App.vue 20 ●●●● patch | view | raw | blame | history
src/views/userHouse/houseHoldList.vue 35 ●●●●● patch | view | raw | blame | history
src/views/userHouse/houseList.vue 217 ●●●● patch | view | raw | blame | history
src/warterMarkVUE.js 8 ●●●● patch | view | raw | blame | history
src/App.vue
@@ -6,19 +6,33 @@
<script>
import Watermark from "./warterMarkVUE"
import { getStore } from "@/util/store"
export default {
    name: "app",
    data () {
        return {}
        return {
            globalUserInfo: getStore({ name: "userInfo" }),
        }
    },
    watch: {},
    created () {
        Watermark.set("饶城格格")
        Watermark.set("饶城格格通" + ' ' + this.globalUserInfo.user_name + ' ' + this.getTime())
    },
    mounted () {
    },
    methods: {},
    methods: {
        getTime () {
            var date = new Date()
            var Y = date.getFullYear() + '-'
            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
            var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
            var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
            var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
            var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
            return Y + M + D + h + m + s
        },
    },
    computed: {}
}
</script>
src/views/userHouse/houseHoldList.vue
@@ -32,6 +32,11 @@
                        <el-button type="text" @click="showStringDispose(row, 'idCardflag')"
                            v-text="textDispose(row, 'idCardflag', 'idCard')"></el-button>
                    </template>
                    <template slot-scope="{row}" slot="householdLabelList">
                        {{ labelDispose(row.householdLabelList) }}
                    </template>
                    <template slot-scope="{row}" slot="tenantName">
                        <el-tag>{{ row.tenantName }}</el-tag>
                    </template>
@@ -44,6 +49,8 @@
                    <template slot-scope="{row}" slot="userTypeName">
                        <el-tag>{{ row.userTypeName }}</el-tag>
                    </template>
                </avue-crud>
                <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px" center>
@@ -139,6 +146,7 @@
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import Qs from "qs"
import { lintOnSave } from "../../../vue.config"
export default {
    data () {
@@ -171,6 +179,7 @@
                dialogType: 'drawer',
                dialogClickModal: false,
                menuWidth: 280,
                menuFixed: 'right',
                column: [{
                    label: "姓名",
                    prop: "name",
@@ -185,12 +194,12 @@
                    slot: true,
                },
                {
                    width: 160,
                    label: "身份证号",
                    prop: "idCard",
                    search: true,
                    searchSpan: 4,
                    slot: true,
                },
                {
                    label: "性别",
@@ -230,6 +239,19 @@
                {
                    label: "地址",
                    prop: "address",
                    display: false
                },
                {
                    label: "地址",
                    prop: "address",
                    display: false
                },
                {
                    width: 210,
                    label: "标签",
                    prop: "householdLabelList",
                    display: false
                },
                ]
@@ -348,6 +370,12 @@
                    }
                }
            }
        },
        labelDispose () {
            return (list) => {
                return list.map(item => item.labelName).join(',')
            }
        }
    },
    mounted () { },
@@ -359,6 +387,8 @@
                    labelId: this.currentLabel.id
                }
                removeHouseholdLabel(params).then(res => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
@@ -372,7 +402,10 @@
                this.labelForm.householdId = this.currentRow.id
                this.labelForm.labelId = this.currentLabel.id
                this.labelForm.lableType = 1
                saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
src/views/userHouse/houseList.vue
@@ -3,10 +3,10 @@
    <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"
          :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">
                    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">
          <template slot="menuLeft">
            <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
              @click="handleDelete">删 除
@@ -19,11 +19,11 @@
            </el-button>
          </template>
          <template slot-scope="scope" slot="menu">
            <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager"
              @click="handleHouseholdManager(scope.row)">住户管理
                        <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 type="text" icon="el-icon-circle-plus-outline" size="small"
                            v-if="permission.househould_manager" @click="manageLabel(scope.row)">标签
            </el-button>
          </template>
@@ -39,11 +39,15 @@
          <template slot-scope="{row}" slot="userTypeName">
            <el-tag>{{ row.userTypeName }}</el-tag>
          </template>
                    <template slot-scope="{row}" slot="userHouseLabelVOList">
                        {{ labelDispose(row.userHouseLabelVOList) }}
                    </template>
        </avue-crud>
        <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
          <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
            :default-checked-keys="roleTreeObj" :props="props">
                    <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id"
                        ref="treeRole" :default-checked-keys="roleTreeObj" :props="props">
          </el-tree>
          <span slot="footer" class="dialog-footer">
@@ -65,7 +69,8 @@
          </span> -->
        </el-dialog>
        <el-dialog :title="'编辑标签   ' +  currentLabel.name" append-to-body :visible.sync="editLabelFlge" width="655px">
                <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">
@@ -99,35 +104,35 @@
    update,
    getDetatil,
    getDetatils
  } from "@/api/userHouse/list/house.js";
} from "@/api/userHouse/list/house.js"
  import {
    removeHouseholdLabel,
    saveOrUpdateHouseholdLabel
  } from "@/api/userHouse/list/userHouseList.js";
} from "@/api/userHouse/list/userHouseList.js"
  import {
    getLabelList,
  } from '@/api/label/label'
  import {
    exportBlob
  } from "@/api/common";
} from "@/api/common"
  import {
    mapGetters
  } from "vuex";
  import website from '@/config/website';
} from "vuex"
import website from '@/config/website'
  import {
    getToken
  } from '@/util/auth';
} from '@/util/auth'
  import {
    downloadXls
  } from "@/util/util";
} from "@/util/util"
  import {
    dateNow
  } from "@/util/date";
  import NProgress from 'nprogress';
  import 'nprogress/nprogress.css';
  import func from "@/util/func";
  import householdManager from "./components/householdManager";
  import Qs from "qs";
} from "@/util/date"
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import func from "@/util/func"
import householdManager from "./components/householdManager"
import Qs from "qs"
  export default {
    components: {
      householdManager
@@ -198,7 +203,7 @@
          viewBtn: true,
          dialogType: 'drawer',
          dialogClickModal: false,
          menuWidth: 280,
                menuWidth: 340,
          column: [{
              label: "房屋编号",
              prop: "houseCode",
@@ -273,6 +278,12 @@
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
            },
                {
                    width: 210,
                    label: "标签",
                    prop: "userHouseLabelVOList",
                    display: false
                },
          ]
        },
        data: [],
@@ -324,7 +335,7 @@
            }
          ]
        }
      };
        }
    },
    watch: {},
    computed: {
@@ -335,7 +346,13 @@
          viewBtn: this.vaildData(this.permission.house_view, true),
          delBtn: this.vaildData(this.permission.house_delete, true),
          editBtn: this.vaildData(this.permission.house_edit, true)
        };
            }
        },
        labelDispose () {
            return (list) => {
                return list.map(item => item.labelName).join(',')
            }
      }
    },
    mounted() {},
@@ -351,10 +368,10 @@
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                    })
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
                    this.loading = false
          })
        } else {
          this.labelForm.houseCode = this.currentRow.houseCode
@@ -365,17 +382,17 @@
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                    })
            this.editLabelFlge = false
            this.manageLabel(this.currentRow)
            this.loading = false;
                    this.loading = false
          })
        }
      },
      changLabel(item) {
        this.editLabelFlge = true
        this.currentLabel = item;
            this.currentLabel = item
        this.labelForm.color = item.color
        this.labelForm.remark = item.remark
      },
@@ -387,15 +404,15 @@
        }
        // 查询标签
        getLabelList(Object.assign(params)).then(res => {
          const data = res.data.data;
          this.loading = false;
                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;
                        this.userHouseLabelVOList = res.data.data.userHouseLabelVOList
                        this.loading = false
              // 将细类放到一起
              data.forEach(f => {
                if (this.userHouseLabelVOList.length > 0) {
@@ -408,9 +425,9 @@
                }
              })
            }
            this.labelData = data;
          });
        });
                    this.labelData = data
                })
            })
      },
      handleHouseholdManager(row) {
        var that = this
@@ -421,31 +438,31 @@
      },
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.initFlag = false;
          this.onLoad(this.page);
                this.initFlag = false
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.initFlag = false;
          this.onLoad(this.page);
                this.initFlag = false
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -454,38 +471,38 @@
            type: "warning"
          })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.treeDeptId = '';
        this.onLoad(this.page);
            this.query = {}
            this.treeDeptId = ''
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
@@ -493,25 +510,25 @@
            type: "warning"
          })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      handleImport() {
        this.excelBox = true;
            this.excelBox = true
      },
      uploadAfter(res, done, loading, column) {
        window.console.log(column);
        this.excelBox = false;
        this.refreshChange();
        done();
            window.console.log(column)
            this.excelBox = false
            this.refreshChange()
            done()
      },
      handleExport() {
        this.$confirm("是否导出房屋数据?", "提示", {
@@ -519,22 +536,22 @@
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          NProgress.start();
                NProgress.start()
          var data = {
            ...this.query
          }
          data = Qs.stringify(data);
                data = Qs.stringify(data)
          exportBlob(
            `/api/blade-house/house/export-house?${this.website.tokenHeader}=${getToken()}&` + data
          ).then(res => {
            downloadXls(res.data, `房屋数据表${dateNow()}.xlsx`);
            NProgress.done();
                    downloadXls(res.data, `房屋数据表${dateNow()}.xlsx`)
                    NProgress.done()
          })
        });
            })
      },
      handleTemplate() {
        exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
          downloadXls(res.data, "房屋数据模板.xlsx");
                downloadXls(res.data, "房屋数据模板.xlsx")
        })
      },
      beforeOpen(done, type) {
@@ -542,33 +559,33 @@
          getDetatil({
            id: this.form.id
          }).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        this.initFlag = true;
        done();
            this.initFlag = true
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
}
</script>
<style>
src/warterMarkVUE.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-18 11:02:55
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-12-18 11:23:55
 * @LastEditTime: 2023-12-18 17:55:12
 * @FilePath: \jczz_web\src\warterMarkVUE.js
 * @Description:
 *
@@ -22,8 +22,8 @@
  //创建画布
  let createCanvas = document.createElement("canvas");
  // 设置canvas画布大小
  createCanvas.width = 200; //宽度
  createCanvas.height = 160; //高度
  createCanvas.width = 320; //宽度
  createCanvas.height = 200; //高度
  //创建Context2D对象作为2D渲染的上下文。
  let Context2D = createCanvas.getContext("2d");
@@ -33,7 +33,7 @@
  Context2D.fillStyle = "#fff"; //水印颜色 HEX格式,可使用red 或者rgb格式
  Context2D.textAlign = "center"; //水印水平位置
  Context2D.textBaseline = "Middle"; //水印垂直位置
  Context2D.fillText(str, createCanvas.width / 2.8, createCanvas.height / 1);
  Context2D.fillText(str, createCanvas.width / 3.2, createCanvas.height / 1);
  //创建元素
  let createDiv = document.createElement("div");