Browse Source

fix: 删除 多余提示 修改

lanceJiang 1 year ago
parent
commit
b18d586be2

+ 7 - 7
src/views/configure/index.vue

@@ -238,13 +238,13 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await app.appDeleteApi(ids)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await app.appDeleteApi(ids)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 10 - 10
src/views/message/list/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="flex-column-page-wrap pageWrap bgc">
 		<!-- 公用搜索组件 -->
-		<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+		<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 		<!--  LeTable 组件使用  -->
 		<LeTable
@@ -44,7 +44,7 @@
 			</template>
 		</LeTable>
 
-		<message-detail v-if="visibleDetail" v-model="visibleDetail" :message-id="currentId" @closed="visibleDetail = false"> </message-detail>
+		<message-detail v-if="visibleDetail" v-model="visibleDetail" :message-id="currentId" @closed="visibleDetail = false"></message-detail>
 	</div>
 </template>
 <script lang="tsx" setup>
@@ -150,14 +150,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await message.messageDeleteApi(ids)
-		updateParams()
-		ElMessage.success(`删除成功~`)
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await message.messageDeleteApi(ids)
+	updateParams()
+	ElMessage.success(`删除成功~`)
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 10 - 10
src/views/message/list/my.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap bgc flex-column-page-wrap">
 		<div class="flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -46,7 +46,7 @@
 			</LeTable>
 		</div>
 
-		<message-detail v-if="visibleDetail" v-model="visibleDetail" :message-id="currentId" @closed="visibleDetail = false"> </message-detail>
+		<message-detail v-if="visibleDetail" v-model="visibleDetail" :message-id="currentId" @closed="visibleDetail = false"></message-detail>
 	</div>
 </template>
 <script lang="tsx" setup>
@@ -152,14 +152,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await message.messageDeleteApi(ids)
-		updateParams()
-		ElMessage.success(`删除成功~`)
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await message.messageDeleteApi(ids)
+	updateParams()
+	ElMessage.success(`删除成功~`)
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 9 - 9
src/views/setting/app/index.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap">
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -239,14 +239,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await app.appDeleteApi(ids)
-		ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await app.appDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 9 - 9
src/views/setting/configure/index.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap">
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -226,14 +226,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await configure.configureDeleteApi(ids)
-		ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await configure.configureDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 18 - 18
src/views/setting/department/index.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap">
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -64,7 +64,7 @@
 <script lang="tsx" setup>
 import department from '@/api/system/department'
 import { computed, nextTick, ref, watch } from 'vue'
-import {ElMessage, ElMessageBox, ElTree} from 'element-plus'
+import { ElMessage, ElMessageBox, ElTree } from 'element-plus'
 import { useTablePage } from '@/hooks/useTablePage'
 import { Plus, Delete } from '@element-plus/icons-vue'
 import StatusIndicator from '@/components/StatusIndicator'
@@ -273,14 +273,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, updateParams } = u
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await department.departmentDeleteApi(ids)
-    ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await department.departmentDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除
@@ -291,14 +291,14 @@ const table_del = row => {
 //批量删除
 const batch_del = () => {
 	const ids = curSelectionRows.value.map(item => item.id) // 多选数据
-  ElMessageBox.confirm('是否删除选中数据?', '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
-    type: 'error',
-    buttonSize: 'default'
-  }).then(() => {
-    deleteItem(ids)
-  })
+	ElMessageBox.confirm('是否删除选中数据?', '提示', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		type: 'error',
+		buttonSize: 'default'
+	}).then(() => {
+		deleteItem(ids)
+	})
 }
 
 const table_edit = async row => {

+ 19 - 16
src/views/setting/dict/index.vue

@@ -33,8 +33,11 @@
 				</el-main>
 				<el-footer style="height: 51px">
 					<el-button type="primary" style="width: 100%" @click="addHandler('tree')">
-						<el-icon><Plus /></el-icon>字典分类</el-button
-					>
+						<el-icon>
+							<Plus />
+						</el-icon>
+						字典分类
+					</el-button>
 				</el-footer>
 			</el-container>
 		</el-aside>
@@ -288,16 +291,16 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await dict.dictDeleteApi(ids)
-		if (current_mode.value === 'tree') {
-			getGroup()
-		}
-		updateParams()
-		ElMessage.success(`删除成功~`)
-	} catch (e) {
-		ElMessage.error(`删除失败~`)
+	// try {
+	await dict.dictDeleteApi(ids)
+	if (current_mode.value === 'tree') {
+		getGroup()
 	}
+	updateParams()
+	ElMessage.success(`删除成功~`)
+	// } catch (e) {
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除
@@ -354,11 +357,11 @@ const dictDel = (node, data) => {
 	current_mode.value = 'tree'
 	ElMessageBox.confirm(`确定删除 ${data.name} 项吗?`, '提示')
 		.then(async () => {
-			try {
-				deleteItem([data.id])
-			} catch (e) {
-				ElMessage.error(`删除失败~`)
-			}
+			// try {
+			deleteItem([data.id])
+			// } catch (e) {
+			// 	ElMessage.error(`删除失败~`)
+			// }
 		})
 		.catch(() => {})
 }

+ 8 - 8
src/views/setting/post/index.vue

@@ -231,14 +231,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await post.postDeleteApi(ids)
-		ElMessage.error(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await post.postDeleteApi(ids)
+	ElMessage.error(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 9 - 9
src/views/setting/region/index.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap">
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -247,14 +247,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, updateParams } = u
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await region.regionDeleteApi(ids)
-		ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await region.regionDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 11 - 11
src/views/setting/role/index.vue

@@ -2,7 +2,7 @@
 	<div class="pageWrap">
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -25,8 +25,8 @@
 						</el-icon>
 					</el-button>
 					<el-button type="primary" plain :disabled="!curSelectionRows.length || curSelectionRows.length !== 1" @click="visiblePermission = true"
-						>权限设置</el-button
-					>
+						>权限设置
+					</el-button>
 				</template>
 
 				<template #statusSlot="scope">
@@ -242,14 +242,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await role.roleDeleteApi(ids)
-		ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await role.roleDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除

+ 10 - 10
src/views/setting/user/index.vue

@@ -25,7 +25,7 @@
 		<!--		<el-divider direction="vertical" style="height: 100%" />-->
 		<div class="content-warp flex-column-page-wrap">
 			<!-- 公用搜索组件 -->
-			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"> </LeSearchForm>
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 
 			<!--  LeTable 组件使用  -->
 			<LeTable
@@ -47,7 +47,7 @@
 							<Delete />
 						</el-icon>
 					</el-button>
-					<el-button plain :disabled="curSelectionRows.length === 0" @click="chooseThing('role')"> 分配角色 </el-button>
+					<el-button plain :disabled="curSelectionRows.length === 0" @click="chooseThing('role')"> 分配角色</el-button>
 					<el-button plain :disabled="curSelectionRows.length === 0" @click="chooseThing('department')"> 分配部门 </el-button>
 					<el-button plain :disabled="curSelectionRows.length === 0" @click="resetPwdVisibile = true"> 密码重置 </el-button>
 				</template>
@@ -385,14 +385,14 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
 
 // 删除
 const deleteItem = async ids => {
-	try {
-		await user.userDeleteApi(ids)
-		ElMessage.success(`删除成功~`)
-		updateParams()
-	} catch (e) {
-		console.log('删除失败')
-		ElMessage.error(`删除失败~`)
-	}
+	// try {
+	await user.userDeleteApi(ids)
+	ElMessage.success(`删除成功~`)
+	updateParams()
+	// } catch (e) {
+	// 	console.log('删除失败')
+	// 	ElMessage.error(`删除失败~`)
+	// }
 }
 
 // 单个删除