Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
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
张伯涛
bigDataSystem
Commits
ccc27f79
Commit
ccc27f79
authored
Nov 12, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重命名
parent
98ac1a63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
13 deletions
+34
-13
ImportRelativeModal.vue
...iews/dataStandards/basicStandards/ImportRelativeModal.vue
+0
-0
MoveModal.vue
src/views/dataStandards/basicStandards/MoveModal.vue
+34
-13
No files found.
src/views/dataStandards/basicStandards/
AddUser
Modal.vue
→
src/views/dataStandards/basicStandards/
ImportRelative
Modal.vue
View file @
ccc27f79
File moved
src/views/dataStandards/basicStandards/
resetName
.vue
→
src/views/dataStandards/basicStandards/
MoveModal
.vue
View file @
ccc27f79
...
@@ -7,24 +7,21 @@
...
@@ -7,24 +7,21 @@
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
accountFormSchema
,
resetNameFormSchema
}
from
'./basicStandards.data'
;
import
{
moveFormSchema
}
from
'./basicStandards.data'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
"@/views/
system/institution/institution
Data"
;
import
{
TreeData
}
from
"@/views/
dataStandards/basicStandards/basicStandards
Data"
;
defineOptions
({
name
:
'AccountModal'
});
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
isMove
=
ref
(
false
);
const
rowId
=
ref
(
''
);
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
'移动'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
resetNam
eFormSchema
,
schemas
:
mov
eFormSchema
,
showActionButtonGroup
:
false
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
actionColOptions
:
{
span
:
23
,
span
:
23
,
...
@@ -34,20 +31,44 @@
...
@@ -34,20 +31,44 @@
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isMove
.
value
=
!!
data
?.
isMove
;
setFieldsValue
({
setFieldsValue
({
...
data
.
record
,
...
data
.
record
,
})
})
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'treeId'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
});
const
getTitle
=
computed
(()
=>
(
'重命名'
));
/**确定按钮*/
/**确定按钮*/
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
createMessage
.
success
(
'
重命名
成功'
);
createMessage
.
success
(
'
移动
成功'
);
closeModal
()
closeModal
()
}
}
/**数组对象转成树*/
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'id'
parentId
=
parentId
||
'parentId'
children
=
children
||
'children'
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
(
item
=>
{
return
item
[
parentId
]
}))
||
0
// 对源数据深度克隆
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
// 循环所有项
const
treeData
=
cloneData
.
filter
(
father
=>
{
const
branchArr
=
cloneData
.
filter
(
child
=>
{
// 返回每一项的子级数组
return
father
[
id
]
===
child
[
parentId
]
})
branchArr
.
length
>
0
?
father
.
children
=
branchArr
:
''
// 返回第一层
return
father
[
parentId
]
===
rootId
})
return
treeData
!==
''
?
treeData
:
data
}
</
script
>
</
script
>
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