2 İşlemeler 190a777361 ... cbc3f71cfa

Yazar SHA1 Mesaj Tarih
  lm cbc3f71cfa 修改打包配置 3 hafta önce
  lm 8ba04ff276 修改分组管理用户删除渲染逻辑 3 hafta önce

+ 1 - 1
.env.test

@@ -1,7 +1,7 @@
 # 测试环境配置文件
 NODE_ENV = 'test'
 
-VITE_API_BASE_URL = "https://index.k12100.net"
+VITE_API_BASE_URL = "https://crm.k12100.net"
 
 
 VITE_API_ADMIN_PRE = "/admin"

+ 10 - 3
src/views/userPrivilegeManagement/groupManage/index.vue

@@ -268,6 +268,7 @@ const HandleAddUser = async (row, cell) => {
  */
 const dialogVisible = ref(false)
 const dialogSubmitLoading = ref(false)
+const currentDeleteCellIndex = ref()  //当前删除的(员工)所在单元格内的索引
 const currentDeleteCell = ref()  //当前准备删除的(员工)单元格数据
 const currentDeleteRow = ref()  //当前准备删除的(员工)所在行数据
 const currentDeleteColumn = ref()  //当前准备删除的(员工)所在列信息
@@ -280,9 +281,13 @@ const HandleDialogConfirm = async ()=>{
     }catch{}
     if(res?.code == 200){
         ElMessage.success(res?.msg)
-        currentDeleteRow.value[currentDeleteColumn.value.name] = currentDeleteRow.value[currentDeleteColumn.value.name].filter(item=>{
-            return item.id !== currentDeleteCell.value.id
-        })
+        // 删除对应索引
+        currentDeleteRow.value[currentDeleteColumn.value.name].splice(currentDeleteCellIndex.value,1)
+
+        // 引用丢失   --重新渲染 会复原
+        // currentDeleteRow.value[currentDeleteColumn.value.name] = currentDeleteRow.value[currentDeleteColumn.value.name].filter(item=>{
+        //     return item.id !== currentDeleteCell.value.id
+        // })
         HandleDialogClose()
         // 重新查询分组 _更新禁删权限
         await GetGroupList()
@@ -297,10 +302,12 @@ const HandleDialogClose = ()=>{
     currentDeleteColumn.value = null
     dialogVisible.value = false
     dialogSubmitLoading.value = false
+    currentDeleteCellIndex.value = null
 }
 const OpenDeleteDialog = (row, cellObj,index)=>{
     if (!isConfigMode.value) return;
     dialogVisible.value = true
+    currentDeleteCellIndex.value = index
     currentDeleteCell.value = row[cellObj.name][index]
     currentDeleteRow.value = row
     currentDeleteColumn.value = cellObj

+ 1 - 1
vite.config.ts

@@ -4,7 +4,7 @@ import path from 'path' // 引入 Node.js 的 path 模块
 // https://vite.dev/config/
 export default defineConfig({
 
-  base:process.env.NODE_ENV === 'production' ? ' /evaluation/' : '/' ,  //测试环境配置,生产环境不需要
+  base:process.env.NODE_ENV === 'production' ? ' /' : '/' ,  //测试环境配置,生产环境不需要
 
   plugins: [vue()],
   resolve: {