Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web
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
INET-TWO
web
Commits
ab2b5e19
Commit
ab2b5e19
authored
Sep 12, 2024
by
ztf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新增和编辑项目相关组件
parent
ca6aac0b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
212 additions
and
33 deletions
+212
-33
index.vue
.../src/privateComponents/components/createProject/index.vue
+15
-4
index.vue
...ct/src/privateComponents/components/editProject/index.vue
+137
-0
index.vue
...ect/src/privateComponents/components/extProject/index.vue
+7
-5
index.vue
.../privateComponents/components/gotoProjectDetial/index.vue
+53
-24
No files found.
applications/dee-project/src/privateComponents/components/createProject/index.vue
View file @
ab2b5e19
...
...
@@ -39,6 +39,7 @@ export default {
immediate
:
true
,
deep
:
true
,
handler
(
val
)
{
//
console
.
log
(
'监听项目分类'
,
val
)
if
(
val
)
{
if
(
val
===
'program'
)
{
...
...
@@ -89,13 +90,23 @@ export default {
})
}
else
if
(
this
.
projectCategory
===
'childProject'
)
{
console
.
log
(
'是子项'
)
this
.
form
.
parentId
=
this
.
form
.
extProject
.
id
const
parentId
=
this
.
form
.
extProject
.
id
delete
this
.
form
.
extProgram
delete
this
.
form
.
extProject
delete
this
.
form
.
dxType
this
.
form
.
subTypeName
=
'DxContextProject'
this
.
form
.
operator
=
'ADD'
const
params
=
Object
.
assign
(
this
.
formData
,
this
.
form
)
delete
this
.
form
.
projectCategory
const
params
=
{
parentId
:
parentId
,
subTypeName
:
'DxContextProject'
,
operator
:
'ADD'
,
state
:
'edit'
,
modelName
:
'DxContextProject'
,
...
this
.
form
}
// this.form.subTypeName = 'DxContextProject'
// this.form.operator = 'ADD'
// const params = Object.assign(this.formData, this.form)
console
.
log
(
'params'
,
params
)
post
(
'/DxContextProject/recursion'
,
params
).
then
(
res
=>
{
this
.
$utils
.
showMessageSuccess
(
`添加成功`
)
...
...
applications/dee-project/src/privateComponents/components/editProject/index.vue
0 → 100644
View file @
ab2b5e19
<
template
>
<div
class=
"project"
>
<dee-as-com
:lay-config=
"
{
typeName: 'ExtProgram',
layKey: 'defaultEdit'
}"
:form="form"
:basic-data="basicDataCmp"
@on-submit="toSubmit"
@on-cancel="cancel"
/>
</div>
</
template
>
<
script
>
import
{
post
}
from
'@/utils/http'
export
default
{
name
:
'EditProject'
,
componentName
:
'编辑项目'
,
props
:
{
basicData
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
data
()
{
return
{
// eslint-disable-next-line vue/no-dupe-keys
form
:
{},
subTypeName
:
'ExtProgram'
,
projectCategory
:
''
}
},
computed
:
{
basicDataCmp
()
{
return
{
secretCode
:
this
.
basicData
.
secretCode
,
id
:
this
.
basicData
.
id
,
subTypeName
:
this
.
basicData
.
subTypeName
,
// dxPlanId: this.basicData.dxPlanId,
// dxContextId: this.basicData.dxProjectItem && this.basicData.dxProjectItem.dxContextId,
// lifecycleTemplateId: this.basicData.lifecycleTemplateId,
state
:
this
.
basicData
.
state
}
}
},
watch
:
{
'form.projectCategory'
:
{
immediate
:
true
,
deep
:
true
,
handler
(
val
)
{
//
console
.
log
(
'监听项目分类'
,
val
)
if
(
val
)
{
if
(
val
===
'program'
)
{
this
.
projectCategory
=
'program'
}
else
if
(
val
===
'project'
)
{
this
.
projectCategory
=
'project'
}
else
if
(
val
===
'childProject'
)
{
this
.
projectCategory
=
'childProject'
}
}
}
}
},
methods
:
{
toSubmit
()
{
console
.
log
(
'进来了'
)
if
(
this
.
projectCategory
===
'program'
)
{
console
.
log
(
'是项目群'
)
const
params
=
this
.
form
post
(
'/ExtProgram/recursion'
,
params
).
then
(
res
=>
{
this
.
$utils
.
showMessageSuccess
(
`添加成功`
)
this
.
$emit
(
'completeEven'
)
})
}
else
if
(
this
.
projectCategory
===
'project'
)
{
console
.
log
(
'是项目'
)
const
id
=
this
.
form
.
extProgram
.
id
delete
this
.
form
.
extProgram
delete
this
.
form
.
dxType
const
params
=
{
subTypeName
:
'DxContextProject'
,
id
:
id
,
extProgramProjectLinks
:
[{
operator
:
'ADD'
,
target
:
{
dxType
:
'project'
,
...
this
.
form
,
operator
:
'ADD'
,
parentId
:
0
,
parentName
:
'Root'
,
state
:
'edit'
}
}],
operator
:
'NO_CHANGE'
}
post
(
'/ExtProgram/recursion'
,
params
).
then
(
res
=>
{
this
.
$utils
.
showMessageSuccess
(
`添加成功`
)
this
.
$emit
(
'completeEven'
)
})
}
else
if
(
this
.
projectCategory
===
'childProject'
)
{
console
.
log
(
'是子项'
)
const
parentId
=
this
.
form
.
extProject
.
id
delete
this
.
form
.
extProgram
delete
this
.
form
.
extProject
delete
this
.
form
.
dxType
delete
this
.
form
.
projectCategory
const
params
=
{
parentId
:
parentId
,
subTypeName
:
'DxContextProject'
,
operator
:
'ADD'
,
state
:
'edit'
,
modelName
:
'DxContextProject'
,
...
this
.
form
}
post
(
'/DxContextProject/recursion'
,
params
).
then
(
res
=>
{
this
.
$utils
.
showMessageSuccess
(
`添加成功`
)
this
.
$emit
(
'completeEven'
)
})
}
},
cancel
()
{
this
.
$emit
(
'cancel'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.project
{
height
:
500px
;
}
</
style
>
applications/dee-project/src/privateComponents/components/extProject/index.vue
View file @
ab2b5e19
...
...
@@ -2,7 +2,7 @@
* @Author: zhangtianfeng 3232807530@qq.com
* @Date: 2024-09-11 11:05:24
* @LastEditors: zhangtianfeng 3232807530@qq.com
* @LastEditTime: 2024-09-1
1 18:30:49
* @LastEditTime: 2024-09-1
2 11:06:53
-->
<
template
>
<div>
...
...
@@ -23,7 +23,7 @@ export default {
componentName
:
'所属项目'
,
props
:
{
value
:
{
type
:
[
Object
,
Array
,
String
],
type
:
[
Object
,
Array
,
String
,
Number
],
default
:
()
=>
null
},
form
:
{
...
...
@@ -46,7 +46,7 @@ export default {
deep
:
true
,
handler
(
val
)
{
if
(
val
)
{
console
.
log
(
'改变了'
,
val
)
//
console.log('改变了', val)
this
.
getProjectList
(
val
)
}
}
...
...
@@ -89,8 +89,10 @@ export default {
})
},
handleChange
(
val
)
{
console
.
log
(
'val'
,
val
)
this
.
$emit
(
'input'
,
val
)
console
.
log
(
'projectList'
,
this
.
projectList
)
const
valObj
=
this
.
projectList
.
find
((
item
)
=>
{
return
item
.
name
===
val
})
console
.
log
(
'点击事件'
,
valObj
)
this
.
$emit
(
'input'
,
valObj
.
id
)
}
}
}
...
...
applications/dee-project/src/privateComponents/components/gotoProjectDetial/index.vue
View file @
ab2b5e19
<
template
>
<div
class=
"link"
@
click=
"ToRelatedPage"
>
{{
currentValu
e
}}
</div>
<div
:class=
"currentValue.class"
@
click=
"ToRelatedPage"
>
{{
currentValue
.
nam
e
}}
</div>
</
template
>
<
script
>
...
...
@@ -11,15 +11,7 @@ export default {
type
:
[
Object
,
String
],
default
:
()
=>
{}
},
form
:
{
type
:
Object
,
default
:
()
=>
{}
},
itemObj
:
{
type
:
Object
,
default
:
()
=>
{}
},
basicData
:
{
scope
:
{
type
:
Object
,
default
:
()
=>
({})
}
...
...
@@ -39,27 +31,64 @@ export default {
],
data
()
{
return
{
currentValue
:
this
.
value
?
this
.
value
.
number
||
this
.
value
:
null
//
form
:
null
}
},
computed
:
{
currentValue
()
{
if
(
!
this
.
form
)
{
return
{
name
:
null
,
class
:
'link'
}
}
const
isExtProgram
=
this
.
form
.
subTypeName
===
'ExtProgram'
const
className
=
isExtProgram
?
'default'
:
'link'
const
name
=
this
.
value
?
this
.
value
.
number
||
this
.
value
:
null
return
{
name
,
class
:
className
}
}
},
watch
:
{
'scope.row'
:
{
immediate
:
true
,
deep
:
true
,
handler
(
val
)
{
this
.
form
=
val
console
.
log
(
'this.form'
,
this
.
form
)
}
}
},
mounted
()
{
console
.
log
(
'value'
,
this
.
value
)
console
.
log
(
'this.form'
,
this
.
form
)
console
.
log
(
'itemObj'
,
this
.
itemObj
)
console
.
log
(
'basicData'
,
this
.
basicData
)
// this.getCurrentValue()
},
methods
:
{
// getCurrentValue() {
// if (this.form.subTypeName !== 'ExtProgram') {
// this.currentValue = {
// name: this.value ? this.value.number || this.value : null,
// class: 'link'
// }
// } else {
// this.currentValue = {
// name: this.value ? this.value.number || this.value : null,
// class: 'default'
// }
// }
// },
ToRelatedPage
()
{
console
.
log
(
'this.form列表数据'
,
this
.
form
)
const
name
=
this
.
form
.
name
const
id
=
this
.
form
.
id
const
pageNumber
=
'7cbdc38f-0122-4e78-b162-57601a33bb7a'
const
title
=
'项目要素'
this
.
$router
.
push
({
path
:
`/page/
${
pageNumber
}
/
${
id
}
?title=
${
title
}
&id=
${
id
}
&name=
${
name
}
`
,
query
:
{
name
:
name
,
id
:
id
}
})
if
(
this
.
form
.
subTypeName
!==
'ExtProgram'
)
{
console
.
log
(
'this.form列表数据'
,
this
.
form
)
const
name
=
this
.
form
.
name
const
id
=
this
.
form
.
id
const
pageNumber
=
'7cbdc38f-0122-4e78-b162-57601a33bb7a'
const
title
=
'项目要素'
this
.
$router
.
push
({
path
:
`/page/
${
pageNumber
}
/
${
id
}
?title=
${
title
}
&id=
${
id
}
&name=
${
name
}
`
,
query
:
{
name
:
name
,
id
:
id
}
})
}
}
}
...
...
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