Explorar el Código

feature: 删除部分数据

ljc hace 5 meses
padre
commit
d938780a05

+ 1 - 1
index.html

@@ -5,7 +5,7 @@
     <link rel="icon" href="/favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <link href="/css/preloading.css" rel="stylesheet" type="text/css">
-    <title>CWG-管理系统</title>
+    <title>CWG-UCard</title>
   </head>
   <body>
   <noscript>

+ 5 - 4
src/config/index.ts

@@ -18,8 +18,9 @@ switch (c) {
   // 测试环境
   case 'test':
     Host00 = ht + '//secure.' + ho + '.com'
-    // Host85 = ht + '//ad.' + ho + '.com'
-    Host85 = 'http://103.158.191.66:8888' // 测试
+    Host85 = ht + '//ad.' + ho + '.com'
+    // Host85 = 'http://103.158.191.66:8888' // 测试
+    Host85 = 'http://103.214.175.29:8888' // 测试
     Host05 = ht + '//file.' + ho + '.com'
     Host80 = ht + '//secure.' + ho + '.com'
     // Host05 = "http://103.171.34.61:8705"
@@ -36,11 +37,11 @@ switch (c) {
     // 开发环境
     Host00 = 'http://103.214.175.29:8000'
     Host85 = 'https://ad.44a5c8109e4.com'
-    // Host85="http://103.171.34.61:8500" // 测试
+    Host85 = 'http://103.214.175.29:8888' // 测试
     Host05 = 'http://103.171.34.61:8705'
     Host80 = 'http://192.168.0.30:8000'
     // Host85 = 'http://192.168.0.18:8500' // 高超本地
-    Host85 = 'http://192.168.0.38:8888' // 孔向阳本地
+    Host85 = 'http://192.168.0.24:8888' // 孔向阳本地
     // Host85 = 'http://103.158.191.66:8501' // 测试
     // Host85="http://192.168.0.30:8500"
     break

+ 0 - 487
src/mock/system.ts

@@ -1,487 +0,0 @@
-export const userData = [
-  {
-    username: 'zzb',
-    nickname: '林峰',
-    sex: '男',
-    role: '超级管理员',
-    status: true,
-    photo: '15333333333',
-    describe: '超级管理员不可删除',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    username: 'zhangsan',
-    nickname: '张三',
-    sex: '女',
-    role: '管理员',
-    status: true,
-    photo: '15311111111',
-    describe: '管理员不可删除',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    username: 'lisi',
-    nickname: '李四',
-    sex: '男',
-    role: '管理员',
-    status: true,
-    photo: '13823456789',
-    describe: '测试账户',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    username: 'wangwu',
-    nickname: '王五',
-    sex: '男',
-    role: '超级管理员',
-    status: false,
-    photo: '13923456789',
-    describe: '超级管理员不可删除',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    username: 'zhaoliu',
-    nickname: '赵柳',
-    sex: '男',
-    role: '普通用户',
-    status: false,
-    photo: '14523456789',
-    describe: '普通测试用户',
-    createTime: '2022-09-02 15:30:20',
-  },
-]
-
-export const deptData = [
-  {
-    id: '0',
-    deptName: '华东分部',
-    orderNo: 1,
-    createTime: '2011-02-25 18:37:39',
-    remark: '世上无难事,只要肯登攀',
-    status: false,
-    children: [
-      {
-        id: '0-0',
-        deptName: '研发部',
-        orderNo: 1,
-        createTime: '1995-10-07 03:22:40',
-        remark: '不曾扬帆,何以至远方',
-        status: true,
-        parentDept: '0',
-      },
-      {
-        id: '0-1',
-        deptName: '市场部',
-        orderNo: 2,
-        createTime: '1972-06-20 09:33:40',
-        remark: '努力到无能为力,拼搏到感动自己',
-        status: false,
-        parentDept: '0',
-      },
-      {
-        id: '0-2',
-        deptName: '商务部',
-        orderNo: 3,
-        createTime: '1992-10-31 02:54:45',
-        remark: '没有过不了的坎,就怕自己不奋斗',
-        status: false,
-        parentDept: '0',
-      },
-      {
-        id: '0-3',
-        deptName: '财务部',
-        orderNo: 4,
-        createTime: '1971-07-06 13:01:49',
-        remark: '没有口水与汗水,就没有成功的泪水。',
-        status: true,
-        parentDept: '0',
-      },
-    ],
-  },
-  {
-    id: '1',
-    deptName: '华南分部',
-    orderNo: 2,
-    createTime: '1995-12-24 06:36:26',
-    remark: '这个世界从来不缺乏机遇,而是缺少抓住机遇的手。',
-    status: false,
-    children: [
-      {
-        id: '1-0',
-        deptName: '研发部',
-        orderNo: 1,
-        createTime: '2022-05-10 12:44:05',
-        remark: '奋斗令我们的生活充满生机,责任让我们的生命充满意义!',
-        status: true,
-        parentDept: '1',
-      },
-      {
-        id: '1-1',
-        deptName: '市场部',
-        orderNo: 2,
-        createTime: '2022-07-15 02:53:29',
-        remark: '学习之心不可无,懒惰之心不可有。',
-        status: true,
-        parentDept: '1',
-      },
-      {
-        id: '1-2',
-        deptName: '商务部',
-        orderNo: 3,
-        createTime: '2022-08-11 22:44:55',
-        remark: '学会等待,学会坚持,成功是一个循序渐进的过程。',
-        status: true,
-        parentDept: '1',
-      },
-      {
-        id: '1-3',
-        deptName: '财务部',
-        orderNo: 4,
-        createTime: '2022-10-26 19:38:29',
-        remark: '能克服困难的人,可使困难化为良机',
-        status: false,
-        parentDept: '1',
-      },
-    ],
-  },
-  {
-    id: '2',
-    deptName: '西北分部',
-    orderNo: 3,
-    createTime: '2022-08-27 16:49:21',
-    remark: '行为决定性格,性格决定命运',
-    status: false,
-    children: [
-      {
-        id: '2-0',
-        deptName: '研发部',
-        orderNo: 1,
-        createTime: '2022-12-11 03:49:33',
-        remark: '带着自己的梦,以一种骄傲的姿态走下去',
-        status: false,
-        parentDept: '2',
-      },
-      {
-        id: '2-1',
-        deptName: '市场部',
-        orderNo: 2,
-        createTime: '2022-06-18 20:15:34',
-        remark: '当世界都在说放弃的时候,轻轻的告诉自己:再试一次',
-        status: true,
-        parentDept: '2',
-      },
-      {
-        id: '2-2',
-        deptName: '商务部',
-        orderNo: 3,
-        createTime: '2022-07-17 09:37:41',
-        remark: '不怕万人阻挡在前方,只怕自己先行投降',
-        status: true,
-        parentDept: '2',
-      },
-      {
-        id: '2-3',
-        deptName: '财务部',
-        orderNo: 4,
-        createTime: '2022-11-23 04:34:33',
-        remark: '胸怀临云志,莫负少年时',
-        status: false,
-        parentDept: '2',
-      },
-    ],
-  },
-]
-
-export const roleData = [
-  {
-    roleName: '超级管理员',
-    roleId: 'admin',
-    roleIdentification: 'admin',
-    describe: '这是超级管理员,拥有一切权限',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    roleName: '管理员',
-    roleId: 'role',
-    roleIdentification: 'admin',
-    describe: '普通管理员',
-    createTime: '2022-09-02 15:30:20',
-  },
-  {
-    roleName: '普通用户',
-    roleId: 'other',
-    describe: '测试用户',
-    roleIdentification: 'other',
-    createTime: '2022-09-02 15:30:20',
-  },
-]
-
-export const menuData = [
-  {
-    menuName: '首页',
-    menuType: '菜单',
-    menuRouter: '/home',
-    identification: 'menu:home',
-    parentId: 0,
-    level: 1,
-    id: 0,
-    createTime: '2022-09-02',
-  },
-  {
-    menuName: '表格',
-    menuType: '目录',
-    menuRouter: '/table',
-    identification: 'menu:table',
-    parentId: 0,
-    level: 1,
-    id: 1,
-    createTime: '2022-09-02',
-    children: [
-      {
-        menuName: '菜单1',
-        menuType: '菜单',
-        menuRouter: '/table',
-        identification: 'menu1:view',
-        parentId: 1,
-        level: 2,
-        id: 10,
-        createTime: '2022-09-02',
-        children: [
-          {
-            menuName: '按钮1',
-            menuType: '按钮',
-            menuRouter: '/table',
-            identification: 'menu1:view:btn1',
-            parentId: 10,
-            id: 20,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮2',
-            menuType: '按钮',
-            menuRouter: '/table',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 21,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮3',
-            menuType: '按钮',
-            menuRouter: '/table',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 22,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-        ],
-      },
-    ],
-  },
-
-  {
-    menuName: '可视化图表',
-    menuType: '目录',
-    menuRouter: '/charts',
-    identification: 'menu:charts',
-    parentId: 0,
-    level: 1,
-    id: 1,
-    createTime: '2022-09-02',
-    children: [
-      {
-        menuName: '菜单1',
-        menuType: '菜单',
-        menuRouter: '/charts',
-        identification: 'menu1:view',
-        parentId: 1,
-        level: 2,
-        id: 10,
-        createTime: '2022-09-02',
-        children: [
-          {
-            menuName: '按钮1',
-            menuType: '按钮',
-            menuRouter: '/charts',
-            identification: 'menu1:view:btn1',
-            parentId: 10,
-            id: 20,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮2',
-            menuType: '按钮',
-            menuRouter: '/charts',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 21,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮3',
-            menuType: '按钮',
-            menuRouter: '/charts',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 22,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-        ],
-      },
-    ],
-  },
-  {
-    menuName: '基础组件',
-    menuType: '目录',
-    menuRouter: '/components',
-    identification: 'menu:components',
-    parentId: 0,
-    level: 1,
-    id: 1,
-    createTime: '2022-09-02',
-    children: [
-      {
-        menuName: '菜单1',
-        menuType: '菜单',
-        menuRouter: '/components',
-        identification: 'menu1:view',
-        parentId: 1,
-        level: 2,
-        id: 10,
-        createTime: '2022-09-02',
-        children: [
-          {
-            menuName: '按钮1',
-            menuType: '按钮',
-            menuRouter: '/components',
-            identification: 'menu1:view:btn1',
-            parentId: 10,
-            id: 20,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮2',
-            menuType: '按钮',
-            menuRouter: '/components',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 21,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-          {
-            menuName: '按钮3',
-            menuType: '按钮',
-            menuRouter: '/components',
-            identification: 'menu1:view:btn2',
-            parentId: 10,
-            id: 22,
-            level: 3,
-            createTime: '2022-09-02',
-          },
-        ],
-      },
-    ],
-  },
-]
-
-export const dictionaryData = [
-  {
-    id: 1,
-    name: '性别',
-    keyCode: 'sex',
-    createTime: '2011-02-25 18:37:39',
-    remark: '性别',
-  },
-  {
-    id: 2,
-    name: '证件类型',
-    keyCode: 'idType',
-    createTime: '2011-02-25 18:37:39',
-    remark: '证件类型',
-  },
-]
-
-export const dictionaryDetailData = [
-  {
-    id: 1,
-    keyCode: 'sex',
-    name: '性别',
-    createTime: '2011-02-25 18:37:39',
-    remark: '性别',
-    children: [
-      {
-        id: 11,
-        name: '男',
-        key: 1,
-        pid: 1,
-        createTime: '2011-02-25 18:37:39',
-        remark: '男',
-      },
-      {
-        id: 12,
-        name: '女',
-        key: 0,
-        pid: 1,
-        createTime: '2011-02-25 18:37:39',
-        remark: '女',
-      },
-    ],
-  },
-  {
-    id: 2,
-    keyCode: 'idType',
-    name: '证件类型',
-    createTime: '2011-02-25 18:37:39',
-    remark: '证件类型',
-    children: [
-      {
-        id: 21,
-        name: '身份证',
-        key: 1,
-        pid: 2,
-        createTime: '2011-02-25 18:37:39',
-        remark: '身份证',
-      },
-      {
-        id: 22,
-        name: '社保卡',
-        key: 2,
-        pid: 2,
-        createTime: '2011-02-25 18:37:39',
-        remark: '社保卡',
-      },
-      {
-        id: 23,
-        name: '驾驶证',
-        key: 3,
-        pid: 2,
-        createTime: '2011-02-25 18:37:39',
-        remark: '驾驶证',
-      },
-      {
-        id: 24,
-        name: '护照',
-        key: 4,
-        pid: 2,
-        createTime: '2011-02-25 18:37:39',
-        remark: '护照',
-      },
-      {
-        id: 25,
-        name: '工作证',
-        key: 5,
-        pid: 2,
-        createTime: '2011-02-25 18:37:39',
-        remark: '工作证',
-      },
-    ],
-  },
-]

+ 0 - 132
src/mock/table.ts

@@ -1,132 +0,0 @@
-export const tableList = [
-  {
-    date: '2016-05-02',
-    name: '王五',
-    price: 20,
-    province: '上海',
-    admin: 'admin',
-    sex: 1,
-    id: 1,
-    age: 18,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 1518 弄',
-    zip: 200333,
-  },
-  {
-    date: '2018-06-11',
-    name: '梦琪',
-    price: 20,
-    province: '上海',
-    admin: 'admin',
-    sex: 1,
-    id: 2,
-    age: 22,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 1519 弄',
-    zip: 200333,
-  },
-  {
-    date: '2022-05-23',
-    name: '忆柳',
-    price: 22,
-    province: '上海',
-    admin: 'admin',
-    sex: 0,
-    id: 3,
-    age: 23,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 1520 弄',
-    zip: 200333,
-  },
-  {
-    date: '2022-01-24',
-    name: '之桃',
-    price: 33,
-    province: '上海',
-    admin: 'admin',
-    sex: 1,
-    id: 4,
-    age: 24,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2222 弄',
-    zip: 200333,
-  },
-  {
-    date: '2022-07-22',
-    name: '慕青',
-    price: 45,
-    province: '上海',
-    admin: 'admin',
-    sex: 0,
-    id: 5,
-    age: 25,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2223 弄',
-    zip: 200333,
-  },
-  {
-    date: '2016-05-02',
-    name: '问兰',
-    price: 47,
-    province: '上海',
-    admin: 'admin',
-    sex: 1,
-    id: 6,
-    age: 26,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2224 弄',
-    zip: 200333,
-  },
-  {
-    date: '2016-08-02',
-    name: '元香',
-    price: 45,
-    province: '上海',
-    admin: 'admin',
-    sex: 0,
-    id: 7,
-    age: 27,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2225 弄',
-    zip: 200333,
-  },
-  {
-    date: '2019-11-11',
-    name: '初夏',
-    price: 23,
-    province: '上海',
-    admin: 'admin',
-    sex: 1,
-    id: 8,
-    age: 28,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2226 弄',
-    zip: 200333,
-  },
-  {
-    date: '2018-08-02',
-    name: '沛菡',
-    price: 33,
-    province: '上海',
-    admin: 'other',
-    sex: 0,
-    id: 9,
-    age: 29,
-    city: '普陀区',
-    address: '上海市普陀区金沙江路 2227 弄',
-    zip: 200339,
-  },
-  {
-    date: '2022-11-03',
-    name: '傲珊',
-    price: 222,
-    province: '浙江',
-    admin: 'admin',
-    sex: 1,
-    id: 10,
-    age: 30,
-    city: '杭州',
-    address: '杭州市滨江区建业路228号',
-    zip: 200433,
-  },
-]

+ 4 - 0
src/service/user.ts

@@ -135,6 +135,10 @@ class UserService extends Service {
   async authorityActionAdd(params = {}) {
     return await this.post('/authority/action/add', params)
   }
+  //销售上级列表
+  async userSales(params = {}) {
+    return await this.post('/user/sales', params)
+  }
 }
 
 export default new UserService()

+ 226 - 0
src/views/card/CardGlobalOrder/components/GlobalOrderBatchApprove.vue

@@ -0,0 +1,226 @@
+<template>
+  <el-dialog
+    v-model="dialogVisible"
+    :title="t('R-GlobalOrder-Batch-Approve')"
+    width="600px"
+    :close-on-click-modal="false"
+    @close="closeDia"
+  >
+    <el-form
+      ref="formRef"
+      :rules="rules"
+      :model="approvalForm"
+      label-width="120px"
+      label-position="right"
+    >
+      <el-form-item prop="amount" :label="t('global.p16') + ':'">
+        <el-input
+          v-model.trim="approvalForm.amount"
+          class="crm-border-radius-no"
+          disabled
+          clearable
+          :placeholder="t('global.p16')"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="fee" :label="t('global.p27') + ':'">
+        <el-input
+          v-model.trim="approvalForm.fee"
+          class="crm-border-radius-no"
+          disabled
+          clearable
+          :placeholder="t('global.p27')"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="status" :label="t('Label.CheckResults') + ':'">
+        <el-select
+          v-model="approvalForm.status"
+          class="crm_search_down"
+          :placeholder="t('Placeholder.Choose')"
+        >
+          <el-option
+            v-for="option in statusOptions"
+            :key="option.value"
+            :label="option.label"
+            :value="option.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="approvalForm.status == 3"
+        prop="approveDesc"
+        :label="t('Label.Descr') + ':'"
+      >
+        <el-select
+          v-model="approvalForm.approveDesc"
+          filterable
+          class="crm_search_down"
+          :placeholder="t('Placeholder.Choose')"
+          allow-create
+        >
+          <el-option
+            v-for="item in reasonsList"
+            :key="item.id"
+            :label="langZh ? item.content : item.enContent"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="closeDia">
+          {{ t('Ucard.Business.p32') }}
+        </el-button>
+        <el-button type="primary" :loading="btnLoading" @click="approve">
+          {{ t('card.Btn.Confirm') }}
+        </el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+  import { ref, reactive, computed, watch, inject, defineProps, defineEmits } from 'vue'
+  import { useI18n } from 'vue-i18n'
+  import { ElMessage, ElMessageBox } from 'element-plus'
+  import CardService from '@/service/ucard'
+  import Config from '@/config/index'
+  import { safeGetUser } from '@/utils/safeJson.js'
+
+  const { t } = useI18n()
+  const { Code } = Config
+  const Session = inject('session')
+  const pigeon = inject('pigeon')
+
+  // props
+  const props = defineProps({
+    visible: Boolean,
+    ids: Array,
+    reasons: Object,
+    allData: Object,
+  })
+
+  // emits
+  const emit = defineEmits(['close'])
+
+  // 响应式数据
+  const dialogVisible = ref(false)
+  const formRef = ref(null)
+  const btnLoading = ref(false)
+
+  const approvalForm = reactive({
+    amount: 0,
+    fee: 0,
+    approveDesc: null,
+    status: null,
+  })
+
+  // 计算属性
+  const user = computed(() => {
+    return safeGetUser(Session)
+  })
+
+  const langZh = computed(() => {
+    return Session.Get('lang') === 'cn'
+  })
+
+  const statusOptions = computed(() => [
+    { label: t('Apply_info.VerifiedUser.Agree'), value: 2 },
+    { label: t('Apply_info.VerifiedUser.Refused'), value: 3 },
+  ])
+
+  const reasonsList = computed(() => {
+    return Object.values(props.reasons || {})
+  })
+
+  const rules = computed(() => ({
+    status: [
+      {
+        required: true,
+        message: t('vaildate.select.empty'),
+        trigger: 'blur',
+      },
+    ],
+    approveDesc: [
+      {
+        required: true,
+        message: t('vaildate.select.empty'),
+        trigger: 'blur',
+      },
+    ],
+  }))
+
+  // 方法
+  const closeDia = (type) => {
+    emit('close', type)
+  }
+
+  const approve = async () => {
+    if (!formRef.value) return
+
+    const valid = await formRef.value.validate()
+    if (!valid) return
+
+    const params = {
+      ...approvalForm,
+      ids: props.ids,
+      operateUser: user.value.cId,
+    }
+
+    btnLoading.value = true
+    try {
+      const res = await CardService.globalOrderApprove(params)
+
+      if (res.code == Code.StatusOK) {
+        ElMessage.success(res.msg)
+        closeDia(true)
+      } else {
+        if (res.msg) {
+          ElMessage.error(res.msg)
+        } else if (res.data) {
+          const data = res.data
+          const list = Object.entries(data).map(([key, value]) => {
+            return `<div>${key}: ${value}</div>`
+          })
+
+          await ElMessageBox.alert(list.join(''), t('Ucard.GlobalOrder.approveTitle'), {
+            center: true,
+            dangerouslyUseHTMLString: true,
+            confirmButtonText: t('Confirm'),
+          })
+
+          closeDia(true)
+        }
+      }
+    } catch (error) {
+      console.error('批量审批失败:', error)
+      ElMessage.error(t('Msg.SystemError'))
+    } finally {
+      btnLoading.value = false
+    }
+  }
+
+  // 监听器
+  watch(
+    () => props.visible,
+    (val) => {
+      dialogVisible.value = val
+    }
+  )
+
+  watch(dialogVisible, (val) => {
+    if (!val) {
+      closeDia()
+    }
+  })
+
+  watch(
+    () => props.allData,
+    (val) => {
+      if (val) {
+        Object.assign(approvalForm, val)
+      }
+    },
+    { immediate: true }
+  )
+</script>

+ 12 - 15
src/views/user/userList/components/UserAdd.vue

@@ -1,14 +1,10 @@
 <template>
-  <div id="TradingDetailedInfoAdd" class="InfoBox" :class="{ active: dialogInfoTradingAdd }">
-    <div class="header">
-      <div>
-        <span v-if="editor" class="title">{{ $t('Label.EditorUser') }}</span>
-        <span v-else class="title">{{ $t('Label.AddUser') }}</span>
-      </div>
-      <span class="close crm-cursor" @click="close">
-        <el-icon><Close /></el-icon>
-      </span>
-    </div>
+  <el-drawer
+    v-model="visible"
+    :title="editor ? t('Label.EditorUser') : t('Label.AddUser')"
+    size="650"
+    @close="close"
+  >
     <el-form ref="formRef" :rules="rules" :model="form" label-width="150PX">
       <el-form-item :label="$t('Label.UserNames') + ':'">
         <el-input v-model.trim="form.username" :placeholder="$t('Placeholder.Input')"></el-input>
@@ -264,10 +260,10 @@
         <el-input v-model.trim="form.limitIp" :placeholder="$t('Placeholder.Input')"></el-input>
       </el-form-item>
     </el-form>
-    <span class="btn crm-cursor" @click="confirm"
-      ><span>{{ $t('Btn.Confirm') }}</span></span
-    >
-  </div>
+    <template #footer>
+      <el-button type="primary" @click="confirm">{{ $t('Btn.Confirm') }}</el-button>
+    </template>
+  </el-drawer>
 </template>
 
 <script setup lang="ts">
@@ -278,7 +274,6 @@
   import ServiceMarket from '@/service/marketing'
   import ServiceUser from '@/service/user'
   import Config from '@/config/index'
-  import { Close } from '@element-plus/icons-vue'
 
   const { Code } = Config
   const { t } = useI18n()
@@ -307,6 +302,7 @@
 
   // Refs
   const formRef = ref<FormInstance>()
+  const visible = ref(props.dialogInfoTradingAdd)
 
   // Reactive data
   const form = reactive({})
@@ -543,6 +539,7 @@
   watch(
     () => props.dialogInfoTradingAdd,
     (newVal) => {
+      visible.value = newVal
       if (!newVal && formRef.value) {
         formRef.value?.resetFields()
         Object.assign(form, {})

+ 1 - 1
src/views/user/userList/index.vue

@@ -650,7 +650,7 @@
       :editor="editor"
       :form-list="formList"
       @confirm-to-reload="confirmToReload"
-      @close-add="closeAdd"
+      @close="closeAdd"
     ></UserAdd>
     <div v-if="dialogInfoTradingAdd" class="crm_verified_info_mask" @click="closeDiaAdd"></div>
   </div>

+ 150 - 118
src/views/user/userRole/components/RoleAdd/index.vue

@@ -1,19 +1,10 @@
 <template>
-  <div
-    id="TradingDetailedInfoAdd"
-    v-loading="loading"
-    element-loading-background="rgba(122, 122, 122, 0.8)"
-    element-loading-text="Loading..."
-    class="InfoBox"
-    :class="{ active: dialogInfoTradingAdd }"
+  <el-drawer
+    v-model="visible"
+    :title="editor ? t('Label.EditorRole') : t('Label.AddRole')"
+    size="500"
+    @close="onClose"
   >
-    <div class="header">
-      <span v-if="editor" class="title">{{ $t('Label.EditorRole') }}</span>
-      <span v-else class="title">{{ $t('Label.AddRole') }}</span>
-      <span class="close crm-cursor" @click="close">
-        <el-icon><Close /></el-icon>
-      </span>
-    </div>
     <el-form ref="formRef" :rules="rules" :model="form" label-width="100PX">
       <el-form-item prop="name" :label="$t('Label.RoleName') + ':'">
         <el-input
@@ -50,8 +41,9 @@
         >
           <el-button
             v-if="role_system"
+            text
+            type="primary"
             style="padding-right: 4px"
-            type="text"
             @click="() => append('one')"
           >
             {{ $t('R-OneNodeAdd') }}
@@ -80,104 +72,126 @@
         </div>
       </el-form-item>
     </el-form>
-    <el-button :loading="addLoading" @click="confirm">{{ $t('Btn.Confirm') }}</el-button>
-    <el-dialog
-      v-model="dialogCheck"
-      :title="dialogCheck_form.title"
-      center
-      append-to-body
-      width="600"
-      custom-class="dialog_header_w"
-      @close="cancel"
-    >
-      <div class="dia-content">
-        <el-form
-          ref="dialogCheckFormRef"
-          :model="dialogCheck_form"
-          :rules="rules"
-          label-width="135px"
-          class="dialogCheck_form"
-        >
-          <el-form-item
-            v-if="dialogCheck_form.typeIndex1 != 3"
-            prop="name"
-            :label="$t('Label.AuthorityName') + ':'"
-          >
-            <el-input
-              v-model="dialogCheck_form.name"
-              style="width: 400px"
-              :placeholder="$t('Placeholder.Input')"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
-            prop="link"
-            :label="$t('Label.Url') + ':'"
-          >
-            <el-input
-              v-model.trim="dialogCheck_form.link"
-              style="width: 400px"
-              :placeholder="$t('Placeholder.Input')"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
-            prop="icon"
-            :label="$t('Label.Icon') + ':'"
-          >
-            <el-input
-              v-model.trim="dialogCheck_form.icon"
-              style="width: 400px"
-              :placeholder="$t('Placeholder.Input')"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
-            prop="subIndex"
-            :label="$t('Label.SubIndex') + ':'"
-          >
-            <el-input
-              v-model.number.trim="dialogCheck_form.subIndex"
-              style="width: 400px"
-              :placeholder="$t('Placeholder.Input')"
-              @input="selectChange"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="dialogCheck_form.typeIndex == 3 && dialogCheck_form.typeIndex1 != 3"
-            prop="action"
-            :label="$t('Label.Url') + ':'"
-          >
-            <el-input
-              v-model.trim="dialogCheck_form.action"
-              style="width: 400px"
-              :placeholder="$t('Placeholder.Input')"
-            ></el-input>
-          </el-form-item>
-          <div
-            v-if="dialogCheck_form.typeIndex1 == 3"
-            style="text-align: center; font-size: 20px; padding: 25px 0"
-          >
-            {{ $t('Msg.Delete') }}
-          </div>
-        </el-form>
+    <template #footer>
+      <div class="flex">
+        <el-button type="primary" :loading="addLoading" @click="confirm">
+          {{ $t('Btn.Confirm') }}
+        </el-button>
       </div>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button v-if="dialogCheck_form.typeIndex1 == 1" type="primary" @click="toAppend()">
-            {{ $t('Btn.Confirm') }}
-          </el-button>
-          <el-button v-if="dialogCheck_form.typeIndex1 == 2" type="primary" @click="toUpdate()">
-            {{ $t('Btn.Confirm') }}
-          </el-button>
-          <el-button v-if="dialogCheck_form.typeIndex1 == 3" type="primary" @click="toRemove()">
-            {{ $t('Btn.Confirm') }}
-          </el-button>
-          <el-button @click="cancel">{{ $t('Btn.Cancel') }}</el-button>
+    </template>
+  </el-drawer>
+  <!--  <div-->
+  <!--    id="TradingDetailedInfoAdd"-->
+  <!--    v-loading="loading"-->
+  <!--    element-loading-background="rgba(122, 122, 122, 0.8)"-->
+  <!--    element-loading-text="Loading..."-->
+  <!--    class="InfoBox"-->
+  <!--    :class="{ active: dialogInfoTradingAdd }"-->
+  <!--  >-->
+  <!--    <div class="header">-->
+  <!--      <span v-if="editor" class="title">{{ $t('Label.EditorRole') }}</span>-->
+  <!--      <span v-else class="title">{{ $t('Label.AddRole') }}</span>-->
+  <!--      <span class="close crm-cursor" @click="close">-->
+  <!--        <el-icon><Close /></el-icon>-->
+  <!--      </span>-->
+  <!--    </div>-->
+  <!--  </div>-->
+  <el-dialog
+    v-model="dialogCheck"
+    :title="dialogCheck_form.title"
+    center
+    append-to-body
+    width="600"
+    custom-class="dialog_header_w"
+    @close="cancel"
+  >
+    <div class="dia-content">
+      <el-form
+        ref="dialogCheckFormRef"
+        :model="dialogCheck_form"
+        :rules="rules"
+        label-width="135px"
+        class="dialogCheck_form"
+      >
+        <el-form-item
+          v-if="dialogCheck_form.typeIndex1 != 3"
+          prop="name"
+          :label="$t('Label.AuthorityName') + ':'"
+        >
+          <el-input
+            v-model="dialogCheck_form.name"
+            style="width: 400px"
+            :placeholder="$t('Placeholder.Input')"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
+          prop="link"
+          :label="$t('Label.Url') + ':'"
+        >
+          <el-input
+            v-model.trim="dialogCheck_form.link"
+            style="width: 400px"
+            :placeholder="$t('Placeholder.Input')"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
+          prop="icon"
+          :label="$t('Label.Icon') + ':'"
+        >
+          <el-input
+            v-model.trim="dialogCheck_form.icon"
+            style="width: 400px"
+            :placeholder="$t('Placeholder.Input')"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          v-if="dialogCheck_form.typeIndex != 3 && dialogCheck_form.typeIndex1 != 3"
+          prop="subIndex"
+          :label="$t('Label.SubIndex') + ':'"
+        >
+          <el-input
+            v-model.number.trim="dialogCheck_form.subIndex"
+            style="width: 400px"
+            :placeholder="$t('Placeholder.Input')"
+            @input="selectChange"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          v-if="dialogCheck_form.typeIndex == 3 && dialogCheck_form.typeIndex1 != 3"
+          prop="action"
+          :label="$t('Label.Url') + ':'"
+        >
+          <el-input
+            v-model.trim="dialogCheck_form.action"
+            style="width: 400px"
+            :placeholder="$t('Placeholder.Input')"
+          ></el-input>
+        </el-form-item>
+        <div
+          v-if="dialogCheck_form.typeIndex1 == 3"
+          style="text-align: center; font-size: 20px; padding: 25px 0"
+        >
+          {{ $t('Msg.Delete') }}
         </div>
-      </template>
-    </el-dialog>
-  </div>
+      </el-form>
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button v-if="dialogCheck_form.typeIndex1 == 1" type="primary" @click="toAppend()">
+          {{ $t('Btn.Confirm') }}
+        </el-button>
+        <el-button v-if="dialogCheck_form.typeIndex1 == 2" type="primary" @click="toUpdate()">
+          {{ $t('Btn.Confirm') }}
+        </el-button>
+        <el-button v-if="dialogCheck_form.typeIndex1 == 3" type="primary" @click="toRemove()">
+          {{ $t('Btn.Confirm') }}
+        </el-button>
+        <el-button @click="cancel">{{ $t('Btn.Cancel') }}</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup>
@@ -213,6 +227,7 @@
   const emit = defineEmits(['confirmToReload', 'closeAdd'])
 
   // refs
+  const visible = ref(props.dialogInfoTradingAdd)
   const formRef = ref(null)
   const treeRef = ref(null)
   const dialogCheckFormRef = ref(null)
@@ -300,6 +315,9 @@
   const selectChange = () => {
     // 这里可能需要强制更新
   }
+  const onClose = () => {
+    emit('closeAdd', false)
+  }
 
   const append = (data) => {
     console.log(data, 'append')
@@ -749,6 +767,7 @@
     () => props.dialogInfoTradingAdd,
     async (newVal) => {
       loading.value = true
+      visible.value = newVal
       if (newVal) {
         if (props.editor) {
           await getRoleDetailUpdate()
@@ -764,13 +783,26 @@
     // await Promise.all([getDepartmentList(), getRoleDetailAdd()])
     getDepartmentList()
     console.log(props, 'props')
-
-    // 设置默认选中
-    if (props.editor && props.formList?.id) {
-      // 如果有编辑数据,设置默认选中项
-      // 这里需要根据实际逻辑设置 defaultSelect.value
-    }
   })
 </script>
 
-<style scoped></style>
+<style scoped>
+  .el-form {
+    .authorityBox.el-form-item .el-form-item__content {
+      display: contents;
+    }
+  }
+  .custom-tree-node {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 14px;
+    padding-right: 4px;
+
+    i {
+      margin-left: 4px;
+      /*font-weight: bold;*/
+    }
+  }
+</style>

+ 1 - 1
src/views/user/userRole/index.vue

@@ -114,7 +114,7 @@
       @close-add="closeAdd"
     >
     </RoleAdd>
-    <div v-if="dialogInfoTradingAdd" class="crm_verified_info_mask" @click="closeDiaAdd"></div>
+    <!--    <div v-if="dialogInfoTradingAdd" class="crm_verified_info_mask" @click="closeDiaAdd"></div>-->
   </div>
 </template>