2 Incheckningar 3af0b9f6e9 ... 0a074bc420

Upphovsman SHA1 Meddelande Datum
  lm 0a074bc420 添加重置密码弹窗 6 dagar sedan
  lm ef0c670a75 用户管理 添加新增/修改用户弹窗,修改表格数据渲染 6 dagar sedan

+ 19 - 7
src/baseComponents/FormDialog.vue

@@ -41,8 +41,11 @@
             <el-input v-if="item.type=='input'" v-model="formData[item.key]"  :disabled="item.disabled" :placeholder="item.placeholder"/>
             <el-input v-else-if="item.type=='password'" type="password" v-model="formData[item.key]"  :disabled="item.disabled"/>
             <el-input v-else-if="item.type=='textarea'" :autosize="{ minRows: item.rows, maxRows: item.rows }" v-model="formData[item.key]" type="textarea" :rows="item.rows"  :disabled="item.disabled" :placeholder="item.placeholder"/>
-            <el-input v-else-if="item.type=='number'" type="number"  v-model="formData[item.key]" :rows="item.rows"  :disabled="item.disabled" :placeholder="item.placeholder"/>
             
+            <template  v-else-if="item.type=='number'" > 
+              <el-input :style="{width: item.unit ? '80%' : '100%'}" type="number"  v-model="formData[item.key]" :rows="item.rows"  :disabled="item.disabled" :placeholder="item.placeholder"/>
+              <span v-if="item.unit" style="margin-left: 10px;">{{ item.unit }} </span>
+            </template>
             <el-radio-group 
               v-else-if="item.type=='radio'"  
               v-model="formData[item.key]" 
@@ -466,10 +469,12 @@
           </template>
 
           <template v-else>
-            <el-input v-if="item.type!=='file' && item.type!=='url' &&  
-                            item.type!=='unionSelect' && item.type !== 'dateTimePicker'" 
-                      class="readonly_input" 
-                      v-model="formData[item.key]" :readonly="true" />
+            <template  v-if="item.type!=='file' && item.type!=='url' &&  
+                    item.type!=='unionSelect' && item.type !== 'dateTimePicker'" >
+                <el-input  :style="{width: item.unit ? '80%' : '100%'}" class="readonly_input" 
+                  v-model="formData[item.key]" :readonly="true" />
+                <span v-if="item.unit" style="margin-left: 10px;">{{ item.unit }} </span>
+            </template>
 
             <span  v-else-if="item.type=='unionSelect' " style="display: flex;width: 100%;gap:20px">
               <el-input  
@@ -539,7 +544,7 @@ import {Loading} from '@element-plus/icons-vue'
 
 import closeFillImg from '@/assets/icon/close_fill.svg'
 
-import { ElMessage } from 'element-plus'
+import { ElMessage, imageEmits } from 'element-plus'
 
 import fileIcon from '@/assets/icon/file.png'
 
@@ -564,6 +569,7 @@ interface formItemProperty {
   key: String,
   label: String,
   type?:ItemType,
+  unit?:String,
   limit?:Number, // 文件上传限制的数量
   uploadTips?:String,
   acceptType?:[],
@@ -1141,11 +1147,17 @@ const HandleFilePreview = (params)=>{
 
 .page_dialog{
   :deep(.el-dialog) {
-    margin: calc(min(50px,5vh)) auto calc(min(50px,5vh));
+    // margin: calc(min(50px,5vh)) auto calc(min(50px,5vh));
+    margin:0 !important;
+    top: 50% !important;
+    left: 50% !important; /* 若需水平居中可加上此行 */
+    transform: translate(-50%, -50%); /* 核心:基于自身宽高反向偏移 */
   }
   :deep(.el-dialog__body){
+    // 后续会在不同页面动态变化
     min-height: 156px;
     max-height: calc(90vh - 48px - 66px);
+
     display: flex;
     flex-direction: column;
     justify-content: flex-start;

+ 0 - 6
src/components/settingCard/SettingCard.vue

@@ -380,12 +380,6 @@ watch(()=>props.defaultTableData,(val)=>{
 }
 
 .parameter_setting_form_dialog{
-     :deep(.el-dialog){
-        margin:0 !important;
-        top: 50% !important;
-        left: 50% !important; /* 若需水平居中可加上此行 */
-        transform: translate(-50%, -50%); /* 核心:基于自身宽高反向偏移 */
-    }
     :deep(.el-dialog__body){
         min-height: 500px !important;
         max-height: 500px !important;

+ 2 - 1
src/views/userPrivilegeManagement/index.vue

@@ -9,8 +9,9 @@
             <div class="page_solid_line" />
             <div class="page_jg_20" />
 
-            <!-- 不同的模块 -->
+            <!-- 用户管理 -->
             <UserManage  v-if="defaultTabKey == 'userManage'"/>
+            <!-- 分组管理 -->
             <GroupManage  v-if="defaultTabKey == 'groupManage'"/>
 
 

+ 116 - 0
src/views/userPrivilegeManagement/userManage/formDialog.ts

@@ -0,0 +1,116 @@
+import { ref } from "vue";
+
+// 新增用户 表单项
+export const userFormItemList = ref([
+  {
+    key: 'account',
+    label: '账号',
+    type: 'input',
+    placeholder: '请输入手机号',
+    rules: [{ required: true, message: '请输入账号', trigger: 'blur' }], 
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'name',
+    label: '姓名',
+    type: 'input',
+    placeholder: '请输入姓名',
+    rules: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'gender',
+    label: '性别',
+    type: 'radio',
+    selectList: [
+      { label: '男', value: '1' },
+      { label: '女', value: '0' }
+    ],
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'phone',
+    label: '手机号',
+    type: 'input',
+    placeholder: '请输入手机号',
+    rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'publicSeaFollowRecord',
+    label: '公海跟进记录',
+    type: 'switch',
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'historyFollowRecord',
+    label: '历史跟进记录',
+    type: 'switch',
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'customerHoldLimit',
+    label: '客户持有上限',
+    type: 'number',
+    placeholder: '请输入',
+    custom: false,
+    unit:'个',
+    style: {},
+  },
+  {
+    key: 'dailyManualReturnLimit',
+    label: '每日手动退回公海上限',
+    type: 'number',
+    placeholder: '请输入',
+    custom: false,
+    unit:'个',
+    style: {},
+  },
+  {
+    key: 'noFollowAutoReturnDays',
+    label: '无跟进自动退回公海天数',
+    type: 'number',
+    placeholder: '请输入',
+    custom: false,
+    unit:'天',
+    style: {},
+  }
+])
+
+
+// 重置密码 表单项
+export const resetPasswordFormItemList =  ref([
+  {
+    key: 'account',
+    label: '账号',
+    type: 'input',
+    disabled: true, 
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'name',
+    label: '姓名',
+    type: 'input',
+    disabled: true, 
+    custom: false,
+    style: {},
+  },
+  {
+    key: 'newPassword',
+    label: '新密码',
+    type: 'password', 
+    placeholder: '请输入新密码',
+    rules: [
+      { required: true, message: '请输入新密码', trigger: 'blur' }
+    ],
+    custom: false,
+    style: {},
+  },
+]);

+ 198 - 13
src/views/userPrivilegeManagement/userManage/index.vue

@@ -3,12 +3,11 @@
         <div class="page_search">
             <div class="search_content">
                 <div class="content_left">
-                    <el-button class="button_background">启用用户</el-button>
-                    <el-button class="button_refresh">禁用用户</el-button>
+                    <TabSearch tabType="box" :tabList="tabList" :defaultTabKey="defaultUserType" />
                     <FormSearchGroup :searchList="formSearhList"></FormSearchGroup>
                 </div>
                 <div class="content_right">
-                    <el-button class="button_border">新增用户</el-button>
+                    <el-button class="button_border" @click="OpenUserFormDialog()">新增用户</el-button>
                 </div>
             </div>
         </div>
@@ -19,8 +18,67 @@
             <template #num="{row,currentIndex}">
                 {{ (currentIndex - 1 ) * pageSize + pageNum }}
             </template>
+
+            <template #gender="{row}">
+                {{row.gender === '0' ? '女' : '男'  }}
+            </template>
+            <template #status="{row}">
+                <TableRowStatus :statusMsg="statusMsg" :useStatus="row.status" />
+            </template>
+
+            <template #publicSeaFollowRecord="{row}">
+                <el-switch
+                    :model-value="Boolean(row.publicSeaFollowRecord)"
+                    @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val})"
+                    style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
+                />
+            </template>
+
+            <template #historyFollowRecord="{row}">
+                <el-switch
+                    :model-value="Boolean(row.historyFollowRecord)"
+                    @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val})"
+                    style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
+                />
+            </template>
+
+            <template #operation="{row}">
+                <div class="table_row_option">
+                    <span class="option_button_editor" @click="OpenUserFormDialog(row)">编辑</span>
+                    <span class="option_button_editor" @click="OpenresetPasswordFormDialog(row)">重置密码</span>
+                    <span class="option_button_editor">禁用</span>
+                    <span class="el_button_delete">删除</span>
+                </div>
+            </template>
         </Table>
     </div>
+
+    <!-- 新增用户 弹窗 -->
+    <FormDialog  
+        class="user_form_dialog"
+        style="flex-grow: 0;" width="482px"
+        v-if="userFormDialogVisible"
+        :formItemList="userFormItemList" :defaultFormData="defaultUserFormData" 
+        :title="userFormDialogTitle" 
+        :submitLoading="userFormDialogSubmiting" 
+        :visible="userFormDialogVisible"
+        @close="CloseUserFormDialog"
+        @confirm="HandleUserFormDialogConfirm">
+    </FormDialog>
+
+    <!-- 重置密码弹窗 -->
+    <FormDialog  
+        class="reset_password_form_dialog"
+        style="flex-grow: 0;" width="500px"
+        v-if="resetPasswordFormDialogVisible"
+        :formItemList="resetPasswordFormItemList" :defaultFormData="defaultResetPasswordFormData" 
+        title="重置密码" 
+        :submitLoading="resetPasswordFormDialogSubmiting" 
+        :visible="resetPasswordFormDialogVisible"
+        @close="CloseResetPasswordFormDialog"
+        @confirm="HandleresetPasswordFormDialogConfirm">
+    </FormDialog>
+
 </template>
 
 
@@ -29,31 +87,158 @@ import { ref } from 'vue';
 import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
 import {formSearhList} from './formSearch'
 import Table from '@/baseComponents/Table.vue';
-
 import {tableColumns} from './table'
+import TableRowStatus from '@/baseComponents/TableRowStatus.vue';
+import TabSearch from '@/baseComponents/TabSearch.vue';
+import {tabList} from './tabSearch'
+import FormDialog from '@/baseComponents/FormDialog.vue';
+import {userFormItemList, resetPasswordFormItemList} from './formDialog'
 
+/**
+ * 1. 表格 有关数据
+ */
 const pageNum = ref(1)
 const pageSize = ref(20)
 const totalNum = ref(0)
 
 const userTableData = ref([
     {
+        id:'1',
         account:'xxx',
         name:'xxx',
-        gender:'xxx',
+        gender:'1',
         phone:'xxx',
-        status:'xxx',
-        publicFollow:'xxx',
-        historyFollow:'xxx',
-        holdLimit:'xxx',
-        dailyReturnLimit:'xxx',
-        returnDays:'xxx',
-        action:'xxx',
-    }
+        status:0,
+        publicSeaFollowRecord:true,
+        historyFollowRecord:false,
+
+        customerHoldLimit:40,
+        dailyManualReturnLimit:16,
+        noFollowAutoReturnDays:10,
+    },
+    {
+        id:'2',
+        account:'xxx',
+        name:'xxx',
+        gender:'0',
+        phone:'xxx',
+        status:1,
+        publicSeaFollowRecord:false,
+        historyFollowRecord:true,
+
+
+        customerHoldLimit:50,
+        dailyManualReturnLimit:20,
+        noFollowAutoReturnDays:30,
+    },
+])
+
+const statusMsg = ref([
+    {
+        statusFlag:0,
+        title:'禁用',
+        themeClass: 'not_included_icon',
+    },
+    {
+        statusFlag:1,
+        title:'启用',
+        themeClass: 'normal_icon',
+    },
 ])
+// 默认展示的用户类型
+const defaultUserType = ref('onlinePeople')
+
+/**
+ * 2. 新增用户弹窗相关数据
+ */
+const userFormDialogVisible = ref(false)
+const userFormDialogSubmiting = ref(false)
+const userFormDialogTitle = ref('')
+const defaultUserFormData = ref({
+    customerHoldLimit:100,
+    dailyManualReturnLimit:15,
+    noFollowAutoReturnDays:15,
+})
+// 打开新增/修改用户弹窗
+const OpenUserFormDialog = (row?:any)=>{
+    if(row?.id){
+        userFormDialogTitle.value = '修改用户'
+        defaultUserFormData.value = {...row}
+        console.log('当前赋值的form表单值',defaultUserFormData.value)
+    }else{
+        userFormDialogTitle.value = '新增用户'
+    }
+    userFormDialogVisible.value = true
+}
+// 关闭新增/修改用户弹窗
+const CloseUserFormDialog = ()=>{
+    userFormDialogVisible.value = false
+    defaultUserFormData.value = {
+        customerHoldLimit:100,
+        dailyManualReturnLimit:15,
+        noFollowAutoReturnDays:15,
+    }
+}
+// 保存新增/修改用户弹窗
+const HandleUserFormDialogConfirm = ()=>{
+    CloseUserFormDialog()
+}
+
+/**
+ * 3. 重置密码弹窗相关数据
+ */
+const resetPasswordFormDialogVisible = ref(false)
+const resetPasswordFormDialogSubmiting = ref(false)
+const defaultResetPasswordFormData = ref({})
+// 打开 重置密码弹窗
+const OpenresetPasswordFormDialog = (row?:any)=>{
+    defaultResetPasswordFormData.value = {...row}
+    resetPasswordFormDialogVisible.value = true
+}
+// 关闭 重置密码弹窗
+const CloseResetPasswordFormDialog = ()=>{
+    resetPasswordFormDialogVisible.value = false
+    defaultResetPasswordFormData.value = {}
+}
+// 保存 重置密码弹窗
+const HandleresetPasswordFormDialogConfirm = ()=>{
+    CloseResetPasswordFormDialog()
+}
+
+
 </script>
 
 
 <style lang="scss" scoped>
 
+.search_content{
+    :deep(.box_tab){
+        gap:10px;
+        .selected + span{
+            border-left: 1px solid  #dcdfe6;
+        }
+        >span:nth-child(n):not(:last-child):not(.selected){
+            border-right: 1px solid  #dcdfe6;
+        }
+        > span{
+            border-radius: 4px !important ;
+        }
+    }
+}
+
+.user_form_dialog{
+     :deep(.el-dialog__body){
+        min-height: 520px !important;
+        max-height: 520px !important;
+    }
+}
+
+.reset_password_form_dialog{
+     :deep(.el-dialog__body){
+        min-height: 210px !important;
+        max-height: 210px !important;
+    }
+}
+
+
 </style>

+ 12 - 0
src/views/userPrivilegeManagement/userManage/tabSearch.ts

@@ -0,0 +1,12 @@
+import { ref } from "vue";
+
+export const tabList = ref([
+    {
+        label:'启用用户',
+        key:'onlinePeople',
+    },
+    {
+        label:'禁用用户',
+        key:'deadlinePeople',
+    }
+])

+ 10 - 10
src/views/userPrivilegeManagement/userManage/table.ts

@@ -37,7 +37,7 @@ export const tableColumns = ref([
         fixed: '',
         align: 'center',
         minWidth: '',
-        custom: false,
+        custom: true,
     },
     {
         name: 'phone',
@@ -55,28 +55,28 @@ export const tableColumns = ref([
         fixed: '',
         align: 'center',
         minWidth: '',
-        custom: false,
+        custom: true,
     },
     {
-        name: 'publicFollow',
+        name: 'publicSeaFollowRecord',
         label: '公海跟进',
         width: '100',
         fixed: '',
         align: 'center',
         minWidth: '',
-        custom: false,
+        custom: true,
     },
     {
-        name: 'historyFollow',
+        name: 'historyFollowRecord',
         label: '历史跟进',
         width: '100',
         fixed: '',
         align: 'center',
         minWidth: '',
-        custom: false,
+        custom: true,
     },
     {
-        name: 'holdLimit',
+        name: 'customerHoldLimit',
         label: '持有上限',
         width: '100',
         fixed: '',
@@ -85,7 +85,7 @@ export const tableColumns = ref([
         custom: false,
     },
     {
-        name: 'dailyReturnLimit',
+        name: 'dailyManualReturnLimit',
         label: '日退上限',
         width: '100',
         fixed: '',
@@ -94,7 +94,7 @@ export const tableColumns = ref([
         custom: false,
     },
     {
-        name: 'returnDays',
+        name: 'noFollowAutoReturnDays',
         label: '退回公海天数',
         width: '120',
         fixed: '',
@@ -109,6 +109,6 @@ export const tableColumns = ref([
         fixed: 'right', 
         align: 'center',
         minWidth: '',
-        custom: false,
+        custom: true,
     },
 ])