|
@@ -18,19 +18,6 @@
|
|
<a-input v-model:value="searchParamsState.LoginID" placeholder=""/>
|
|
<a-input v-model:value="searchParamsState.LoginID" placeholder=""/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :span="6">
|
|
|
|
- <a-form-item label="用户类型" :label-col="{span:8}" name="UserTypeName">
|
|
|
|
- <a-select
|
|
|
|
- ref="select"
|
|
|
|
- v-model:value="searchParamsState.UserTypeName"
|
|
|
|
- :options="userTypeList"
|
|
|
|
- :field-names="{label:'name',value:'value'}"
|
|
|
|
- @change="loadData"
|
|
|
|
- :allow-clear="true"
|
|
|
|
- >
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
<a-col :span="6" style="text-align: left">
|
|
<a-col :span="6" style="text-align: left">
|
|
<a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
|
|
<a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
|
|
<a-button style="margin: 0 8px" @click="() => {formRef.resetFields();loadData()}">重置</a-button>
|
|
<a-button style="margin: 0 8px" @click="() => {formRef.resetFields();loadData()}">重置</a-button>
|
|
@@ -38,7 +25,8 @@
|
|
</a-row>
|
|
</a-row>
|
|
<a-row class="edit-operation">
|
|
<a-row class="edit-operation">
|
|
<a-col :span="24" style="text-align: right">
|
|
<a-col :span="24" style="text-align: right">
|
|
- <a-button @click="editTeacher" functioncode="T0199010101">新增</a-button>
|
|
|
|
|
|
+ <a-button @click="addUser" >新增</a-button>
|
|
|
|
+ <a-button @click="onDelete">删除</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
@@ -61,25 +49,31 @@
|
|
</a-table>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
<UpdatePassword ref="updatePasswordRef"></UpdatePassword>
|
|
<UpdatePassword ref="updatePasswordRef"></UpdatePassword>
|
|
|
|
+ <AddUserInfo ref="addUserInfoRef" :loadData="loadData"></AddUserInfo>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import {reactive, ref, computed, defineComponent} from 'vue';
|
|
|
|
|
|
+import {reactive, ref, computed, defineComponent,createVNode} from 'vue';
|
|
import type {FormInstance} from 'ant-design-vue';
|
|
import type {FormInstance} from 'ant-design-vue';
|
|
import type {TableColumnsType, TableProps, SelectProps} from 'ant-design-vue';
|
|
import type {TableColumnsType, TableProps, SelectProps} from 'ant-design-vue';
|
|
-import {getUserListPage, updateUserStatu} from '@/api/system/user'
|
|
|
|
|
|
+import {getUserListPage, updateUserStatu,deleteSysUsers} from '@/api/system/user'
|
|
import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
import UpdatePassword from '@/views/system/users/updatePassword.vue';
|
|
import UpdatePassword from '@/views/system/users/updatePassword.vue';
|
|
import {getPaginationTotalTitle} from "@/utils/common";
|
|
import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
|
+import AddUserInfo from '@/views/system/users/edit.vue';
|
|
|
|
+import {message, Modal} from "ant-design-vue";
|
|
|
|
+import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
|
+
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'UserList',
|
|
name: 'UserList',
|
|
- components: {UpdatePassword},
|
|
|
|
|
|
+ components: {UpdatePassword,AddUserInfo},
|
|
setup() {
|
|
setup() {
|
|
const modalRoleUserRef = ref();
|
|
const modalRoleUserRef = ref();
|
|
const modalRoleEditRef = ref();
|
|
const modalRoleEditRef = ref();
|
|
const formRef = ref<FormInstance>();
|
|
const formRef = ref<FormInstance>();
|
|
|
|
+ const addUserInfoRef = ref();
|
|
const searchParamsState = reactive({page: 1, limit: 20, Name: '', userTypeID: ''});
|
|
const searchParamsState = reactive({page: 1, limit: 20, Name: '', userTypeID: ''});
|
|
const formState = reactive({
|
|
const formState = reactive({
|
|
total: 0,
|
|
total: 0,
|
|
@@ -96,7 +90,6 @@ export default defineComponent({
|
|
},
|
|
},
|
|
{title: '用户名', dataIndex: 'Name', key: 'Name', width: 150},
|
|
{title: '用户名', dataIndex: 'Name', key: 'Name', width: 150},
|
|
{title: '帐号', dataIndex: 'LoginID', key: 'LoginID', width: 150},
|
|
{title: '帐号', dataIndex: 'LoginID', key: 'LoginID', width: 150},
|
|
- {title: '用户类型', dataIndex: 'UserTypeName', key: 'UserTypeName', width: 150},
|
|
|
|
{title: '角色', dataIndex: 'roleName', key: 'roleName',},
|
|
{title: '角色', dataIndex: 'roleName', key: 'roleName',},
|
|
{
|
|
{
|
|
title: '账号状态', dataIndex: 'RecordStatus', key: 'RecordStatus', width: 150, customRender: ({record}) => (
|
|
title: '账号状态', dataIndex: 'RecordStatus', key: 'RecordStatus', width: 150, customRender: ({record}) => (
|
|
@@ -121,7 +114,10 @@ export default defineComponent({
|
|
const onSelectChange = (selectedRowKeys: any) => {
|
|
const onSelectChange = (selectedRowKeys: any) => {
|
|
formState.selectedRowKeys = selectedRowKeys;
|
|
formState.selectedRowKeys = selectedRowKeys;
|
|
};
|
|
};
|
|
|
|
+ const addUser = () => {
|
|
|
|
+ addUserInfoRef.value.show();
|
|
|
|
|
|
|
|
+ }
|
|
const handleTableChange: TableProps['onChange'] = (
|
|
const handleTableChange: TableProps['onChange'] = (
|
|
pag: { pageSize: number; current: number }
|
|
pag: { pageSize: number; current: number }
|
|
) => {
|
|
) => {
|
|
@@ -142,23 +138,28 @@ export default defineComponent({
|
|
const onUpdatePassword = (item) => {
|
|
const onUpdatePassword = (item) => {
|
|
updatePasswordRef.value.show(item.UserID,item.Name,item.LoginID);
|
|
updatePasswordRef.value.show(item.UserID,item.Name,item.LoginID);
|
|
};
|
|
};
|
|
- const editTeacher = () => {
|
|
|
|
- TeacherRef.value.show(formState.selectedRowKeys);
|
|
|
|
- // getTaskStudentList({
|
|
|
|
- // page: 1,
|
|
|
|
- // rows: 10000,
|
|
|
|
- // taskIdList: formState.selectedRowKeys.join(",")
|
|
|
|
- // }).then((result: any) => {
|
|
|
|
- // const studentList = result.list.filter(e => (e.positionID == null || e.positionID == '') && e.recordStatus != 4 && e.arrangeType != 2);
|
|
|
|
- // if (studentList.length <= 0) {
|
|
|
|
- // message.warning("选择的班级已完成指派,请刷新任务数据!");
|
|
|
|
- // return false;
|
|
|
|
- // } else {
|
|
|
|
- // //modalPositionRef.value.show(studentList.map(it => it.practiceTaskStudentID), majorGradeIDs[0].majorGradeID, schoolYearIDs[0].schoolYearID);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ const onDelete = () => {
|
|
|
|
+ if (formState.selectedRowKeys.length <= 0) {
|
|
|
|
+ message.warning('请选择需要删除的数据!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title: '确认删除选中用户?',
|
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
+ content: '',
|
|
|
|
+ okText: '确认删除',
|
|
|
|
+ okType: 'danger',
|
|
|
|
+ okButtonProps: {},
|
|
|
|
+ cancelText: '取消',
|
|
|
|
+ onOk() {
|
|
|
|
+ deleteSysUsers(formState.selectedRowKeys).then(() => {
|
|
|
|
+ loadData();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onCancel() {
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
const loadData = async function () {
|
|
const loadData = async function () {
|
|
formState.loading = true;
|
|
formState.loading = true;
|
|
const result: any = await getUserListPage(searchParamsState);
|
|
const result: any = await getUserListPage(searchParamsState);
|
|
@@ -189,11 +190,13 @@ export default defineComponent({
|
|
onSelectChange,
|
|
onSelectChange,
|
|
handleTableChange,
|
|
handleTableChange,
|
|
onFinish,
|
|
onFinish,
|
|
- editTeacher,
|
|
|
|
|
|
+ onDelete,
|
|
onUpdateUserStatu,
|
|
onUpdateUserStatu,
|
|
onUpdatePassword,
|
|
onUpdatePassword,
|
|
TeacherRef,
|
|
TeacherRef,
|
|
- updatePasswordRef
|
|
|
|
|
|
+ updatePasswordRef,
|
|
|
|
+ addUser,
|
|
|
|
+ addUserInfoRef
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|