在公安安全监管模块,增加校园场所管理模块,在场所的展示的字段基础上,展示校园的基本信息,包括小程序校园主体账号场所维护里面的基本信息和学校信息
4 files added
2908 ■■■■■ changed files
src/views/propertySupervision/components/auditBase.vue 112 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/components/baseAllInfo.vue 1180 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/components/boxTitle.vue 483 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/place.vue 1133 ●●●●● patch | view | raw | blame | history
src/views/propertySupervision/components/auditBase.vue
New file
@@ -0,0 +1,112 @@
<template>
  <div class="cur-container-box">
    <avue-form ref="replyForm" :option="option" v-model="form" :close-on-click-modal="false">
      <template slot-scope="{size}" slot="menuForm">
        <el-button type="primary" :size="size" @click="handleSubmit">通 过</el-button>
        <el-button :size="size" @click="handleReset">驳 回</el-button>
      </template>
    </avue-form>
  </div>
</template>
<script>
  import {
    setCheckPlaceExt
  } from "@/api/place/place"
  export default {
    inject: ["placeElement"],
    data() {
      return {
        form: {},
        option: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
            span: 23,
            row: true,
            label: "审批意见",
            prop: "confirmNotion",
            type: 'textarea',
            minRows: 3,
            maxRows: 5,
            rules: [],
          }]
        },
      }
    },
    methods: {
      handleSubmit() {
        setCheckPlaceExt({
          confirmFlag: 2,
          id: this.placeElement.curAuditRow.placeExtId,
          confirmNotion: this.form.confirmNotion
        }).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          this.$refs.replyForm && this.$refs.replyForm.resetForm()
          this.placeElement.auditBasePopup = false
          this.placeElement.onLoad(this.placeElement.page)
        })
      },
      handleReset() {
        if ('confirmNotion' in this.form && this.form.confirmNotion.trim() == '' || !this.form.confirmNotion) {
          this.$message({
            type: 'warning',
            message: "请输入审批意见!",
          })
          return
        }
        setCheckPlaceExt({
          confirmFlag: 3,
          id: this.placeElement.curAuditRow.placeExtId,
          confirmNotion: this.form.confirmNotion
        }).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          this.$refs.replyForm && this.$refs.replyForm.resetForm()
          this.placeElement.auditBasePopup = false
          this.placeElement.onLoad(this.placeElement.page)
        })
      },
    }
  }
</script>
<style lang="scss" scoped>
  .cur-container-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    .content-box {
      margin: 0 4px;
      padding: 0 16px;
      height: 0;
      flex: 1;
      overflow: hidden;
      overflow-y: auto;
    }
    .footer-btn-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
    }
  }
</style>
src/views/publicSecurity/components/baseAllInfo.vue
New file
@@ -0,0 +1,1180 @@
<template>
  <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose">
    <div class="cur-container-box">
      <div class="content-box">
        <box-title class="m10" :classVal="9" :title="'基本信息'"></box-title>
        <avue-form v-if="baseShow" ref="baseForm" :option="option" v-model="form">
          <template slot-scope="{ row, size, index }" slot="houseCodeBinds">
            <el-select v-model="form.houseCodeBinds" filterable remote multiple :remote-method="onRemoteMethod"
              @change="onSelectChange" placeholder="请选择标准地址" reserve-keyword>
              <el-option v-for="item in standardAddressList" :key="item.addressCode" :label="item.addressName"
                :value="item.addressCode">
              </el-option>
            </el-select>
          </template>
        </avue-form>
        <!-- <box-title class="m10" :classVal="9" :title="'房东信息'"></box-title>
        <avue-form v-if="restShow" ref="restForm" :option="houseOwnerOption" v-model="placeForm"></avue-form> -->
        <box-title class="m10" :classVal="9" :title="'其他信息'"></box-title>
        <avue-form v-if="restShow" ref="restForm" :option="optionDetail" v-model="placeForm"></avue-form>
        <box-title class="m10" :classVal="9" :title="'教职工人员'"></box-title>
        <avue-crud :option="placeOption" :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="holdCurrentChange"
          @size-change="holdSizeChange" @refresh-change="refreshHoldChange" @on-load="holdOnLoad">
        </avue-crud>
      </div>
      <div class="footer-btn-box">
        <el-button size="small" :disabled="disabled" type="primary" @click="dataUpdate">保 存</el-button>
        <el-button size="small" @click="roleBoxClose">关 闭</el-button>
      </div>
    </div>
  </el-dialog>
</template>
<script>
  import {
    getPlaceDetaill,
    getPlaceExt,
    holdRemove,
    holdAdd,
    holdUpdate,
    getHoldList,
    update,
    updatePlaceExt,
    getPlaceAddressList
  } from "@/api/place/place"
  import {
    getPlaceList
  } from "@/api/doorplateAddress/doorplateAddress"
  import website from "@/config/website"
  import boxTitle from "./boxTitle"
  export default {
    data() {
      //手机号格式校验
      let validatorPhone = function(rule, value, callback) {
        if (value) {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error("手机号格式有误!"))
          } else {
            callback()
          }
        }
        callback()
      }
      return {
        disabled: false,
        roleBox: false,
        baseShow: false,
        restShow: false,
        placeExt: [],
        form: {},
        option: {
          submitBtn: false,
          emptyBtn: false,
          dialogMenuPosition: 'right',
          column: [{
              span: 12,
              label: "场所名称",
              prop: "placeName",
              labelWidth: 120,
              rules: [{
                required: true,
                message: "请输入场所名称",
                trigger: "blur",
              }, ],
            },
            {
              label: "负责人",
              prop: "principal",
              labelWidth: 120,
              rules: [{
                required: false,
                message: "请输入负责人",
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "手机号码",
              prop: "principalPhone",
              labelWidth: 120,
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              width: 120,
              overHidden: true,
              label: "身份证号",
              labelWidth: 120,
              prop: "principalIdCard",
              search: true,
              searchSpan: 4,
              slot: true,
              rules: [{
                required: false,
                message: "请输身份证号",
                trigger: "blur",
              }],
            },
            {
              hide: true,
              parent: false,
              label: "所属社区",
              labelWidth: 120,
              prop: "neiCode",
              search: false,
              type: "tree",
              dicUrl: "/api/blade-system/region/treeToCommunity",
              props: {
                label: "name",
                value: "id",
              },
              cascader: ["gridCode"],
              // dicFormatter: (res) => {
              //  return dsposeData(res.data)
              // },
              rules: [{
                required: true,
                message: "请选择所属社区",
                trigger: "blur",
              }, ],
            },
            {
              hide: true,
              label: "所属网格",
              prop: "gridCode",
              type: "tree",
              labelWidth: 120,
              cell: true,
              props: {
                label: "gridName",
                value: "gridCode",
              },
              // dataType: 'string',
              dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
              rules: [{
                required: true,
                message: "请选择所属网格",
                trigger: "blur",
              }, ],
            },
            {
              span: 7,
              label: "场所标签",
              prop: "label",
              labelWidth: 120,
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?level=2",
              cascader: ["smallLabel"],
              props: {
                label: "categoryName",
                value: "categoryNo",
              },
              dataType: "string",
              hide: true,
              rules: [{
                required: true,
                message: "请输入场所标签",
                trigger: "blur",
              }, ],
            },
            {
              span: 5,
              label: "",
              labelWidth: 20,
              prop: "smallLabel",
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
              props: {
                label: "categoryName",
                value: "categoryNo",
              },
              dataType: "string",
              hide: true,
            },
            {
              span: 12,
              label: "标签颜色",
              prop: "color",
              type: "select",
              labelWidth: 120,
              dicData: [{
                  label: "绿",
                  value: "green",
                },
                {
                  label: "黄",
                  value: "yellow",
                },
                {
                  label: "红",
                  value: "red",
                },
              ],
              props: {
                label: "label",
                value: "value",
              },
              hide: true,
            },
            {
              span: 12,
              label: "九小场所",
              prop: "isNine",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              rules: [{
                required: true,
                message: "请选择九小分类",
                trigger: "blur",
              }, ],
              hide: true,
            },
            {
              span: 12,
              label: "九小分类",
              prop: "nineType",
              labelWidth: 120,
              type: "select",
              display: false,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "阵地",
              prop: "isFront",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: true,
                message: "请选择阵地",
                trigger: "blur",
              }, ],
            },
            {
              span: 12,
              label: "阵地类型",
              prop: "frontType",
              type: "select",
              labelWidth: 120,
              display: false,
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "三级消防单位",
              prop: "threeFireProtection",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: false,
                message: "请选择三级消防单位",
                trigger: "blur",
              }],
            },
            {
              span: 12,
              label: "无炸类型",
              prop: "noExplosionCategory",
              type: "select",
              labelWidth: 120,
              display: true,
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=noExplosionCategory",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              label: "场所照片",
              prop: "imageUrls",
              width: 80,
              type: "upload",
              labelWidth: 120,
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
            {
              width: 160,
              overHidden: true,
              slot: true,
              label: "地址",
              prop: "location",
              type: "map",
              dataType: "string",
              labelWidth: 120,
              span: 24,
              value: [117.96646, 28.431002, ""],
              cascader: ['houseCodeBinds'],
              rules: [{
                required: true,
                message: "请选择地址",
                trigger: "blur",
              }, ],
            },
            {
              width: 160,
              overHidden: true,
              display: false,
              labelWidth: 120,
              hide: true,
              label: "地址",
              prop: "addressName",
              span: 12
            },
            // {
            //   width: 160,
            //   overHidden: true,
            //   slot: true,
            //   label: "标准地址",
            //   prop: "houseCodeBinds",
            //   span: 24,
            //   type: 'select',
            //   labelWidth:120,
            //   dataType: "object",
            //   remote: true,
            //   multiple: true,
            //   hide: true,
            //   display: false,
            //   filterable:true,
            //   dicUrl: `/api/blade-doorplateAddress/doorplateAddress/getPlaceList`,
            //   props: {
            //     label: 'addressName',
            //     value: 'addressCode',
            //   },
            //   dicData: [],
            //   rules: [{
            //     required: false,
            //     message: "请选择标准地址",
            //     trigger: "blur",
            //   }, ]
            // },
            {
              span: 24,
              hide: true,
              prop: "houseCodeBinds",
              slot: true,
              label: "标准地址",
              labelWidth: 120,
            },
            {
              label: "备注",
              prop: "remark",
              type: 'textarea',
              labelWidth: 120,
              hide: true,
              span: 24,
              rules: [{
                required: false,
                message: "请输入场所备注",
                trigger: "blur",
              }, ],
            },
          ],
        },
        placeForm: {},
        optionDetail: {
          submitBtn: false,
          emptyBtn: false,
          labelWidth: 130,
          column: [{
              label: "学生人数",
              prop: "studentNumber",
            },
            {
              label: "教职工人数",
              prop: "workersNumber",
            },
            {
              label: "专职保安",
              prop: "securityNumber",
            },
            {
              label: "专职门卫",
              prop: "guardNumber",
            },
            {
              label: "专兼职保卫人员",
              prop: "temporarySecurityNumber",
            },
            {
              label: "走读/寄宿",
              prop: "dayStudentsNumber",
            },
            {
              label: "住校生人数",
              prop: "residentialStudentsNumber",
            },
            {
              label: "宿舍管理人员",
              prop: "housemasterNumber",
            },
            {
              label: "法人信息",
              prop: "legalPerson",
            },
            {
              label: "法人电话",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              label: "营业执照",
              prop: "imageUrls",
              width: 80,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
            {
              label: "场所平面图",
              prop: "planImageUrls",
              width: 80,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
          ],
        },
        loading: true,
        placeOption: {
          menu: true,
          height: 300,
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          searchShow: false,
          addBtn: true,
          delBtn: true,
          editBtn: true,
          border: true,
          index: true,
          dialogClickModal: false,
          column: [{
              labelWidth: 100,
              label: "姓名",
              prop: "name",
              searchSpan: 4,
              search: true,
            },
            {
              labelWidth: 100,
              label: "性别",
              prop: "gender",
              type: "select",
              dicData: [{
                  label: "男",
                  value: 1
                },
                {
                  label: "女",
                  value: 0
                },
                {
                  label: "未知",
                  value: "3"
                }
              ],
            },
            {
              labelWidth: 100,
              span: 12,
              label: "民族",
              prop: "ethnicity",
              type: "select",
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationType",
              dataType: "number",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              labelWidth: 100,
              label: "身份证号",
              prop: "idCard",
            },
            {
              labelWidth: 100,
              label: "电话号码",
              prop: "telephone",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              labelWidth: 100,
              label: "现居住地",
              prop: "tempAddress",
              searchSpan: 4,
              search: true,
            },
            {
              labelWidth: 100,
              label: "岗位",
              prop: "jobNature",
              // hide: true
            },
            {
              label: "从业人员照片",
              prop: "employerImg",
              labelWidth: 100,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
              hide: true
            },
            {
              label: "入职时间",
              labelWidth: 100,
              hide: true,
              row: true,
              prop: "resignationTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              // format: "yyyy-MM-dd hh:mm:ss",
              // valueFormat: "yyyy-MM-dd hh:mm:ss",
              rules: [{
                required: false,
                message: "请选择入职时间",
                trigger: "blur",
              }]
            },
            {
              label: "离职时间",
              labelWidth: 100,
              hide: true,
              row: true,
              prop: "employmentTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              // format: "yyyy-MM-dd hh:mm:ss",
              // valueFormat: "yyyy-MM-dd hh:mm:ss",
              rules: [{
                required: false,
                message: "请选择离职时间",
                trigger: "blur",
              }]
            },
            {
              labelWidth: 100,
              label: "状态",
              prop: "resignationFlag",
              // hide: true
              type: "select",
              display: false,
              dicData: [{
                  label: "在职",
                  value: 1
                },
                {
                  label: "离职",
                  value: 2
                }
              ],
            },
          ]
        },
        holdPage: {
          pageSize: 20,
          currentPage: 1,
          total: 0,
        },
        houseHoldForm: {},
        houseOwnerOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [
            {
              width: 96,
              label: "姓名",
              prop: "landlordName",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true
            },
            {
              width: 96,
              label: "身份证号",
              prop: "landlordIdCard",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                // validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "手机号",
              prop: "landlordPhone",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
          ],
        },
        userOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [
            {
              width: 96,
              label: "电话",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "微信号",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
          ],
        },
        standardAddressList: [], //标准地址数据
        standardAddress: "",
        standardAddressSearchKey: ""
      }
    },
    components: {
      boxTitle
    },
    inject: ["placeElement"],
    watch: {
      'form.houseBindList': {
        handler(newData) {
          console.log("=======>", newData)
        }
      },
      'form.isNine': {
        handler(newData) {
          if (newData) {
            let nineTypeColumn = this.findObject(
              this.option.column,
              'nineType'
            )
            if (newData == 1) {
              nineTypeColumn.display = true
            } else {
              nineTypeColumn.display = false
            }
          }
        },
      },
      'form.isFront': {
        handler(newData) {
          if (newData) {
            let frontTypeColumn = this.findObject(
              this.option.column,
              'frontType'
            )
            if (newData == 1) {
              frontTypeColumn.display = true
            } else {
              frontTypeColumn.display = false
            }
          }
        }
      },
      'form.addressName': {
        handler(newData) {
          console.log("111111")
          const column = this.findObject(this.option.column, "houseCodeBinds")
          if (newData) {
            column.display = true;
          } else {
            column.display = false
          }
        }
      }
    },
    methods: {
      initOpen(newData) {
        console.log("item==>", newData);
        this.curRow = newData
        this.roleBox = true
        this.baseShow = false
        this.restShow = false
        this.form = {}
        this.placeForm = {}
        const that = this
        that.$axios
          .all([getPlaceDetaill(newData["houseCode"]), getPlaceExt({
            placeId: newData["id"]
          }), getPlaceList()])
          .then(
            that.$axios.spread(function(baseInfo, restInfo) {
              console.log("houseCodeBinds===>", baseInfo.data.data.houseCodeBinds)
              that.form = baseInfo.data.data
              that.form.addressName = that.form.location;
              that.form.location = [
                that.form.lng,
                that.form.lat,
                that.form.location,
              ].join(",")
              if (baseInfo.data.data.houseCodeBinds) {
                that.standardAddressList = baseInfo.data.data.houseBindList;
                that.form.houseCodeBinds = baseInfo.data.data.houseCodeBinds.split(",")
              }
              if (that.form.imageUrls && that.form.imageUrls.length) {
                that.form.imageUrls = that.form.imageUrls
                  .split(",")
                  .filter((item) => item != "")
                  .map((item) => website.minioUrl + item)
                  .join(",")
              }
              if (
                that.form.placePoiLabelVOList &&
                that.form.placePoiLabelVOList.length
              ) {
                let lebelTwo = that.form.placePoiLabelVOList.find((item) => {
                  return item.type == 2
                })
                if (lebelTwo) that.form.label = String(lebelTwo.poiCode)
                let lebelThree = that.form.placePoiLabelVOList.find((item) => {
                  return item.type == 3
                })
                if (lebelThree) that.form.smallLabel = String(lebelThree.poiCode)
              }
              that.baseShow = true
              const data = restInfo.data.data
              // console.log("----------****************" + JSON.stringify(data))
              if (data) {
                let imageUrls = data.imageUrls
                let planImageUrls = data.planImageUrls
                if (imageUrls && imageUrls.length) {
                  imageUrls = imageUrls
                    .split(",")
                    .filter((item) => item != "")
                    .map((item) => website.minioUrl + item)
                    .join(",")
                }
                if (planImageUrls && planImageUrls.length) {
                  planImageUrls = planImageUrls
                    .split(",")
                    .filter((item) => item != "")
                    .map((item) => website.minioUrl + item)
                    .join(",")
                }
                that.placeForm = {
                  ...data,
                  imageUrls,
                  planImageUrls,
                }
              }
              that.restShow = true
            })
          )
        that.getPlaceAddressListRequest()
      },
      locationDispose(data) {
        data = data.split(",")
        return {
          longitude: data[0],
          latitude: data[1],
          location: data[2],
        }
      },
      selectionClear() {
        this.$nextTick(() => {
          this.$refs.crud && this.$refs.crud.toggleSelection()
        })
      },
      houseHoldRowUpdate(row, index, done, loading) {
        holdUpdate(row).then(
          () => {
            this.holdOnLoad(this.holdPage)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      houseHoldRowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return holdRemove(row.id)
          })
          .then(() => {
            this.holdOnLoad(this.holdPage)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      houseHoldRowSave(row, done, loading) {
        holdAdd({
          ...row,
          placeId: this.curRow.id,
        }).then(
          () => {
            this.holdOnLoad(this.holdPage)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      refreshHoldChange() {
        this.holdOnLoad(this.holdPage)
      },
      holdOnLoad(holdPage, params = {}) {
        if (!this.curRow.id) return
        let values = {
          ...params,
          placeId: this.curRow.id,
        }
        getHoldList(holdPage.currentPage, holdPage.pageSize, values).then(
          (res) => {
            const data = res.data.data
            this.holdPage.total = data.total
            this.placeExt = data.records
            this.loading = false
            this.selectionClear()
          }
        )
      },
      holdCurrentChange(currentPage) {
        this.holdPage.currentPage = currentPage
      },
      holdSizeChange(pageSize) {
        this.holdPage.pageSize = pageSize
      },
      desposeImage(data) {
        if (data) {
          if (data.length > 0) {
            var urls = []
            var split = data.split(",").filter((item) => item != "")
            split.forEach((url) => {
              var names = url.split("jczz/")
              urls.push(names[1])
            })
            data = urls.join(",")
          }
        }
        return data
      },
      dataUpdate() {
        const that = this
        that.disabled = true;
        let imageUrls = this.desposeImage(this.form.imageUrls)
        let placeImages = this.desposeImage(this.placeForm.imageUrls)
        let placePlanImageUrls = this.desposeImage(this.placeForm.planImageUrls)
        let label = this.form.label
        if (this.form.smallLabel != "") {
          label = label + "," + this.form.smallLabel
        }
        delete this.form.smallLabel
        if (Array.isArray(this.form.houseCodeBinds)) {
          this.form.houseCodeBinds = this.form.houseCodeBinds.join(",")
        }
        this.form.placeExtEntity = null
        this.$refs.baseForm.validate((valid, done, msg) => {
          if (valid) {
            that.$axios
              .all([
                update({
                  // ...this.placeElement.curRow,
                  ...this.form,
                  imageUrls,
                  label,
                  ...this.locationDispose(this.form.location),
                }),
                updatePlaceExt({
                  ...this.placeForm,
                  imageUrls: placeImages,
                  planImageUrls: placePlanImageUrls,
                }),
              ])
              .then(
                that.$axios.spread(function() {
                  that.$message({
                    type: "success",
                    message: "操作成功!",
                  })
                  that.roleBoxClose()
                  that.placeElement.onLoad(
                    that.placeElement.page,
                    that.placeElement.query
                  )
                  done()
                })
              )
          } else {
            console.log("error submit!!")
            return false
          }
        })
      },
      roleBoxClose() {
        this.form = {}
        this.placeForm = {}
        this.disabled = false
        this.$refs.baseForm && this.$refs.baseForm.resetForm()
        this.$refs.restForm && this.$refs.restForm.resetForm()
        this.baseShow = false
        this.restShow = false
        this.roleBox = false
      },
      getPlaceAddressListRequest(query) {
        getPlaceAddressList({
          addressName: query
        }).then(res => {
          this.standardAddressList = res.data.data;
        })
      },
      onSelectChange(e) {
        console.log("selectChange===>", e);
        // this.getPlaceAddressListRequest()
      },
      onRemoteMethod(query) {
        console.log("remote===>", query)
        this.getPlaceAddressListRequest(query)
      },
    },
  }
</script>
<style lang="scss" scoped>
  .cur-container-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    .content-box {
      margin: 0 4px;
      padding: 0 10px;
      height: 0;
      flex: 1;
      overflow: hidden;
      overflow-y: auto;
    }
    .footer-btn-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
    }
  }
</style>
src/views/publicSecurity/components/boxTitle.vue
New file
@@ -0,0 +1,483 @@
<!--
 * @name: name
 * @description: Description
 * @lastEditors: Francis
 * @date: Do not edit
 * @lastEditTime: Do not edit
 * @filePath: Do not edit
-->
<template>
    <div class="titleContent">
        <!-- <div class="title1" data-color="red"></div> -->
        <div :class="`title title${classVal} ${classStyle}`">
            {{ title }}</div>
    </div>
</template>
<script>
export default {
    name: 'boxTitle',
    props: {
        title: {
            type: String,
            default: ''
        },
        classVal: {
            type: Number,
        },
        classStyle: {
            type: String,
            default: ''
        },
    }
}
</script>
<style lang="scss" scoped>
.titleContent {
    >div {
        margin: 10px 0;
    }
}
.title {
    height: 32px;
    font-size: 20px;
    font-weight: 600;
    line-height: 32px;
    margin-left: 5px;
    padding-left: 5px;
    position: relative;
    color: #444;
    z-index: 0;
}
.echarts-title {
    margin: 0 !important;
}
.title1 {
    padding-left: 15px;
    &:after {
        content: " ";
        width: 4px;
        height: 20px;
        background: #12a3f5;
        position: absolute;
        left: 0;
        top: 6px;
        border-radius: 2px;
    }
}
.title2 {
    padding-left: 15px;
    &:after {
        content: " ";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #12a3f5;
        position: absolute;
        left: 0;
        top: 12px;
    }
}
.title3 {
    &:after {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 100%;
        background: linear-gradient(to right, #01DFE3, rgba(255, 255, 255, 0));
    }
}
.title4 {
    &:after {
        content: attr(data-text);
        position: absolute;
        display: inline-block;
        bottom: -8px;
        left: 5px;
        opacity: 0.2;
        z-index: 0;
        text-align: right;
        transform: rotateY(30deg);
        transform: scaleY(30deg);
    }
}
.title5 {
    color: #10faf8;
    padding-left: 80px;
    line-height: 22px;
    position: relative;
    border-bottom: 2px solid linear-gradient(to right, #01DFE3, rgba(255, 255, 255, 0));
    &:after {
        content: "";
        position: absolute;
        bottom: 0;
        top: 0;
        left: 18px;
        width: 50px;
        height: 18px;
        transform: skewX(35deg);
        background: linear-gradient(to right,
                #2d83fa,
                #10faf8);
    }
    &:before {
        content: "|||";
        display: inline-block;
        font-weight: 900;
        color: #FFF;
        line-height: 30px;
        font-size: 18px;
        position: absolute;
        position: absolute;
        top: -8px;
        left: 0;
        color: #2d83fa;
        transform: skewX(35deg);
    }
}
.title6 {
    color: #C6D039;
    padding-left: 80px;
    line-height: 22px;
    position: relative;
    border-bottom: 2px solid linear-gradient(to right, #01DFE3, rgba(255, 255, 255, 0));
    &:after {
        content: "";
        position: absolute;
        bottom: 0;
        top: 0;
        left: 18px;
        width: 50px;
        height: 18px;
        transform: skewX(35deg);
        background: linear-gradient(to right,
                #4BF15A,
                #C6D039);
    }
    &:before {
        content: "|||";
        display: inline-block;
        font-weight: 900;
        color: #FFF;
        line-height: 30px;
        font-size: 18px;
        position: absolute;
        position: absolute;
        top: -8px;
        left: 0;
        color: #4BF15A;
        transform: skewX(35deg);
    }
}
.title7 {
    &:after {
        content: "";
        position: absolute;
        bottom: 0;
        top: 0;
        left: 0;
        width: 180px;
        height: 100%;
        opacity: 0.3;
        background: linear-gradient(to right,
                #4BF15A,
                #4bf15900);
    }
    &:before {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 100%;
        background: linear-gradient(to right, #4BF15A, rgba(255, 255, 255, 0));
    }
}
.title8 {
    border-radius: 16px;
    border: 1px solid #e8e9fb;
    box-shadow: 0 0 10px #e8e9fb;
    text-align: center;
    width: 160px;
    color: #12a3f5;
    &:before {
        content: "";
        width: 300%;
        height: 2px;
        background: #e8e9fb;
        position: absolute;
        top: 15px;
        left: 100%;
        background: linear-gradient(to right, #e8e9fb, rgba(255, 255, 255, 0));
    }
}
.title9 {
    background: #ECF8FF;
    border-top-left-radius: 5px;
    padding-left: 20px;
    &:before {
        content: "";
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        width: 4px;
        height: 100%;
        background: #50BFFF;
        position: absolute;
        top: 0;
        left: 0;
    }
}
.title10 {
    background: #FFF6F7;
    border-top-left-radius: 5px;
    padding-left: 20px;
    &:before {
        content: "";
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        width: 4px;
        height: 100%;
        background: #FE6C6F;
        position: absolute;
        top: 0;
        left: 0;
    }
}
.title11 {
    display: inline-block;
    position: relative;
    width: 150px;
    height: 32px;
    line-height: 32px;
    padding-left: 15px;
    background: #50BFFF;
    left: -8px;
    color: #FFF;
    &:before {
        content: "";
        position: absolute;
        height: 0;
        width: 0;
        border-bottom: 8px solid #4396c5;
        border-left: 8px solid transparent;
        top: -8px;
        left: 0;
    }
    &:after {
        content: "";
        position: absolute;
        height: 0;
        width: 0;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        border-left: 8px solid #50BFFF;
        right: -8px;
    }
}
.title12 {
    position: relative;
    width: 160px;
    padding-left: 10px;
    // top: 15px;
    // padding: 8px 10px;
    background: #00B3ED;
    box-shadow: -1px 2px 4px rgba(0, 0, 0, 0.5);
    color: #FFF;
    // height: 40px;
    &:before {
        position: absolute;
        content: "";
        display: block;
        width: 7px;
        height: 100%;
        padding: 0 0 7px;
        top: 0;
        left: -7px;
        background: inherit;
        border-radius: 5px 0 0 5px;
    }
    &:before {
        position: absolute;
        content: "";
        display: block;
        width: 5px;
        height: 5px;
        background: rgba(0, 0, 0, 0.35);
        bottom: -5px;
        left: -5px;
        border-radius: 5px 0 0 5px;
    }
}
.title13 {
    border-left: 2px solid #FE6C6F;
    &:after {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 60%;
        background: linear-gradient(to right, #FE6C6F, rgba(255, 255, 255, 0));
    }
    &::before {
        content: " ";
        position: absolute;
        top: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 30%;
        background: linear-gradient(to right, #FE6C6F, rgba(255, 255, 255, 0));
    }
}
.title14 {
    border-left: 2px solid #01DFE3;
    &:after {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 60%;
        background: linear-gradient(to right, #01DFE3, rgba(255, 255, 255, 0));
    }
    &::before {
        content: " ";
        position: absolute;
        top: 0;
        left: 0;
        position: absolute;
        height: 2px;
        width: 30%;
        background: linear-gradient(to right, #01DFE3, rgba(255, 255, 255, 0));
    }
}
.title15 {
    color: #FFF;
    padding-left: 50px;
    background: linear-gradient(-210deg, transparent 1.5em, #01DFE3 0);
    &::before {
        content: '';
        display: block;
        width: 1.73em;
        height: 3em;
        position: absolute;
        background: linear-gradient(-60deg, #577b98 50%, transparent 0);
        left: -3px;
        top: 0;
        border-bottom-left-radius: inherit;
        transform: translateY(-0.5em) rotate(30deg);
        transform-origin: bottom right;
        box-shadow: .2em .2em .3em -.1em rgba(0, 0, 0, .15);
    }
}
.title16 {
    color: #FFF;
    padding-left: 50px;
    background: linear-gradient(-210deg, transparent 1.5em, #FE6C6F 0);
    &::before {
        content: '';
        display: block;
        width: 1.73em;
        height: 3em;
        position: absolute;
        background: linear-gradient(-60deg, #f18384 50%, transparent 0);
        left: -3px;
        top: 0;
        border-bottom-left-radius: inherit;
        transform: translateY(-0.5em) rotate(30deg);
        transform-origin: bottom right;
        box-shadow: .2em .2em .3em -.1em rgba(0, 0, 0, .15);
    }
}
.title17 {
    &:after {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 100%;
        width: 100%;
        animation: animation3 1s linear infinite;
        background: linear-gradient(135deg, #01DFE3 0.25em, transparent 0.25em) -0.5em 0, linear-gradient(225deg, #01DFE3 0.25em, transparent 0.25em) -0.5em 0, linear-gradient(315deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) 0 0, linear-gradient(45deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) 0 0;
        background-size: 0.75em 0.75em;
        opacity: 0.3;
    }
}
.title18 {
    &:after {
        content: " ";
        position: absolute;
        bottom: 0;
        left: 0;
        position: absolute;
        height: 100%;
        width: 100%;
        opacity: 0.3;
        animation: animation2 1s linear infinite;
        background: repeating-linear-gradient(45deg, #01DFE3 0, #01DFE3 0.25em, transparent 0.25em, transparent 0.5em);
        background-size: 0.75em 0.75em;
    }
}
</style>
src/views/publicSecurity/place.vue
New file
@@ -0,0 +1,1133 @@
<template>
  <basic-container>
    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @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.place_delete"
          @click="handleDelete">删 除
        </el-button>
        <el-button type="success" size="small" plain v-if="permission.place_import" icon="el-icon-upload2"
          @click="handleImport">导入
        </el-button>
        <el-button type="warning" size="small" plain v-if="permission.place_export" icon="el-icon-download"
          @click="handleExport">导出
        </el-button>
        <el-button type="success" size="small" plain v-if="permission.place_import" icon="el-icon-upload2"
          @click="handlePractitionerImport">从业人员导入
        </el-button>
      </template> -->
      <template slot-scope="{row}" slot="location">
        <span v-text="showLocation(row.location)"></span>
      </template>
      <template slot-scope="{row}" slot="lng">
        <span v-text="decimalProcessing(row.lng)"></span>
      </template>
      <template slot-scope="{row}" slot="lat">
        <span v-text="decimalProcessing(row.lat)"></span>
      </template>
      <template slot-scope="{row, size}" slot="confirmFlag">
        <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">{{
            showConfirmFlag(row.confirmFlag).text
        }}</el-tag>
      </template>
      <template slot-scope="{row, size}" slot="source">
        <el-tag :size="size" :type="showSource(row.source).type">{{ showSource(row.source).text
                    }}</el-tag>
      </template>
      <template slot-scope="{row, size}" slot="menu">
        <!--  <el-button :size="size" type="text" icon="el-icon-s-check" v-if="permission.place_audit_cur"
          @click="auditCur({ ...row, confirmFlag: 1 })">审核
        </el-button> -->
        <el-button :size="size" type="text" icon="el-icon-edit" v-if="permission.place_manage_tenants"
          @click="ManageTenants(row)">场所维护
        </el-button>
      </template>
      <template slot-scope="{row, size}" slot="principalPhone">
        <el-button :size="size" type="text" @click="showStringDispose(row, 'principalPhoneflag')"
          v-text="textDispose(row, 'principalPhoneflag', 'principalPhone')">
        </el-button>
      </template>
      <template slot-scope="{row, size}" slot="principalIdCard">
        <el-button :size="size" type="text" @click="showStringDispose(row, 'principalIdCardflag')"
          v-text="textDispose(row, 'principalIdCardflag', 'principalIdCard')">
        </el-button>
      </template>
    </avue-crud>
    <baseAllInfo ref="BaseAllInfo"></baseAllInfo>
    <el-dialog class="place-info-box audit-info-box" title="审核" append-to-body :visible.sync="auditBasePopup"
      width="30%">
      <auditBase></auditBase>
    </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">
          <el-button size="small" type="primary" @click="handleTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog>
    <el-dialog title="从业人员数据导入" append-to-body :visible.sync="excelBoxPractitioner" width="555px">
      <avue-form :option="excelPractitionerOption" v-model="excelPractitionerForm"
        :upload-after="uploadPractitionerAfter">
        <template slot="excelTemplate">
          <el-button size="small" type="primary" @click="handlePractitionerTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {
    getList,
    remove,
    update,
    add,
    getPlace,
  } from "@/api/place/place"
  import {
    mapGetters
  } from "vuex"
  import {
    exportBlob
  } from "@/api/common"
  import {
    getToken
  } from '@/util/auth'
  import {
    downloadXls,
  } from "@/util/util"
  import {
    dateNow
  } from "@/util/date"
  import NProgress from 'nprogress'
  import 'nprogress/nprogress.css'
  import Qs from "qs"
  import website from '@/config/website'
  import auditBase from './components/auditBase'
  import baseAllInfo from './components/baseAllInfo'
  export default {
    data() {
      //手机号格式校验
      let validatorPhone = function(rule, value, callback) {
        if (value) {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error('手机号格式有误!'))
          } else {
            callback()
          }
        }
        callback()
      }
      return {
        excelPractitionerOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              label: '模板上传',
              prop: 'excelFile',
              type: 'upload',
              drag: true,
              loadText: '模板上传中,请稍等',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              tip: '请上传 .xls,.xlsx 标准格式文件',
              action: "/api/blade-placePractitioner/placePractitioner/import-practitioner"
            },
            {
              label: "数据覆盖",
              prop: "isCovered",
              type: "switch",
              align: "center",
              width: 80,
              dicData: [{
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                }
              ],
              value: 0,
              slot: true,
              rules: [{
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur"
              }]
            },
            {
              label: '模板下载',
              prop: 'excelTemplate',
              formslot: true,
              span: 24,
            }
          ]
        },
        excelPractitionerForm: {},
        excelOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              label: '模板上传',
              prop: 'excelFile',
              type: 'upload',
              drag: true,
              loadText: '模板上传中,请稍等',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              tip: '请上传 .xls,.xlsx 标准格式文件',
              action: "/api/blade-place/place/import-place"
            },
            {
              label: "数据覆盖",
              prop: "isCovered",
              type: "switch",
              align: "center",
              width: 80,
              dicData: [{
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                }
              ],
              value: 0,
              slot: true,
              rules: [{
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur"
              }]
            },
            {
              label: '模板下载',
              prop: 'excelTemplate',
              formslot: true,
              span: 24,
            }
          ]
        },
        excelForm: {},
        excelBox: false,
        excelBoxPractitioner: false,
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 120,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 180,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: true,
          //stripe:true,
          index: true,
          viewBtn: true,
          editBtn: false,
          selection: true,
          delBtn: false,
          dialogClickModal: false,
          menuFixed: 'right',
          column: [{
              width: 156,
              overHidden: true,
              label: "场所名称",
              span: 12,
              prop: "placeName",
              searchSpan: 5,
              search: true,
              searchLabelWidth: 76,
              rules: [{
                required: true,
                message: "请输入场所名称",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "场所负责人",
              prop: "principal",
              searchSpan: 5,
              searchLabelWidth: 110,
              search: true,
              rules: [{
                required: false,
                message: "请输入负责人",
                trigger: "blur",
              }, ],
            },
            {
              width: 120,
              overHidden: true,
              label: "手机号码",
              prop: "principalPhone",
              search: true,
              searchSpan: 4,
              slot: true,
              rules: [{
                validator: validatorPhone,
                trigger: 'blur'
              }],
            },
            {
              width: 120,
              overHidden: true,
              label: "身份证号",
              prop: "principalIdCard",
              // search: true,
              searchSpan: 4,
              slot: true,
              rules: [{
                required: false,
                message: "请输身份证号",
                trigger: "blur",
              }],
            },
            {
              width: 110,
              label: "所属街道",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "townStreetName",
              search: true,
              searchSpan: 4
            },
            {
              width: 156,
              overHidden: true,
              label: "所属社区",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "neiName",
              search: true,
              searchSpan: 4,
              rules: [{
                required: true,
                message: "请选择所属社区",
                trigger: "blur",
              }, ],
            },
            {
              hide: true,
              parent: false,
              label: "所属社区",
              prop: "neiCode",
              search: false,
              width: 150,
              type: "tree",
              dicUrl: "/api/blade-system/region/treeToCommunity",
              props: {
                label: "name",
                value: "id",
              },
              cascader: ["gridCode"],
              rules: [{
                required: true,
                message: "请选择所属社区",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              overHidden: true,
              label: "所属网格",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "gridName",
              rules: [{
                required: true,
                message: "请选择所属网格",
                trigger: "blur",
              }, ],
            },
            {
              hide: true,
              label: "所属网格",
              prop: "gridCode",
              type: "tree",
              cell: true,
              props: {
                label: "gridName",
                value: "gridCode",
              },
              dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
              rules: [{
                required: true,
                message: "请选择所属网格",
                trigger: "blur",
              }, ],
            },
            {
              span: 7,
              label: "场所标签",
              prop: "label",
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?level=2",
              cascader: ["smallLabel"],
              props: {
                label: "categoryName",
                value: "categoryNo"
              },
              dataType: "string",
              hide: true,
              rules: [{
                required: true,
                message: "请输入场所标签",
                trigger: "blur",
              }, ],
            },
            {
              span: 5,
              label: "",
              labelWidth: 20,
              prop: "smallLabel",
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
              props: {
                label: "categoryName",
                value: "categoryNo"
              },
              dataType: "string",
              hide: true,
            },
            {
              span: 12,
              label: "标签颜色",
              prop: "color",
              type: "select",
              dicData: [{
                label: '绿',
                value: 'green'
              }, {
                label: '黄',
                value: 'yellow'
              }, {
                label: '红',
                value: 'red'
              }],
              props: {
                label: "label",
                value: "value"
              },
              hide: true,
            },
            {
              span: 12,
              label: "九小场所",
              prop: "isNine",
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: true,
                message: "请选择九小场所",
                trigger: "blur",
              }, ],
            },
            {
              span: 12,
              label: "九小分类",
              prop: "nineType",
              type: "select",
              display: false,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "阵地",
              prop: "isFront",
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: true,
                message: "请选择阵地",
                trigger: "blur",
              }, ],
            },
            {
              span: 12,
              label: "阵地类型",
              prop: "frontType",
              type: "select",
              display: false,
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "三级消防单位",
              prop: "threeFireProtection",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: false,
                message: "请选择三级消防单位",
                trigger: "blur",
              }, ],
            },
            {
              width: 110,
              label: "场所照片",
              prop: "imageUrls",
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: 'name',
                url: "link",
              },
              span: 24,
            },
            {
              width: 156,
              overHidden: true,
              slot: true,
              label: "地址",
              prop: "location",
              type: 'map',
              dataType: "string",
              minWidth: 250,
              span: 24,
              value: [117.966460, 28.431002, ""],
              rules: [{
                required: true,
                message: "请选择地址",
                trigger: "blur",
              }, ],
            },
            {
              label: "备注",
              prop: "remark",
              type: 'textarea',
              hide: true,
              span: 24,
              rules: [{
                required: false,
                message: "请输入场所备注",
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              slot: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              label: "经度",
              hide: true,
              prop: "lng",
            },
            {
              width: 96,
              slot: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              label: "纬度",
              hide: true,
              prop: "lat",
            },
            {
              width: 100,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              label: '审核状态',
              prop: 'confirmFlag',
              type: 'radio',
              slot: true,
              dicData: [{
                label: '待审核',
                value: 1
              }, {
                label: '已审核',
                value: 2
              }, {
                label: '未通过',
                value: 3
              }]
            },
            {
              width: 120,
              display: false,
              label: '是否有二维码',
              searchLabelWidth: 104,
              prop: 'source',
              type: "select",
              search: true,
              searchSpan: 5,
              slot: true,
              dicData: [{
                label: '是',
                value: 1
              }, {
                label: '否',
                value: 2
              }]
            }
          ],
        },
        data: [],
        auditBasePopup: false,
      }
    },
    provide() {
      return {
        placeElement: this,
      }
    },
    components: {
      auditBase,
      baseAllInfo
    },
    watch: {
      'form.isNine': {
        handler(newData) {
          if (newData) {
            let nineTypeColumn = this.findObject(
              this.option.column,
              'nineType'
            )
            if (newData == 1) {
              nineTypeColumn.display = true
            } else {
              nineTypeColumn.display = false
            }
          }
        },
      },
      'form.isFront': {
        handler(newData) {
          if (newData) {
            let frontTypeColumn = this.findObject(
              this.option.column,
              'frontType'
            )
            if (newData == 1) {
              frontTypeColumn.display = true
            } else {
              frontTypeColumn.display = false
            }
          }
        },
      },
      'excelForm.isCovered'() {
        if (this.excelForm.isCovered !== '') {
          const column = this.findObject(this.excelOption.column, "excelFile")
          column.action = `/api/blade-place/place/import-place?isCovered=${this.excelForm.isCovered}`
        }
      },
      'excelPractitionerForm.isCovered'() {
        if (this.excelForm.isCovered !== '') {
          const column = this.findObject(this.excelPractitionerForm.column, "excelFile")
          column.action =
            `/api/blade-placePractitioner/placePractitioner/import-practitioner?isCovered=${this.excelPractitionerForm.isCovered}`
        }
      }
    },
    computed: {
      ...mapGetters(["permission", "userInfo"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.place_add, true),
          viewBtn: this.vaildData(this.permission.place_view, true),
          delBtn: this.vaildData(this.permission.place_delete, true),
          editBtn: this.vaildData(this.permission.place_edit, true),
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach((ele) => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
      showConfirmFlag() {
        return (data) => {
          let tags = {
            text: '',
            type: ''
          }
          if (data == 1) {
            tags = {
              text: '待审核',
              type: 'warning'
            }
          } else if (data == 2) {
            tags = {
              text: '已审核',
              type: 'success'
            }
          } else if (data == 3) {
            tags = {
              text: '未通过',
              type: 'danger'
            }
          } else if (data == 4) {
            tags = {
              text: '待完善',
              type: 'info'
            }
          }
          return tags
        }
      },
      showSource() {
        return (data) => {
          let tags = {
            text: '',
            type: ''
          }
          if (data == 1) {
            tags = {
              text: '是',
              type: 'success'
            }
          } else if (data == 2) {
            tags = {
              text: '否',
              type: 'info'
            }
          }
          return tags
        }
      },
      showLocation() {
        return (data) => {
          if (data != null && data.indexOf(',') != -1) {
            data = data.split(',')
            return data[2]
          } else {
            return data || ''
          }
        }
      },
      decimalProcessing() {
        return (data) => {
          if (data != null) {
            return Number(data).toFixed(6)
          } else {
            return ''
          }
        }
      },
      textDispose() {
        return (row, flag, type) => {
          if (row[flag] || row[type] == null) {
            return row[type]
          } else {
            if (type == 'principalIdCard') {
              return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
            } else {
              return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
            }
          }
        }
      }
    },
    methods: {
      showStringDispose(row, type) {
        row[type] = !row[type]
      },
      locationDispose(data) {
        data = data.split(',')
        return {
          longitude: data[0],
          latitude: data[1],
          location: data[2]
        }
      },
      auditCur(row) {
        this.curAuditRow = row
        this.auditBasePopup = true
      },
      ManageTenants(item) {
        this.$refs.BaseAllInfo.initOpen(item)
      },
      rowSave(row, done, loading) {
        if (row.imageUrls.length > 0) {
          var urls = []
          var split = row.imageUrls.split(",").filter(item => item != '')
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.imageUrls = urls.join(",")
        }
        let label = row.label
        if (row.smallLabel != '') {
          label = label + ',' + row.smallLabel
        }
        delete row.smallLabel
        add({
          ...row,
          label,
          ...this.locationDispose(row.location)
        }).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowUpdate(row, index, done, loading) {
        if (row.imageUrls.length > 0) {
          var urls = []
          var split = row.imageUrls.split(",").filter(item => item != '')
          split.forEach(url => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          row.imageUrls = urls.join(",")
        }
        let label = row.label
        if (row.smallLabel != '') {
          label = label + ',' + row.smallLabel
        }
        delete row.smallLabel
        update({
          ...row,
          label,
          ...this.locationDispose(row.location)
        }).then(
          () => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      searchReset() {
        this.query = {}
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$nextTick(() => {
          this.$refs.crud && this.$refs.crud.toggleSelection()
        })
      },
      handlePractitionerImport() {
        this.excelBoxPractitioner = true
      },
      handleImport() {
        this.excelBox = true
      },
      uploadAfter(res, done, loading, column) {
        this.excelBox = false
        this.onLoad(this.page)
        this.$message({
          type: "success",
          message: res
        })
        this.$refs.crud.toggleSelection()
        done()
      },
      uploadPractitionerAfter(res, done, loading, column) {
        this.excelBoxPractitioner = false
        this.onLoad(this.page)
        this.$message({
          type: "success",
          message: res
        })
        this.$refs.crud.toggleSelection()
        done()
      },
      handleExport() {
        this.$confirm("是否导出场所数据?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          NProgress.start()
          var data = {
            ...this.query
          }
          data = Qs.stringify(data)
          exportBlob(
            `/api/blade-place/place/export-place?${this.website.tokenHeader}=${getToken()}&` + data
          ).then(res => {
            downloadXls(res.data, `场所数据表${dateNow()}.xlsx`)
            NProgress.done()
          })
        })
      },
      handleTemplate() {
        exportBlob(`/api/blade-place/place/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
          downloadXls(res.data, "场所数据模板.xlsx")
        })
      },
      handlePractitionerTemplate() {
        exportBlob(
            `/api/blade-placePractitioner/placePractitioner/export-practitioner-template?${this.website.tokenHeader}=${getToken()}`
          )
          .then(res => {
            downloadXls(res.data, "从业人员数据模板.xlsx")
          })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            this.$refs.crud.toggleSelection()
          })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getPlace(this.form.id).then((res) => {
            this.form = res.data.data
            this.form.location = [this.form.lng, this.form.lat, this.form.location].join(',')
            if (this.form.imageUrls.length) {
              this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website
                .minioUrl + item).join(',')
            }
            if (this.form.placePoiLabelVOList.length) {
              let lebelTwo = this.form.placePoiLabelVOList.find(item => {
                return item.type == 2
              })
              if (lebelTwo) this.form.label = String(lebelTwo.poiCode)
              let lebelThree = this.form.placePoiLabelVOList.find(item => {
                return item.type == 3
              })
              if (lebelThree) this.form.smallLabel = String(lebelThree.poiCode)
            }
            done()
          })
        } else {
          done()
        }
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true
        this.query.poiCodes = "160101,160102,160103"
        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.data.forEach(item => {
            this.$set(item, 'principalPhoneflag', false)
            this.$set(item, 'principalIdCardflag', false)
            if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) {
              var urls = []
              var names = item.imageUrls.split(",").filter(item => item != '')
              names.forEach(name => {
                urls.push(website.minioUrl + name)
              })
              item.imageUrls = urls.join(",")
            }
          })
          this.loading = false
          this.selectionClear()
        })
      }
    }
  }
</script>
<style>
  .avue-upload__icon {
    line-height: 6;
  }
</style>