zhangzengfei
2022-08-22 f14f98a263141d2f8ec0079866a758cc7a1c38d1
添加用户删除功能
3个文件已修改
52 ■■■■ 已修改文件
src/api/user.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personalCenter/components/SubAccount.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/search/components/ModelCard.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/user.ts
@@ -108,3 +108,11 @@
    data: params
  });
};
export const deleteUser = (params: any) => {
  return request({
    url: "/saas/api-u/user/deleteUser",
    method: "post",
    data: params
  });
};
src/views/personalCenter/components/SubAccount.vue
@@ -4,11 +4,11 @@
    <div class="search">
      <div class="left">
        <div class="id">
          姓名/手机号
          <el-input v-model="inputText" placeholder="请输入"></el-input>
          用户名/姓名/手机号
          <el-input v-model="inputText" placeholder="请输入" clearable></el-input>
        </div>
        <div class="cluster">
        <div class="cluster" v-show="false">
          授权时长
          <el-select @change="findUserList" v-model="timeLength" placeholder="请选择">
            <el-option v-for="item in durationArr" :key="item.value" :label="item.label" :value="item.value">
@@ -45,10 +45,10 @@
        <el-table-column label="序号" width="55" class-name="index">
          <template slot-scope="scope">{{ scope.$index + 1 + (page - 1) * size }}</template>
        </el-table-column>
        <el-table-column prop="username" label="用户名" show-overflow-tooltip></el-table-column>
        <el-table-column prop="trueName" label="姓名" show-overflow-tooltip></el-table-column>
        <el-table-column prop="phoneNum" label="手机号" show-overflow-tooltip></el-table-column>
        <el-table-column prop="userType" label="用户类型">
        <el-table-column prop="username" label="用户名" show-overflow-tooltip ></el-table-column>
        <el-table-column prop="trueName" label="姓名" show-overflow-tooltip ></el-table-column>
        <el-table-column prop="phoneNum" label="手机号" show-overflow-tooltip ></el-table-column>
        <el-table-column prop="userType" label="用户类型" >
          <template slot-scope="scope">
            <span>{{ scope.row.userType == 1 ? "本地" : "OA账户" }}</span>
          </template>
@@ -63,7 +63,7 @@
        <!-- <el-table-column prop="authDuration" label="授权时长">
        </el-table-column> -->
        <!-- <el-table-column prop="dataNames" label="公司"> </el-table-column> -->
        <el-table-column prop="companyName" label="部门" show-overflow-tooltip></el-table-column>
        <el-table-column prop="companyName" label="部门" show-overflow-tooltip min-width="200px"></el-table-column>
        <!-- <el-table-column label="状态">
          <template slot-scope="scope">
@@ -72,9 +72,10 @@
          </template>
        </el-table-column> -->
        <el-table-column label="操作">
        <el-table-column label="操作" align="center" width="100px">
          <template slot-scope="scope">
            <span class="iconfont option" @click="editUser(scope.row)">编辑</span>
            <span class="iconfont option" style="color:red" @click="delUser(scope.row)">删除</span>
          </template>
        </el-table-column>
      </el-table>
@@ -211,7 +212,7 @@
</template>
<script>
import { findUserList, saveSubUser, getMenu, getDataTree } from "@/api/user"
import { findUserList, saveSubUser, getMenu, getDataTree, deleteUser } from "@/api/user"
import { getAreas, getDic } from "@/api/login"
import Steps from "./Steps"
@@ -386,7 +387,7 @@
      this.ruleForm.companyName = row.companyName
      this.ruleForm.phoneNum = row.phoneNum
      this.ruleForm.email = row.email
      this.ruleForm.isChangePwd = row.isChangePwd
      this.ruleForm.isChangePwd = false
      this.ruleForm.industryId = row.industryId
      this.ruleForm.areaId = row.areaId
      this.ruleForm.address = [row.provinceId, row.areaId]
@@ -414,6 +415,23 @@
        this.$refs.ztreeMenus.updateNodes(cameraIds)
      }
    },
    delUser(row) {
      this.$confirm('确认要删除该用户吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(async () => {
          let rsp = await deleteUser({id:row.id})
          if (rsp && rsp.success) {
            this.$message({
              type: 'success',
              message: '删除成功!'
            });
          }
          this.findUserList()
        })
    },
    resetUser() {
      this.ruleForm = {
        id: "",
src/views/search/components/ModelCard.vue
@@ -85,7 +85,7 @@
                <span style="white-space: nowrap; font-weight: 600; font-size: 13px">{{ data.showLabels }}</span>
              </p>
            </div>
            <b style="float: right; margin-right: 50px;" @click="markDialogVisible = true">标记</b>
            <b style="float: right; margin-right: 50px; cursor: pointer;" @click="markDialogVisible = true">标记</b>
          </div>
        </div>
@@ -176,7 +176,7 @@
          title="标记"
          :visible.sync="markDialogVisible"
          width="30%"
          style="z-index:4000;margin-top:200px"
          style="z-index:4000;margin-top:200px;margin-left:140px;"
          center
          :modal="false"
        >