zhanghua
2023-03-23 394e444b3d6f20da250f89a5bc72c8ce782d5528
src/views/systemSetting/baseSetting/user/components/main/index.vue
@@ -10,14 +10,15 @@
          background: '#F5F5F5',
          'font-size': '14px',
          'font-weight': '650',
          'line-height': '45px',
                    'line-height': '45px'
        }"
        :data="tableData"
        style="width: 100%"
        :row-class-name="tableRowClassName"
        @selection-change="tableChange"
      >
        <el-table-column type="selection" min-width="5"> </el-table-column>
                <el-table-column type="selection" min-width="5">
                </el-table-column>
        <el-table-column label="用户ID" min-width="6">
          <template slot-scope="scope">{{ scope.row.id }}</template>
        </el-table-column>
@@ -32,14 +33,22 @@
            <span>{{ filterRole(scope.row.roles) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="departName" label="所属部门" min-width="10">
                <el-table-column
                    prop="departName"
                    label="所属部门"
                    min-width="10"
                >
          <template slot-scope="scope">
            <span>{{ filterDepart(scope.row.depart) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="jobTitle" label="所属职务" min-width="8">
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" min-width="10">
                <el-table-column
                    prop="createTime"
                    label="创建时间"
                    min-width="10"
                >
          <template slot-scope="scope">
            <span>{{ changeTime(scope.row) }}</span>
          </template>
@@ -60,11 +69,12 @@
        <el-table-column prop="operation" label="操作" min-width="20">
          <template slot-scope="scope">
            <div class="operation">
              <span @click="handleChangeRole(scope.row, 'role')">修改角色</span>
                            <span @click="handleChange(scope.row)">修改</span>
              <span class="line">|</span>
              <span @click="handleFind(scope.row)">查看</span>
              <span class="line">|</span>
              <span @click="handleChangeRole(scope.row, 'password')"
                            <span
                                @click="handleChangeRole(scope.row, 'password')"
                >修改密码</span
              >
              <span class="line">|</span>
@@ -75,7 +85,7 @@
              >
              <span class="line">|</span>
              <span @click="handleChangeStatus(scope.row)">{{
                scope.row.status === true ? "停用" : "启用"
                                scope.row.status === true ? '停用' : '启用'
              }}</span>
            </div>
          </template>
@@ -114,16 +124,34 @@
          :getUserList="getUserList"
          v-if="!flag.password"
        />
        <MyPwd v-else :userInfo="userInfo" @closeDialog="closeDialog"></MyPwd>
                <MyPwd
                    v-else
                    :userInfo="userInfo"
                    @closeDialog="closeDialog"
                ></MyPwd>
            </el-dialog>
            <el-dialog
                :visible.sync="dialogCreate"
                title="新增账户"
                width="800px"
                v-if="dialogCreate"
                :before-close="handleClose"
            >
                <createUser @sendDialog="sendDialog" :userInfo="userInfo" />
      </el-dialog>
      <!-- tools -->
      <div class="tools">
        <div class="funs">
          <div class="funsItem funs-sp">
            <el-checkbox v-model="all" @change="selectAll()">全选</el-checkbox>
                        <el-checkbox v-model="all" @change="selectAll()"
                            >全选</el-checkbox
                        >
          </div>
          <div class="funsItem funs-sp">
            <el-checkbox v-model="unsame" @change="disSame(tableData)"
                        <el-checkbox
                            v-model="unsame"
                            @change="disSame(tableData)"
              >反选</el-checkbox
            >
          </div>
@@ -164,11 +192,13 @@
</template>
<script>
import helper from "@/utils/mydate";
import createUser from "../createUser";
import updateUser from "../updateUser";
import MyPwd from "../password";
import MyView from "../myView";
export default {
  components: {
        createUser,
    updateUser,
    MyPwd,
    MyView,
@@ -177,6 +207,7 @@
    return {
      tableData: [],
      search: "",
            dialogCreate: false,
      dialogUpdate: false,
      dialogView: false,
      updateFlag: false,
@@ -221,7 +252,6 @@
  },
  methods: {
    async selectChange(list) {
      console.log(this.tempList);
      if (this.tempList.length !== 0) {
        this.preMyIdx = list;
        if (list === 3) {
@@ -253,7 +283,6 @@
    },
    // 批量删除用户信息
    mulDelte(idArr) {
      console.log(idArr);
      this.$confirm("您确定要进行批量删除用户吗?")
        .then((_) => {
          this.$axios({
@@ -281,7 +310,6 @@
    },
    // 批量修改账号
    mulUpdateStatus(idArr, flag) {
      console.log(flag);
      this.$confirm(
        flag === 1
          ? "您确定要进行批量启用用户吗?"
@@ -339,6 +367,10 @@
        })
        .catch((_) => {});
    },
        sendDialog(flag) {
            this.dialogCreate = flag.flag;
            this.$emit('setDialog', { flag: true })
        },
    closeDialog({ flag }) {
      this.dialogUpdate = flag;
      this.getUserList();
@@ -372,6 +404,11 @@
      this.getUserList();
    },
    // 修改角色
        handleChange(obj) {
            this.dialogCreate = true;
            this.userInfo = obj;
        },
        // 修改角色
    handleChangeRole(obj, mykey) {
      this.dialogUpdate = true;
      this.updateFlag = true;