From b80ee8c883f279e843071e6b53ab9cddec3f88a0 Mon Sep 17 00:00:00 2001
From: 胡思旗 <931347610@qq.com>
Date: Tue, 29 Aug 2023 15:07:13 +0800
Subject: [PATCH] 登录流程对接、项目列表组件封装

---
 src/pages/page-web/projects/members.vue |   38 +++++++++++++++++++++++---------------
 1 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/src/pages/page-web/projects/members.vue b/src/pages/page-web/projects/members.vue
index 642599a..c0e0bad 100644
--- a/src/pages/page-web/projects/members.vue
+++ b/src/pages/page-web/projects/members.vue
@@ -3,8 +3,8 @@
   <div class="table flex-display flex-column">
     <a-table :columns="columns" :data-source="data.member" :pagination="paginationProp" @change="refreshData" row-key="user_id"
     :row-selection="rowSelection" :rowClassName="(record, index) => ((index % 2) === 0 ? 'table-striped' : null)" :scroll="{ x: '100%', y: 600 }">
-      <template v-for="col in ['mqtt_username', 'mqtt_password']" #[col]="{ text, record }" :key="col">
-        <div>
+      <template v-for="col in ['organization_name', 'user_role', ]" #[col]="{ text, record }" :key="col">
+        <div v-if="col == 'organization_name'">
           <a-input
             v-if="editableData[record.user_id]"
             v-model:value="editableData[record.user_id][col]"
@@ -14,6 +14,9 @@
             {{ text }}
           </template>
         </div>
+        <!-- <div v-else-if="col == 'user_role'"> -->
+          <!--  -->
+        <!-- </div> -->
       </template>
       <template #action="{ record }">
         <div class="editable-row-operations">
@@ -25,8 +28,9 @@
               <span @click="() => delete editableData[record.user_id]" class="ml15" style="color: #e70102;"><CloseOutlined /></span>
             </a-tooltip>
           </span>
-          <span v-else class="fz18 flex-align-center flex-row" style="color: #2d8cf0">
+          <span v-else class="fz18 flex-align-center flex-justify-between flex-row" style="color: #2d8cf0">
             <EditOutlined @click="edit(record)" />
+            <DeleteOutlined @click="del(record)" />
           </span>
         </div>
       </template>
@@ -41,29 +45,29 @@
 import { IPage } from '/@/api/http/type'
 import { getAllUsersInfo, updateUserInfo } from '/@/api/manage'
 import { ELocalStorageKey } from '/@/types'
-import { EditOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue'
+import { EditOutlined, DeleteOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue'
 
 export interface Member {
     user_id: string
     username: string
-    user_type: string
-    workspace_name: string
+    organization_name: string
+    project: string
     create_time: string
-    mqtt_username: string
-    mqtt_password: string
+    user_role: string
+    join_way: string
 }
 
 interface MemberData {
   member: Member[]
 }
 const columns = [
-  { title: 'Account', dataIndex: 'username', width: 150, sorter: (a: Member, b: Member) => a.username.localeCompare(b.username), className: 'titleStyle' },
-  { title: 'User Type', dataIndex: 'user_type', width: 150, className: 'titleStyle' },
-  { title: 'Workspace Name', dataIndex: 'workspace_name', width: 150, className: 'titleStyle' },
-  { title: 'Mqtt Username', dataIndex: 'mqtt_username', width: 150, className: 'titleStyle', slots: { customRender: 'mqtt_username' } },
-  { title: 'Mqtt Password', dataIndex: 'mqtt_password', width: 150, className: 'titleStyle', slots: { customRender: 'mqtt_password' } },
-  { title: 'Joined', dataIndex: 'create_time', width: 150, sorter: (a: Member, b: Member) => a.create_time.localeCompare(b.create_time), className: 'titleStyle' },
-  { title: 'Action', dataIndex: 'action', width: 100, className: 'titleStyle', slots: { customRender: 'action' } },
+  { title: '账号', dataIndex: 'username', width: 150, sorter: (a: Member, b: Member) => a.username.localeCompare(b.username), className: 'titleStyle' },
+  { title: '人员组织名称', dataIndex: 'organization_name', sorter: (a: Member, b: Member) => a.organization_name.localeCompare(b.organization_name), width: 150, className: 'titleStyle' },
+  { title: '用户角色', dataIndex: 'user_role', width: 150, className: 'titleStyle', slots: { customRender: 'user_role' } },
+  { title: '所属项目', dataIndex: 'project', width: 150, className: 'titleStyle' },
+  { title: '加入方式', dataIndex: 'join_way', width: 150, className: 'titleStyle', slots: { customRender: 'join_way' } },
+  { title: '加入时间', dataIndex: 'create_time', width: 150, sorter: (a: Member, b: Member) => a.create_time.localeCompare(b.create_time), className: 'titleStyle' },
+  { title: '操作', dataIndex: 'action', width: 70, className: 'titleStyle', slots: { customRender: 'action' } },
 ]
 
 const data = reactive<MemberData>({
@@ -124,6 +128,10 @@
   editableData[record.user_id] = record
 }
 
+const del = (record: Member) => {
+  console.log(record)
+}
+
 function save (record: Member) {
   delete editableData[record.user_id]
   updateUserInfo(workspaceId, record.user_id, record).then(res => {

--
Gitblit v1.9.3