Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
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
紫光云
web-project
Commits
34922ebe
Commit
34922ebe
authored
Jun 05, 2024
by
mengzixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 工程投资计划,新建
parent
b07198be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
35 deletions
+94
-35
engineeringProject.ts
src/api/project/engineeringProject.ts
+2
-2
data.tsx
src/views/engineeringProject/data.tsx
+45
-30
engineeringEdit.vue
src/views/engineeringProject/engineeringEdit.vue
+47
-3
No files found.
src/api/project/engineeringProject.ts
View file @
34922ebe
...
...
@@ -2,7 +2,7 @@ import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/
import
{
defHttp
}
from
'@/utils/http/axios'
;
enum
Api
{
GetList
=
'/statement/list/page'
,
GetList
=
'/statement/list/page'
,
}
export
const
getEngineeringList
=
(
params
?:
ProjectParams
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
src/views/engineeringProject/data.tsx
View file @
34922ebe
...
...
@@ -4,7 +4,6 @@ import { Switch } from 'ant-design-vue';
import
{
setRoleStatus
}
from
'@/api/demo/system'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
type
CheckedType
=
boolean
|
string
|
number
;
export
const
columns
:
(
|
{
dataIndex
:
string
;
width
:
number
;
title
:
string
}
...
...
@@ -127,12 +126,51 @@ export const searchFormSchema: FormSchema[] = [
];
export
const
formSchema
:
FormSchema
[]
=
[
// {
// field: 'projectName',
// label: '项目名称',
// required: true,
// component: 'Input',
// },
{
field
:
'projectName'
,
label
:
'项目名称'
,
component
:
'Input'
,
required
:
true
,
componentProps
:
{
placeholder
:
'XXXX项目'
,
disabled
:
true
,
style
:
{
background
:
'none'
,
border
:
'none'
,
},
},
colProps
:
{
span
:
8
},
},
{
field
:
'projectName'
,
label
:
'建设地点'
,
component
:
'Input'
,
required
:
true
,
componentProps
:
{
placeholder
:
'华苑片区'
,
disabled
:
true
,
style
:
{
background
:
'none'
,
border
:
'none'
,
},
},
colProps
:
{
span
:
8
},
},
{
field
:
'projectName'
,
label
:
'建设模式'
,
component
:
'Input'
,
required
:
true
,
componentProps
:
{
placeholder
:
'自建'
,
disabled
:
true
,
style
:
{
background
:
'none'
,
border
:
'none'
,
},
},
colProps
:
{
span
:
8
},
},
// {
// field: 'isReserveProject',
// label: '是否为储备项目',
...
...
@@ -157,27 +195,4 @@ export const formSchema: FormSchema[] = [
// ],
// },
// },
// {
// label: '建设模式',
// field: 'constructionMode',
// component: 'InputTextArea',
// },
// {
// label: '项目类型',
// field: 'projectType',
// required: true,
// component: 'Input',
// },
// {
// label: '项目概况',
// field: 'projectOverview',
// required: true,
// component: 'InputTextArea',
// },
// {
// label: '建设目的及项目功能',
// field: 'constructionPurpose',
// required: true,
// component: 'InputTextArea',
// },
];
src/views/engineeringProject/engineeringEdit.vue
View file @
34922ebe
<
template
>
<PageWrapper
:title=
"getTitle"
:contentBackground=
"false"
headerSticky
>
<template
#
extra
>
<a-button
type=
"primary"
danger
>
删除
</a-button>
</
template
>
<PageCard
v-for=
"(item, index) in tabsFormSchema"
:key=
"index"
:title=
"item.name"
>
<BasicForm
@
register=
"item.Form[0]"
/>
</PageCard>
<a-button
type=
"primary"
@
click=
"addItem"
>
添加
</a-button>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
unref
,
computed
,
onMounted
,
ref
,
reactive
}
from
'vue'
;
<
script
>
import
{
useRoute
}
from
'vue-router'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
PageCard
from
'@/components/Page/src/PageCard.vue'
;
import
{
BasicForm
,
useForm
,
FormProps
,
UseFormReturnType
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./data'
;
</
script
>
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增2024年工程项目投资计划(工程)'
:
'编辑2024年工程项目投资计划(工程)'
));
const
isUpdate
=
ref
(
false
);
onMounted
(()
=>
{
const
route
=
useRoute
();
const
id
=
route
.
query
.
id
;
// 获取名为id的参数
console
.
log
(
route
.
query
);
});
type
TabsFormType
=
{
name
:
string
;
forceRender
?:
boolean
;
Form
:
UseFormReturnType
;
};
const
baseFormConfig
:
Partial
<
FormProps
>
=
{
showActionButtonGroup
:
false
,
labelWidth
:
100
,
layout
:
'vertical'
,
};
<
style
scoped
>
const
tabsFormSchema
=
reactive
<
TabsFormType
[]
>
([]);
async
function
addItem
()
{
tabsFormSchema
.
push
({
name
:
'序号'
+
(
tabsFormSchema
.
length
+
1
),
forceRender
:
true
,
Form
:
useForm
(
Object
.
assign
({
schemas
:
formSchema
},
baseFormConfig
)
as
FormProps
),
});
}
</
script
>
<
style
lang=
"less"
scoped
>
// .vben-page-wrapper-content-bg {
// background-color: transparent;
// }
</
style
>
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