|
@@ -1,167 +1,3 @@
|
|
|
-<!--
|
|
|
-<template>
|
|
|
- <DynamicTable
|
|
|
- ref="dynamicTableRef"
|
|
|
- header-title="用户列表"
|
|
|
- title-tooltip=""
|
|
|
- :data-request="loadData"
|
|
|
- :columns="columns"
|
|
|
- />
|
|
|
-</template>
|
|
|
-
|
|
|
-<script lang="tsx" setup>
|
|
|
-import { Tag } from 'ant-design-vue';
|
|
|
-import type { TableColumn } from '@/components/core/dynamic-table';
|
|
|
-import { useTable } from '@/components/core/dynamic-table';
|
|
|
-import { useSocket } from '@/core/socket/useSocket';
|
|
|
-import { getUserListPage,updateUserStatu } from '@/api/system/user'
|
|
|
-
|
|
|
-defineOptions({
|
|
|
- name: 'SystemDictionary',
|
|
|
-});
|
|
|
-
|
|
|
-const [DynamicTable, dynamicTableInstance] = useTable();
|
|
|
-
|
|
|
-const loadData = async (params) => {
|
|
|
- const { list } = await getUserListPage(params);
|
|
|
- return list;
|
|
|
-};
|
|
|
-
|
|
|
-const columns: TableColumn[] = [
|
|
|
- {
|
|
|
- title: '用户名',
|
|
|
- dataIndex: 'LoginID',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '姓名',
|
|
|
- dataIndex: 'Name',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '性别',
|
|
|
- dataIndex: 'Sex',
|
|
|
- align: 'center',
|
|
|
- customRender: ({ record }) => (
|
|
|
- <div>
|
|
|
- {record.Sex==1?"男":"女"}
|
|
|
- </div>
|
|
|
- ),
|
|
|
- formItemProps: {
|
|
|
- component: 'Select',
|
|
|
- componentProps: () => ({
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: '男',
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '女',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- ],
|
|
|
- onChange() {
|
|
|
-
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '用户类型',
|
|
|
- dataIndex: 'UserTypeName',
|
|
|
- align: 'center',
|
|
|
- formItemProps: {
|
|
|
- component: 'Select',
|
|
|
- componentProps: () => ({
|
|
|
- request: () => {
|
|
|
- //return fetchStatusMapData();
|
|
|
- },
|
|
|
- onChange() {
|
|
|
-
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '角色名称',
|
|
|
- dataIndex: 'roleName',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '账号状态',
|
|
|
- dataIndex: 'RecordStatus',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- customRender: ({ record }) => (
|
|
|
- <div>
|
|
|
- {record.RecordStatus==1?"正常":"禁用"}
|
|
|
- </div>
|
|
|
- ),
|
|
|
- formItemProps: {
|
|
|
- component: 'Select',
|
|
|
- componentProps: () => ({
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: '正常',
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '禁用',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- ],
|
|
|
- onChange() {
|
|
|
-
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '创建时间',
|
|
|
- dataIndex: 'CreateTime',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'ACTION',
|
|
|
- align: 'center',
|
|
|
- actions: ({ record }) => [
|
|
|
- {
|
|
|
- label: '启用',
|
|
|
- disabled: record.RecordStatus==1,
|
|
|
- onClick:async () => {
|
|
|
- await updateUserStatu({userId: record.UserID, statu:1 });
|
|
|
- dynamicTableInstance?.reload();
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '禁用',
|
|
|
- // auth: 'sys.online.kick',
|
|
|
- disabled: record.RecordStatus==0,
|
|
|
- popConfirm: {
|
|
|
- title: '确定禁用该用户吗?',
|
|
|
- onConfirm:async () => {
|
|
|
- await updateUserStatu({userId: record.UserID, statu: 0 });
|
|
|
- dynamicTableInstance?.reload();
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
-];
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
--->
|
|
|
-
|
|
|
<template>
|
|
|
<div class="card-search">
|
|
|
<a-form
|
|
@@ -201,7 +37,8 @@ const columns: TableColumn[] = [
|
|
|
</a-row>
|
|
|
<a-row class="edit-operation">
|
|
|
<a-col :span="24" style="text-align: right">
|
|
|
-
|
|
|
+<!-- functioncode="T01030202"-->
|
|
|
+ <a-button type="primary" html-type="submit" @click='onAdd' >新增</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -215,8 +52,8 @@ const columns: TableColumn[] = [
|
|
|
<template #bodyCell="{ column, text, record }">
|
|
|
<template v-if="column.key === 'operation'">
|
|
|
<div class="table-operation">
|
|
|
- <a-button type="link" @click="onUpdateUserStatu(record.UserID,1)" functioncode="T0199010102">启用</a-button>
|
|
|
- <a-button type="link" @click="onUpdateUserStatu(record.UserID,0)" functioncode="T0199010103">禁用</a-button>
|
|
|
+ <a-button type="link" @click="onUpdateUserStatus(record.UserID,1)" functioncode="T0199010102">启用</a-button>
|
|
|
+ <a-button type="link" @click="onUpdateUserStatus(record.UserID,0)" functioncode="T0199010103">禁用</a-button>
|
|
|
<a-button type="link" @click="onUpdatePassword(record)" functioncode="T0199010104">修改密码</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -224,6 +61,7 @@ const columns: TableColumn[] = [
|
|
|
</a-table>
|
|
|
</div>
|
|
|
<UpdatePassword ref="updatePasswordRef"></UpdatePassword>
|
|
|
+ <UserAdd ref="userAddRef"></UserAdd>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -231,14 +69,15 @@ const columns: TableColumn[] = [
|
|
|
import {reactive, ref, computed, defineComponent} from 'vue';
|
|
|
import type {FormInstance} from 'ant-design-vue';
|
|
|
import type {TableColumnsType, TableProps, SelectProps} from 'ant-design-vue';
|
|
|
-import {getUserListPage, updateUserStatu} from '@/api/system/user'
|
|
|
+import {getUserListPage, updateUserStatus} from '@/api/system/user'
|
|
|
import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
|
import UpdatePassword from '@/views/system/users/updatePassword.vue';
|
|
|
+import UserAdd from '@/views/system/users/addUser.vue';
|
|
|
import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'UserList',
|
|
|
- components: { UpdatePassword},
|
|
|
+ components: { UpdatePassword,UserAdd},
|
|
|
setup() {
|
|
|
const modalRoleUserRef = ref();
|
|
|
const modalRoleEditRef = ref();
|
|
@@ -279,6 +118,7 @@ export default defineComponent({
|
|
|
const dataList = ref([]);
|
|
|
const userTypeList = ref<SelectProps['options']>();
|
|
|
const updatePasswordRef = ref();
|
|
|
+ const userAddRef = ref();
|
|
|
|
|
|
const onSelectChange = (selectedRowKeys: any) => {
|
|
|
formState.selectedRowKeys = selectedRowKeys;
|
|
@@ -296,11 +136,16 @@ export default defineComponent({
|
|
|
loadData();
|
|
|
}
|
|
|
|
|
|
- const onUpdateUserStatu = async function (userID, statu) {
|
|
|
- await updateUserStatu({userId: userID, statu: statu});
|
|
|
+ const onAdd = ()=>{
|
|
|
+ userAddRef.value.show();
|
|
|
loadData();
|
|
|
}
|
|
|
|
|
|
+ const onUpdateUserStatus = async function (userID, status) {
|
|
|
+ await updateUserStatus({userId: userID, status: status});
|
|
|
+ await loadData();
|
|
|
+ }
|
|
|
+
|
|
|
const onUpdatePassword = (item) => {
|
|
|
updatePasswordRef.value.show(item.UserID,item.Name,item.LoginID);
|
|
|
};
|
|
@@ -308,8 +153,8 @@ export default defineComponent({
|
|
|
const loadData = async function () {
|
|
|
formState.loading = true;
|
|
|
const result: any = await getUserListPage(searchParamsState);
|
|
|
-
|
|
|
dataList.value = result.list;
|
|
|
+ console.log("dataList",dataList.value);
|
|
|
formState.total = result.total;
|
|
|
formState.loading = false;
|
|
|
}
|
|
@@ -334,10 +179,12 @@ export default defineComponent({
|
|
|
userTypeList,
|
|
|
onSelectChange,
|
|
|
handleTableChange,
|
|
|
+ onAdd,
|
|
|
onFinish,
|
|
|
- onUpdateUserStatu,
|
|
|
+ onUpdateUserStatus,
|
|
|
onUpdatePassword,
|
|
|
- updatePasswordRef
|
|
|
+ updatePasswordRef,
|
|
|
+ userAddRef
|
|
|
};
|
|
|
},
|
|
|
created() {
|