MrShi
17 小时以前 6e61b49f9cddbda65bad95af5d6300265384c37f
admin/src/views/system/user.vue
@@ -81,6 +81,25 @@
            </ul>
          </template>
        </el-table-column>
        <el-table-column prop="prohibitStatus" label="禁止登录" min-width="160px" class-name="table-column-strings">
          <template slot-scope="{row}">
            <el-switch
              v-model="row.prohibitStatus"
              @change="changeStatus($event, row.id)"
              active-color="#13ce66"
              inactive-color="#ff4949"
              :active-value="0"
              :inactive-value="1">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column prop="prohibitRemark" label="禁用备注" min-width="100px"></el-table-column>
        <el-table-column label="初始化密码" min-width="100px">
          <template slot-scope="{row}">
            <span v-if="row.needChangePwd === 0">{{row.firstPassword}}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column prop="createUser" label="创建人" min-width="100px">
          <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template>
        </el-table-column>
@@ -128,6 +147,7 @@
import DepartmentSelect from '@/components/common/DepartmentSelect'
import PositionSelect from '@/components/common/PositionSelect'
import { fetchAll as fetchAllRoles, fetchAll } from '@/api/system/role'
import { updUserProhibitStatus } from '@/api/system/user'
export default {
  name: 'SystemUser',
  extends: BaseTable,
@@ -165,6 +185,18 @@
      .catch(e => {
        this.$tip.apiFailed(e)
      })
  },
  methods: {
    changeStatus(prohibitStatus, id) {
      console.log(id)
      console.log(prohibitStatus)
      updUserProhibitStatus({
        prohibitStatus,
        id
      }).then(res => {
        this.search()
      })
    }
  }
}
</script>