|
|
|
@ -15,13 +15,18 @@ |
|
|
|
|
<!--引用表格--> |
|
|
|
|
<BasicTable @register="registerTable"></BasicTable> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<!--引用表格--> |
|
|
|
|
<BasicForm @register="registerForm" @submit="handleSubmit" /> |
|
|
|
|
</div> |
|
|
|
|
<div class="button-container"> |
|
|
|
|
<a-button type="primary" @click="router.back();">返回</a-button> |
|
|
|
|
<a-button type="primary" @click="router.back()">返回</a-button> |
|
|
|
|
<a-button type="primary" @click="handleSubmit">保存</a-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import {ref} from 'vue'; |
|
|
|
|
import {onMounted, ref} from 'vue'; |
|
|
|
|
import {Description} from '/@/components/Description/index'; |
|
|
|
|
import {PageWrapper} from '/@/components/Page'; |
|
|
|
|
import {BasicTable, useTable} from '/@/components/Table'; |
|
|
|
@ -31,8 +36,12 @@ import {useModal} from "@/components/Modal"; |
|
|
|
|
import {useListPage} from "@/hooks/system/useListPage"; |
|
|
|
|
import {columns} from "@/views/projectObjective/ProjectObjective.data"; |
|
|
|
|
import {getBaseInfo, list} from '@/views/projectObjective/ProjectObjective.api'; |
|
|
|
|
import {saveOrUpdate} from '@/views/projectApplication/project/Project.api'; |
|
|
|
|
import {columns2} from "@/views/cooperationDepart/CooperationDepart.data"; |
|
|
|
|
import {list2} from "@/views/cooperationDepart/CooperationDepart.api"; |
|
|
|
|
import {FormSchema, useForm, BasicForm} from "@/components/Form"; |
|
|
|
|
import {useMessage} from "@/hooks/web/useMessage"; |
|
|
|
|
const { createMessage, createSuccessModal } = useMessage(); |
|
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
|
const router = useRouter(); |
|
|
|
@ -65,6 +74,61 @@ async function listProjectObjectiveByProjectId() { |
|
|
|
|
return await list(params); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const schemas: FormSchema[] = [ |
|
|
|
|
/*{ |
|
|
|
|
field: 'describe', |
|
|
|
|
label: '不满意原因说明', |
|
|
|
|
component: 'InputTextArea', |
|
|
|
|
//ifShow和show属性一致,values代表当前表单的值,js 控制,会删除 dom |
|
|
|
|
// ifShow: ({ values }) => { |
|
|
|
|
// return values.evaluate == '1'; |
|
|
|
|
// }, |
|
|
|
|
},*/ |
|
|
|
|
{ |
|
|
|
|
field: 'projectContent', |
|
|
|
|
component: 'JEditor', |
|
|
|
|
label: '项目主要内容', |
|
|
|
|
defaultValue: '', |
|
|
|
|
required: false, |
|
|
|
|
}, |
|
|
|
|
/*{ |
|
|
|
|
field: 'markdown', |
|
|
|
|
component: 'JMarkdownEditor', |
|
|
|
|
label: 'Markdown', |
|
|
|
|
defaultValue: '# 张三', |
|
|
|
|
required: true, |
|
|
|
|
componentProps: { |
|
|
|
|
height: 300, |
|
|
|
|
}, |
|
|
|
|
},*/ |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const [registerForm, { validate, setFieldsValue }] = useForm({ |
|
|
|
|
labelWidth: 120, |
|
|
|
|
schemas: schemas, |
|
|
|
|
actionColOptions: { |
|
|
|
|
span: 24, |
|
|
|
|
}, |
|
|
|
|
schemas: schemas, |
|
|
|
|
actionColOptions: { |
|
|
|
|
span: 40, |
|
|
|
|
}, |
|
|
|
|
compact: true, |
|
|
|
|
showResetButton: false, |
|
|
|
|
showSubmitButton: false, |
|
|
|
|
showAdvancedButton: false, |
|
|
|
|
disabled: false, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
async function handleSubmit() { |
|
|
|
|
let val = await validate(); |
|
|
|
|
console.log('val----------',JSON.stringify(val)) |
|
|
|
|
// let data = getFieldsValue(); |
|
|
|
|
// let params = Object.assign({}, formData, data); |
|
|
|
|
val.id = route.query.id; |
|
|
|
|
console.log('表单数据', val) |
|
|
|
|
await saveOrUpdate(val, true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const [registerTimeTable] = useTable({ |
|
|
|
|
title: '主要合作单位:', |
|
|
|
@ -133,12 +197,23 @@ async function getData() { |
|
|
|
|
projectBaseInfoData.realName = obj.realName; |
|
|
|
|
projectBaseInfoData.projectTime = obj.projectTime; |
|
|
|
|
projectBaseInfoData.title = obj.title; |
|
|
|
|
projectBaseInfoData.projectContent = obj.projectContent; |
|
|
|
|
console.log('projectBaseInfoData', JSON.stringify(projectBaseInfoData)) |
|
|
|
|
setValues(obj.projectContent) |
|
|
|
|
falg.value = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setValues(val) { |
|
|
|
|
// alert("setValuse------"+val) |
|
|
|
|
setFieldsValue({ |
|
|
|
|
projectContent: val, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|