|
|
|
@ -1,26 +1,82 @@ |
|
|
|
|
<template> |
|
|
|
|
<PageWrapper title="详情组件示例"> |
|
|
|
|
<Description title="基础示例" :collapseOptions="{ canExpand: true, helpMessage: 'help me' }" |
|
|
|
|
:column="3" :data="mockData" :schema="schema"/> |
|
|
|
|
|
|
|
|
|
<Description |
|
|
|
|
class="mt-4" |
|
|
|
|
title="垂直示例" |
|
|
|
|
layout="vertical" |
|
|
|
|
:collapseOptions="{ canExpand: true, helpMessage: 'help me' }" |
|
|
|
|
:column="2" |
|
|
|
|
:data="mockData" |
|
|
|
|
:schema="schema" |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<Description @register="register" class="mt-4"/> |
|
|
|
|
<Description @register="register1" class="mt-4"/> |
|
|
|
|
</PageWrapper> |
|
|
|
|
<div> |
|
|
|
|
<PageWrapper> |
|
|
|
|
<Description |
|
|
|
|
title="项目基本信息" |
|
|
|
|
:collapseOptions="{ canExpand: false, helpMessage: 'help me' }" |
|
|
|
|
:column="2" |
|
|
|
|
:data="projectBaseInfoData" |
|
|
|
|
:schema="schema" |
|
|
|
|
/> |
|
|
|
|
<!-- <Description |
|
|
|
|
class="mt-4" |
|
|
|
|
title="垂直示例" |
|
|
|
|
layout="vertical" |
|
|
|
|
:collapseOptions="{ canExpand: false, helpMessage: 'help me' }" |
|
|
|
|
:column="2" |
|
|
|
|
:data="mockData" |
|
|
|
|
:schema="schema" |
|
|
|
|
/>--> |
|
|
|
|
|
|
|
|
|
<Description @register="register" class="mt-4"/> |
|
|
|
|
<Description @register="register1" class="mt-4"/> |
|
|
|
|
</PageWrapper> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<!--引用表格--> |
|
|
|
|
<BasicTable @register="registerTable"></BasicTable> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script lang="ts"> |
|
|
|
|
import {defineComponent} from 'vue'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import {onMounted} from 'vue'; |
|
|
|
|
import {DescItem, Description, useDescription} from '/@/components/Description/index'; |
|
|
|
|
import {PageWrapper} from '/@/components/Page'; |
|
|
|
|
import {BasicTable} from '/@/components/Table'; |
|
|
|
|
|
|
|
|
|
import {useRoute} from "vue-router"; |
|
|
|
|
import {getFengMian} from './FengMian.api'; |
|
|
|
|
import {useModal} from "@/components/Modal"; |
|
|
|
|
import {useListPage} from "@/hooks/system/useListPage"; |
|
|
|
|
import {columns} from "@/views/projectObjective/ProjectObjective.data"; |
|
|
|
|
import {list} from '@/views/projectObjective/ProjectObjective.api'; |
|
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
|
|
|
|
|
|
//注册model |
|
|
|
|
const [registerModal, {openModal}] = useModal(); |
|
|
|
|
//注册table数据 |
|
|
|
|
const {tableContext} = useListPage({ |
|
|
|
|
tableProps: { |
|
|
|
|
title: '项目绩效目标及分年度目标:', |
|
|
|
|
api: list, |
|
|
|
|
columns, |
|
|
|
|
canResize: false, |
|
|
|
|
formConfig: { |
|
|
|
|
//labelWidth: 120, |
|
|
|
|
// schemas: searchFormSchema, |
|
|
|
|
autoSubmitOnEnter: true, |
|
|
|
|
showAdvancedButton: true, |
|
|
|
|
fieldMapToNumber: [], |
|
|
|
|
fieldMapToTime: [], |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const [registerTable, {reload}, {rowSelection, selectedRowKeys}] = tableContext |
|
|
|
|
|
|
|
|
|
const projectBaseInfoData: Recordable = { |
|
|
|
|
username: 'oooooo777', |
|
|
|
|
nickName: 'VB', |
|
|
|
|
age: '123', |
|
|
|
|
phone: '15695909xxx', |
|
|
|
|
email: '190848757@qq.com', |
|
|
|
|
addr: '厦门市思明区', |
|
|
|
|
sex: '男', |
|
|
|
|
certy: '3504256199xxxxxxxxx', |
|
|
|
|
tag: 'orange', |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const mockData: Recordable = { |
|
|
|
|
username: 'test', |
|
|
|
@ -58,23 +114,43 @@ const schema: DescItem[] = [ |
|
|
|
|
label: '地址', |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
export default defineComponent({ |
|
|
|
|
components: {Description, PageWrapper}, |
|
|
|
|
setup() { |
|
|
|
|
const [register] = useDescription({ |
|
|
|
|
title: 'useDescription', |
|
|
|
|
data: mockData, |
|
|
|
|
schema: schema, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const [register1] = useDescription({ |
|
|
|
|
title: '无边框', |
|
|
|
|
bordered: false, |
|
|
|
|
data: mockData, |
|
|
|
|
schema: schema, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return {mockData, schema, register, register1}; |
|
|
|
|
}, |
|
|
|
|
// export default defineComponent({ |
|
|
|
|
// components: { |
|
|
|
|
// Description, PageWrapper, BasicTable |
|
|
|
|
// } |
|
|
|
|
// , |
|
|
|
|
// setup() { |
|
|
|
|
const [register] = useDescription({ |
|
|
|
|
title: 'useDescription', |
|
|
|
|
// data: mockData, |
|
|
|
|
data: projectBaseInfoData, |
|
|
|
|
schema: schema, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/*const [register1] = useDescription({ |
|
|
|
|
title: '无边框', |
|
|
|
|
bordered: false, |
|
|
|
|
data: mockData, |
|
|
|
|
schema: schema, |
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function getData() { |
|
|
|
|
let params = { |
|
|
|
|
id: route.query.id, |
|
|
|
|
}; |
|
|
|
|
let obj = await getFengMian(params); |
|
|
|
|
console.log('data', JSON.stringify(obj)) |
|
|
|
|
projectBaseInfoData.value = obj |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
getData() |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return {mockData, projectBaseInfoData, schema, register/*, register1*/}; |
|
|
|
|
// }, |
|
|
|
|
// }); |
|
|
|
|
</script> |
|
|
|
|