This commit is contained in:
owenchen committed 2026-09-08 13:55:01 +08:00
1 parent ef688db767
commit 3759fcc14a
8 files changed
+223 -148

No files matched your search

@@ -243,8 +243,11 @@ namespace CloudBuilder.Security.Service
IRepository<SecurityFunctionMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<SecurityFunctionMapViewEntity>>(); IRepository<SecurityFunctionMapViewEntity> repositoryMapView = repository.GetRepository<IRepository<SecurityFunctionMapViewEntity>>();
IRepository<SecurityFunctionMapEntity> repositoryMap = repository.GetRepository<IRepository<SecurityFunctionMapEntity>>(); IRepository<SecurityFunctionMapEntity> repositoryMap = repository.GetRepository<IRepository<SecurityFunctionMapEntity>>();
SecurityFunctionMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.SonFunctionName == functionName).ToArray(); SecurityFunctionMapViewEntity[] olds = repositoryMapView.Entities.Where(x => x.SonFunctionName == functionName).ToArray();
int oldOrderBy = 0;
if (olds != null && olds.Length > 0) if (olds != null && olds.Length > 0)
{ {
if (olds.Length == 1) oldOrderBy = olds[0].Orderby;
foreach (SecurityFunctionMapViewEntity old in olds) foreach (SecurityFunctionMapViewEntity old in olds)
{ {
repositoryMap.DeleteNow(new SecurityFunctionMapEntity() { FunctionNameSon = old.SonFunctionName, FunctionNameParent = old.ParentFunctionName }); repositoryMap.DeleteNow(new SecurityFunctionMapEntity() { FunctionNameSon = old.SonFunctionName, FunctionNameParent = old.ParentFunctionName });
@@ -264,7 +267,7 @@ namespace CloudBuilder.Security.Service
{ {
FunctionNameSon = functionName, FunctionNameSon = functionName,
FunctionNameParent = map.ParentFunctionName, FunctionNameParent = map.ParentFunctionName,
Orderby = oldMaps == null ? 1 : maxOrderBy + 1 Orderby = oldOrderBy > 0 ? oldOrderBy : (oldMaps == null ? 1 : maxOrderBy + 1)
}); });
} }
@@ -286,7 +289,7 @@ namespace CloudBuilder.Security.Service
if (maps == null || maps.Length == 0) return; if (maps == null || maps.Length == 0) return;
int i = 1; int i = 1;
foreach (SecurityFunctionMapViewEntity map in maps.OrderBy(x=>x.Orderby).ToArray()) foreach (SecurityFunctionMapViewEntity map in maps.OrderBy(x => x.Orderby).ToArray())
{ {
repositoryMap.InsertNow(new SecurityFunctionMapEntity() repositoryMap.InsertNow(new SecurityFunctionMapEntity()
{ {
+1 -1
View File
@@ -1 +1 @@
window._iconfont_svg_string_2184398='<svg><symbol id="icon-dgroup" viewBox="0 0 1024 1024"><path d="M42.666667 192h853.333333c46.933333 0 85.333333 38.4 85.333333 85.333333v597.333334c0 46.933333-38.4 85.333333-85.333333 85.333333H128c-46.933333 0-85.333333-38.4-85.333333-85.333333v-682.666667z" fill="#FC7748" p-id="5535"></path><path d="M128 64h384l128 128H42.666667v-42.666667c0-46.933333 38.4-85.333333 85.333333-85.333333z" fill="#FED2C3" p-id="5536"></path><path d="M405.333333 469.333333m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#FFFFFF" p-id="5537"></path><path d="M618.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#FFFFFF" p-id="5538"></path><path d="M512 725.333333c0 34.133333 46.933333 21.333333 106.666667 21.333334s106.666667 12.8 106.666666-21.333334-46.933333-106.666667-106.666666-106.666666S512 686.933333 512 725.333333zM465.066667 601.6c-17.066667-17.066667-38.4-25.6-59.733334-25.6-59.733333 0-106.666667 81.066667-106.666666 128 0 38.4 34.133333 42.666667 76.8 42.666667 12.8-46.933333 46.933333-102.4 89.6-145.066667z" fill="#FFFFFF" p-id="5539"></path></symbol><symbol id="icon-dbank" viewBox="0 0 1024 1024"><path d="M512 44.521739C865.636174 44.521739 979.478261 158.363826 979.478261 512S865.636174 979.478261 512 979.478261 44.521739 865.636174 44.521739 512 158.363826 44.521739 512 44.521739z m10.373565 311.652174c-64.77913 0-117.626435 50.621217-120.119652 113.975652a99.417043 99.417043 0 0 0-87.618783 98.214957c0 53.559652 43.097043 97.190957 96.923827 98.882782l222.163478 0.044522c53.604174-2.003478 96.434087-45.501217 96.434087-98.927304a99.372522 99.372522 0 0 0-87.663305-98.170435C640.044522 406.79513 587.241739 356.173913 522.373565 356.173913z m4.051478 110.280348c2.80487 0 5.476174 1.157565 7.435131 3.161043l44.655304 45.81287a10.373565 10.373565 0 0 1-7.479652 17.630609h-29.829565v40.381217a14.825739 14.825739 0 0 1-29.606957 0v-40.336696h-29.829565a10.373565 10.373565 0 0 1-7.43513-17.67513l44.655304-45.81287a10.373565 10.373565 0 0 1 7.43513-3.116521z" fill="#FC7068" p-id="4517"></path></symbol><symbol id="icon-source-pic" viewBox="0 0 1024 1024"><path d="M480 422.4h211.2v51.2H480zM480 505.6h211.2v51.2H480z" fill="#F16967" p-id="30292"></path><path d="M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512-230.4-512-512-512zM396.8 716.8c32-32 57.6-64 83.2-108.8l32 19.2c-25.6 44.8-51.2 83.2-83.2 115.2l-32-25.6z m211.2-6.4c0 25.6-12.8 38.4-44.8 38.4h-44.8l-6.4-32h44.8c6.4 0 19.2 0 19.2-12.8V588.8H448v-192h108.8c6.4-12.8 6.4-32 12.8-51.2H384V512c0 102.4-19.2 185.6-51.2 249.6l-25.6-25.6c25.6-51.2 38.4-128 38.4-224V307.2H768v38.4H595.2c0 19.2-6.4 32-12.8 51.2h140.8v192H608v121.6z m128 32c-19.2-32-44.8-70.4-83.2-115.2l32-19.2c38.4 38.4 64 76.8 83.2 108.8l-32 25.6z" fill="#F16967" p-id="30293"></path></symbol><symbol id="icon-mp3-play" viewBox="0 0 1024 1024"><path d="M513.024 2.048c282.112 0 510.976 228.864 510.976 510.976S795.136 1024 513.024 1024 2.048 795.136 2.048 513.024C2.048 230.912 230.912 2.048 513.024 2.048z" fill="#FE7C84" p-id="16052"></path><path d="M719.36 495.616c9.728 6.144 12.288 18.432 6.656 28.16-1.536 2.56-4.096 5.12-6.656 6.656l-281.6 176.128c-9.728 6.144-22.016 3.072-28.16-6.656-2.048-3.072-3.072-7.168-3.072-10.752V336.896c0-11.264 9.216-20.48 20.48-20.48 3.584 0 7.68 1.024 10.752 3.072l281.6 176.128z" fill="#FFFFFF" p-id="16053"></path></symbol><symbol id="icon-picture" viewBox="0 0 1024 1024"><path d="M512 0c282.768 0 512 229.232 512 512 0 282.778-229.232 512-512 512S0 794.768 0 512 229.232 0 512 0z" fill="#2EA9D3" p-id="3341"></path><path d="M149.422 339.364l523.56-140.288c16.518-4.434 33.484 5.264 37.868 21.648l103.352 385.71c4.392 16.394-5.438 33.26-21.976 37.694l-523.55 140.288c-16.528 4.434-33.484-5.264-37.868-21.648l-103.352-385.72c-4.392-16.384 5.448-33.26 21.966-37.684z m86.488-1.31h542.034c17.1 0 30.966 13.752 30.966 30.72v399.32c0 16.958-13.864 30.72-30.966 30.72H235.91c-17.112 0-30.966-13.762-30.966-30.72v-399.32c0-16.968 13.854-30.72 30.966-30.72z" fill="#2998BE" p-id="3342"></path><path d="M808.908 632.76v-46.06l-66.622-248.648H235.91c-17.112 0-30.966 13.752-30.966 30.72v297.442l25.866 96.552c4.392 16.394 21.34 26.082 37.868 21.648l523.55-140.278c6.984-1.872 12.666-6.04 16.68-11.376z" fill="#268BAE" p-id="3343"></path><path d="M159.662 318.884l523.56-140.288c16.518-4.434 33.484 5.264 37.868 21.648l103.352 385.71c4.392 16.394-5.438 33.26-21.976 37.694l-523.55 140.288c-16.528 4.434-33.484-5.264-37.868-21.648l-103.352-385.72c-4.392-16.384 5.448-33.26 21.966-37.684z" fill="#EDEDED" p-id="3344"></path><path d="M808.908 621.066v-93.072l-50.892-189.942H235.91c-17.112 0-30.966 13.752-30.966 30.72v238.736l36.106 134.768c4.392 16.394 21.34 26.082 37.868 21.648l523.55-140.278c2.294-0.604 4.424-1.514 6.44-2.58z" fill="#D5D5D5" p-id="3345"></path><path d="M202.548 349.552l458.558-122.87c12.656-3.39 25.672 4.096 29.05 16.732l85.832 320.308c3.38 12.626-4.126 25.62-16.804 29.02l-458.548 122.86c-12.656 3.4-25.672-4.096-29.062-16.732l-85.Line truncated window._iconfont_svg_string_2184398='<svg><symbol id="icon-family" viewBox="0 0 1024 1024"><path d="M1018.368 807.424c0-79.36-52.224-143.872-117.248-185.856 28.672-31.744 56.832-80.896 56.832-123.392 0-93.184-73.728-168.96-164.864-168.96-90.624 0-164.864 75.776-164.864 168.96 0 43.008 28.672 97.792 57.344 129.024-65.536 42.496-117.76 101.376-117.76 180.736 0 25.088 0.512 47.104 25.088 47.104 24.064 0 24.576-22.016 24.576-47.104 0-77.312 99.84-158.72 175.104-158.72 75.264 0 180.224 81.408 180.224 158.72 0 25.088 4.096 48.64 27.136 44.032 24.576-5.632 17.92-19.456 18.432-44.544z m-225.28-193.536c-65.024 0-117.76-54.272-117.76-120.832 0-66.56 53.248-120.832 117.76-120.832s117.76 54.272 117.76 120.832c-0.512 67.072-53.248 120.832-117.76 120.832z" fill="#FFBD80" p-id="5692"></path><path d="M61.44 747.52V276.48c0-27.648 22.016-49.664 48.64-49.664h623.616c26.624 0 48.64 22.528 48.64 49.664v28.16h55.808V276.48c0-59.392-47.104-107.52-104.448-107.52H110.08C52.224 168.96 5.632 217.088 5.632 276.48v471.04c0 59.392 47.104 107.52 104.448 107.52H527.36v-57.344H110.08c-26.624-0.512-48.64-23.04-48.64-50.176z" fill="#FFBD80" p-id="5693"></path><path d="M477.184 264.192H177.152c-39.424 0-71.168 32.768-71.168 73.216v308.224c0 40.448 31.744 73.216 71.168 73.216h300.032c39.424 0 71.168-32.768 71.168-73.216V337.408c0-40.448-31.744-73.216-71.168-73.216zM142.848 358.912c0-33.792 26.624-55.808 59.392-55.808h50.688v212.992H142.848V358.912z m59.392 321.536c-32.768 0-59.392-22.528-59.392-55.808v-92.672 17.92h110.08v130.56h35.328V302.592h61.44v377.856H202.24zM511.488 624.64c0 33.792-26.624 55.808-59.392 55.808h-66.56v-220.16h125.44v-34.304H385.536v-122.88h66.56c32.768 0 59.392 22.528 59.392 55.808V624.64z" fill="#FFBD80" p-id="5694"></path></symbol><symbol id="icon-dgroup" viewBox="0 0 1024 1024"><path d="M42.666667 192h853.333333c46.933333 0 85.333333 38.4 85.333333 85.333333v597.333334c0 46.933333-38.4 85.333333-85.333333 85.333333H128c-46.933333 0-85.333333-38.4-85.333333-85.333333v-682.666667z" fill="#FC7748" p-id="5535"></path><path d="M128 64h384l128 128H42.666667v-42.666667c0-46.933333 38.4-85.333333 85.333333-85.333333z" fill="#FED2C3" p-id="5536"></path><path d="M405.333333 469.333333m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#FFFFFF" p-id="5537"></path><path d="M618.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#FFFFFF" p-id="5538"></path><path d="M512 725.333333c0 34.133333 46.933333 21.333333 106.666667 21.333334s106.666667 12.8 106.666666-21.333334-46.933333-106.666667-106.666666-106.666666S512 686.933333 512 725.333333zM465.066667 601.6c-17.066667-17.066667-38.4-25.6-59.733334-25.6-59.733333 0-106.666667 81.066667-106.666666 128 0 38.4 34.133333 42.666667 76.8 42.666667 12.8-46.933333 46.933333-102.4 89.6-145.066667z" fill="#FFFFFF" p-id="5539"></path></symbol><symbol id="icon-dbank" viewBox="0 0 1024 1024"><path d="M512 44.521739C865.636174 44.521739 979.478261 158.363826 979.478261 512S865.636174 979.478261 512 979.478261 44.521739 865.636174 44.521739 512 158.363826 44.521739 512 44.521739z m10.373565 311.652174c-64.77913 0-117.626435 50.621217-120.119652 113.975652a99.417043 99.417043 0 0 0-87.618783 98.214957c0 53.559652 43.097043 97.190957 96.923827 98.882782l222.163478 0.044522c53.604174-2.003478 96.434087-45.501217 96.434087-98.927304a99.372522 99.372522 0 0 0-87.663305-98.170435C640.044522 406.79513 587.241739 356.173913 522.373565 356.173913z m4.051478 110.280348c2.80487 0 5.476174 1.157565 7.435131 3.161043l44.655304 45.81287a10.373565 10.373565 0 0 1-7.479652 17.630609h-29.829565v40.381217a14.825739 14.825739 0 0 1-29.606957 0v-40.336696h-29.829565a10.373565 10.373565 0 0 1-7.43513-17.67513l44.655304-45.81287a10.373565 10.373565 0 0 1 7.43513-3.116521z" fill="#FC7068" p-id="4517"></path></symbol><symbol id="icon-source-pic" viewBox="0 0 1024 1024"><path d="M480 422.4h211.2v51.2H480zM480 505.6h211.2v51.2H480z" fill="#F16967" p-id="30292"></path><path d="M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512-230.4-512-512-512zM396.8 716.8c32-32 57.6-64 83.2-108.8l32 19.2c-25.6 44.8-51.2 83.2-83.2 115.2l-32-25.6z m211.2-6.4c0 25.6-12.8 38.4-44.8 38.4h-44.8l-6.4-32h44.8c6.4 0 19.2 0 19.2-12.8V588.8H448v-192h108.8c6.4-12.8 6.4-32 12.8-51.2H384V512c0 102.4-19.2 185.6-51.2 249.6l-25.6-25.6c25.6-51.2 38.4-128 38.4-224V307.2H768v38.4H595.2c0 19.2-6.4 32-12.8 51.2h140.8v192H608v121.6z m128 32c-19.2-32-44.8-70.4-83.2-115.2l32-19.2c38.4 38.4 64 76.8 83.2 108.8l-32 25.6z" fill="#F16967" p-id="30293"></path></symbol><symbol id="icon-mp3-play" viewBox="0 0 1024 1024"><path d="M513.024 2.048c282.112 0 510.976 228.864 510.976 510.976S795.136 1024 513.024 1024 2.048 795.136 2.048 513.024C2.048 230.912 230.912 2.048 513.024 2.048z" fill="#FE7C84" p-id="16052"></path><path d="M719.36 495.616c9.728 6.144 12.288 18.432 6.656 28.16-1.536 2.56-4.096 5.12-6.656 6.656l-281.6 176.128c-9.728 6.144-22.016 3.072-28.16-6.656-2.048-3.072-3.072-7.168-3.072-10.752V336.896c0-11.264 9.216-20.48 20.48-20.48 3.584 Line truncated
@@ -3,7 +3,7 @@
<div class="operator-group main-actions"> <div class="operator-group main-actions">
<a-tooltip title="新增文件夹"> <a-tooltip title="新增文件夹">
<a-button type="primary" v-if="canCreate" :icon="h(FolderAddOutlined)" <a-button type="primary" v-if="canCreate" :icon="h(FolderAddOutlined)"
@click="$emit('create-folder')">新增文件夹</a-button> @click="$emit('create-folder')">新增</a-button>
</a-tooltip> </a-tooltip>
<a-tooltip title="上传文件"> <a-tooltip title="上传文件">
<a-button type="primary" v-if="canCreate" :icon="h(UploadOutlined)" @click="triggerUpload">上传</a-button> <a-button type="primary" v-if="canCreate" :icon="h(UploadOutlined)" @click="triggerUpload">上传</a-button>
@@ -1,13 +1,13 @@
<template> <template>
<div class="operator-station" v-if="!isDirectoryTop"> <div class="operator-station">
<div class="operator-group main-actions"> <div class="operator-group main-actions" v-if="!isDirectoryTop">
<a-tooltip title="新增文件夹"> <a-tooltip title="新增文件夹">
<a-button <a-button
type="primary" type="primary"
v-if="canCreate" v-if="canCreate"
:icon="h(FolderAddOutlined)" :icon="h(FolderAddOutlined)"
@click="$emit('create-folder')" @click="$emit('create-folder')"
>新增文件夹</a-button >新增</a-button
> >
</a-tooltip> </a-tooltip>
</div> </div>
+36 -31
View File
@@ -101,15 +101,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import { reactive, onMounted, onUnmounted, ref, unref, h, provide } from "vue";
reactive,
onMounted,
onUnmounted,
ref,
unref,
h,
provide,
} from "vue";
import { BindOption } from "@/data/custom/bindOption"; import { BindOption } from "@/data/custom/bindOption";
import { SelectOption } from "@/data/auto/selectOption"; import { SelectOption } from "@/data/auto/selectOption";
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData"; import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
@@ -245,9 +237,8 @@ const shareEnquiry = ref<ShareEnquiry | null>(null);
const sound = ref(); const sound = ref();
const toUploadView = ( const toUploadView = (r: Record<string, any>): DmsFileUploadViewDisplayData =>
r: Record<string, any>, r as DmsFileUploadViewDisplayData;
): DmsFileUploadViewDisplayData => r as DmsFileUploadViewDisplayData;
onUnmounted(() => { onUnmounted(() => {
sound.value?.stop(); sound.value?.stop();
@@ -340,9 +331,7 @@ onMounted(async () => {
await initBindOption(); await initBindOption();
pathStack.value = [ pathStack.value = [{ value: rootPath.value, displayName: "我的云盘" }];
{ value: rootPath.value, displayName: "我的云盘" },
];
onSearchByFilePath(rootPath.value); onSearchByFilePath(rootPath.value);
}); });
@@ -421,11 +410,15 @@ const uploadChunk = async (
} }
}; };
const CHUNK_SIZE = 1024 * 1024; const CHUNK_SIZE = 100 * 1024 * 1024;
const splitFile = (file: any) => { const splitFile = (file: any) => {
const chunks: Blob[] = []; const chunks: Blob[] = [];
if (!file || typeof file.size !== "number" || typeof file.slice !== "function") { if (
!file ||
typeof file.size !== "number" ||
typeof file.slice !== "function"
) {
return chunks; return chunks;
} }
let start = 0; let start = 0;
@@ -489,10 +482,7 @@ const onVideoPlay = async (fid: number) => {
}); });
}; };
const onPreviewFile = async ( const onPreviewFile = async (usernameOrRecord: any, orderKey?: string) => {
usernameOrRecord: any,
orderKey?: string,
) => {
let username: string; let username: string;
let fname: string; let fname: string;
if (typeof usernameOrRecord === "object") { if (typeof usernameOrRecord === "object") {
@@ -506,10 +496,7 @@ const onPreviewFile = async (
getPreviewFile(username, fname); getPreviewFile(username, fname);
}; };
const onPreviewOrgFile = async ( const onPreviewOrgFile = async (usernameOrRecord: any, orderKey?: string) => {
usernameOrRecord: any,
orderKey?: string,
) => {
let fileId: number; let fileId: number;
let orgFileName: string; let orgFileName: string;
if (typeof usernameOrRecord === "object") { if (typeof usernameOrRecord === "object") {
@@ -1128,11 +1115,20 @@ const onShareSelected = (items: DmsFileUploadViewDisplayData[]) => {
const onPublishSelected = (items: DmsFileUploadViewDisplayData[]) => { const onPublishSelected = (items: DmsFileUploadViewDisplayData[]) => {
if (items.length === 0) return; if (items.length === 0) return;
const first = items[0]; const first = items[0];
if (fileTypePolicy.isImage(first.OrderKey) || fileTypePolicy.isImage(first.OrgFileName)) { if (
fileTypePolicy.isImage(first.OrderKey) ||
fileTypePolicy.isImage(first.OrgFileName)
) {
onPublishPhoto(); onPublishPhoto();
} else if (fileTypePolicy.isVideo(first.OrderKey) || fileTypePolicy.isVideo(first.OrgFileName)) { } else if (
fileTypePolicy.isVideo(first.OrderKey) ||
fileTypePolicy.isVideo(first.OrgFileName)
) {
onPublishVideo(); onPublishVideo();
} else if (fileTypePolicy.isAudio(first.OrderKey) || fileTypePolicy.isAudio(first.OrgFileName)) { } else if (
fileTypePolicy.isAudio(first.OrderKey) ||
fileTypePolicy.isAudio(first.OrgFileName)
) {
onPublishAudio(); onPublishAudio();
} }
}; };
@@ -1140,11 +1136,20 @@ const onPublishSelected = (items: DmsFileUploadViewDisplayData[]) => {
const onViewPreviewSelected = (items: DmsFileUploadViewDisplayData[]) => { const onViewPreviewSelected = (items: DmsFileUploadViewDisplayData[]) => {
if (items.length === 0) return; if (items.length === 0) return;
const first = items[0]; const first = items[0];
if (fileTypePolicy.isImage(first.OrderKey) || fileTypePolicy.isImage(first.OrgFileName)) { if (
fileTypePolicy.isImage(first.OrderKey) ||
fileTypePolicy.isImage(first.OrgFileName)
) {
onViewPreviewPhoto(first.FilePath); onViewPreviewPhoto(first.FilePath);
} else if (fileTypePolicy.isVideo(first.OrderKey) || fileTypePolicy.isVideo(first.OrgFileName)) { } else if (
fileTypePolicy.isVideo(first.OrderKey) ||
fileTypePolicy.isVideo(first.OrgFileName)
) {
onViewPreviewVideo(first.FilePath); onViewPreviewVideo(first.FilePath);
} else if (fileTypePolicy.isAudio(first.OrderKey) || fileTypePolicy.isAudio(first.OrgFileName)) { } else if (
fileTypePolicy.isAudio(first.OrderKey) ||
fileTypePolicy.isAudio(first.OrgFileName)
) {
onViewPreviewAudio(first.FilePath); onViewPreviewAudio(first.FilePath);
} }
}; };
@@ -84,21 +84,13 @@ const columns = ref([
hidden: 'N' hidden: 'N'
}, },
{ {
title: "顶级目录", title: "共享路径",
dataIndex: FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME, dataIndex: FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME,
sorter: false, sorter: false,
width: '80px', width: '80px',
sequence: 2, sequence: 2,
hidden: 'N' hidden: 'N'
}, },
{
title: "目录",
dataIndex: FamilyFolderFavoriteViewEntity.FOLDER_LOCAL_NAME,
sorter: false,
width: '80px',
sequence: 3,
hidden: 'N'
},
{ {
title: "目录描述", title: "目录描述",
dataIndex: FamilyFolderFavoriteViewEntity.NOTICE, dataIndex: FamilyFolderFavoriteViewEntity.NOTICE,
+175 -100
View File
@@ -1,12 +1,26 @@
<template> <template>
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination" :scrollx="400" <search
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType" @on-submit="onSubmit"
@on-select-change="onSelectChange"> @on-print="onPrint"
<template #control> @on-reset="onReset"
@use-pagination="onPagination"
</template> :scrollx="400"
:is-modal="isModal"
:loading="loading"
:pagination="result"
:rowSelectionType="selectionType"
@on-select-change="onSelectChange"
>
<template #control> </template>
<template #bodyCell="{ column, record, index }"> <template #bodyCell="{ column, record, index }">
<template
v-if="
column.dataIndex ===
FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME
"
>
<FolderOutlined /> {{ record.TopFolderLocalName +(record.TopFolderLocalName!=record.FolderLocalName?(' > '+record.FolderLocalName):'') }}
</template>
</template> </template>
<template #footer> <template #footer>
<div v-if="!isModal" class="page-footer"> <div v-if="!isModal" class="page-footer">
@@ -14,9 +28,20 @@
<a-col :lg="24" :sm="24"> <a-col :lg="24" :sm="24">
<a-row v-if="!isEdit" :gutter="[16, 8]"> <a-row v-if="!isEdit" :gutter="[16, 8]">
<a-space> <a-space>
<a-popconfirm title="确定是否删除这些记录?" ok-text="是" cancel-text="否" @confirm="onDelete"> <a-popconfirm
<a-button type="primary" danger :icon="h(DeleteOutlined)" v-if="canDelete" title="确定是否删除这些记录?"
:disabled="!(keys && keys.length > 0)">删除</a-button> ok-text="是"
cancel-text="否"
@confirm="onDelete"
>
<a-button
type="primary"
danger
:icon="h(DeleteOutlined)"
v-if="canDelete"
:disabled="!(keys && keys.length > 0)"
>删除</a-button
>
</a-popconfirm> </a-popconfirm>
</a-space> </a-space>
</a-row> </a-row>
@@ -27,33 +52,57 @@
</search> </search>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue"; import {
reactive,
inject,
defineComponent,
onMounted,
ref,
unref,
provide,
h,
} from "vue";
import { BindOption } from "@/data/custom/bindOption"; import { BindOption } from "@/data/custom/bindOption";
import { SelectOption } from "@/data/auto/selectOption"; import { SelectOption } from "@/data/auto/selectOption";
import search from "@/components/basic/Search.vue"; import search from "@/components/basic/Search.vue";
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue"; import {
DeleteOutlined,
FolderOutlined,
EditOutlined,
FileAddOutlined,
FileTextOutlined,
} from "@ant-design/icons-vue";
import { FamilyGroupResultData } from "@/data/auto/familyGroupResultData"; import { FamilyGroupResultData } from "@/data/auto/familyGroupResultData";
import { FamilyFolderFavoriteViewEntity } from "@/data/auto/familyFolderFavoriteViewEntity"; import { FamilyFolderFavoriteViewEntity } from "@/data/auto/familyFolderFavoriteViewEntity";
import { FamilyFolderFavoriteEntity } from "@/data/auto/familyFolderFavoriteEntity"; import { FamilyFolderFavoriteEntity } from "@/data/auto/familyFolderFavoriteEntity";
import { FamilyGroupFolderEntity } from "@/data/auto/familyGroupFolderEntity"; import { FamilyGroupFolderEntity } from "@/data/auto/familyGroupFolderEntity";
import { SearchFilter } from "@/data/auto/searchFilter" import { SearchFilter } from "@/data/auto/searchFilter";
import dmsFileService from "@/service/master/dmsFileService"; import dmsFileService from "@/service/master/dmsFileService";
import familyGroupService from "@/service/master/familyGroupService"; import familyGroupService from "@/service/master/familyGroupService";
import { FamilyGroupManagerUserSearchCriteria } from "@/data/auto/familyGroupManagerUserSearchCriteria"; import { FamilyGroupManagerUserSearchCriteria } from "@/data/auto/familyGroupManagerUserSearchCriteria";
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData"; import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext" import {
PermissionContext,
usePermissionContext,
} from "@/hooks/PermissionContext";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useBindOption } from "@/hooks/useBindOption"; import { useBindOption } from "@/hooks/useBindOption";
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy" import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy";
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy" import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
import { GridColumnInfo } from "@/data/auto/gridColumnInfo" import { GridColumnInfo } from "@/data/auto/gridColumnInfo";
import { useGridColumnInfo } from "@/hooks/gridColumnInfo" import { useGridColumnInfo } from "@/hooks/gridColumnInfo";
import { title } from "process"; import { title } from "process";
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections"; import {
enquiryMethodKey,
searchCriteriaManagerKey,
masterOperationToEnquiryMethodKey,
MasterOperationToEnquiryModelOption,
layoutProviderMethodKey,
} from "@/injections";
import { useOrderedChildren } from "@/hooks/use-ordered-children"; import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections"; import { SearchCriteriaContext } from "@/injections";
//page from----------------------------------------------------------------------------------------------------------------------------------- //page from-----------------------------------------------------------------------------------------------------------------------------------
@@ -66,7 +115,7 @@ const isModal = ref(inject("isModalShare", false) as boolean);
//初始化查询条件的值 //初始化查询条件的值
const initBindOptions = ref(inject("initBindOptionsShare", []) as BindOption[]); const initBindOptions = ref(inject("initBindOptionsShare", []) as BindOption[]);
//记录单选还是多选 //记录单选还是多选
const selectionType = ref(inject("selectionTypeShare", 'checkbox') as string); const selectionType = ref(inject("selectionTypeShare", "checkbox") as string);
//================inject================ //================inject================
@@ -81,57 +130,47 @@ const router = useRouter();
const columns = ref([ const columns = ref([
{ {
title: '序号', title: "序号",
dataIndex: 'index', dataIndex: "index",
width: '3%', width: "3%",
align: 'center', align: "center",
fixed: 'left', fixed: "left",
sequence: 0, sequence: 0,
hidden: 'N', hidden: "N",
format: '' format: "",
}, },
{ {
title: "群组", title: "群组",
dataIndex: FamilyFolderFavoriteViewEntity.FAMILY_LOCAL_NAME, dataIndex: FamilyFolderFavoriteViewEntity.FAMILY_LOCAL_NAME,
sorter: false, sorter: false,
width: '10%', width: "10%",
sequence: 1, sequence: 1,
hidden: 'N' hidden: "N",
}, },
{ {
title: "顶级目录", title: "共享路径",
dataIndex: FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME, dataIndex: FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME,
sorter: false, sorter: false,
width: '10%', width: "10%",
sequence: 2, sequence: 2,
hidden: 'N' hidden: "N",
},
{
title: "目录",
dataIndex: FamilyFolderFavoriteViewEntity.FOLDER_LOCAL_NAME,
sorter: false,
width: '10%',
sequence: 3,
hidden: 'N'
}, },
{ {
title: "目录描述", title: "目录描述",
dataIndex: FamilyFolderFavoriteViewEntity.NOTICE, dataIndex: FamilyFolderFavoriteViewEntity.NOTICE,
sorter: false, sorter: false,
width: '30%', width: "30%",
sequence: 4, sequence: 4,
hidden: 'N' hidden: "N",
}, },
]); ]);
const viewOption = { const viewOption = {
Value: 'default', Value: "default",
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }], SelectOptions: [{ BindValue: "default", DisplayName: "默认" }],
Columns: [{ BindValue: 'default', BindColumn: columns }] Columns: [{ BindValue: "default", BindColumn: columns }],
}; };
const bindOptions = ref<BindOption[]>([]); const bindOptions = ref<BindOption[]>([]);
const datas = ref<FamilyFolderFavoriteViewEntity[]>([]); const datas = ref<FamilyFolderFavoriteViewEntity[]>([]);
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 }); const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
@@ -140,7 +179,9 @@ const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
const data = ref<FamilyGroupResultData>(new FamilyGroupResultData()); const data = ref<FamilyGroupResultData>(new FamilyGroupResultData());
const currentFilter = ref<SearchFilter[]>([]); const currentFilter = ref<SearchFilter[]>([]);
const isSearched = ref<boolean>(false); const isSearched = ref<boolean>(false);
const currentSearchCriteria = ref<FamilyGroupManagerUserSearchCriteria>(new FamilyGroupManagerUserSearchCriteria()); const currentSearchCriteria = ref<FamilyGroupManagerUserSearchCriteria>(
new FamilyGroupManagerUserSearchCriteria(),
);
const keys = ref<FamilyFolderFavoriteViewEntity[]>([]); const keys = ref<FamilyFolderFavoriteViewEntity[]>([]);
@@ -152,10 +193,24 @@ const {
//================provide================ //================provide================
//初始化查询条件UI(search) //初始化查询条件UI(search)
provide(enquiryMethodKey, { provide(enquiryMethodKey, {
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; }, getLayoutSetting: () => {
getBindOptions: () => { return unref(bindOptions); }, return {
getViewOption: () => { return unref(viewOption); }, controlLeft: 16,
getDatas: () => { return datas; }, controlRight: 8,
space: true,
soltLeft: 24,
soltRight: 24,
};
},
getBindOptions: () => {
return unref(bindOptions);
},
getViewOption: () => {
return unref(viewOption);
},
getDatas: () => {
return datas;
},
}); });
provide( provide(
@@ -164,7 +219,7 @@ provide(
items, items,
addItem, addItem,
removeItem, removeItem,
}) }),
); );
//================provide================ //================provide================
@@ -172,7 +227,7 @@ provide(
defineExpose({ defineExpose({
keys, keys,
initBindOptions, initBindOptions,
}) });
onMounted(() => { onMounted(() => {
let pContext: PermissionContext = usePermissionContext(); let pContext: PermissionContext = usePermissionContext();
@@ -182,16 +237,16 @@ onMounted(() => {
canCreate.value = pContext.canCreate(route.meta.permission as string); canCreate.value = pContext.canCreate(route.meta.permission as string);
initBindOption(); initBindOption();
onSubmit(items.value[0].getFilter()); onSubmit(items.value[0].getFilter());
}) });
const onSelectChange = ((selected: FamilyFolderFavoriteViewEntity[]) => { const onSelectChange = (selected: FamilyFolderFavoriteViewEntity[]) => {
keys.value = selected; keys.value = selected;
}) };
const onDelete = (async () => { const onDelete = async () => {
let fgfs: FamilyFolderFavoriteEntity[] = []; let fgfs: FamilyFolderFavoriteEntity[] = [];
let fgf: FamilyFolderFavoriteEntity; let fgf: FamilyFolderFavoriteEntity;
keys.value.forEach(element => { keys.value.forEach((element) => {
fgf = new FamilyFolderFavoriteEntity(); fgf = new FamilyFolderFavoriteEntity();
fgf.UserName = element.UserName; fgf.UserName = element.UserName;
fgf.FolderName = element.FolderName; fgf.FolderName = element.FolderName;
@@ -200,55 +255,75 @@ const onDelete = (async () => {
await familyGroupService.DeleteFamilyFolderFavorites(fgfs).then(() => { await familyGroupService.DeleteFamilyFolderFavorites(fgfs).then(() => {
notification.info({ notification.info({
message: '系统提示:', message: "系统提示:",
description: '记录删除成功', description: "记录删除成功",
placement: "topRight", placement: "topRight",
}); });
onReload(); onReload();
}); });
};
}) const onReset = () => {
const onReset = (() => {
keys.value = []; keys.value = [];
result.value.Total = 0; result.value.Total = 0;
}) };
const setBindOptionValue = (
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => { bindValue: string,
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0]; value: string,
value1: string,
values: string[],
disabled: boolean,
) => {
let bindOption: BindOption = bindOptions.value.filter(
(x) => x.BindValue == bindValue,
)[0];
if (!bindOption) return; if (!bindOption) return;
bindOption.Value = value; bindOption.Value = value;
bindOption.Value1 = value1; bindOption.Value1 = value1;
bindOption.Values = values; bindOption.Values = values;
bindOption.disabled = disabled; bindOption.disabled = disabled;
}) };
//初始化查询条件 //初始化查询条件
const initBindOption = (async () => { const initBindOption = async () => {
let ubo = useBindOption(); let ubo = useBindOption();
let bindOption: BindOption = ubo.getBindOption(FamilyFolderFavoriteViewEntity.DB_FAMILY_LOCAL_NAME, '群组名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CN_CONTAIN); let bindOption: BindOption = ubo.getBindOption(
FamilyFolderFavoriteViewEntity.DB_FAMILY_LOCAL_NAME,
"群组名称",
SearchFilterTypePolicy.TEXT,
SearchFilterOperatorPolicy.CN_CONTAIN,
);
bindOptions.value.push(bindOption); bindOptions.value.push(bindOption);
bindOption = ubo.getBindOption(FamilyFolderFavoriteViewEntity.DB_FOLDER_LOCAL_NAME, '目录名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CN_CONTAIN); bindOption = ubo.getBindOption(
FamilyFolderFavoriteViewEntity.DB_FOLDER_LOCAL_NAME,
"目录名称",
SearchFilterTypePolicy.TEXT,
SearchFilterOperatorPolicy.CN_CONTAIN,
);
bindOption.lg = 10; bindOption.lg = 10;
bindOptions.value.push(bindOption); bindOptions.value.push(bindOption);
initBindOptions.value.forEach(element => { initBindOptions.value.forEach((element) => {
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled); setBindOptionValue(
element.BindValue,
element.Value,
element.Value1,
element.Values,
element.disabled,
);
}); });
}) };
//table from----------------------------------------------------------------------------------------------------------------------------------- //table from-----------------------------------------------------------------------------------------------------------------------------------
result.value.Page = pagingParams.value.page ?? 1; result.value.Page = pagingParams.value.page ?? 1;
result.value.Limit = pagingParams.value.pageSize; result.value.Limit = pagingParams.value.pageSize;
const onSubmit = (async (filters: SearchFilter[]) => { const onSubmit = async (filters: SearchFilter[]) => {
let c: FamilyGroupManagerUserSearchCriteria =
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria(); new FamilyGroupManagerUserSearchCriteria();
currentFilter.value = filters; currentFilter.value = filters;
isSearched.value = true; isSearched.value = true;
c.Filter = filters; c.Filter = filters;
@@ -257,12 +332,12 @@ const onSubmit = (async (filters: SearchFilter[]) => {
c.GridColumns = []; c.GridColumns = [];
currentSearchCriteria.value = c; currentSearchCriteria.value = c;
await findBySearchCriteria(c); await findBySearchCriteria(c);
}) };
const onPrint = (async () => { const onPrint = async () => {
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria(); let c: FamilyGroupManagerUserSearchCriteria =
if (currentFilter.value.length > 0) new FamilyGroupManagerUserSearchCriteria();
c.Filter = currentFilter.value; if (currentFilter.value.length > 0) c.Filter = currentFilter.value;
else c.Filter = []; else c.Filter = [];
c.limit = pagingParams.value.pageSize; c.limit = pagingParams.value.pageSize;
@@ -274,12 +349,14 @@ const onPrint = (async () => {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
};
}) const findBySearchCriteria = async (
c: FamilyGroupManagerUserSearchCriteria,
const findBySearchCriteria = (async (c: FamilyGroupManagerUserSearchCriteria) => { ) => {
try { try {
data.value = await familyGroupService.FamilyFolderFavoriteBySearchCriteria(c); data.value =
await familyGroupService.FamilyFolderFavoriteBySearchCriteria(c);
result.value.Total = data.value.Total; result.value.Total = data.value.Total;
result.value.Page = data.value.Page; result.value.Page = data.value.Page;
result.value.Limit = data.value.Limit; result.value.Limit = data.value.Limit;
@@ -287,30 +364,28 @@ const findBySearchCriteria = (async (c: FamilyGroupManagerUserSearchCriteria) =>
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
}) };
const onPagination = (async (params: PagingParams) => {
const onPagination = async (params: PagingParams) => {
if (!isSearched.value) return; if (!isSearched.value) return;
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria(); let c: FamilyGroupManagerUserSearchCriteria =
new FamilyGroupManagerUserSearchCriteria();
if (currentFilter.value.length > 0) if (currentFilter.value.length > 0) c.Filter = currentFilter.value;
c.Filter = currentFilter.value;
else c.Filter = []; else c.Filter = [];
c.limit = params.pageSize; c.limit = params.pageSize;
c.page = params.page ?? 1; c.page = params.page ?? 1;
if (params.sortField) if (params.sortField) c.orderby = params.sortField!;
c.orderby = params.sortField!;
if (params.sortOrder) if (params.sortOrder)
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!; c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
c.GridColumns = []; c.GridColumns = [];
currentSearchCriteria.value = c; currentSearchCriteria.value = c;
await findBySearchCriteria(c); await findBySearchCriteria(c);
}); };
const onReload = (async () => { const onReload = async () => {
await findBySearchCriteria(unref(currentSearchCriteria)); await findBySearchCriteria(unref(currentSearchCriteria));
}) };
//table end----------------------------------------------------------------------------------------------------------------------------------- //table end-----------------------------------------------------------------------------------------------------------------------------------
</script> </script>
@@ -19,7 +19,7 @@
v-if="canCreate && !isModal" v-if="canCreate && !isModal"
:icon="h(FolderAddOutlined)" :icon="h(FolderAddOutlined)"
@click.prevent="onCreate" @click.prevent="onCreate"
>新增文件夹</a-button >新增</a-button
> >
</template> </template>