From b9bd29a1a81f6f7de479e3cc3fdfe3d85fc660bf Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期三, 23 四月 2025 13:35:06 +0800 Subject: [PATCH] UA 整理提交 --- src/views/system/user/index.vue | 62 ++++++++++++++---------------- 1 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index e65b2c9..4c312ce 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -2,11 +2,14 @@ import { ref, reactive, onMounted, computed } from "vue"; import { storeToRefs } from "pinia"; import { Search, Plus } from "@element-plus/icons-vue"; - import HdwCard from "@/components/HdwCard/index.vue"; + import ycCard from "@/components/ycCard/index.vue"; import addEdit from "./addEdit.vue"; import { ElMessage } from "element-plus"; import useElement from "@/hooks/useElement.js"; - import store from "@/store"; + import { useUserStore } from '@/store/user'; + const userStore = useUserStore(); + const { uname } = storeToRefs(userStore); + import { getAllUser, deleteUser, @@ -16,11 +19,27 @@ } from "@/api/user"; const { $loading, $message, $confirm } = useElement(); + // const $message = ElMessage; const headers = [ { prop: "uname", + label: "鐢ㄦ埛鍚�", + width: "", + }, + { + prop: "realName", label: "濮撳悕", + width: "", + }, + { + prop: "phoneNumber", + label: "鐢佃瘽", + width: "", + }, + { + prop: "address", + label: "鍦板潃", width: "", }, { @@ -48,7 +67,6 @@ userInfo: {}, }); - const uname = computed(() => store.user().name); // const tableData = reactive([]); // const userInfo = reactive({}); @@ -97,19 +115,13 @@ function edit(record) { dialogTitle.value = "缂栬緫鐢ㄦ埛"; addEditVisible.value = true; - console.log(record); - let ids = record.ainfList.map(v => { - let res = v.idPath.split("_").map((vv) => vv * 1); - res.push(v.id); - return res - }); + console.log(record, '=======edit======'); // if (record.ainfList.idPath) { // ids = record.ainfList.idPath.split("_").map((v) => v * 1); // } // ids.push(record.areaId); - console.log('ids', ids, '============='); - datas.userInfo = { ...record, areaId: ids }; + datas.userInfo = { ...record }; } function confirmRemove(record) { $confirm("鍒犻櫎璇ョ敤鎴�", () => { @@ -192,34 +204,18 @@ }); } - function itemClickHandler(item) { - console.log(item, "====item", item.data); - // areaId lockName lockState lockType pageNum pageSize - currentAreaId.value = item.data.id; - currentAreaIds.value = item.data.idPath - ? item.data.idPath.split("_").map((v) => v * 1) - : []; - currentAreaIds.value.push(item.data.id); - - getList(); - } onMounted(() => { - // getList(); + getList(); }); </script> <template> <div class="page-wrapper"> - <div class="page-header"> - <div class="hdw-card-container"> - <hdw-card title="鍖哄煙鍒楄〃" is-full> - <hdw-tree @item-click="itemClickHandler"></hdw-tree> - </hdw-card> - </div> - </div> + <!-- <div class="page-header"> + </div> --> <div class="page-content"> - <hdw-card is-full> + <yc-card is-full> <div class="page-content-wrapper"> <div class="page-content-tools"> <el-button type="primary" round size="small" @click="addUser" :icon="Plus">娣诲姞</el-button> @@ -229,7 +225,7 @@ <div class="pos-rel"> <div class="pos-abs"> <el-table class="yc-table" stripe height="100%" size="small" :data="datas.tableData" style="width: 100%"> - <el-table-column type="index" label="搴忓彿" width="80"></el-table-column> + <el-table-column type="index" fixed="left" label="搴忓彿" width="80"></el-table-column> <el-table-column v-for="header in headers" :key="header.prop" :prop="header.prop" :label="header.label" :min-width="header.width" align="center"></el-table-column> <el-table-column label="鎿嶄綔" width="360" align="center"> @@ -272,7 +268,7 @@ <div class="page-tool"></div> </div> </div> - </hdw-card> + </yc-card> </div> <div class="page-footer"></div> <!-- 寮圭獥 --> -- Gitblit v1.9.1