招聘岗位

This commit is contained in:
Leo_Ding 2025-06-19 11:01:07 +08:00
parent f6eec94b31
commit 38e2fca3f8
2 changed files with 50 additions and 41 deletions

View File

@ -19,6 +19,12 @@
<a-input v-model:value="formData.link" :placeholder="'请输入链接'" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'日期'" name="pushAt">
<a-date-picker v-model:value="formData.pushAt" :format="'YYYY-MM-DD'" placeholder="选择日期" style="width: 100%;">
</a-date-picker>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'状态'" name="status">
<a-radio-group v-model:value="formData.status" :options="[
@ -29,7 +35,7 @@
</a-col>
<a-col :span="24">
<a-form-item :label="'图片'" name="imgUrl">
<x-upload-image v-model="imgUrl" @imgChange="imgChange"/>
<x-upload-image v-model="imgUrl" @imgChange="imgChange" />
</a-form-item>
</a-col>
</a-row>
@ -55,12 +61,13 @@ const cancelText = ref(t('button.cancel'))
const okText = ref(t('button.confirm'))
const rolesValue = ref([])
const roles = ref([])
const imgUrl=ref('')
const imgUrl = ref('')
formRules.value = {
title: { required: true, message: '请输入标题' },
content: { required: true, message: '请输入内容' },
link: { required: true, message: '请输入链接' },
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
pushAt: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
// imgUrl: [{ required: true, message: '', trigger: 'change' }],
}
@ -72,8 +79,8 @@ formRules.value = {
const handleChange = (value) => {
rolesValue.value = value
}
const imgChange=(value)=>{
formData.value.img=value
const imgChange = (value) => {
formData.value.img = value
}
/**
* 新建
@ -100,24 +107,26 @@ async function handleEdit(record = {}) {
hideModal()
return
}
formData.value = {...data}
imgUrl.value=config('http.apiBasic')+data.img
formData.value = { ...data }
formData.value.pushAt=dayjs(data.pushAt)
console.log(formData.value)
imgUrl.value = config('http.apiBasic') + data.img
}
/**
* 确定
*/
function handleOk() {
if(!formData.value.img) return message.error('请上传图片');
if (!formData.value.img) return message.error('请上传图片');
formRef.value.validateFields().then(async (values) => {
console.log(values)
try {
showLoading()
const params = {
...values,
img:formData.value.img,
pushAt:dayjs().format('YYYY-MM-DD'),
type:'news'
img: formData.value.img,
pushAt:dayjs(formData.value.pushAt).format("YYYY-MM-DD"),
type: 'news'
}
let result = null
console.log(modal.value.type)
@ -180,7 +189,7 @@ function formatArr(data, type = '') {
* 取消
*/
function handleCancel() {
imgUrl.value=''
imgUrl.value = ''
hideModal()
}

View File

@ -106,7 +106,7 @@ const { t } = useI18n() // 解构出t方法
const columns = [
{ title: '图片', dataIndex: 'img', width: 100, align: 'center' },
{ title: '标题', dataIndex: 'title', key: 'title' },
{ title: '内容', dataIndex: 'content', key: 'content' },
{ title: '简介', dataIndex: 'content', key: 'content' },
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
{ title: '链接', dataIndex: 'link', align: 'center' },