diff --git a/package.json b/package.json index e423703..e88a4cd 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,13 @@ "@eslint/js": "^9.39.2", "@vitejs/plugin-vue": "^6.0.3", "@vue/eslint-config-prettier": "^10.2.0", - "sass-embedded": "^1.97.2", "eslint": "^9.39.2", "eslint-plugin-vue": "~10.6.2", "globals": "^17.0.0", "prettier": "3.7.4", + "sass-embedded": "^1.97.2", "vite": "^7.3.0", - "vite-plugin-vue-devtools": "^8.0.5" + "vite-plugin-vue-devtools": "^8.0.5", + "vue-eslint-parser": "^10.2.0" } } diff --git a/src/components/DynamicForm.vue b/src/components/scForm/index.vue similarity index 100% rename from src/components/DynamicForm.vue rename to src/components/scForm/index.vue diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue new file mode 100644 index 0000000..8cef357 --- /dev/null +++ b/src/components/scTable/index.vue @@ -0,0 +1,350 @@ + + + + + diff --git a/src/pages/system/user/index.vue b/src/pages/auth/user/index.vue similarity index 53% rename from src/pages/system/user/index.vue rename to src/pages/auth/user/index.vue index 278fa70..8e3cfb6 100644 --- a/src/pages/system/user/index.vue +++ b/src/pages/auth/user/index.vue @@ -9,41 +9,28 @@
- - - - - - - 全部 - 正常 - 禁用 - - - - - 查询 - 重置 - - - +
- - @@ -52,45 +39,66 @@ import { ref, onMounted } from 'vue' import { message } from 'ant-design-vue' import { PlusOutlined } from '@ant-design/icons-vue' +import ScTable from '@/components/scTable/index.vue' +import ScForm from '@/components/scForm/index.vue' const columns = [ { title: 'ID', dataIndex: 'id', key: 'id', - width: 80 + width: 80, }, { title: '用户名', dataIndex: 'username', - key: 'username' + key: 'username', }, { title: '昵称', dataIndex: 'nickname', - key: 'nickname' + key: 'nickname', }, { title: '状态', dataIndex: 'status', key: 'status', - width: 100 + width: 100, }, { title: '创建时间', dataIndex: 'createTime', - key: 'createTime' + key: 'createTime', + }, +] + +// 搜索表单配置 +const formItems = [ + { + field: 'username', + label: '用户名', + type: 'input', + placeholder: '请输入用户名', + allowClear: true, }, { - title: '操作', - key: 'action', - width: 150 - } + field: 'status', + label: '状态', + type: 'select', + placeholder: '请选择状态', + options: [ + { label: '全部', value: '' }, + { label: '正常', value: 1 }, + { label: '禁用', value: 0 }, + ], + allowClear: true, + style: 'width: 120px', + }, ] const searchForm = ref({ username: '', - status: '' + status: '', }) const dataSource = ref([]) @@ -100,7 +108,7 @@ const pagination = ref({ pageSize: 10, total: 0, showSizeChanger: true, - showTotal: (total) => `共 ${total} 条` + showTotal: (total) => `共 ${total} 条`, }) // 模拟数据 @@ -110,15 +118,15 @@ const mockData = [ username: 'admin', nickname: '管理员', status: 1, - createTime: '2024-01-01 10:00:00' + createTime: '2024-01-01 10:00:00', }, { id: 2, username: 'user', nickname: '普通用户', status: 1, - createTime: '2024-01-02 10:00:00' - } + createTime: '2024-01-02 10:00:00', + }, ] const loadData = () => { @@ -138,7 +146,7 @@ const handleSearch = () => { const handleReset = () => { searchForm.value = { username: '', - status: '' + status: '', } loadData() } diff --git a/src/pages/ucenter/components/BasicInfo.vue b/src/pages/ucenter/components/BasicInfo.vue index 04ac4d0..d7b6e05 100644 --- a/src/pages/ucenter/components/BasicInfo.vue +++ b/src/pages/ucenter/components/BasicInfo.vue @@ -1,12 +1,12 @@