odc.xiaohui
2023-02-09 eafd90c248a7e0560f98c957eaf05cb6e71e2f3b
2022/2/9
肖辉
部门管理处理
3个文件已修改
89 ■■■■ 已修改文件
package-lock.json 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/baseSetting/violation/createUser/index.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/baseSetting/user/components/main/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -18,8 +18,6 @@
        "file-saver": "^2.0.5",
        "jszip": "^3.10.1",
        "jszip-utils": "^0.1.0",
        "leaflet": "^1.9.3",
        "leaflet.chinatmsproviders": "^3.0.6",
        "leaflet.pm": "^2.2.0",
        "normalize.css": "^8.0.1",
        "pizzip": "^3.1.3",
@@ -6741,12 +6739,8 @@
    "node_modules/leaflet": {
      "version": "1.9.3",
      "resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.3.tgz",
      "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ=="
    },
    "node_modules/leaflet.chinatmsproviders": {
      "version": "3.0.6",
      "resolved": "https://registry.npmmirror.com/leaflet.chinatmsproviders/-/leaflet.chinatmsproviders-3.0.6.tgz",
      "integrity": "sha512-B4UPSn2MT//RkFoyrVjwqQyfKuf4tSmMjJDKQ6nqwCCGgirYKRWHafSH9JmA88WoG5pkuMXBcKQhY32FobxU/g=="
      "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ==",
      "peer": true
    },
    "node_modules/leaflet.pm": {
      "version": "2.2.0",
@@ -17570,12 +17564,8 @@
    "leaflet": {
      "version": "1.9.3",
      "resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.3.tgz",
      "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ=="
    },
    "leaflet.chinatmsproviders": {
      "version": "3.0.6",
      "resolved": "https://registry.npmmirror.com/leaflet.chinatmsproviders/-/leaflet.chinatmsproviders-3.0.6.tgz",
      "integrity": "sha512-B4UPSn2MT//RkFoyrVjwqQyfKuf4tSmMjJDKQ6nqwCCGgirYKRWHafSH9JmA88WoG5pkuMXBcKQhY32FobxU/g=="
      "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ==",
      "peer": true
    },
    "leaflet.pm": {
      "version": "2.2.0",
src/views/operate/baseSetting/violation/createUser/index.vue
@@ -18,9 +18,10 @@
                    </el-form-item>
                    <!-- 父级id -->
                    <el-form-item class="optionItem" label="父级:" prop="parentId">
                        <el-select v-model="things.parentId" placeholder="请选择所属类型" :disabled="things.level===1">
                        <el-select  ref="projectApplicant" v-model="things.parentId" placeholder="请选择所属类型" :disabled="things.level===1">
                            <el-option :value="mylabel">
                                <el-tree ref="tree" :check-strictly="true"  :data="parentList" :props="defaultProps" show-checkbox
                                <el-tree ref="tree" :check-strictly="true"  :data="parentList" :props="defaultProps"
                                         @node-click="handleCheck"
                                    @check-change="handleCheck" default-expand-all node-key="id">
                                </el-tree>
                            </el-option>
@@ -221,7 +222,7 @@
                    item.children = [];
                })
            } else if (index === 3) {
                this.parentList = this.addChildren(await this.getTypeThird(), await this.getTypeSecond());
                console.log(this.parentList);
            } else {
@@ -243,32 +244,43 @@
            return parentArr;
        },
        handleCheck(data, checked) {
            console.log(this.selectOrg.orgsid,data,checked);
          //只能点击最后一级
          if(checked.childNodes.length == 0){
            this.things.parentId = data.name;
            console.log(this.selectOrg.orgsid);
            // 获取当前选择的id在数组中的索引
            const indexs = this.selectOrg.orgsid.indexOf(data.id)
            // 如果不存在数组中,并且数组中已经有一个id并且checked为true的时候,代表不能再次选择。
            if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) {
                this.$message({
                    message: '只能选择一个区域!',
                    type: 'error',
                    showClose: true
                })
                // 设置已选择的节点为false 很重要
                this.$refs.tree.setChecked(data, false)
            } else if (this.selectOrg.orgsid.length === 0 && checked) {
                // 发现数组为空 并且是已选择
                // 防止数组有值,首先清空,再push
                this.selectOrg.orgsid = []
                this.selectOrg.orgsid.push(data.id)
            } else if (
                indexs >= 0 &&
                this.selectOrg.orgsid.length === 1 &&
                !checked
            ) {
                // 再次直接进行赋值为空操作
                this.selectOrg.orgsid = []
            }
            let _this = this;
            _this.$refs.projectApplicant.blur();
            this.selectOrg.orgsid = []
            this.selectOrg.orgsid.push(data.id)
          }else {
            return
          }
            // // 获取当前选择的id在数组中的索引
            // const indexs = this.selectOrg.orgsid.indexOf(data.id)
            // // 如果不存在数组中,并且数组中已经有一个id并且checked为true的时候,代表不能再次选择。
            // if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) {
            //     this.$message({
            //         message: '只能选择一个区域!',
            //         type: 'error',
            //         showClose: true
            //     })
            //     // 设置已选择的节点为false 很重要
            //     this.$refs.tree.setChecked(data, false)
            // } else if (this.selectOrg.orgsid.length === 0 && checked) {
            //     // 发现数组为空 并且是已选择
            //     // 防止数组有值,首先清空,再push
            //     let _this = this;
            //     _this.$refs.projectApplicant.blur();
            //     this.selectOrg.orgsid = []
            //     this.selectOrg.orgsid.push(data.id)
            // } else if (
            //     indexs >= 0 &&
            //     this.selectOrg.orgsid.length === 1 &&
            //     !checked
            // ) {
            //     // 再次直接进行赋值为空操作
            //     this.selectOrg.orgsid = []
            // }
        },
    },
    props: ['changeDialog']
@@ -340,4 +352,4 @@
    //     font-size: 10px;
    // }
}
</style>
</style>
src/views/systemSetting/baseSetting/user/components/main/index.vue
@@ -261,6 +261,7 @@
            url: "sccg/admin/deleteBatch?ids=" + idArr,
          }).then((res) => {
            if (res.code === 200) {
              this.$message({
                type: "success",
                message: "删除用户信息成功",