Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hr-admin-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
anjia-hr
hr-admin-view
Commits
028e7c19
Commit
028e7c19
authored
Nov 19, 2025
by
刘斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 去掉多余文件
parent
e0cf2e3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
161 deletions
+0
-161
form.vue
apps/web-antd/src/views/hr/phoneBook/form.vue
+0
-161
No files found.
apps/web-antd/src/views/hr/phoneBook/form.vue
deleted
100644 → 0
View file @
e0cf2e3f
<
script
lang=
"ts"
setup
>
import
type
{
VbenFormSchema
}
from
'#/adapter/form'
;
import
type
{
PhoneBookApi
}
from
'#/api/hr/phoneBook'
;
import
{
computed
,
ref
}
from
'vue'
;
import
{
useVbenDrawer
}
from
'@vben/common-ui'
;
import
{
DictEnum
}
from
'@vben/constants'
;
import
{
getVxePopupContainer
}
from
'@vben/utils'
;
import
{
useVbenForm
,
z
}
from
'#/adapter/form'
;
import
{
apiAdd
,
apiUpdate
}
from
'#/api/hr/phoneBook'
;
import
{
getDictOptions
}
from
'#/utils/dict'
;
import
{
defaultFormValueGetter
,
useBeforeCloseDiff
}
from
'#/utils/popup'
;
const
emit
=
defineEmits
<
{
success
:
[];
}
>
();
const
formData
=
ref
<
PhoneBookApi
.
PhoneBook
>
();
const
formSchema
:
VbenFormSchema
[]
=
[
{
component
:
'Input'
,
fieldName
:
'plate'
,
label
:
'板块'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'firstLevelDepartment'
,
label
:
'一级部门'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'secondLevelDepartment'
,
label
:
'二级部门'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'thirdLevelDepartment'
,
label
:
'三级部门'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'deptId'
,
label
:
'部门ID'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'position'
,
label
:
'主岗位'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'name'
,
label
:
'姓名'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'phoneNumber'
,
label
:
'手机号码'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'officePhone'
,
label
:
'办公电话'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
fieldName
:
'shortLine'
,
label
:
'短线'
,
rules
:
'required'
,
},
{
component
:
'Textarea'
,
fieldName
:
'remarks'
,
label
:
'备注'
,
rules
:
'required'
,
},
];
const
[
BasicForm
,
formApi
]
=
useVbenForm
({
commonConfig
:
{
componentProps
:
{
class
:
'w-full'
,
},
formItemClass
:
'col-span-2'
,
labelWidth
:
90
,
},
schema
:
formSchema
,
showDefaultActions
:
false
,
wrapperClass
:
'grid-cols-2'
,
});
const
{
onBeforeClose
,
markInitialized
,
resetInitialized
}
=
useBeforeCloseDiff
(
{
initializedGetter
:
defaultFormValueGetter
(
formApi
),
currentGetter
:
defaultFormValueGetter
(
formApi
),
},
);
const
[
Drawer
,
drawerApi
]
=
useVbenDrawer
({
onBeforeClose
,
onClosed
:
handleClosed
,
onConfirm
:
onSubmit
,
async
onOpenChange
(
isOpen
)
{
if
(
!
isOpen
)
{
return
null
;
}
const
data
=
drawerApi
.
getData
<
PhoneBookApi
.
PhoneBook
>
();
if
(
data
)
{
formData
.
value
=
data
;
await
formApi
.
setValues
(
formData
.
value
);
}
else
{
formApi
.
resetForm
();
}
await
markInitialized
();
},
});
async
function
onSubmit
()
{
const
{
valid
}
=
await
formApi
.
validate
();
if
(
valid
)
{
drawerApi
.
lock
();
const
data
=
await
formApi
.
getValues
<
PhoneBookApi
.
PhoneBook
>
();
try
{
await
(
formData
.
value
?.
id
?
apiUpdate
({
id
:
formData
.
value
.
id
,
...
data
})
:
apiAdd
(
data
));
resetInitialized
();
emit
(
'success'
);
drawerApi
.
close
();
}
finally
{
drawerApi
.
unlock
();
}
}
}
async
function
handleClosed
()
{
await
formApi
.
resetForm
();
resetInitialized
();
}
const
getDrawerTitle
=
computed
(()
=>
formData
.
value
?.
id
?
'修改电话本管理'
:
'新增电话本管理'
,
);
</
script
>
<
template
>
<Drawer
class=
"w-full max-w-[800px]"
:title=
"getDrawerTitle"
>
<BasicForm
class=
"mx-4"
/>
</Drawer>
</
template
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment