mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 02:55:07 +08:00
refactor: vue3 delete function
This commit is contained in:
@ -38,10 +38,6 @@ const handleTypeUpdate = async (row: DictTypeVO) => {
|
||||
const res = await DictTypeApi.getDictTypeApi(row.id)
|
||||
unref(typeFormRef)?.setValues(res)
|
||||
}
|
||||
// 字典分类删除操作
|
||||
const handleTypeDelete = async (row: DictTypeVO) => {
|
||||
await delTypeList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 字典数据列表相关 ==========
|
||||
const tableTypeSelect = ref(false)
|
||||
@ -71,10 +67,6 @@ const handleDataUpdate = async (row: DictDataVO) => {
|
||||
const res = await DictDataApi.getDictDataApi(row.id)
|
||||
unref(dataFormRef)?.setValues(res)
|
||||
}
|
||||
// 字典数据删除操作
|
||||
const handleDataDelete = async (row: DictTypeVO) => {
|
||||
await delDataList(row.id, false)
|
||||
}
|
||||
// 字典分类点击行事件
|
||||
const parentType = ref('')
|
||||
const onClickType = async (data: { [key: string]: any }) => {
|
||||
@ -195,7 +187,7 @@ onMounted(async () => {
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:dict:delete']"
|
||||
@click="handleTypeDelete(row)"
|
||||
@click="delTypeList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
@ -252,7 +244,7 @@ onMounted(async () => {
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:dict:delete']"
|
||||
@click="handleDataDelete(row)"
|
||||
@click="delDataList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -68,11 +68,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: ErrorCodeVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -139,7 +134,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:error-code:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -67,11 +67,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: NoticeVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -141,7 +136,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:notice:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -68,11 +68,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: OAuth2ClientVo) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -152,7 +147,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:oauth2-client:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -74,11 +74,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: PostVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -153,7 +148,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:post:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -83,11 +83,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: RoleVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -221,7 +216,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:role:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -79,11 +79,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: SensitiveWordVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -171,7 +166,7 @@ onMounted(async () => {
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:post:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -68,11 +68,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: SmsChannelVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -142,7 +137,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:sms-channel:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -68,11 +68,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: SmsTemplateVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -190,7 +185,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:sms-template:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -97,11 +97,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: TenantVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 详情相关 ==========
|
||||
const detailRef = ref() // 详情 Ref
|
||||
|
||||
@ -191,7 +186,7 @@ onMounted(async () => {
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:tenant:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
@ -101,11 +101,6 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: TenantPackageVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// ========== 初始化 ==========
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
@ -149,7 +144,7 @@ onMounted(async () => {
|
||||
<el-button link type="primary" @click="handleUpdate(row)">
|
||||
<Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(row)">
|
||||
<el-button link type="primary" @click="delList(row.id, false)">
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -164,10 +164,6 @@ const handleResetPwd = (row: UserVO) => {
|
||||
})
|
||||
})
|
||||
}
|
||||
// 删除操作
|
||||
const handleDelete = (row: UserVO) => {
|
||||
delList(row.id, false)
|
||||
}
|
||||
|
||||
// 导出操作
|
||||
const handleExport = async () => {
|
||||
@ -360,7 +356,7 @@ getList()
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['system:user:delete']"
|
||||
@click="handleDelete(row)"
|
||||
@click="delList(row.id, false)"
|
||||
>
|
||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
||||
</el-button>
|
||||
|
Reference in New Issue
Block a user