|
@@ -1,282 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="user-manage flex flex-col">
|
|
|
- <SearchForm :fields="searchColumns" :params="params"></SearchForm>
|
|
|
-
|
|
|
- <div class="flex-1 page-wrap">
|
|
|
- <t-table
|
|
|
- bordered
|
|
|
- size="small"
|
|
|
- row-key="id"
|
|
|
- :columns="columns"
|
|
|
- :data="tableData"
|
|
|
- :selected-row-keys="selectedRowKeys"
|
|
|
- select-on-row-click
|
|
|
- @select-change="rehandleSelectChange"
|
|
|
- >
|
|
|
- </t-table>
|
|
|
- </div>
|
|
|
-
|
|
|
- <AddUserDialog
|
|
|
- v-model:visible="showAddUserDialog"
|
|
|
- :title="title"
|
|
|
- :type="type"
|
|
|
- :handleSave="handleSave"
|
|
|
- :formData="formData"
|
|
|
- ref="formDialogRef"
|
|
|
- ></AddUserDialog>
|
|
|
-
|
|
|
- <ImportFileDialog
|
|
|
- v-model:visible="showImportFileDialog"
|
|
|
- :importType="importType"
|
|
|
- :title="importTitle"
|
|
|
- >
|
|
|
- </ImportFileDialog>
|
|
|
- <MultAddUserDialog
|
|
|
- v-model:visible="showMultAddUserDialog"
|
|
|
- ></MultAddUserDialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script lang="jsx" setup name="UserManage">
|
|
|
-import useTableCrud from '@/hooks/useTableCrud';
|
|
|
-import { ref, reactive } from 'vue';
|
|
|
-import AddUserDialog from './add-user-dialog.vue';
|
|
|
-import ImportFileDialog from './import-file-dialog.vue';
|
|
|
-import MultAddUserDialog from './mult-add-dialog.vue';
|
|
|
-
|
|
|
-const formDialogRef = ref(null);
|
|
|
-const showMultAddUserDialog = ref(false);
|
|
|
-const showImportFileDialog = ref(false);
|
|
|
-const importType = ref('');
|
|
|
-const importTitle = ref('');
|
|
|
-
|
|
|
-const selectedRowKeys = ref([]);
|
|
|
-const rehandleSelectChange = (value, { selectedRowData }) => {
|
|
|
- selectedRowKeys.value = value;
|
|
|
-};
|
|
|
-const columns = [
|
|
|
- {
|
|
|
- colKey: 'row-select',
|
|
|
- type: 'multiple',
|
|
|
- width: 50,
|
|
|
- },
|
|
|
- { colKey: 'a', title: '登录名' },
|
|
|
- { colKey: 'b', title: '名称' },
|
|
|
- { colKey: 'c', title: '来源' },
|
|
|
- { colKey: 'd', title: '角色' },
|
|
|
- { colKey: 'e', title: '状态' },
|
|
|
- { colKey: 'f', title: '关联账号' },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- colKey: 'operate',
|
|
|
- width: 150,
|
|
|
- cell: (h, { row }) => {
|
|
|
- return (
|
|
|
- <div class="table-operations">
|
|
|
- <t-link
|
|
|
- theme="primary"
|
|
|
- hover="color"
|
|
|
- data-id={row.id}
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
- handleEdit(row);
|
|
|
- }}
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </t-link>
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
-];
|
|
|
-const tableData = [
|
|
|
- { id: 'a', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'b', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'c', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'd', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'e', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'f', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
- { id: 'g', a: '111', b: '111', c: '111', d: '111', e: '111', f: '111' },
|
|
|
-];
|
|
|
-const add = async () => {
|
|
|
- await 1;
|
|
|
- alert(1);
|
|
|
-};
|
|
|
-const update = async () => {};
|
|
|
-const refresh = async () => {};
|
|
|
-
|
|
|
-const {
|
|
|
- visible: showAddUserDialog,
|
|
|
- type,
|
|
|
- title,
|
|
|
- loading,
|
|
|
- handleAdd,
|
|
|
- handleEdit,
|
|
|
- handleSave,
|
|
|
- formData,
|
|
|
- formRef,
|
|
|
-} = useTableCrud(
|
|
|
- {
|
|
|
- name: '用户',
|
|
|
- doCreate: add,
|
|
|
- doUpdate: update,
|
|
|
- refresh: refresh,
|
|
|
- },
|
|
|
- formDialogRef
|
|
|
-);
|
|
|
-const searchColumns = ref([
|
|
|
- {
|
|
|
- prop: 'a',
|
|
|
- label: '登录名',
|
|
|
- labelWidth: '60px',
|
|
|
- colSpan: 3.6,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'b',
|
|
|
- label: '姓名',
|
|
|
- labelWidth: '60px',
|
|
|
- colSpan: 3.6,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'c',
|
|
|
- label: '来源',
|
|
|
- type: 'select',
|
|
|
- labelWidth: '60px',
|
|
|
- colSpan: 3.6,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'd',
|
|
|
- label: '角色',
|
|
|
- type: 'select',
|
|
|
- labelWidth: '60px',
|
|
|
- colSpan: 3.6,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'e',
|
|
|
- label: '状态',
|
|
|
- type: 'select',
|
|
|
- labelWidth: '60px',
|
|
|
- colSpan: 3.6,
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'buttons',
|
|
|
- colSpan: 6,
|
|
|
- children: [
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '查询',
|
|
|
- attrs: {
|
|
|
- theme: 'primary',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '新建',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- // variant: 'outline',
|
|
|
- },
|
|
|
- onClick: handleAdd,
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'dropdown',
|
|
|
- text: '导入',
|
|
|
- attrs: {
|
|
|
- options: [
|
|
|
- { content: '科组长', value: 1 },
|
|
|
- { content: '复核员', value: 2 },
|
|
|
- ],
|
|
|
- },
|
|
|
- buttonAttrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: (data) => {
|
|
|
- showImportFileDialog.value = true;
|
|
|
- importTitle.value = data.content;
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'buttons',
|
|
|
- colSpan: 24,
|
|
|
- children: [
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '导入评卷员班级',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'dropdown',
|
|
|
- text: '导出',
|
|
|
- attrs: {
|
|
|
- options: [
|
|
|
- { content: '导出', value: 1 },
|
|
|
- { content: '按考试导出', value: 2 },
|
|
|
- ],
|
|
|
- },
|
|
|
- buttonAttrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: (data) => {
|
|
|
- alert(data.content);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '批量创建',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '启用',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '禁用',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: '重置密码',
|
|
|
- attrs: {
|
|
|
- theme: 'default',
|
|
|
- },
|
|
|
- onClick: () => {
|
|
|
- alert(1);
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
-]);
|
|
|
-const params = reactive({
|
|
|
- a: '',
|
|
|
- b: '',
|
|
|
- c: '',
|
|
|
- d: '',
|
|
|
- e: '',
|
|
|
-});
|
|
|
-</script>
|