diff --git a/config/theme/variables.less b/config/theme/variables.less index 230a8e7c9584935254e616e079237942f0064412..651222753ab6db4bef6327d9b7ab9467ab35e555 100644 --- a/config/theme/variables.less +++ b/config/theme/variables.less @@ -42,7 +42,11 @@ // 全局背景色变量 @background: #fefefe; @active-background: #e6f1ff; -@focus-background: #506cfa; +// <<<<<<< HEAD +// @focus-background: #506cfa; +// ======= +// @focus-background: #3838b9; +@focus-background: #366EF4; @portal-background: #F7F8FA; // 左侧菜单 diff --git a/package.json b/package.json index 239b6839b4a61b849cdda64d5ce47161390ce347..2d55dd5dff6387765c36d8f15a01d3368b3b5db5 100644 --- a/package.json +++ b/package.json @@ -131,5 +131,6 @@ "vite-aliases": "^0.11.3", "vite-plugin-imp": "^2.4.0", "vite-plugin-style-import": "^2.0.0" - } + }, + "type": "commonjs" } diff --git a/public/svg/activity-select.svg b/public/svg/activity-select.svg index 3841dba50a02984aec7db943945ab882b8d4d2d2..bcc0632a844f7a60fb19f0351f6109eaffbe34d7 100644 --- a/public/svg/activity-select.svg +++ b/public/svg/activity-select.svg @@ -1,8 +1 @@ - - - - + \ No newline at end of file diff --git a/public/svg/activity.svg b/public/svg/activity.svg index 218bc08aab57ff0c4383133620a0e4f4fac2fdf7..c28ce2c58886548f59d225bc7bfac917a60979bc 100644 --- a/public/svg/activity.svg +++ b/public/svg/activity.svg @@ -1,8 +1 @@ - - - - + diff --git a/public/svg/addApplication.svg b/public/svg/addApplication.svg new file mode 100644 index 0000000000000000000000000000000000000000..f59664bb98dc0822355dd019e69bec5ee1486f4a --- /dev/null +++ b/public/svg/addApplication.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/addFriend.svg b/public/svg/addFriend.svg new file mode 100644 index 0000000000000000000000000000000000000000..4dab11c6185b4c2f368f2e790f47cb9a545b37ca --- /dev/null +++ b/public/svg/addFriend.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/addList.svg b/public/svg/addList.svg new file mode 100644 index 0000000000000000000000000000000000000000..da636827efdcd7b9b4fa86c9216eac0a1c96289a --- /dev/null +++ b/public/svg/addList.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/application.svg b/public/svg/application.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d93a4ff93f8e187094216907890c988babfdfb1 --- /dev/null +++ b/public/svg/application.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/applicationFile.svg b/public/svg/applicationFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..2f3158080f26734d20e3a4ec7049f5fb82de5dc1 --- /dev/null +++ b/public/svg/applicationFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/chat-left-search_more.svg b/public/svg/chat-left-search_more.svg new file mode 100644 index 0000000000000000000000000000000000000000..9dbff6d754586cda0a190c5f733c80bbe271534a --- /dev/null +++ b/public/svg/chat-left-search_more.svg @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/public/svg/chat-select.svg b/public/svg/chat-select.svg index eea4a430efc4f5b2192d921b2fc5d13e07651aa7..10898ec7e18cfbc8b2fc9172a889e06641802066 100644 --- a/public/svg/chat-select.svg +++ b/public/svg/chat-select.svg @@ -1,5 +1 @@ - - - + \ No newline at end of file diff --git a/public/svg/chat.svg b/public/svg/chat.svg index 10e00b5ac9559ab8e734e773cebf5a24b5b19998..4917b813add8b80d80c89fe3aec5af44ac283fca 100644 --- a/public/svg/chat.svg +++ b/public/svg/chat.svg @@ -1,5 +1 @@ - - - + \ No newline at end of file diff --git a/public/svg/classificationFile.svg b/public/svg/classificationFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..d3797eb1dc0106e235102ad0a2a7dcd0a4b94f8c --- /dev/null +++ b/public/svg/classificationFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/commonlyUsed.svg b/public/svg/commonlyUsed.svg new file mode 100644 index 0000000000000000000000000000000000000000..68991415eebdb86b76b7aa6b36acb3cd8bc8e9a6 --- /dev/null +++ b/public/svg/commonlyUsed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/copyFile.svg b/public/svg/copyFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..99a407dbd3607f97b7d44907a7004188a10e7161 --- /dev/null +++ b/public/svg/copyFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/dataDepartment.svg b/public/svg/dataDepartment.svg new file mode 100644 index 0000000000000000000000000000000000000000..064b1524eeff8ed1557550925807b9a556662918 --- /dev/null +++ b/public/svg/dataDepartment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/dataDictionary.svg b/public/svg/dataDictionary.svg new file mode 100644 index 0000000000000000000000000000000000000000..9594da8395ae088f0c8af7413e35e47eb7945489 --- /dev/null +++ b/public/svg/dataDictionary.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/dataProperty.svg b/public/svg/dataProperty.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5a3e300318580250f1a8596b61d8b0cecd319a5 --- /dev/null +++ b/public/svg/dataProperty.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/deleteOperate.svg b/public/svg/deleteOperate.svg new file mode 100644 index 0000000000000000000000000000000000000000..f4a86b81022a9252eec3730479d2637945f7229d --- /dev/null +++ b/public/svg/deleteOperate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/directory.svg b/public/svg/directory.svg new file mode 100644 index 0000000000000000000000000000000000000000..b851aaa3f1958f67e258d15e9cb8f49238808b4d --- /dev/null +++ b/public/svg/directory.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/excelFile.svg b/public/svg/excelFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..2b241045e16290711535fa818cc17a7894f55157 --- /dev/null +++ b/public/svg/excelFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/formFile.svg b/public/svg/formFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d8d93df84d599cd555ab05d596045967037b4ca --- /dev/null +++ b/public/svg/formFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/home-app.svg b/public/svg/home-app.svg new file mode 100644 index 0000000000000000000000000000000000000000..d85c2e00b8d9e5b96e0f2fd70207e28288d17ea0 --- /dev/null +++ b/public/svg/home-app.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/svg/home-setting.svg b/public/svg/home-setting.svg new file mode 100644 index 0000000000000000000000000000000000000000..0f611c8a798c0260df8a73446a3d4ed492bcb9db --- /dev/null +++ b/public/svg/home-setting.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/svg/imageFile.svg b/public/svg/imageFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..73f97feba5df2c1d91ce8b70d33adbf1bfd1fe39 --- /dev/null +++ b/public/svg/imageFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/info.svg b/public/svg/info.svg new file mode 100644 index 0000000000000000000000000000000000000000..fc055a4f00086221f7093ca043fbaef461b4b7de --- /dev/null +++ b/public/svg/info.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/joinCohort.svg b/public/svg/joinCohort.svg new file mode 100644 index 0000000000000000000000000000000000000000..30a5dca964a7b31a6ddb4da34f7272dba9b3045d --- /dev/null +++ b/public/svg/joinCohort.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/svg/joinCompany.svg b/public/svg/joinCompany.svg new file mode 100755 index 0000000000000000000000000000000000000000..80bfba62207af4c501684ffa0aac54d2169227c6 --- /dev/null +++ b/public/svg/joinCompany.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/svg/joinFriend.svg b/public/svg/joinFriend.svg new file mode 100644 index 0000000000000000000000000000000000000000..f9e53d46586df76339d2051d716cc2a0417aa086 --- /dev/null +++ b/public/svg/joinFriend.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/svg/joinJiQun.svg b/public/svg/joinJiQun.svg new file mode 100644 index 0000000000000000000000000000000000000000..adbcdfe344ebd6a10e549703bbca8bb9e7458b08 --- /dev/null +++ b/public/svg/joinJiQun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/joinStorage.svg b/public/svg/joinStorage.svg new file mode 100644 index 0000000000000000000000000000000000000000..2bb683366a3037661b6eb5b5b5fb2061e29268cf --- /dev/null +++ b/public/svg/joinStorage.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/svg/joinStorageGroup.svg b/public/svg/joinStorageGroup.svg new file mode 100644 index 0000000000000000000000000000000000000000..cf4cb8a991dc9a13127aa0535f7853556aa47cb6 --- /dev/null +++ b/public/svg/joinStorageGroup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/moveFile.svg b/public/svg/moveFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..85f0c29783be8ffa75b8331caf386a03b8d17975 --- /dev/null +++ b/public/svg/moveFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newCohort.svg b/public/svg/newCohort.svg new file mode 100644 index 0000000000000000000000000000000000000000..56444e00cc7f29b4e239e218914e694f6c6bb310 --- /dev/null +++ b/public/svg/newCohort.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/svg/newCompany.svg b/public/svg/newCompany.svg new file mode 100755 index 0000000000000000000000000000000000000000..f3131cd05fbd543f33d2edfe686db84a4407bc46 --- /dev/null +++ b/public/svg/newCompany.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/svg/newDict.svg b/public/svg/newDict.svg new file mode 100644 index 0000000000000000000000000000000000000000..54d34ae622b434ba16dbb5804f4fb147114d6faf --- /dev/null +++ b/public/svg/newDict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newFormFile.svg b/public/svg/newFormFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..26f7bfa58d3514a5e70e696a35953842d7c0d7d8 --- /dev/null +++ b/public/svg/newFormFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newModule.svg b/public/svg/newModule.svg new file mode 100644 index 0000000000000000000000000000000000000000..bab45c8069b97b2a072d375510422b98d1f31808 --- /dev/null +++ b/public/svg/newModule.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newProperty.svg b/public/svg/newProperty.svg new file mode 100644 index 0000000000000000000000000000000000000000..0fbd2919429e36118bfd676602acd2c399893e71 --- /dev/null +++ b/public/svg/newProperty.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newSpecies.svg b/public/svg/newSpecies.svg new file mode 100644 index 0000000000000000000000000000000000000000..e15520d6959f022107865fc189a1093f9eaf242c --- /dev/null +++ b/public/svg/newSpecies.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/newTemplate.svg b/public/svg/newTemplate.svg new file mode 100644 index 0000000000000000000000000000000000000000..a882346d8e2ece68487a7bbcc9d8762de0adb3dc --- /dev/null +++ b/public/svg/newTemplate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/openList.svg b/public/svg/openList.svg new file mode 100644 index 0000000000000000000000000000000000000000..c2bea0be10adcf7bb6902e5873c30a41beecca55 --- /dev/null +++ b/public/svg/openList.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/pdf.svg b/public/svg/pdf.svg new file mode 100644 index 0000000000000000000000000000000000000000..b2ff9884fc472c98efe25c0bb6dfef9315872460 --- /dev/null +++ b/public/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/permission.svg b/public/svg/permission.svg new file mode 100644 index 0000000000000000000000000000000000000000..bdfe8f59a4b64d846174e1b1b3435ff2c7daf42c --- /dev/null +++ b/public/svg/permission.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/qrcode.svg b/public/svg/qrcode.svg index 75d9c6d488af6abd57aa0e454d0bad96043a8620..ad15d1487d1b57d780a6d5bd0dca2f8825c3db35 100644 --- a/public/svg/qrcode.svg +++ b/public/svg/qrcode.svg @@ -1,12 +1 @@ - - - - - - - - - - - - + \ No newline at end of file diff --git a/public/svg/refreshList.svg b/public/svg/refreshList.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f4e2d894dae2a307e297ce486b371891e20badc --- /dev/null +++ b/public/svg/refreshList.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/relation-select.svg b/public/svg/relation-select.svg index 98ca30f43fa373fd7577850213f17f402953109d..9fbced26cb52a3c59d98941365747dde361fc458 100644 --- a/public/svg/relation-select.svg +++ b/public/svg/relation-select.svg @@ -1,20 +1 @@ - - - - - - - - + \ No newline at end of file diff --git a/public/svg/relation.svg b/public/svg/relation.svg index 6a5d1fcf215e3b1fc92079f26c13fa2872c949a2..c162c798dc2c8fcc03b3a487556c65b34b939a70 100644 --- a/public/svg/relation.svg +++ b/public/svg/relation.svg @@ -1,4 +1,4 @@ - + + diff --git a/public/svg/removeMember.svg b/public/svg/removeMember.svg new file mode 100644 index 0000000000000000000000000000000000000000..e237d8f1f12df841089259849611a49f1a131d93 --- /dev/null +++ b/public/svg/removeMember.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/renameFile.svg b/public/svg/renameFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..05a110028e16351e7ce22041261155a474895455 --- /dev/null +++ b/public/svg/renameFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/setCluster.svg b/public/svg/setCluster.svg new file mode 100644 index 0000000000000000000000000000000000000000..5eaa00e9da33548428bad50921b1d2a73cd2e978 --- /dev/null +++ b/public/svg/setCluster.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/setDepartment.svg b/public/svg/setDepartment.svg new file mode 100644 index 0000000000000000000000000000000000000000..df4c1adfa8a9d4d6e7b1cd1a2ed705eccc9853a7 --- /dev/null +++ b/public/svg/setDepartment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/setGroup.svg b/public/svg/setGroup.svg new file mode 100644 index 0000000000000000000000000000000000000000..473b5d697ee91b70473233a75ec729cbeb0a7c80 --- /dev/null +++ b/public/svg/setGroup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/store-select.svg b/public/svg/store-select.svg index 947c01b9cf25e7b1f5222a8413c11034614c86c2..61c3484d530dc6b9f352f91eb6b2cf30aab0ea07 100644 --- a/public/svg/store-select.svg +++ b/public/svg/store-select.svg @@ -1,8 +1 @@ - - - - + \ No newline at end of file diff --git a/public/svg/store.svg b/public/svg/store.svg index c9469ff1a15d05e1f0a7a0f5be36add876766041..6cfd1e2dc43a6d82a74364afe8f53b774a3866a3 100644 --- a/public/svg/store.svg +++ b/public/svg/store.svg @@ -1,8 +1 @@ - - - - + diff --git a/public/svg/template.svg b/public/svg/template.svg new file mode 100644 index 0000000000000000000000000000000000000000..5d8d93df84d599cd555ab05d596045967037b4ca --- /dev/null +++ b/public/svg/template.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/textFile.svg b/public/svg/textFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..6b0f7fbcdaadeffd3b4e2cd8e11112bdb703fcb9 --- /dev/null +++ b/public/svg/textFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/unKnowFile.svg b/public/svg/unKnowFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..a0da4acb3982c630aa39481ddb75a0a46e2a2d46 --- /dev/null +++ b/public/svg/unKnowFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/updateInfo.svg b/public/svg/updateInfo.svg new file mode 100644 index 0000000000000000000000000000000000000000..65a7fcd663ca633b22134201f3feb5702df0a24f --- /dev/null +++ b/public/svg/updateInfo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/uploadFile.svg b/public/svg/uploadFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..712b462ec306c67857b7d15021509d7945e7b84d --- /dev/null +++ b/public/svg/uploadFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/uploadList.svg b/public/svg/uploadList.svg new file mode 100644 index 0000000000000000000000000000000000000000..f5119b214dbdc4b7e6944f5929a8b36e44bc277a --- /dev/null +++ b/public/svg/uploadList.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/videoFile.svg b/public/svg/videoFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..7b099ce6be053fefd2af2f0ef3061a89c12e9bf7 --- /dev/null +++ b/public/svg/videoFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/svg/worldFile.svg b/public/svg/worldFile.svg new file mode 100644 index 0000000000000000000000000000000000000000..3dede7016feed763d7aff3650b26214e770531ef --- /dev/null +++ b/public/svg/worldFile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Common/FlowDesign/Config/Components/ApprovalNode/index.tsx b/src/components/Common/FlowDesign/Config/Components/ApprovalNode/index.tsx index e2ede1c3319b1f9399dbb9fc2199e477a5d30953..c0912907b43eaf89c723678d3184b22fc3b392f8 100644 --- a/src/components/Common/FlowDesign/Config/Components/ApprovalNode/index.tsx +++ b/src/components/Common/FlowDesign/Config/Components/ApprovalNode/index.tsx @@ -120,7 +120,6 @@ const ApprovalNode: React.FC = (props) => { return (
- {' '} = (props) => { props.current.destName = '发起人'; props.current.destType = '发起人'; setCurrentData({ id: '1', name: '发起人' }); - props.refresh(); break; default: break; } - setDestType(e.selectedItem.value); + if (destType != e.selectedItem.value) { + setDestType(e.selectedItem.value); + props.refresh(); + } }} dataSource={[ { value: '1', label: '指定角色' }, @@ -162,7 +163,7 @@ const ApprovalNode: React.FC = (props) => { onClick={() => { setIsOpen(true); }}> - 选择角色 + + 选择角色 )} diff --git a/src/components/Common/GlobalComps/entityIcon.tsx b/src/components/Common/GlobalComps/entityIcon.tsx index bae6fc46879d9d08b0232f040d2343083e1d41ce..51e85e83061e4717d17f1c4f82e07e54769c05cc 100644 --- a/src/components/Common/GlobalComps/entityIcon.tsx +++ b/src/components/Common/GlobalComps/entityIcon.tsx @@ -130,6 +130,7 @@ export const ShareIconItem = (info: shareIconInfo) => { ); } else { + console.log('info.share.typeName', info.share.typeName) const icon = ( { const iconSize = size || 14; const config: any = { size: iconSize, color: Theme.FocusColor }; + const renderImage = (name: string, config: any) => { + return ( + + ); + }; const loadFileIcon = () => { switch (iconType) { case 'application/pdf': - return ; + return renderImage('pdf', config); case 'application/x-zip-compressed': return ; + case 'application/msword': + return renderImage('worldFile', config); + } + if (iconType === '页面模板') { + return renderImage('template', config); + } + if (iconType === '新建页面模板') { + return renderImage('newTemplate', config); + } + if (~iconType?.indexOf('word')) { + return renderImage('worldFile', config); + } + if (~iconType?.indexOf('excel') || ~iconType?.indexOf('sheet')) { + return renderImage('excelFile', config); } if (iconType?.startsWith('application')) { - return ; + return renderImage('applicationFile', config); } else if (iconType?.startsWith('video')) { - return ; + return renderImage('videoFile', config); } else if (iconType?.startsWith('image')) { - return ; + return renderImage('imageFile', config); } else if (iconType?.startsWith('text')) { - return ; + return renderImage('textFile', config); } else if (iconType?.startsWith('audio')) { - return ; + return renderImage('videoFile', config); } - return ; + return renderImage('unknowFile', config); }; + const loadIcon = () => { switch (iconType) { case '动态': return ; case '目录': - return ; + return renderImage('directory', { ...config, color: 'blue', fill: 'blue' }); case '成员目录': return ; case '标准': return ; case '字典': - return ; + return renderImage('dataDictionary', config); + case '新建字典': + return renderImage('newDict', config); case '分类': - return ; + return renderImage('classificationFile', config); + case '新建分类': + return renderImage('newSpecies', config); case '分类项': return ; case '属性': - return ; + return renderImage('dataProperty', config); + case 'newProperty': + return renderImage('newProperty', config); case '应用': - return ; + return renderImage('application', config); + case '新建应用': + return renderImage('addApplication', config); case '模块': - return ; + return renderImage('newModule', config); + case '新建模块': + return renderImage('newModule', config); case '办事': return ; case '表单': - return ; + return renderImage('formFile', config); + case '新建表单': + return renderImage('newFormFile', config); case '角色': return ; case '权限': - return ; + return renderImage('permission', config); case '激活': return ; case '事项': @@ -80,12 +116,14 @@ const TypeIcon = ({ avatar, iconType, size }: TypeIconInfo) => { return ; case '子流程': case TargetType.Group: - return ; + return renderImage('joinJiQun', config); + case 'setCluster': + return renderImage('setCluster', config); case TargetType.Cohort: - return ; + return renderImage('setGroup', config); case TargetType.Section: case TargetType.Department: - return ; + return renderImage('setDepartment', config); case TargetType.Person: return ; case TargetType.College: @@ -99,49 +137,53 @@ const TypeIcon = ({ avatar, iconType, size }: TypeIconInfo) => { case TargetType.Working: return ; case 'newDir': - return ; + return renderImage('addList', config); case 'refresh': - return ; + return renderImage('refreshList', config); case 'remark': - return ; + return renderImage('info', config); case 'open': return ; case 'design': return ; case 'copy': - return ; + return renderImage('copyFile', config); case 'move': - return ; + return renderImage('moveFile', config); case 'parse': return ; case 'rename': - return ; + return renderImage('renameFile', config); + case 'download': + return renderImage('renameFile', config); case 'delete': - return ; + return renderImage('deleteOperate', config); case 'shortcut': return ; case 'restore': return ; case 'remove': - return ; + return renderImage('removeMember', config); case 'update': - return ; + return renderImage('updateInfo', config); case 'pull': return ; case 'qrcode': - return ; + return renderImage('qrcode', config); case 'joinFriend': - return ; + return renderImage('addFriend', config); case 'joinCohort': return ; case 'joinCompany': return ; + case 'joinStorage': + return renderImage('joinStorageGroup', config); case 'joinGroup': return ; case 'newFile': - return ; + return renderImage('uploadFile', config); case 'taskList': - return ; + return renderImage('uploadList', config); case 'setToping': return ; case 'removeToping': @@ -151,7 +193,7 @@ const TypeIcon = ({ avatar, iconType, size }: TypeIconInfo) => { case 'setNoReaded': return ; case 'setCommon': - return ; + return renderImage('commonlyUsed', config); case 'delCommon': return ; default: @@ -165,7 +207,18 @@ const TypeIcon = ({ avatar, iconType, size }: TypeIconInfo) => { ); } - return
{loadIcon()}
; + return ( +
+ {loadIcon()} +
+ ); }; export default TypeIcon; diff --git a/src/components/DataStandard/WorkForm/Design/config/attribute.tsx b/src/components/DataStandard/WorkForm/Design/config/attribute.tsx index 6bbb597268fb9f83b1b7c767992867662591584a..d43b15fef2dc8e3c815d8652ac15293e342be582 100644 --- a/src/components/DataStandard/WorkForm/Design/config/attribute.tsx +++ b/src/components/DataStandard/WorkForm/Design/config/attribute.tsx @@ -167,7 +167,7 @@ const AttributeConfig: React.FC = ({ useEffect(() => { loadAttributeResource(); - setSelect(JSON.parse(attribute.rule)); + setSelect(JSON.parse(attribute?.rule ?? '{}')); setReadOnlyConditions(attribute.options!['readOnlyConditions']); setHideFieldConditions(attribute.options!['hideFieldConditions']); setIsRequiredConditions(attribute.options!['isRequiredConditions']); @@ -215,7 +215,7 @@ const AttributeConfig: React.FC = ({ type="link" icon={} onClick={() => { - setSelect(JSON.parse(attribute.rule)); + setSelect(JSON.parse(attribute?.rule ?? '{}')); setOpenType(1); }}> 编辑计算规则 diff --git a/src/components/Directory/tagsBar/index.module.less b/src/components/Directory/tagsBar/index.module.less index e7552ce19f1011922479f1419196b9ae0513b6fa..3ddb59896cc897a50dfabe01ace0034bf91d089b 100644 --- a/src/components/Directory/tagsBar/index.module.less +++ b/src/components/Directory/tagsBar/index.module.less @@ -16,9 +16,11 @@ .tags_item { cursor: pointer; white-space: nowrap; - padding: 4px 12px; font-size: 12px; - height: 26px; + height: 24px; + width: 48px; + text-align:center; + line-height: 24px; border-radius: 6px; background-color: #efefef; & > * { @@ -36,9 +38,11 @@ cursor: not-allowed; white-space: nowrap; border-radius: 6px; - padding: 4px 12px; + width: 48px; + height: 24px; + text-align:center; + line-height: 24px; font-size: 12px; - height: 26px; .item_count { font-style: italic; transform: scale(0.9); @@ -48,7 +52,7 @@ color: @text-color-inverse; } color: @text-color-inverse; - background-color:@focus-background; + background-color: @focus-background; } } } diff --git a/src/components/Directory/views/listMode.tsx b/src/components/Directory/views/listMode.tsx index 0c3fe2559bb761345be577932b3d2f59e809350a..321851543a173898b60080e65dde5c8625abd97d 100644 --- a/src/components/Directory/views/listMode.tsx +++ b/src/components/Directory/views/listMode.tsx @@ -4,6 +4,7 @@ import { Badge, Dropdown, List, MenuProps, Tag } from 'antd'; import { showChatTime } from '@/utils/tools'; import css from './less/list.module.less'; import EntityIcon from '@/components/Common/GlobalComps/entityIcon'; +import { XFileLink } from '@/ts/base/schema'; const ListMode = ({ focusFile, @@ -55,6 +56,8 @@ const ListMode = ({
{item.name}
{item.metadata.sourceId ? ( 快捷方式 + ) : (item.metadata as unknown as XFileLink)?.isLinkFile ? ( + 引用文件 ) : ( <> )} diff --git a/src/components/MainLayout/preview/index.tsx b/src/components/MainLayout/preview/index.tsx index f9455d011ad1ca04d6e0b27a9a825111dd7ba128..de92d82b585b59e2af85e00e10d4d38e3a4d5154 100644 --- a/src/components/MainLayout/preview/index.tsx +++ b/src/components/MainLayout/preview/index.tsx @@ -77,7 +77,6 @@ const EntityPreview: React.FC<{ flag?: string }> = (props) => { command.unsubscribe(id); }; }, [props]); - const renderEntityBody = (entity: any, children?: React.ReactNode) => { return {children && children}; }; @@ -131,6 +130,7 @@ const EntityPreview: React.FC<{ flag?: string }> = (props) => { return <>; } } + if ('node' in entity) { return renderEntityBody(entity, ); } diff --git a/src/components/MainLayout/preview/layout/index.tsx b/src/components/MainLayout/preview/layout/index.tsx index b339593da3c5236abb212686a33b23c2d5a575f8..85f4e3fe774474017f1c0a0ea59534eaf245d96f 100644 --- a/src/components/MainLayout/preview/layout/index.tsx +++ b/src/components/MainLayout/preview/layout/index.tsx @@ -35,7 +35,7 @@ const PreviewLayout: React.FC = (props) => { props.onActionChanged(action.key); } }}> - + ); })}> diff --git a/src/components/MainLayout/preview/session/chat/SendBox/index.tsx b/src/components/MainLayout/preview/session/chat/SendBox/index.tsx index 06494dd1e26d0ea4cc586478d04e7d81e4dcc4fd..2a94b1959435b81f7f138a8afe69f93e4c61e89d 100644 --- a/src/components/MainLayout/preview/session/chat/SendBox/index.tsx +++ b/src/components/MainLayout/preview/session/chat/SendBox/index.tsx @@ -1,4 +1,4 @@ -import { Popover, Input } from 'antd'; +import { Popover, Input, Button } from 'antd'; import React, { useEffect, useState } from 'react'; import { IMessage, ISession, ISysFileInfo, MessageType } from '@/ts/core'; import OpenFileDialog from '@/components/OpenFileDialog'; @@ -160,26 +160,36 @@ const GroupInputBox = (props: IProps) => { open={openEmoji} trigger={['click', 'contextMenu']} onOpenChange={setOpenEmoji}> - setOpenEmoji(!openEmoji)} - /> + setOpenEmoji(!openEmoji)}> + + + - - setOpen(true)} - /> - - 0 ? Theme.FocusColor : '#909090'} + + + + setOpen(true)}> + + + +
{open && ( = ({ entity, finished }) => { open title={ -
- +
+ {entity.name}
} diff --git a/src/executor/open/index.tsx b/src/executor/open/index.tsx index 187a26e15dae5d31494d155b3ebeae9c133bbac2..72ea230a7149bce419a40bb1fd3ed36863d9624c 100644 --- a/src/executor/open/index.tsx +++ b/src/executor/open/index.tsx @@ -34,6 +34,7 @@ interface IOpenProps { const ExecutorOpen: React.FC = (props: IOpenProps) => { if (props.entity === undefined) return <>; if ('size' in props.entity || 'filedata' in props.entity) { + const data = 'size' in props.entity ? props.entity : props.entity.filedata; if (data.contentType?.startsWith('image')) { return ; diff --git a/src/executor/tools/task/start/multitabTable/stagging.tsx b/src/executor/tools/task/start/multitabTable/stagging.tsx index 056d3eca47264ce1c57fcc61109cfacb8d3e81ae..b8293acb0a91cac7cc8c39f739a9f45ad680280c 100644 --- a/src/executor/tools/task/start/multitabTable/stagging.tsx +++ b/src/executor/tools/task/start/multitabTable/stagging.tsx @@ -34,6 +34,8 @@ const WorkStagging: React.FC = ({ onShow, apply }) => { }; }; const loadFields = () => { + // 取主表字段作为列名; + const mainFormFields = apply.primaryForms![0]?.fields ?? []; return [ { id: 'title', @@ -55,6 +57,7 @@ const WorkStagging: React.FC = ({ onShow, apply }) => { visible: true, }, }, + ...mainFormFields, ] as model.FieldModel[]; }; return ( diff --git a/src/executor/tools/uploadItem.tsx b/src/executor/tools/uploadItem.tsx index 91a380bd8ca158d5544fb8cda66ed63398cf02cc..c85fd5c2c0650ca89eea8ff8f16ea69dff887f85 100644 --- a/src/executor/tools/uploadItem.tsx +++ b/src/executor/tools/uploadItem.tsx @@ -48,7 +48,12 @@ const UploadItem: React.FC = ({ {
)} +
+ 技术支持: + + 资产云开放协同创新中心 + +
+
+ + Powered by Orginone{' '} + +
diff --git a/src/layouts/Basic/index.module.less b/src/layouts/Basic/index.module.less index e0e169f404bc8826365ec1b3aae85bf1d13dd003..f4ebee094b1882a2fdb912b8f07cadbfb9b9718e 100644 --- a/src/layouts/Basic/index.module.less +++ b/src/layouts/Basic/index.module.less @@ -14,12 +14,17 @@ justify-content: space-between; align-items: flex-end; .budget { + height: 60px; display: flex; flex-direction: row; flex-wrap: nowrap; + justify-content: center; align-items: center; cursor: pointer; } + text-align: center; + // padding: 10px 5px; + // background-color: var(--color-brand-Light, #F2F3FF) !important; .navbar { height: 60px; .barItem { @@ -62,11 +67,34 @@ border-radius: var(--radius-md, 8px); background: #FFF; } + .navbar-item { + display: flex; + padding: 5px 12px; + flex-direction: column; + align-items: flex-start; + gap: 1px; + } + .navbar-item_selected { + border-radius: var(--radius-md, 8px); + background: #FFF; + } .title { color: white; - font-size: 14px; font-weight: bold; + font-family: PingFang SC; + font-size: 12px; text-align: center; + line-height: 20px; + } + .title_selected { + font-weight: bold; + color: #366EF4; + } + .navbar-exit { + color: #003CAB; + font-family: PingFang SC; + font-size: 12px; + line-height: 20px; } .title_selected { color: rgb(246, 255, 144); diff --git a/src/pages/Chats/index.tsx b/src/pages/Chats/index.tsx index 5b7cb545979b835948c3068eb7db11a3b6a7dc9b..83bfa20b27872ed9ff82419db437cf052e69b63f 100755 --- a/src/pages/Chats/index.tsx +++ b/src/pages/Chats/index.tsx @@ -1,4 +1,4 @@ -import { Button, Dropdown, Spin } from 'antd'; +import { Button, Dropdown, Spin, Image } from 'antd'; import React, { useEffect, useState } from 'react'; import orgCtrl from '@/ts/controller'; import { ISession } from '@/ts/core'; @@ -7,13 +7,12 @@ import { command } from '@/ts/base'; import { useFlagCmdEmitter } from '@/hooks/useCtrlUpdate'; import { cleanMenus } from '@/utils/tools'; import { loadFileMenus, operatesToMenus } from '@/executor/fileOperate'; -import OrgIcons from '@/components/Common/GlobalComps/orgIcons'; import AppLayout from '@/components/MainLayout/appLayout'; import { personJoins } from '@/ts/core/public'; import SelectChat from './select'; import FullScreenModal from '@/components/Common/fullScreen'; -import { RiMore2Fill } from 'react-icons/ri'; -import { Theme } from '@/config/theme'; +// import { RiMore2Fill } from 'react-icons/ri'; +// import { Theme } from '@/config/theme'; /** 沟通-通讯录 */ const ChatContent: React.FC = () => { @@ -108,12 +107,14 @@ const ChatContent: React.FC = () => { )} placement="bottom" trigger={['click', 'contextMenu']}> - +
+ +
); }; @@ -121,8 +122,7 @@ const ChatContent: React.FC = () => {
- - 消息 + 沟通
{ + const history = useHistory(); + // 渲染数据项 + const renderDataItem = ( + title: string, + number: string | number, + size?: number, + info?: string, + ) => { + return ( +
+
{title}
+
{number}
+ {size && size > 0 &&
大小:{formatSize(size)}
} + {info && info.length > 0 &&
{info}
} +
+ ); + }; + // 渲染沟通信息 + const RenderChat: React.FC = () => { + const [msgCount, setMsgCount] = useState(0); + const [loaded] = useFlagCmdEmitter('session', () => { + setMsgCount( + orgCtrl.chats + .map((i) => { + return i.isMyChat ? i.badgeCount : 0; + }) + .reduce((total, count) => total + count, 0), + ); + }); + return ( + <> +
+ 沟通 + + + 未读<>{msgCount}条 + + + +
+
+ + } size={2}> + {renderDataItem('好友(人)', orgCtrl.user.members.length)} + {renderDataItem( + '同事(个)', + orgCtrl.user.companys + .map((i) => i.members.map((i) => i.id)) + .reduce( + (ids, current) => [ + ...ids, + ...current.filter((i) => !ids.includes(i)), + ], + [], + ).length, + )} + {renderDataItem( + '群聊(个)', + orgCtrl.chats.filter((i) => i.isMyChat && i.isGroup).length, + )} + {renderDataItem('单位(家)', orgCtrl.user.companys.length)} + + +
+ + ); + }; + // 渲染办事信息 + const RenderWork: React.FC = () => { + const [todoCount, setTodoCount] = useState(0); + const [ApplyCount, setApplyCount] = useState(0); + const [CopysCount, setCopysCount] = useState(0); + const [CompletedCount, setCompletedCount] = useState(0); + useEffect(() => { + const id = orgCtrl.work.notity.subscribe(() => { + setTodoCount(orgCtrl.work.todos.length); + orgCtrl.work.loadTaskCount('已发起').then((v) => { + setApplyCount(v); + }); + orgCtrl.work.loadTaskCount('抄送').then((v) => { + setCopysCount(v); + }); + orgCtrl.work.loadTaskCount('已办').then((v) => { + setCompletedCount(v); + }); + }); + return () => { + orgCtrl.unsubscribe(id); + }; + }, []); + return ( + <> +
+ 办事 + + + 待办{todoCount}件 + + + +
+
+ } size={2}> + {renderDataItem('待办', todoCount)} + {renderDataItem('已办', CompletedCount)} + {renderDataItem('抄送', CopysCount)} + {renderDataItem('已发起', ApplyCount)} + +
+ + ); + }; + // 渲染存储数据信息 + const RendeStore: React.FC = () => { + const [noStore, setNoStore] = useState(false); + const [diskInfo, setDiskInfo] = useState(); + useEffect(() => { + orgCtrl.user.getDiskInfo().then((value) => { + setDiskInfo(value); + setNoStore(value === undefined); + }); + }, []); + return ( + <> +
+ 数据 + +
+ +
+ 管理数据 +
+
+
+ } size={6}> + {diskInfo && ( + <> + {renderDataItem( + `关系(个)`, + orgCtrl.chats.filter( + (i) => i.isMyChat && i.typeName !== TargetType.Group, + ).length, + -1, + `共计:${orgCtrl.chats.length}个`, + )} + {renderDataItem(`数据集(个)`, diskInfo.collections, diskInfo.dataSize)} + {renderDataItem(`对象数(个)`, diskInfo.objects, diskInfo.totalSize)} + {renderDataItem(`文件(个)`, diskInfo.filesCount, diskInfo.filesSize)} + {renderDataItem( + `硬件`, + formatSize(diskInfo.fsUsedSize), + diskInfo.fsTotalSize, + )} + + )} + {noStore && ( +

+ {`您还未申请存储资源, + 您将无法使用本系统, + 请申请加入您的存储资源群(用来存储您的数据), + 个人用户试用存储群为(orginone_data), + 申请通过后请在关系中激活使用哦!`} +

+ )} +
+
+ + ); + }; + // 渲染常用信息 + const RendeCommonInfo: React.FC = () => { + const [editMode, setEditMode] = useState(false); + const [commonFiles, setCommonFiles] = useState([]); + const [groups, setGroups] = useState({}); + const [loaded] = useFlagCmdEmitter('commons', async () => { + setCommonFiles(await orgCtrl.loadCommons()); + }); + const loadGroups = () => { + const letGroups: any = { 其它: [] }; + for (const item of orgCtrl.user.commons) { + const file = commonFiles.find( + (i) => i.id === item.id && i.spaceId === item.spaceId, + ); + if (file) { + const groupName = item.groupName ?? '其它'; + letGroups[groupName] = letGroups[groupName] || []; + letGroups[groupName].push({ + file, + common: item, + }); + } + } + + return letGroups; + }; + useEffect(() => { + if (loaded) { + const groups = loadGroups(); + setGroups(groups); + } + }, [loaded, commonFiles, orgCtrl.user.commons]); + + const contextMenu = (file: IFile) => { + return { + items: cleanMenus(loadFileMenus(file)) || [], + onClick: ({ key }: { key: string }) => { + command.emitter('executor', key, file); + }, + }; + }; + // 加载常用 + const loadCommonCard = (item: IFile, index: number) => { + if (index < 3) { + return ( + +
{ + command.emitter('executor', 'open', item); + }}> + {item.cache.tags?.includes('常用') ? ( + + + + ) : ( + + )} +
{item.name}
+
{item.directory.target.name}
+ {/*
{item.directory.target.space.name}
*/} +
+
+ ); + } + }; + + const loadGroupItem = (title: string, data: any[], index: number) => { + if (data.length < 1) return
; + if (index > 2) return
; + return ( +
+
+ {title} +
+
+ } size={2}> + { + setGroups((pre: any) => { + const data = pre[e.fromData].splice(e.fromIndex, 1); + data.forEach((item: any) => { + item.common.groupName = e.toData; + if (item.common.groupName === '其它') { + delete item.common.groupName; + } + pre[e.toData].push(item); + }); + return { ...pre }; + }); + }}> + {data.map((subapp, index) => { + return loadCommonCard(subapp.file, index); + })} + + +
+
+ ); + }; + return ( + <> +
+ 常用 + setEditMode((pre) => !pre)}> +
+ +
+ 编辑分组 +
+
+ +
+
+ {Object.keys(groups).map((groupName, index) => { + return loadGroupItem(groupName, groups[groupName], index); + })} +
+
+
+ {editMode && ( + { + orgCtrl.user.updateCommons(commons); + setEditMode(false); + }} + /> + )} + + ); + }; + // 渲染全部应用 + const RendelastInfo: React.FC = () => { + const [editMode, setEditMode] = useState(false); + const [appData, setappData] = useState([]); + const [loaded, setLoaded] = useState(false); + const [groupsData, setGroupsData] = useState([]); + useEffect(() => { + orgCtrl.loadApplications().then((res) => { + setappData(res); + changeGroups(res); + setLoaded(true); + }); + }, []); + const changeGroups = (res: IApplication[]) => { + let result = res.reduce((acc: any, item) => { + let key = item.belong.name; + if (!acc[key]) { + acc[key] = []; + } + let targetKey = item.directory.target.name; + if (!acc[key][targetKey]) { + acc[key][targetKey] = []; + } + acc[key][targetKey].push(item); + return acc; + }, {}); + setGroupsData(result); + }; + const contextMenu = (file: IFile) => { + return { + items: cleanMenus(loadFileMenus(file)) || [], + onClick: ({ key }: { key: string }) => { + command.emitter('executor', key, file); + }, + }; + }; + // 加载前8个应用 + const loadCommonCard = (item: IFile) => ( + +
{ + command.emitter('executor', 'open', item); + }}> + +
{item.name}
+
+
+ ); + // 根据三级分类显示全部应用 + const loadAllGruopCard = () => { + let data: any = groupsData; + const items = []; + for (const key in data) { + items.push( +
+
{key}
+ {data[key] && + Object.keys(data[key]).map((subKey) => { + return ( +
+
{subKey}
+
+ {data[key][subKey].map((item: any) => { + return ( + +
{ + command.emitter('executor', 'open', item); + }}> + +
{item.name}
+
+
+ ); + })} +
+
+ ); + })} +
, + ); + } + return items; + }; + + return ( + <> +
+ 最近应用 + setEditMode((pre) => !pre)}> +
+ +
+ 全部应用 +
+
+ +
+
+ {appData.slice(-8).map((app) => { + return loadCommonCard(app); + })} +
+
+
+ {editMode && ( + setEditMode((pre) => !pre)}> +
{loadAllGruopCard()}
+
+ )} + + ); + }; + // 日历组件 + const calendarItem = () => { + return ( +
+
+ 日历 + {/* + + */} +
+ +
+ ); + }; + // 操作组件 + const RenderOperate = () => { + // 发送快捷命令 + const renderCmdBtn = (cmd: string, title: string) => { + return ( + + ); + }; + return ( + <> +
+ 快捷操作 + history.push('relation')}> + 更多操作 + +
+
+ } size={6}> + {renderCmdBtn('joinFriend', '添加好友')} + {renderCmdBtn('joinStorage', '申请存储')} + {renderCmdBtn('newCohort', '创建群聊')} + {renderCmdBtn('joinCohort', '加入群聊')} + {renderCmdBtn('newCompany', '设立单位')} + {renderCmdBtn('joinCompany', '加入单位')} + +
+ + ); + }; + return ( +
+
+
+ +
+
+
+
+ +
+
+
+
history.push('chat')}> + +
+
history.push('work')}> + +
+
+
+
+ +
+
+
+
history.push('store')}> + +
+
+
{calendarItem()}
+
+ ); +}; + +export default WorkBench; diff --git a/src/pages/Home/components/NavigationBar/index.tsx b/src/pages/Home/components/NavigationBar/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..1482505ade80299567484fda54ea754be0d0e95e --- /dev/null +++ b/src/pages/Home/components/NavigationBar/index.tsx @@ -0,0 +1,189 @@ +import React, { useEffect, useState } from 'react'; + +import BasicTitle from '@/pages/Home/components/BaseTitle'; +import { command } from '@/ts/base'; +import orgCtrl from '@/ts/controller'; +import { IPageTemplate } from '@/ts/core/thing/standard/page'; +import { EllipsisOutlined, MinusCircleFilled, PlusCircleFilled } from '@ant-design/icons'; +import { Badge, Button, Row, Typography, message } from 'antd'; +import { NavigationItem } from '../..'; +import { ViewerHost } from '@/executor/open/page/view/ViewerHost'; +import ViewerManager from '@/executor/open/page/view/ViewerManager'; +import { getResouces } from '@/config/location'; +import { generateUuid } from '@/utils/excel'; +const resource = getResouces(); + +export const allPages: NavigationItem[] = [ + { + key: 'workbench', + label: '工作台', + type: 'inner', + backgroundImageUrl: `/img/${resource.location}/banner/workbench.png`, + component: React.lazy(() => import('../Content/WorkBench')), + }, + { + key: 'activity', + label: '群动态', + type: 'inner', + backgroundImageUrl: `/img/${resource.location}/banner/groupactivity.png`, + component: React.lazy(() => import('../Content/Activity/cohort')), + }, + { + key: 'circle', + label: '好友圈', + type: 'inner', + backgroundImageUrl: `/img/${resource.location}/banner/friendactivity.png`, + component: React.lazy(() => import('../Content/Activity/friends')), + }, +]; + +const NavigationBar: React.FC<{ + list: NavigationItem[]; + onChange: (item: NavigationItem) => void; +}> = ({ list, onChange }) => { + const [current, setCurrent] = useState(0); + const [more, setMore] = useState(false); + const [pages, setPages] = useState([]); + const mapping = (item: IPageTemplate) => { + const navigation: NavigationItem = { + key: generateUuid(), + label: item.name, + backgroundImageUrl: '', + type: 'page', + component: , + }; + return navigation; + }; + useEffect(() => { + const id = command.subscribeByFlag('pages', async () => { + setPages(await orgCtrl.loadPages()); + }); + return () => { + command.unsubscribeByFlag(id); + }; + }, []); + const regularNavigation = ( + <> +
+ {[ + ...list, + ...pages.filter((item) => item.cache.tags?.includes('常用')).map(mapping), + ].map((item, index) => { + return ( +
{ + setCurrent(index); + onChange(item); + }}> + {item.label} +
+ ); + })} +
+ { + setMore(true); + }} + className="navigationBar-more" + /> + + ); + + const configNavigation = ( + <> +
+
+ + +
+
+ 常用页面 + + {pages + .filter((item) => item.cache.tags?.includes('常用')) + .map((item, index) => { + return ( + { + removeRegularNavigationItem(item); + }} + style={{ color: 'red' }} + /> + } + key={index}> +
+
{item.name}
+
{item.title}
+
+
+ ); + })} +
+
+
+ 全部页面 + + {pages.map((item, index) => { + return ( + { + addRegularNavigationItem(item); + }} + style={{ color: 'blue' }} + /> + ) + } + key={index}> +
+
{item.name}
+
{item.title}
+
+
+ ); + })} +
+
+
+ + ); + + const removeRegularNavigationItem = (item: IPageTemplate) => { + item.cache.tags = item.cache.tags?.filter((i) => i != '常用'); + item.cacheUserData(true); + message.success('移除页面'); + }; + + const addRegularNavigationItem = (item: IPageTemplate) => { + item.cache.tags = item.cache.tags || []; + item.cache.tags.push('常用'); + item.cacheUserData(true); + message.success('添加页面'); + }; + + const onSave = () => { + message.success('保存成功'); + setMore(false); + }; + return ( +
+ {more ? configNavigation : regularNavigation} +
+ ); +}; + +export default NavigationBar; diff --git a/src/ts/base/model.ts b/src/ts/base/model.ts index 07ebf3d852ed167eb8dd3d7762ffb14f8496bb7a..efb983df3a6c73ec4d5c4d7fc5fc0af548fc193a 100644 --- a/src/ts/base/model.ts +++ b/src/ts/base/model.ts @@ -12,7 +12,7 @@ import { XStandard, XTarget, XThing, - XTagFilter + XTagFilter, } from './schema'; // 请求类型定义 export type ReqestType = { @@ -691,6 +691,8 @@ export type FieldModel = { name: string; /** 代码(属性代码) */ code: string; + /** 代码(原始特性代码) */ + info?: string; /** 类型(属性类型) */ valueType: string; /** 规则(特性规则) */ @@ -826,7 +828,7 @@ export type speciesListItem = { // 筛选名称 name: string; // 分类名称 - typeName: string + typeName: string; // 编码 code: string; // 值 @@ -913,7 +915,7 @@ export type speciesFilter = { // 条件文本 remark: string; // 分类数据 - speciesList: XTagFilter[] + speciesList: XTagFilter[]; }; export type MappingData = { @@ -1104,6 +1106,10 @@ export type FileItemModel = { isDirectory: boolean; /** 是否包含子目录 */ hasSubDirectories: boolean; + /** 归属id */ + belongId: string; + // /** 是否引用文件 */ + isLinkFile?: boolean; } & FileItemShare; /** 桶支持的操作 */ diff --git a/src/ts/base/schema.ts b/src/ts/base/schema.ts index 60809f16358486de9bf0362bb6ea12d8e0a82f2d..f0cb04cc7c6146aae740484fb2e628296bf08a32 100644 --- a/src/ts/base/schema.ts +++ b/src/ts/base/schema.ts @@ -752,3 +752,9 @@ export interface XPageTemplate extends XStandard { // 模板类型 kind?: string; } + +export type XFileLink = { + // 文件目录id + directoryId: string; +} & model.FileItemModel & + Xbase; diff --git a/src/ts/controller/index.ts b/src/ts/controller/index.ts index ab4c502d276df365416bdd6fd8272a6622f1a5ae..45e071e34972e2af8f9cd3d0db3794bd7959f6f1 100644 --- a/src/ts/controller/index.ts +++ b/src/ts/controller/index.ts @@ -4,6 +4,7 @@ import { IWorkProvider } from '../core/work/provider'; import { IPageTemplate } from '../core/thing/standard/page'; import { IBoxProvider } from '../core/work/box'; import { AuthProvider } from '../core/auth'; +import { uniqueArrayBy } from '@/utils'; /** 控制器基类 */ export class Controller extends common.Emitter { public currentKey: string; @@ -108,7 +109,7 @@ class IndexController extends Controller { const templates = await directory.loadAllTemplate(); pages.push(...templates.filter((item) => item.metadata.public)); } - return pages; + return uniqueArrayBy(pages, 'fromPath'); } } diff --git a/src/ts/core/public/operates.ts b/src/ts/core/public/operates.ts index 5627e1c4f767ae90a6eb381c3db9d622e3d5b17a..6d197fd61a5334ddd4451ffc64c5bd9a9e79cfcf 100644 --- a/src/ts/core/public/operates.ts +++ b/src/ts/core/public/operates.ts @@ -67,7 +67,7 @@ export const fileOperates = { sort: 20, cmd: 'download', label: '下载文件', - iconType: 'rename', + iconType: 'download', }, Copy: { sort: 21, @@ -143,7 +143,7 @@ export const directoryOperates = { sort: 1, cmd: 'newApp', label: '新建应用', - iconType: '应用', + iconType: '新建应用', }, Standard: { sort: 2, @@ -161,19 +161,19 @@ export const directoryOperates = { sort: 3, cmd: 'newSpecies', label: '新建分类', - iconType: '分类', + iconType: '新建分类', }, NewDict: { sort: 4, cmd: 'newDict', label: '新建字典', - iconType: '字典', + iconType: '新建字典', }, NewProperty: { sort: 5, cmd: 'newProperty', label: '新建属性', - iconType: '属性', + iconType: 'newProperty', }, NewWork: { sort: 6, @@ -185,13 +185,13 @@ export const directoryOperates = { sort: 7, cmd: 'newModule', label: '新建模块', - iconType: '模块', + iconType: '新建模块', }, NewForm: { sort: 8, cmd: 'newForm', label: '新建表单', - iconType: '事项配置', + iconType: '新建表单', }, NewTransferConfig: { sort: 9, @@ -203,7 +203,7 @@ export const directoryOperates = { sort: 11, cmd: 'newPageTemplate', label: '新建页面模板', - iconType: '页面模板', + iconType: '新建页面模板', }, }; @@ -293,7 +293,7 @@ export const targetOperates = { sort: 35, cmd: 'newGroup', label: '设立集群', - iconType: '组织群', + iconType: 'setCluster', }, NewDepartment: { sort: 36, @@ -317,7 +317,7 @@ export const targetOperates = { sort: 43, cmd: 'joinStorage', label: '加入存储资源群', - iconType: '存储资源', + iconType: 'joinStorage', }, Chat: { sort: 15, diff --git a/src/ts/core/thing/directory.ts b/src/ts/core/thing/directory.ts index 0a8fd813cd303d49bc2fee75359b992b2de48ec6..9796eff3c9628de828702bd0ad6b42de21cbc3d2 100644 --- a/src/ts/core/thing/directory.ts +++ b/src/ts/core/thing/directory.ts @@ -234,6 +234,16 @@ export class Directory extends StandardFileInfo implements ID return new SysFileInfo(item, this); }); } + // 查询是否包含引用文件 + const fileLinks = this.resource.fileLinkColl.cache.filter( + (i) => i.directoryId === this.id, + ); + if (Array.isArray(fileLinks) && fileLinks.length > 0) { + const linkFiles = fileLinks.map((item) => { + return new SysFileInfo(item, this); + }); + this.files.push(...linkFiles); + } } return this.files; } @@ -366,6 +376,10 @@ export class Directory extends StandardFileInfo implements ID destDirectory.id, isSameBelong, ); + await directory.loadFiles(); + for (const file of await directory.files) { + await file.copy(destDirectory); + } for (const app of await directory.standard.applications) { await app.copy(destDirectory); } diff --git a/src/ts/core/thing/resource.ts b/src/ts/core/thing/resource.ts index 17953847fb4aa1327036a718ea13d2a2d2e40397..9882929979842bb6a24adb6495b43a46a6d4053f 100644 --- a/src/ts/core/thing/resource.ts +++ b/src/ts/core/thing/resource.ts @@ -11,6 +11,7 @@ import { XPageTemplate, XStaging, XThing, + XFileLink, } from '../../base/schema'; import { BucketOpreates, ChatMessageType, Transfer } from '@/ts/base/model'; import { kernel, model } from '@/ts/base'; @@ -38,6 +39,7 @@ export class DataResource { this.templateColl = this.genTargetColl('standard-page-template'); this.stagingColl = this.genTargetColl('resource-staging'); this.thingColl = this.genTargetColl('_system-things'); + this.fileLinkColl = this.genTargetColl('resource-file-link'); } /** 表单集合 */ @@ -64,6 +66,8 @@ export class DataResource { stagingColl: XCollection; /** 实体集合 */ thingColl: XCollection; + /** 文件引用数据集合 */ + fileLinkColl: XCollection; /** 资源对应的用户信息 */ get targetMetadata() { return this.target; @@ -75,6 +79,7 @@ export class DataResource { this.directoryColl.all(reload), this.applicationColl.all(reload), this.templateColl.all(reload), + this.fileLinkColl.all(reload), ]); } this._proLoaded = true; diff --git a/src/ts/core/thing/standard/form.ts b/src/ts/core/thing/standard/form.ts index c00b038af6a947435bfcddbb6637988aa80d7709..11e1fcf6fa490c24d49c00e9011534f6fd82424e 100644 --- a/src/ts/core/thing/standard/form.ts +++ b/src/ts/core/thing/standard/form.ts @@ -154,6 +154,7 @@ export class Form extends StandardFileInfo implements IForm { widget: attr.widget, options: attr.options, code: `T${attr.propId}`, + info: attr.code, remark: attr.remark, lookups: [], valueType: attr.property!.valueType, @@ -167,6 +168,8 @@ export class Form extends StandardFileInfo implements IForm { text: i.name, value: `S${i.id}`, icon: i.icon, + info: i.info, + remark: i.remark, parentId: i.parentId, }; }); diff --git a/src/ts/core/thing/standard/page.ts b/src/ts/core/thing/standard/page.ts index e1525426fffdf7e29e242ad18bce5b682fe4c89f..0b1ee0caac2a1180fb6303ae8889b9e35425fcc0 100644 --- a/src/ts/core/thing/standard/page.ts +++ b/src/ts/core/thing/standard/page.ts @@ -3,10 +3,14 @@ import { IDirectory } from '../directory'; import { IStandardFileInfo, StandardFileInfo } from '../fileinfo'; import { ISpecies, Species } from './species'; import { IWork } from '../../work'; -import { IForm } from '../..'; +import { IForm, TargetType } from '../..'; import { Form } from './form'; export interface IPageTemplate extends IStandardFileInfo { + /** 来源名称 */ + title?: string; + /** 数据来源 */ + fromPath?: string; /** 触发器 */ command: Command; /** 关系 */ @@ -45,6 +49,26 @@ export class PageTemplate [this.directory.target.spaceId, this.directory.target.id].join('-') ); } + get title() { + const companyName = this.directory.target.user.findShareById( + this.directory.target.spaceId, + ).name; + const { name: targetName, typeName: targetTypeName } = this.directory.target; + return companyName === targetName || targetTypeName === TargetType.Group + ? `(${targetName})` + : `(${companyName}-${targetName})`; + } + get fromPath() { + return ( + this.directory.target.typeName + + '-' + + this.directory.target.id + + '-' + + this.belongId + + '-' + + this.id + ); + } async copy(destination: IDirectory): Promise { if (this.allowCopy(destination)) { return await super.copyTo(destination.id, destination.resource.templateColl); diff --git a/src/ts/core/thing/systemfile.ts b/src/ts/core/thing/systemfile.ts index 698ca75a1fca33192af3dd1031f0ad9af518323e..fb1df28ebcadd25e4f8e4a3b27f1952a62ff0559 100644 --- a/src/ts/core/thing/systemfile.ts +++ b/src/ts/core/thing/systemfile.ts @@ -1,5 +1,5 @@ import { model, schema } from '@/ts/base'; -import { encodeKey, formatSize, generateUuid } from '../../base/common'; +import { encodeKey, formatDate, formatSize, generateUuid } from '../../base/common'; import { BucketOpreates, FileItemModel, FileItemShare } from '../../base/model'; import { FileInfo, IFile, IFileInfo } from './fileinfo'; import { IDirectory } from './directory'; @@ -18,7 +18,7 @@ export const fileToEntity = ( version: directory.version, icon: JSON.stringify(data), belong: directory.belong, - belongId: directory.belongId, + belongId: data.belongId ?? directory.belongId, shareId: directory.shareId, typeName: data.contentType ?? '文件', createTime: data.dateCreated, @@ -26,8 +26,9 @@ export const fileToEntity = ( directoryId: directory.id, createUser: directory.createUser, updateUser: directory.updateUser, + isLinkFile: data.isLinkFile, remark: `${data.name}(${formatSize(data.size)})`, - }; + } as schema.XStandard; }; /** 系统文件接口 */ @@ -64,6 +65,9 @@ export class SysFileInfo extends FileInfo implements ISysFileInf } return [...gtags, '文件']; } + get belongId(): string { + return this.filedata.belongId ?? this.target.belongId; + } filedata: FileItemModel; shareInfo(): model.FileItemShare { return { @@ -92,21 +96,37 @@ export class SysFileInfo extends FileInfo implements ISysFileInf return false; } async delete(): Promise { - const res = await this.directory.resource.bucketOpreate({ - key: encodeKey(this.filedata.key), - operate: BucketOpreates.Delete, - }); - if (res.success) { - this.directory.notifyReloadFiles(); - this.directory.files = this.directory.files.filter((i) => i.key != this.key); + if (this.filedata.isLinkFile) { + return await this.linkFileDelete(); + } else { + const res = await this.directory.resource.bucketOpreate({ + key: encodeKey(this.filedata.key), + operate: BucketOpreates.Delete, + }); + if (res.success) { + this.directory.notifyReloadFiles(); + this.directory.files = this.directory.files.filter((i) => i.key != this.key); + } + return res.success; } - return res.success; + } + async linkFileDelete(): Promise { + await this.directory.resource.fileLinkColl.removeMany([ + this.filedata as schema.XFileLink, + ]); + this.directory.files = this.directory.files.filter((i) => i.key != this.key); + await this.directory.resource.fileLinkColl.all(true); + this.directory.notifyReloadFiles(); + this.directory.files = this.directory.files.filter((i) => i.key != this.key); + return true; } async hardDelete(): Promise { return await this.delete(); } async copy(destination: IDirectory): Promise { - if (destination.id != this.directory.id) { + if (destination.spaceId !== this.directory.spaceId) { + return await this.linkFileCopy(destination); + } else if (destination.id != this.directory.id) { const res = await this.directory.resource.bucketOpreate({ key: encodeKey(this.filedata.key), destination: destination.id, @@ -120,6 +140,25 @@ export class SysFileInfo extends FileInfo implements ISysFileInf } return false; } + async linkFileCopy(destination: IDirectory): Promise { + const params = { + ...this.filedata, + belongId: this.belongId, + directoryId: destination.id, + name: this.filedata.name, + typeName: this.typeName, + dateCreated: formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss.S'), + isLinkFile: true, + id: 'snowId()', + } as unknown as schema.XFileLink; + const data = await destination.resource.fileLinkColl.replace(params); + if (data) { + await destination.resource.fileLinkColl.all(true); + destination.notifyReloadFiles(); + destination.files.push(new SysFileInfo(params, destination)); + } + return true; + } async move(destination: IDirectory): Promise { if (destination.id != this.directory.id) { const res = await this.directory.resource.bucketOpreate({ diff --git a/src/ts/core/work/apply.ts b/src/ts/core/work/apply.ts index c81b98cd4b44311ffd2f007f9702bfea8668ca61..92b628ea9fb0ba3d66d68e7dde6ee505467d8303 100644 --- a/src/ts/core/work/apply.ts +++ b/src/ts/core/work/apply.ts @@ -82,9 +82,9 @@ export class WorkApply implements IWorkApply { } } } - if (isRequired && valueIsNull(data[item.id])) { - return false; - } + } + if (isRequired && valueIsNull(data[item.id])) { + return false; } } } diff --git a/src/utils/index.ts b/src/utils/index.ts index e37a0a37097f551edbcddb0cec70ed6c35b6ec2b..adcbf1b763af05196a71fe49a537f1f746d6bdc9 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -333,6 +333,24 @@ function assignment(oldObj: { [key: string]: any }, newObj: { [key: string]: any }); } +/** + * 对象数组中 根据key,进行除重 + * @param arr 数据源 + * @param key 过滤凭证 + */ +function uniqueArrayBy(arr: T[], key: keyof T): T[] { + const uniqueValues = new Set(); + const result: T[] = []; + + for (const item of arr) { + const findValue = uniqueValues.has(item[key]); + if (!findValue) { + uniqueValues.add(item[key]); + result.push(item); + } + } + return result; +} export { assignment, ellipsisText, @@ -345,5 +363,6 @@ export { isEmoji, isSpecialChar, sortObjByKeys, + uniqueArrayBy, visitTree, }; diff --git a/tsconfig.json b/tsconfig.json index f3962dfc492c43842a97754ef5206ef763e97f3a..6f0a7d583807c0d643086219262076ad73fafca3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "types": ["vite/client", "node"], "allowJs": true, "skipLibCheck": false, - "esModuleInterop": false, + "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, @@ -21,7 +21,7 @@ "paths": { "@/*": ["src/*"], "@cfg/*": ["config/*"] - } + }, }, "include": [ "src/**/*.ts", diff --git a/vite.config.ts b/vite.config.ts index d98b81c0ecbb096273de7cf5c5361ae1148cf7a9..b2edc19679b7a4046e28c1d43daad334a60d0557 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -125,6 +125,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { }, ], }, + commonjsOptions: { transformMixedEsModules: true }, // Change }, define: { // 设置应用信息