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
478a852d
Commit
478a852d
authored
Nov 14, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了公共代码页面
parent
3f86eefa
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
4215 additions
and
10 deletions
+4215
-10
CopyModal.vue
src/views/dataStandards/publicCode/CopyModal.vue
+74
-0
ImportDataStandardsModal.vue
...ews/dataStandards/publicCode/ImportDataStandardsModal.vue
+58
-0
ImportRelativeModal.vue
src/views/dataStandards/publicCode/ImportRelativeModal.vue
+58
-0
MoveModal.vue
src/views/dataStandards/publicCode/MoveModal.vue
+74
-0
PublicCodeTree.vue
src/views/dataStandards/publicCode/PublicCodeTree.vue
+251
-0
ResetNameModal.vue
src/views/dataStandards/publicCode/ResetNameModal.vue
+45
-0
VersionModal.vue
src/views/dataStandards/publicCode/VersionModal.vue
+132
-0
createPublicCode.vue
src/views/dataStandards/publicCode/createPublicCode.vue
+126
-0
createStandardsType.vue
src/views/dataStandards/publicCode/createStandardsType.vue
+139
-0
detailPublicCode.vue
src/views/dataStandards/publicCode/detailPublicCode.vue
+210
-0
editDetail.vue
src/views/dataStandards/publicCode/editDetail.vue
+186
-0
index.vue
src/views/dataStandards/publicCode/index.vue
+265
-10
publicCode.data.ts
src/views/dataStandards/publicCode/publicCode.data.ts
+1494
-0
publicCodeContrast.vue
src/views/dataStandards/publicCode/publicCodeContrast.vue
+112
-0
publicCodeData.ts
src/views/dataStandards/publicCode/publicCodeData.ts
+714
-0
relatedBasicStandardModal.vue
...ws/dataStandards/publicCode/relatedBasicStandardModal.vue
+76
-0
relatedRelationships.vue
src/views/dataStandards/publicCode/relatedRelationships.vue
+139
-0
treeTwo.vue
src/views/dataStandards/publicCode/treeTwo.vue
+62
-0
No files found.
src/views/dataStandards/publicCode/CopyModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
moveFormSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
"@/views/dataStandards/basicStandards/basicStandardsData"
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
'复制到'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
moveFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setFieldsValue
({
...
data
.
record
,
})
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'treeId'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
/**确定按钮*/
async
function
handleSubmit
()
{
createMessage
.
success
(
'移动成功'
);
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
>
src/views/dataStandards/publicCode/ImportDataStandardsModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
>
<template
#
formFooter
>
<a-Button
type=
"info"
@
click=
"handleDownByData"
style=
"margin-left: 150px;border-color: #4aabfe"
>
下载文件模版
</a-Button>
</
template
>
</BasicForm>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
importDataStandardsFormSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicUpload
}
from
'@/components/Upload'
;
import
{
uploadApi
}
from
'@/api/sys/upload'
;
import
{
downloadByData
}
from
"@/utils/file/download"
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
getTitle
=
computed
(()
=>
(
'标准导入'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
importDataStandardsFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
});
/**下载*/
function
handleDownByData
()
{
downloadByData
(
'text content'
,
'导入数据标准模版.xls'
);
}
/**上传事件*/
function
handleChange
(
list
:
string
[])
{
createMessage
.
success
(
`已上传文件
${
JSON
.
stringify
(
list
)}
`
);
}
/**提交按钮*/
function
handleSubmit
()
{
createMessage
.
success
(
'导入成功!'
)
closeModal
();
}
</
script
>
src/views/dataStandards/publicCode/ImportRelativeModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
>
<template
#
formFooter
>
<a-Button
type=
"info"
@
click=
"handleDownByData"
style=
"margin-left: 150px;border-color: #4aabfe"
>
下载文件模版
</a-Button>
</
template
>
</BasicForm>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
importRelativeFormSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicUpload
}
from
'@/components/Upload'
;
import
{
uploadApi
}
from
'@/api/sys/upload'
;
import
{
downloadByData
}
from
"@/utils/file/download"
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
getTitle
=
computed
(()
=>
(
'导入关联关系'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
importRelativeFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
});
/**下载*/
function
handleDownByData
()
{
downloadByData
(
'text content'
,
'导入关联关系模版.xls'
);
}
/**上传事件*/
function
handleChange
(
list
:
string
[])
{
createMessage
.
success
(
`已上传文件
${
JSON
.
stringify
(
list
)}
`
);
}
/**提交按钮*/
function
handleSubmit
()
{
createMessage
.
success
(
'导入成功!'
)
closeModal
();
}
</
script
>
src/views/dataStandards/publicCode/MoveModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
moveFormSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
"@/views/dataStandards/basicStandards/basicStandardsData"
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
'移动'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
moveFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setFieldsValue
({
...
data
.
record
,
})
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'treeId'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
/**确定按钮*/
async
function
handleSubmit
()
{
createMessage
.
success
(
'移动成功'
);
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
>
src/views/dataStandards/publicCode/PublicCodeTree.vue
0 → 100644
View file @
478a852d
<
template
>
<div
class=
"m-4 mr-0 overflow-hidden bg-white"
>
<BasicTree
title=
"公共代码"
ref=
"treeRef"
toolbar
search
treeWrapperClassName=
"h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand=
"false"
:defaultExpandAll=
"true"
:treeData=
"treeData"
:fieldNames=
"
{ key: 'businessId', title: 'standardChineseName' }"
@select="handleSelect"
:beforeRightClick="getRightMenuList"
:actionList="actionList"
/>
</div>
<!-- 移动 弹窗-->
<MoveModal
@
register=
"registerMoveModal"
@
success=
"handleSuccess"
/>
<!-- 复制到 弹窗-->
<CopyModal
@
register=
"registerCopyModal"
@
success=
"handleSuccess"
/>
<!-- 新建公共代码 弹窗-->
<CreatePublicCode
@
register=
"registerCreatePublicCodeModal"
@
success=
"handleSuccess"
/>
<!-- 新建标准分类 弹窗-->
<CreateStandardsType
@
register=
"registerCreateStandardsTypeModal"
@
success=
"handleSuccess"
/>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
h
,
nextTick
,
onMounted
,
ref
,
unref
}
from
'vue'
;
import
{
BasicTree
,
ContextMenuItem
,
TreeActionType
,
TreeItem
}
from
'@/components/Tree'
;
import
{
Nullable
}
from
"@vben/types"
;
import
{
TreeData
}
from
"./publicCodeData"
;
import
{
EventDataNode
}
from
"ant-design-vue/es/vc-tree/interface"
;
import
{
PlusOutlined
,
EllipsisOutlined
}
from
"@ant-design/icons-vue"
;
import
{
useMessage
}
from
"@/hooks/web/useMessage"
;
import
{
Modal
}
from
"ant-design-vue"
;
import
{
useModal
}
from
"@/components/Modal"
;
import
{
router
}
from
"@/router"
;
import
CreatePublicCode
from
'./createPublicCode.vue'
;
import
CreateStandardsType
from
'./createStandardsType.vue'
;
import
MoveModal
from
'./MoveModal.vue'
;
import
CopyModal
from
'./CopyModal.vue'
;
defineOptions
({
name
:
'DeptTree'
});
const
emit
=
defineEmits
([
'select'
]);
const
treeData
=
ref
<
TreeItem
[]
>
([]);
const
treeRef
=
ref
<
Nullable
<
TreeActionType
>>
(
null
);
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
[
registerMoveModal
,
{
openModal
:
openMoveModal
}]
=
useModal
();
const
[
registerCopyModal
,
{
openModal
:
openCopyModal
}]
=
useModal
();
const
[
registerCreatePublicCodeModal
,
{
openModal
:
openCreatePublicCodeModal
}]
=
useModal
();
const
[
registerCreateStandardsTypeModal
,
{
openModal
:
openCreateStandardsTypeModal
}]
=
useModal
();
function
getTree
()
{
const
tree
=
unref
(
treeRef
);
if
(
!
tree
)
{
throw
new
Error
(
'tree is null!'
);
}
return
tree
;
}
async
function
fetch
()
{
const
data
=
TreeData
treeData
.
value
=
handleTree
(
data
,
'businessId'
,
undefined
,
undefined
,
undefined
)
await
nextTick
(()
=>
{
getTree
().
expandAll
(
true
)
})
}
/** 转成树 */
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
}
/**选中的数据*/
function
handleSelect
(
keys
)
{
emit
(
'select'
,
keys
[
0
]);
}
onMounted
(()
=>
{
fetch
();
});
// 树的操作列表
const
actionList
=
[
{
//全部操作按钮
render
:
(
node
)
=>
{
return
h
(
EllipsisOutlined
,
{
class
:
'ml-2'
,
onClick
:
()
=>
{
getRightMenuList
(
node
)
},
});
},
},
];
function
getRightMenuList
(
node
:
EventDataNode
):
Promise
<
ContextMenuItem
[]
>
{
const
menu
=
[
{
label
:
'查看详情'
,
handler
:
()
=>
{
detailButton
(
node
)
},
icon
:
'ant-design:file-search-outlined'
,
},
{
label
:
'编辑'
,
handler
:
()
=>
{
editButton
(
node
)
},
icon
:
'ant-design:edit-outlined'
,
},
{
label
:
'标准分类信息'
,
handler
:
()
=>
{
standardsTypeButton
(
node
)
},
icon
:
'ant-design:file-text-twotone'
,
},
{
label
:
'新建标准分类'
,
handler
:
()
=>
{
createStandardsTypeButton
(
node
)
},
icon
:
'ant-design:file-add-outlined'
,
},
{
label
:
'新建公共代码'
,
handler
:
()
=>
{
createPublicCodeButton
(
node
)
},
icon
:
'ant-design:file-add-outlined'
,
},
{
label
:
'复制到'
,
handler
:
()
=>
{
copyButton
()
},
icon
:
'ant-design:snippets-twotone'
,
},
{
label
:
'删除'
,
handler
:
()
=>
{
deleteButton
(
node
)
},
icon
:
'ant-design:rest-outlined'
,
},
{
label
:
'移动'
,
handler
:
()
=>
{
MoveButton
()
},
icon
:
'ant-design:folder-open-outlined'
,
},
];
return
new
Promise
((
resolve
)
=>
{
resolve
(
menu
);
});
}
/**查看详情*/
function
detailButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/detailStandard'
,
query
:
{
businessId
:
record
.
businessId
,
},
});
}
/**移动*/
function
MoveButton
()
{
openMoveModal
(
true
,
{
});
}
/**新建标准分类*/
function
createStandardsTypeButton
(
record
)
{
openCreateStandardsTypeModal
(
true
,
{
record
});
}
/**新建公共代码*/
function
createPublicCodeButton
(
record
)
{
openCreatePublicCodeModal
(
true
,
{
record
});
}
/**复制到 按钮*/
function
copyButton
()
{
openCopyModal
(
true
,
{
});
}
/**删除 按钮*/
function
deleteButton
(
record
:
Recordable
)
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'删除成功!'
);
},
});
}
/** 修改 按钮*/
function
handleUpdateButton
(
record
:
Recordable
)
{
}
/**编辑标准*/
function
editButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/editDetailStandard'
,
query
:
{
businessId
:
record
.
businessId
,
},
});
}
/**标准分类信息*/
function
standardsTypeButton
(
record
:
Recordable
)
{
createMessage
.
success
(
'标准分类信息'
)
}
/** 成功回调*/
function
handleSuccess
()
{
}
</
script
>
src/views/dataStandards/publicCode/ResetNameModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
resetNameFormSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
"@/views/dataStandards/basicStandards/basicStandardsData"
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
'重命名'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
resetNameFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setFieldsValue
({
...
data
.
record
,
})
});
/**确定按钮*/
async
function
handleSubmit
()
{
createMessage
.
success
(
'移动成功'
);
closeModal
()
}
</
script
>
src/views/dataStandards/publicCode/VersionModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"50%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
>
<BasicTable
@
register=
"registerTable"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
label: '对比',
onClick: contrastButton.bind(null, record),
},
{
label: '撤回',
onClick: withdrawButton.bind(null, record),
},
{
// icon: 'clarity:note-edit-line',
label: '查看',
onClick: detailButton.bind(null, record),
},
]"
/>
</
template
>
</template>
</BasicTable>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
reactive
,
unref
,
onDeactivated
,
onMounted
,
ref
,
computed
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
searchFormSchema
,
versionColumns
,
versionData
}
from
'./publicCodeData'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
downloadByData
}
from
'@/utils/file/download'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
useUserStore
}
from
"@/store/modules/user"
;
import
{
userData
}
from
"@/views/system/institution/institutionData"
;
import
{
router
}
from
"@/router"
;
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerMoveUser
,
{
openModal
:
openMoveUserModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
getTitle
=
computed
(()
=>
(
'版本管理'
));
const
tableData
=
ref
([])
const
isAdd
=
ref
(
true
)
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
}]
=
useTable
({
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
var
data
=
[]
data
=
tableData
.
value
if
(
params
.
name
!=
undefined
&&
params
.
name
!=
''
&&
params
.
name
!=
null
){
//过滤出名字包含params.name的数据
data
=
data
.
filter
((
item
)
=>
item
.
name
.
includes
(
params
.
name
));
}
if
(
params
.
username
!=
undefined
&&
params
.
username
!=
''
&&
params
.
username
!=
null
){
data
=
data
.
filter
((
item
)
=>
item
.
username
.
includes
(
params
.
username
));
}
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
columns
:
versionColumns
,
rowSelection
:
true
,
formConfig
:
{
labelWidth
:
100
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
actionColumn
:
{
width
:
150
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
handleSearchInfoFn
(
info
)
{
return
info
;
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
setModalProps
({
confirmLoading
:
false
,
showOkBtn
:
false
,
showCancelBtn
:
false
});
isAdd
.
value
=
!!
data
?.
isAdd
;
});
/** 对比成功*/
function
contrastButton
()
{
closeModal
()
router
.
push
({
path
:
'/dataStandards/publicCode/publicCodeContrast'
,
query
:
{
businessId
:
route
.
query
.
businessId
,
},
});
}
/** 撤回成功*/
function
withdrawButton
()
{
createMessage
.
success
(
'撤回成功!'
)
}
/** 查看*/
function
detailButton
(
record
)
{
emit
(
'success'
,
{
values
:
{
...
record
}});
closeModal
();
}
onMounted
(()
=>
{
tableData
.
value
=
versionData
});
</
script
>
src/views/dataStandards/publicCode/createPublicCode.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
<div
class=
"modalRow"
>
<div>
可见范围
</div>
</div>
<div
class=
"addDialogBG"
>
<div
style=
"float: right"
>
<Icon
icon=
"ant-design:delete-outlined"
:size=
"25"
:color=
"'#ED6F6F'"
/>
</div>
<TreeTwo
class=
"w-1/4 xl:w-1/5"
@
select=
"handleSelect"
/>
</div>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
resetNameFormSchema
}
from
'./publicCode.data'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
TreeData
}
from
"./publicCodeData"
;
import
{
createBasicStandardsFormSchema
}
from
'./publicCode.data'
;
import
TreeTwo
from
'@/views/dataStandards/basicStandards/TreeTwo.vue'
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
isMove
=
ref
(
false
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
createBasicStandardsFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
var
formData
=
{}
if
(
data
.
record
===
null
||
data
.
record
===
undefined
){
formData
=
{
standardsTree
:
'100'
}
}
else
{
formData
=
{
standardsTree
:
data
.
record
.
businessId
}
}
// 塞值
setFieldsValue
({
...
formData
,
});
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'standardsTree'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
const
getTitle
=
computed
(()
=>
(
'新建基础标准'
));
/**数组对象转成树*/
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
}
/**确定按钮*/
async
function
handleSubmit
()
{
closeModal
()
}
</
script
>
<
style
lang=
"scss"
scoped
>
.modalRow
{
padding
:
0
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.clearAll
{
padding-right
:
10px
;
font-size
:
16px
;
}
.right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
}
.addDialogBG
{
margin
:
10px
;
border-radius
:
10px
;
padding
:
20px
;
background-color
:
#E8ECF7
;
width
:
98%
;
height
:
400px
;
}
</
style
>
src/views/dataStandards/publicCode/createStandardsType.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"50%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
<div
class=
"modalRow"
>
<div>
可见范围
</div>
<div
class=
"right"
>
<div
class=
"clearAll"
>
清空
</div>
<div>
<a-button
type=
"primary"
>
添加工作组
</a-button>
</div>
</div>
</div>
<div
class=
"addDialogBG"
>
<div
style=
"float: right"
>
<Icon
icon=
"ant-design:delete-outlined"
:size=
"25"
:color=
"'#ED6F6F'"
/>
</div>
<TreeTwo
class=
"w-1/4 xl:w-1/5"
@
select=
"handleSelect"
/>
</div>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
resetNameFormSchema
}
from
'./publicCode.data'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
createBasicTypeFormSchema
}
from
'./publicCode.data'
;
import
{
TreeData
}
from
"./publicCodeData"
;
import
TreeTwo
from
'@/views/dataStandards/basicStandards/TreeTwo.vue'
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
createBasicTypeFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
var
formData
=
{}
if
(
data
.
record
===
null
||
data
.
record
===
undefined
){
formData
=
{
standardsTree
:
'100'
}
}
else
{
formData
=
{
standardsTree
:
data
.
record
.
businessId
}
}
// 塞值
setFieldsValue
({
...
formData
,
});
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'standardsTree'
,
componentProps
:
{
treeData
:
treeList
},
},
{
field
:
'ModelTree'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
const
getTitle
=
computed
(()
=>
(
'新建文件夹'
));
/**确定按钮*/
async
function
handleSubmit
()
{
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
>
<
style
lang=
"scss"
scoped
>
.modalRow
{
padding
:
0
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.clearAll
{
padding-right
:
10px
;
font-size
:
16px
;
}
.right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
}
.addDialogBG
{
margin
:
10px
;
border-radius
:
10px
;
padding
:
20px
;
background-color
:
#E8ECF7
;
width
:
98%
;
height
:
400px
;
}
</
style
>
src/views/dataStandards/publicCode/detailPublicCode.vue
0 → 100644
View file @
478a852d
<
template
>
<div
style=
"background-color: white"
>
<div
style=
"display:flex;margin-top: 15px;margin-bottom: 15px;justify-content: space-between; align-items: center;"
v-if=
"isShow"
>
<div
style=
"margin-left: 15px;font-size: 15px;font-weight: bold"
>
查看版本
<Select
v-model:value=
"optionValue"
show-search
placeholder=
"请选择版本"
style=
"width: 200px"
:options=
"options"
@
change=
"handleChange"
></Select>
</div>
<div>
<a-button
type=
"primary"
@
click=
"contrastButton"
>
版本对比
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 10px"
@
click=
"resetButton"
>
回滚
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 10px"
@
click=
"exitButton"
>
退出查看
</a-button>
</div>
</div>
<Divider
/>
<div
style=
"display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px"
>
<div
style=
"margin-top: 10px;display: flex;font-weight: bold;font-size: 25px;margin-left: 10px"
>
{{
title
}}
<div
style=
"font-size: 15px;padding-top: 15px;padding-left: 10px"
>
版本:
{{
optionValue
}}
</div>
</div>
<div
style=
"margin-top: 10px;display: flex"
v-if=
"!isShow"
>
<a-button
type=
"primary"
@
click=
"editButton"
>
编辑标准
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 10px"
@
click=
"versionButton"
>
版本管理
</a-button>
</div>
</div>
<Divider
/>
<BasicForm
@
register=
"registerForm1"
/>
<Divider
/>
<BasicTable
@
register=
"registerTable"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'ant-design:file-search-outlined',
// label: '查看详情',
onClick: detailButton.bind(null, record),
},
]"
/>
</
template
>
</template>
<
template
#
referenceStandard=
"{ text, record }"
>
<span
v-for=
"(item, index) in text"
:key=
"index"
>
{{
item
.
icon
}}
</span>
</
template
>
</BasicTable>
<!-- 版本管理 弹窗-->
<VersionModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
Select
}
from
'ant-design-vue'
;
import
{
Description
}
from
'@/components/Description'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
Divider
}
from
'ant-design-vue'
;
import
{
detailData
,
TreeData
}
from
'./publicCodeData'
;
import
{
router
}
from
"@/router"
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
detailColumns
,
detailFormSchema
,
detailSchema
,
searchFormSchema
,
}
from
'./publicCode.data'
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useRoute
}
from
"vue-router"
;
import
VersionModal
from
'./VersionModal.vue'
import
{
useModal
}
from
"@/components/Modal"
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
const
route
=
useRoute
()
const
title
=
ref
(
''
)
const
formData
=
ref
({})
const
businessId
=
ref
(
''
)
const
isShow
=
ref
(
false
)
const
optionValue
=
ref
(
''
)
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
[
registerForm1
,
{
setFieldsValue
:
setFieldsValue1
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
detailSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
}]
=
useTable
({
title
:
'公共代码'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
detailData
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
return
{
...
response
,
data
:
detailData
};
},
columns
:
detailColumns
,
scroll
:
{
y
:
600
},
formConfig
:
{
labelWidth
:
120
,
schemas
:
detailFormSchema
,
autoSubmitOnEnter
:
true
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
actionColumn
:
{
width
:
250
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
const
options
=
ref
<
any
>
([
{
value
:
'V1'
,
label
:
'V1'
},
{
value
:
'V2'
,
label
:
'V2'
},
{
value
:
'V3'
,
label
:
'V3'
},
]);
/**编辑标准*/
function
editButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/editDetail'
,
query
:
{
businessId
:
businessId
.
value
,
},
});
}
/**基本标准对比*/
function
contrastButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/basicStandardsContrast'
,
query
:
{
businessId
:
businessId
.
value
,
},
});
}
/**版本管理 弹窗*/
function
versionButton
(
record
)
{
openModal
(
true
,
{
});
}
/**下拉框改变事件*/
function
handleChange
(
value
)
{
}
/**回滚*/
function
resetButton
(
value
)
{
createMessage
.
success
(
'回滚成功!'
)
}
/**查看详情*/
function
detailButton
(
value
)
{
}
/**退出查看*/
function
exitButton
(
record
)
{
isShow
.
value
=
false
optionValue
.
value
=
'V3'
}
/**版本管理 弹出回调函数*/
function
handleSuccess
(
record
)
{
optionValue
.
value
=
record
.
values
.
versionName
isShow
.
value
=
true
}
/**初始化*/
onMounted
(()
=>
{
optionValue
.
value
=
'V3'
businessId
.
value
=
route
.
query
.
businessId
const
data
=
TreeData
.
filter
(
item
=>
item
.
businessId
==
businessId
.
value
)
title
.
value
=
data
[
0
].
standardChineseName
setFieldsValue1
({
...
data
[
0
]
})
});
</
script
>
<
style
lang=
"less"
scoped
>
.desc-wrap {
padding: 16px;
background-color: @component-background;
}
</
style
>
src/views/dataStandards/publicCode/editDetail.vue
0 → 100644
View file @
478a852d
<
template
>
<div
style=
"background-color: white"
>
<Divider
/>
<div
style=
"display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px"
>
<div
style=
"margin-top: 10px;display: flex;font-weight: bold;font-size: 25px"
>
{{
title
}}
</div>
<div
style=
"margin-top: 10px;display: flex"
>
<a-button
type=
"primary"
@
click=
"publishButton"
>
发布
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 10px"
@
click=
"saveButton"
>
保存修改
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 10px"
@
click=
"exitEditButton"
>
退出编辑
</a-button>
</div>
</div>
<Divider
/>
<BasicForm
@
register=
"registerForm1"
/>
<Divider
/>
<BasicTable
@
register=
"registerTable"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"addValueButton"
>
添加值
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'ant-design:form-outlined',
// label: '编辑',
onClick: editButton.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
// label: '删除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: deleteButton.bind(null, record),
},
},
]"
/>
</
template
>
</template>
<
template
#
referenceStandard=
"{ text, record }"
>
<span
v-for=
"(item, index) in text"
:key=
"index"
>
{{
item
.
icon
}}
</span>
</
template
>
</BasicTable>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
Description
}
from
'@/components/Description'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
Divider
}
from
'ant-design-vue'
;
import
{
detailData
,
TreeData
}
from
'./publicCodeData'
;
import
{
router
}
from
"@/router"
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
detailColumns
,
detailFormSchema
,
editStandardsDetailFormSchema1
,
}
from
'./publicCode.data'
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
useModal
}
from
"@/components/Modal"
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
const
route
=
useRoute
()
const
title
=
ref
(
''
)
const
formData
=
ref
({})
const
businessId
=
ref
(
''
)
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
[
registerForm1
,
{
setFieldsValue
:
setFieldsValue1
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
editStandardsDetailFormSchema1
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
}]
=
useTable
({
title
:
'公共代码'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
detailData
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
return
{
...
response
,
data
:
detailData
};
},
columns
:
detailColumns
,
scroll
:
{
y
:
600
},
formConfig
:
{
labelWidth
:
120
,
schemas
:
detailFormSchema
,
autoSubmitOnEnter
:
true
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
actionColumn
:
{
width
:
250
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/**编辑标准*/
function
exitEditButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/detailPublicCode'
,
query
:
{
businessId
:
businessId
.
value
,
},
});
}
/**保存*/
function
saveButton
(
record
)
{
createMessage
.
success
(
'保存成功'
)
router
.
push
({
path
:
'/dataStandards/publicCode/detailPublicCode'
,
query
:
{
businessId
:
businessId
.
value
,
},
});
}
/**编辑*/
function
editButton
(
record
)
{
}
/**添加值*/
function
addValueButton
(
record
)
{
}
/**删除*/
function
deleteButton
(
record
)
{
createMessage
.
success
(
'删除成功!'
)
}
/**发布*/
function
publishButton
(
record
)
{
createMessage
.
success
(
'发布成功!'
)
router
.
push
({
path
:
'/dataStandards/publicCode/detailPublicCode'
,
query
:
{
businessId
:
businessId
.
value
,
},
});
}
/**初始化*/
onMounted
(()
=>
{
businessId
.
value
=
route
.
query
.
businessId
const
data
=
TreeData
.
filter
(
item
=>
item
.
businessId
==
businessId
.
value
)
title
.
value
=
data
[
0
].
standardChineseName
setFieldsValue1
({
...
data
[
0
]
})
});
</
script
>
<
style
lang=
"less"
scoped
>
.desc-wrap {
padding: 16px;
background-color: @component-background;
}
</
style
>
src/views/dataStandards/publicCode/index.vue
View file @
478a852d
<
template
>
<
template
>
<div>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
公共代码
<BasicStandardsTree
class=
"w-1/4 xl:w-1/5"
@
select=
"handleSelect"
/>
</div>
<BasicTable
@
register=
"registerTable"
class=
"w-3/4 xl:w-4/5"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"copyButton"
>
复制到
</a-button>
<a-button
type=
"primary"
@
click=
"deleteBatchButton"
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"MoveButton"
>
移动
</a-button>
<a-button
type=
"primary"
@
click=
"ExportRelativeButton"
>
导出关联关系
</a-button>
<a-button
type=
"primary"
@
click=
"ExportDataStandardsButton"
>
导出数据标准
</a-button>
<a-button
type=
"primary"
@
click=
"batchPublishButton"
>
批量发布
</a-button>
<a-button
type=
"primary"
@
click=
"createStandardsTypeButton"
>
新建标准分类
</a-button>
<a-button
type=
"primary"
@
click=
"createPublicCodeButton"
>
新建公共代码
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'ant-design:form-outlined',
// label: '重命名',
onClick: resetNameButton.bind(null, record),
},
{
icon: 'ant-design:folder-open-outlined',
// label: '移动',
onClick: MoveButton.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
// label: '删除',
color: 'error',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: deleteButton.bind(null, record),
},
},
{
icon: 'ant-design:folder-outlined',
// label: '复制',
onClick: copyButton.bind(null, record),
},
{
icon: 'ant-design:file-search-outlined',
// label: '查看详情',
onClick: detailButton.bind(null, record),
},
{
icon: 'ant-design:api-outlined',
// label: '关联关系',
onClick: relatedRelationshipsButton.bind(null, record),
},
]"
/>
</
template
>
</template>
<
template
#
referenceStandard=
"{ text, record }"
>
<span
v-for=
"(item, index) in text"
:key=
"index"
>
{{
item
.
icon
}}
</span>
</
template
>
</BasicTable>
<!-- 新建公共代码 弹窗-->
<CreatePublicCode
@
register=
"registerCreatePublicCodeModal"
@
success=
"handleSuccess"
/>
<!-- 新建标准分类 弹窗-->
<CreateStandardsType
@
register=
"registerCreateStandardsTypeModal"
@
success=
"handleSuccess"
/>
<!-- 移动 弹窗-->
<MoveModal
@
register=
"registerMoveModal"
@
success=
"handleSuccess"
/>
<!-- 复制到 弹窗-->
<CopyModal
@
register=
"registerCopyModal"
@
success=
"handleSuccess"
/>
<!-- 重命名 弹窗-->
<ResetNameModal
@
register=
"registerResetNameModal"
@
success=
"handleSuccess"
/>
</PageWrapper>
</template>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
unref
,
onDeactivated
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
BasicStandardsTree
from
'./PublicCodeTree.vue'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
CreatePublicCode
from
'./createPublicCode.vue'
;
import
CreateStandardsType
from
'./createStandardsType.vue'
;
import
MoveModal
from
'./MoveModal.vue'
;
import
CopyModal
from
'./CopyModal.vue'
;
import
ResetNameModal
from
'./ResetNameModal.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./publicCode.data'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
TreeData
}
from
"./publicCodeData"
;
import
{
router
}
from
'@/router'
;
import
{
exportUserList
}
from
"@/api/system/user/user"
;
import
{
downloadByData
}
from
"@/utils/file/download"
;
<
script
>
defineOptions
({
name
:
'AccountManagement'
});
export
default
{
const
{
createMessage
,
createConfirm
}
=
useMessage
();
name
:
"index"
const
route
=
useRoute
();
}
const
go
=
useGo
();
</
script
>
const
[
registerCreatePublicCodeModal
,
{
openModal
:
openCreatePublicCodeModal
}]
=
useModal
();
const
[
registerCreateStandardsTypeModal
,
{
openModal
:
openCreateStandardsTypeModal
}]
=
useModal
();
const
[
registerMoveModal
,
{
openModal
:
openMoveModal
}]
=
useModal
();
const
[
registerCopyModal
,
{
openModal
:
openCopyModal
}]
=
useModal
();
const
[
registerResetNameModal
,
{
openModal
:
openResetNameModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([])
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
}]
=
useTable
({
title
:
''
,
api
:
async
(
params
)
=>
{
//过滤掉tableData.value中,businessId等于100的
var
data
=
[];
if
(
params
.
taskId
==
undefined
||
params
.
taskId
==
''
){
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
>=
200
);
}
else
if
(
params
.
taskId
>=
200
){
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
==
params
.
taskId
);
}
else
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
==
params
.
taskId
);
}
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
data
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
columns
,
rowSelection
:
true
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
taskId
=
''
},
},
useSearchForm
:
true
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
return
info
;
},
actionColumn
:
{
width
:
250
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/**复制到 按钮*/
function
copyButton
()
{
openCopyModal
(
true
,
{
});
}
/**重命名 按钮*/
function
resetNameButton
(
record
)
{
openResetNameModal
(
true
,
{
record
});
}
/**复制到 按钮*/
function
copyButton1
()
{
openCopyModal
(
true
,
{
});
}
/**查看详情*/
function
detailButton
(
record
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/detailPublicCode'
,
query
:
{
businessId
:
record
.
businessId
,
},
});
}
/**移动*/
function
MoveButton
()
{
openMoveModal
(
true
,
{
});
}
/**批量发布*/
function
batchPublishButton
()
{
createMessage
.
success
(
'发布成功!'
)
}
/**删除按钮*/
function
deleteBatchButton
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'删除成功!'
);
reload
();
},
});
}
<
style
scoped
>
/**删除按钮*/
function
deleteButton
()
{
createMessage
.
success
(
'删除成功!'
);
}
</
style
>
/**新建标准分类*/
function
createStandardsTypeButton
()
{
openCreateStandardsTypeModal
(
true
,
{
});
}
/**新建公共代码*/
function
createPublicCodeButton
()
{
openCreatePublicCodeModal
(
true
,
{
});
}
/**导出关联关系*/
async
function
ExportRelativeButton
()
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
const
data
=
await
exportUserList
(
params
);
downloadByData
(
data
,
'关联关系信息'
+
'.xlsx'
);
}
/**导出数据标准*/
async
function
ExportDataStandardsButton
()
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
const
data
=
await
exportUserList
(
params
);
downloadByData
(
data
,
'数据标准信息'
+
'.xlsx'
);
}
function
handleSuccess
({
isUpdate
,
values
})
{
}
/** 树的select*/
function
handleSelect
(
taskId
=
''
)
{
searchInfo
.
taskId
=
taskId
;
reload
();
}
/**关联关系*/
function
relatedRelationshipsButton
(
record
:
Recordable
)
{
router
.
push
({
path
:
'/dataStandards/publicCode/relatedRelationships'
,
query
:
{
businessId
:
record
.
businessId
,
},
});
}
onMounted
(()
=>
{
tableData
.
value
=
TreeData
});
</
script
>
src/views/dataStandards/publicCode/publicCode.data.ts
0 → 100644
View file @
478a852d
This diff is collapsed.
Click to expand it.
src/views/dataStandards/publicCode/publicCodeContrast.vue
0 → 100644
View file @
478a852d
<
template
>
<PageWrapper
title=
"版本对比"
contentFullHeight
contentBackground
contentClass=
"flex"
>
<template
#
footer
>
<div
style=
"display: flex; justify-content: flex-end; padding-bottom: 10px"
>
<a-button
style=
"margin-right: 5px"
type=
"primary"
@
click=
"startContrast"
>
开始对比
</a-button>
<a-button
style=
"margin-right: 5px"
type=
"primary"
@
click=
"endContrast"
>
结束对比
</a-button>
</div>
</
template
>
<div
class=
"w-1/2 xl:w-1/2 pl-4"
>
<div
style=
"display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px"
>
<div
style=
"margin-top: 10px;display: flex;font-weight: bold;font-size: 20px;margin-left: 10px"
>
<Icon
icon=
"ion:layers-outline"
:size=
"25"
:color=
"'#1091FE'"
/>
{{title}}
<div
style=
"font-size: 15px;padding-left: 10px;padding-left: 50px"
>
<div>
版本
<Select
v-model:value=
"optionValue"
show-search
placeholder=
"请选择版本"
style=
"width: 200px;margin-left: 10px"
:options=
"options"
@
change=
"handleChange"
></Select>
</div>
</div>
</div>
</div>
<div>
<BasicForm
@
register=
"registerLeftForm"
/>
</div>
</div>
<div
class=
"w-1/2 xl:w-1/2"
>
<div
style=
"display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px"
>
<div
style=
"margin-top: 10px;display: flex;font-weight: bold;font-size: 20px;margin-left: 10px"
>
<Icon
icon=
"ion:layers-outline"
:size=
"25"
:color=
"'#1091FE'"
/>
{{title}}
<div
style=
"font-size: 15px;padding-left: 10px;padding-left: 50px"
>
<div>
版本
<Select
v-model:value=
"optionValue"
show-search
placeholder=
"请选择版本"
style=
"width: 200px;margin-left: 10px"
:options=
"options"
@
change=
"handleChange"
></Select>
</div>
</div>
</div>
</div>
<div>
<BasicForm
@
register=
"registerRightForm"
/>
</div>
</div>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
BasicTable
,
useTable
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
contrastSchema
}
from
'@/views/dataStandards/basicStandards/basicStandards.data'
;
import
{
leftContrastData
,
rightContrastData
}
from
'@/views/dataStandards/basicStandards/basicStandardsData'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
Select
}
from
'ant-design-vue'
;
import
Icon
from
'@/components/Icon/Icon.vue'
;
import
{
router
}
from
"@/router"
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
defineOptions
({
name
:
'Metadata'
});
const
route
=
useRoute
();
const
title
=
ref
(
'对外投资出资方式'
)
const
options
=
ref
<
any
>
([
{
value
:
'V1'
,
label
:
'V1'
},
{
value
:
'V2'
,
label
:
'V2'
},
{
value
:
'V3'
,
label
:
'V3'
},
]);
const
{
createMessage
}
=
useMessage
();
const
[
registerLeftForm
,{
setFieldsValue
:
setLeftFieldsValue
}]
=
useForm
({
labelWidth
:
100
,
schemas
:
contrastSchema
,
showActionButtonGroup
:
false
,
});
const
[
registerRightForm
,{
setFieldsValue
:
setRightFieldsValue
}]
=
useForm
({
labelWidth
:
100
,
schemas
:
contrastSchema
,
showActionButtonGroup
:
false
,
});
/**开始对比*/
function
startContrast
()
{
createMessage
.
success
(
'开始对比'
);
}
/**结束对比*/
function
endContrast
()
{
router
.
push
({
path
:
'/dataStandards/publicCode/detailStandard'
,
query
:
{
businessId
:
route
.
query
.
businessId
,
},
});
}
onMounted
(()
=>
{
setLeftFieldsValue
({
...
leftContrastData
[
0
],
})
setRightFieldsValue
({
...
rightContrastData
[
0
],
})
});
</
script
>
src/views/dataStandards/publicCode/publicCodeData.ts
0 → 100644
View file @
478a852d
This diff is collapsed.
Click to expand it.
src/views/dataStandards/publicCode/relatedBasicStandardModal.vue
0 → 100644
View file @
478a852d
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
relatedBasicStandardsSchema
}
from
'./publicCode.data'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
qualityTreeData
,
TreeData
}
from
"@/views/dataStandards/basicStandards/basicStandardsData"
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
rowId
=
ref
(
''
);
const
getTitle
=
computed
(()
=>
(
'关联基础标准'
));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
relatedBasicStandardsSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setFieldsValue
({
...
data
.
record
,
})
const
treeList
=
handleTree
(
TreeData
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
{
field
:
'basicStandardsTree'
,
componentProps
:
{
treeData
:
treeList
},
},
]);
});
/**确定按钮*/
async
function
handleSubmit
()
{
createMessage
.
success
(
'移动成功'
);
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
>
src/views/dataStandards/publicCode/relatedRelationships.vue
0 → 100644
View file @
478a852d
<
template
>
<PageWrapper
:title=
"title"
class=
"content-padding"
contentBackground
@
back=
"goBack"
>
<!--
<div
class=
"relatedRelationships_module"
>
-->
<BasicTable
@
register=
"registerTable3"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"referenceBasicStandardsButton"
>
引用标准
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'ant-design:link-outlined',
onClick: Button.bind(null, record),
},
]"
/>
</
template
>
</template>
<
template
#
standardName=
"{ text, record }"
>
<a
@
click=
"showDetails(record)"
>
{{
text
}}
</a>
</
template
>
</BasicTable>
<!-- </div>-->
<!-- 引用基础标准 弹窗-->
<RelatedBasicStandardModal
@
register=
"registerBasicStandardModal"
@
success=
"handleSuccess"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
Divider
}
from
'ant-design-vue'
;
import
{
router
}
from
"@/router"
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
RelatedBasicStandardModal
from
'./relatedBasicStandardModal.vue'
;
import
{
relatedRelationshipColumns3
,
}
from
"./publicCode.data"
;
import
{
relatedRelationshipsData3
,
}
from
"./publicCodeData"
;
import
{
useModal
}
from
"@/components/Modal"
;
const
go
=
useGo
();
const
route
=
useRoute
()
const
title
=
ref
(
'关联关系'
)
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
[
registerBasicStandardModal
,
{
openModal
:
openBasicStandardModal
}]
=
useModal
();
/**列表*/
const
[
registerTable3
]
=
useTable
({
title
:
'基础标准'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
relatedRelationshipsData3
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
return
{
...
response
,
data
:
relatedRelationshipsData3
};
},
columns
:
relatedRelationshipColumns3
,
useSearchForm
:
false
,
showTableSetting
:
false
,
pagination
:
false
,
showIndexColumn
:
false
,
bordered
:
true
,
scroll
:
{
y
:
500
},
actionColumn
:
{
width
:
100
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/**引用基础标准 按钮*/
function
referenceBasicStandardsButton
(
record
)
{
openBasicStandardModal
(
true
,{
})
}
/**按钮*/
function
Button
(
record
)
{
router
.
push
({
path
:
''
,
query
:
{
},
});
}
/**表1 跳转*/
function
showDetails1
()
{
}
/**返回*/
function
goBack
()
{
// 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
go
(
'/dataStandards/publicCode/index'
);
}
/**初始化*/
onMounted
(()
=>
{
});
</
script
>
<!--<style lang="scss" scoped>-->
<!--.relatedRelationships_module{-->
<!-- ::v-deep(.ant-table-body){-->
<!-- min-height: 150px!important;-->
<!-- height:150px!important;-->
<!-- }-->
<!--}-->
<!--</style>-->
src/views/dataStandards/publicCode/treeTwo.vue
0 → 100644
View file @
478a852d
<
template
>
<div
class=
"m-4 mr-0 overflow-hidden bg-white"
>
<BasicTree
title=
"工作组"
ref=
"treeRef"
toolbar
search
treeWrapperClassName=
"h-[calc(100%-35px)] overflow-auto"
:clickRowToExpand=
"true"
:checkable=
"true"
:defaultExpandAll=
"true"
:treeData=
"treeData"
:fieldNames=
"
{ key: 'businessId', title: 'label' }"
@select="handleSelect"
/>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
nextTick
,
onMounted
,
ref
,
unref
}
from
'vue'
;
import
{
BasicTree
,
TreeActionType
,
TreeItem
}
from
'@/components/Tree'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
Nullable
}
from
"@vben/types"
;
import
{
treeDataListTwo
}
from
"./publicCodeData"
;
defineOptions
({
name
:
'DeptTree'
});
const
emit
=
defineEmits
([
'select'
]);
const
treeData
=
ref
<
TreeItem
[]
>
([]);
const
treeRef
=
ref
<
Nullable
<
TreeActionType
>>
(
null
);
async
function
fetch
()
{
treeData
.
value
=
treeDataListTwo
await
nextTick
(()
=>
{
getTree
().
expandAll
(
true
)
})
}
function
getTree
()
{
const
tree
=
unref
(
treeRef
);
if
(
!
tree
)
{
throw
new
Error
(
'tree is null!'
);
}
return
tree
;
}
function
handleSelect
(
keys
)
{
emit
(
'select'
,
keys
[
0
]);
}
onMounted
(()
=>
{
fetch
();
});
</
script
>
<
style
lang=
"scss"
scoped
>
.bg-white
{
width
:
97%
;
}
::v-deep
(
.vben-tree
)
{
background-color
:
#E8ECF7
!
important
;
}
</
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