feat:优化 system/post 的实现代码

This commit is contained in:
YunaiV
2025-12-15 14:35:31 +08:00
parent 0461f29e97
commit dbcf7017d8
4 changed files with 74 additions and 61 deletions

View File

@@ -8,9 +8,9 @@
/>
<!-- 表单区域 -->
<view class="p-24rpx">
<view>
<wd-form ref="formRef" :model="formData" :rules="formRules">
<wd-cell-group custom-class="cell-group" border>
<wd-cell-group border>
<wd-input
v-model="formData.name"
label="岗位名称"
@@ -54,7 +54,7 @@
</view>
<!-- 底部保存按钮 -->
<view class="safe-area-inset-bottom fixed bottom-0 left-0 right-0 bg-white p-24rpx">
<view class="fixed bottom-0 left-0 right-0 bg-white p-24rpx">
<wd-button
type="primary"
block
@@ -72,10 +72,11 @@ import type { Post } from '@/api/system/post'
import { computed, onMounted, ref } from 'vue'
import { useToast } from 'wot-design-uni'
import { createPost, getPost, updatePost } from '@/api/system/post'
import { navigateBackPlus } from '@/utils'
import { CommonStatusEnum } from '@/utils/constants'
const props = defineProps<{
id?: number
id?: number | any
}>()
definePage({
@@ -106,7 +107,7 @@ const formRef = ref()
/** 返回上一页 */
function handleBack() {
uni.navigateBack()
navigateBackPlus('/pages-system/post/index')
}
/** 加载岗位详情 */
@@ -148,13 +149,4 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
:deep(.cell-group) {
border-radius: 12rpx;
overflow: hidden;
box-shadow: 0 3rpx 8rpx rgba(24, 144, 255, 0.06);
}
.safe-area-inset-bottom {
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
}
</style>