文件上传功能添加,注意使用Path.Combine处理通用路径问题(windows||docker)
This commit is contained in:
1 parent
7817c5374c
commit
244b59a3fb
135 files changed
+16937
-75
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import fileTypePolicyService from "@/service/master/fileTypePolicyService";
|
||||
import { storage } from "@/store/storage";
|
||||
|
||||
export const useFileTypePolicy = () => {
|
||||
const fileTypePolicy = "x-fileTypePolicy";
|
||||
|
||||
const getSelectOption = async (blank: boolean): Promise<SelectOption[]> => {
|
||||
let selectOptions: SelectOption[] = [];
|
||||
let str = storage.get(fileTypePolicy);
|
||||
if (str === null) {
|
||||
selectOptions = await fileTypePolicyService.FindSelectOption(blank);
|
||||
storage.set(fileTypePolicy, JSON.stringify(selectOptions));
|
||||
return selectOptions;
|
||||
}
|
||||
|
||||
selectOptions = JSON.parse(str) as Array<SelectOption>;
|
||||
return selectOptions;
|
||||
};
|
||||
|
||||
const GetComposeMessage = (value: string): string => {
|
||||
let selectOptions: SelectOption[] = [];
|
||||
let str = storage.get(fileTypePolicy);
|
||||
if (str === null) {
|
||||
return '';
|
||||
}
|
||||
selectOptions = JSON.parse(str) as Array<SelectOption>;
|
||||
return selectOptions.filter((x:SelectOption) => x.BindValue === value)[0].DisplayName;
|
||||
};
|
||||
return {
|
||||
getSelectOption,
|
||||
GetComposeMessage,
|
||||
};
|
||||
};
|
||||
+1
-1
@@ -35,7 +35,7 @@ async function setupApp() {
|
||||
setupStore(app);
|
||||
// 挂载路由
|
||||
await setupRouter(app);
|
||||
// 初始化 i18n(内部会异步拉取数据库翻译补充,不阻塞挂载)
|
||||
// 初始化 i18n
|
||||
await setupI18n(app);
|
||||
|
||||
app.mount("#app");
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
|
||||
import { request,download } from "@/utils/request";
|
||||
import type { DmsFileEntity } from "@/data/auto/dmsFileEntity";
|
||||
import type { DmsFileSearchCriteria } from "@/data/auto/dmsFileSearchCriteria";
|
||||
import type { DmsFileResultData } from "@/data/auto/dmsFileResultData";
|
||||
import type { DmsFileDeleteLogEntity } from "@/data/auto/dmsFileDeleteLogEntity";
|
||||
import type { FamilyDmsFileViewEntity } from "@/data/auto/familyDmsFileViewEntity";
|
||||
import type { SelectOption } from "@/data/auto/selectOption";
|
||||
import type { DmsFolderData } from "@/data/auto/dmsFolderData";
|
||||
import type { FamilyGroupFolderEntity } from "@/data/auto/familyGroupFolderEntity";
|
||||
|
||||
class DmsFileService{
|
||||
|
||||
async FindByKey(data: number) {
|
||||
return request<DmsFileEntity>(
|
||||
{
|
||||
url: "/DmsFile/FindByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindBySearchCriteria(data: DmsFileSearchCriteria) {
|
||||
return request<DmsFileResultData>(
|
||||
{
|
||||
url: "/DmsFile/FindBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDatasBySearchCriteria(data: DmsFileSearchCriteria) {
|
||||
return request<DmsFileResultData>(
|
||||
{
|
||||
url: "/DmsFile/FindDatasBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDeleteLogBySearchCriteria(data: DmsFileSearchCriteria) {
|
||||
return request<DmsFileResultData>(
|
||||
{
|
||||
url: "/DmsFile/FindDeleteLogBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindFamilyBySearchCriteria(data: DmsFileSearchCriteria) {
|
||||
return request<DmsFileResultData>(
|
||||
{
|
||||
url: "/DmsFile/FindFamilyBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDmsFileDeleteLogByKey(data: number) {
|
||||
return request<DmsFileDeleteLogEntity>(
|
||||
{
|
||||
url: "/DmsFile/FindDmsFileDeleteLogByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async PrintBySearchCriteria(data: DmsFileSearchCriteria) {
|
||||
return download(
|
||||
{
|
||||
url: "/DmsFile/PrintBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
filename:'DmsFile'
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Insert(data: DmsFileEntity) {
|
||||
return request<DmsFileEntity>(
|
||||
{
|
||||
url: "/DmsFile/Insert",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Update(data: DmsFileEntity) {
|
||||
return request<DmsFileEntity>(
|
||||
{
|
||||
url: "/DmsFile/Update",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Delete(data: number) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/Delete?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DeleteLog(data: number) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/DeleteLog?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async CreateDmsFolder(data: DmsFileEntity) {
|
||||
return request<string>(
|
||||
{
|
||||
url: "/DmsFile/CreateDmsFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async CreateFamilyDmsFolder(data: FamilyDmsFileViewEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/CreateFamilyDmsFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async UpdateDmsFolder(data: DmsFileEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/UpdateDmsFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDmsFolders() {
|
||||
return request<SelectOption[]>(
|
||||
{
|
||||
url: "/DmsFile/FindDmsFolders",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDmsFolderDeleteLogs() {
|
||||
return request<SelectOption[]>(
|
||||
{
|
||||
url: "/DmsFile/FindDmsFolderDeleteLogs",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDmsFolderData() {
|
||||
return request<DmsFolderData>(
|
||||
{
|
||||
url: "/DmsFile/FindDmsFolderData",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async MoveDmsFolder(data: DmsFileEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/MoveDmsFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async UploadFile() {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/UploadFile",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindM3u8Path(data: number) {
|
||||
return request<string>(
|
||||
{
|
||||
url: "/DmsFile/FindM3u8Path?fileId="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindSourceVideoPath(data: number) {
|
||||
return request<string>(
|
||||
{
|
||||
url: "/DmsFile/FindSourceVideoPath?fileId="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDeleteLogM3u8Path(data: number) {
|
||||
return request<string>(
|
||||
{
|
||||
url: "/DmsFile/FindDeleteLogM3u8Path?fileId="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DownloadFile(data: number) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/DownloadFile?fileId="+data,
|
||||
method: "post",
|
||||
data,
|
||||
responseType: "arraybuffer",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DownloadFilePreview(data: DmsFileEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/DownloadFilePreview",
|
||||
method: "post",
|
||||
data,
|
||||
responseType: "arraybuffer",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DownloadFileCombine(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/DownloadFileCombine?fileName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
responseType: "arraybuffer",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindFamilyDmsFolders() {
|
||||
return request<SelectOption[]>(
|
||||
{
|
||||
url: "/DmsFile/FindFamilyDmsFolders",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindFamilyDmsFoldersByFamilyName(data: string) {
|
||||
return request<SelectOption[]>(
|
||||
{
|
||||
url: "/DmsFile/FindFamilyDmsFoldersByFamilyName?familyName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindDmsFolderMapByFolderName(data: string) {
|
||||
return request<number>(
|
||||
{
|
||||
url: "/DmsFile/FindDmsFolderMapByFolderName?folderName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindFolderNameParentByFolderName(data: string) {
|
||||
return request<string>(
|
||||
{
|
||||
url: "/DmsFile/FindFolderNameParentByFolderName?folderName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async CreateFamilyGroupFolder(data: FamilyGroupFolderEntity[]) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/CreateFamilyGroupFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DeleteFamilyGroupFolder(data: FamilyGroupFolderEntity[]) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/DmsFile/DeleteFamilyGroupFolder",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const dmsFileService= new DmsFileService();
|
||||
export default dmsFileService;
|
||||
@@ -0,0 +1,167 @@
|
||||
|
||||
import { request,download } from "@/utils/request";
|
||||
import type { FamilyGroupData } from "@/data/auto/familyGroupData";
|
||||
import type { FamilyGroupSearchCriteria } from "@/data/auto/familyGroupSearchCriteria";
|
||||
import type { FamilyGroupResultData } from "@/data/auto/familyGroupResultData";
|
||||
import type { FamilyGroupManagerUserSearchCriteria } from "@/data/auto/familyGroupManagerUserSearchCriteria";
|
||||
import type { FamilyGroupManagerEntity } from "@/data/auto/familyGroupManagerEntity";
|
||||
import type { FamilyGroupPermissionEntity } from "@/data/auto/familyGroupPermissionEntity";
|
||||
import type { FamilyFolderFavoriteEntity } from "@/data/auto/familyFolderFavoriteEntity";
|
||||
|
||||
class FamilyGroupService{
|
||||
|
||||
async FindByKey(data: string) {
|
||||
return request<FamilyGroupData>(
|
||||
{
|
||||
url: "/FamilyGroup/FindByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindBySearchCriteria(data: FamilyGroupSearchCriteria) {
|
||||
return request<FamilyGroupResultData>(
|
||||
{
|
||||
url: "/FamilyGroup/FindBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindFamilyUserBySearchCriteria(data: FamilyGroupManagerUserSearchCriteria) {
|
||||
return request<FamilyGroupResultData>(
|
||||
{
|
||||
url: "/FamilyGroup/FindFamilyUserBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FamilyFolderFavoriteBySearchCriteria(data: FamilyGroupManagerUserSearchCriteria) {
|
||||
return request<FamilyGroupResultData>(
|
||||
{
|
||||
url: "/FamilyGroup/FamilyFolderFavoriteBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async PrintBySearchCriteria(data: FamilyGroupSearchCriteria) {
|
||||
return download(
|
||||
{
|
||||
url: "/FamilyGroup/PrintBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
filename:'FamilyGroup'
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Insert(data: FamilyGroupData) {
|
||||
return request<FamilyGroupData>(
|
||||
{
|
||||
url: "/FamilyGroup/Insert",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Update(data: FamilyGroupData) {
|
||||
return request<FamilyGroupData>(
|
||||
{
|
||||
url: "/FamilyGroup/Update",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Delete(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/Delete?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertFamilyGroupManager(data: FamilyGroupManagerEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/InsertFamilyGroupManager",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertFamilyGroupPermission(data: FamilyGroupPermissionEntity[]) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/InsertFamilyGroupPermission",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async UpdateFamilyGroupManager(data: FamilyGroupManagerEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/UpdateFamilyGroupManager",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DeleteFamilyGroupManager(data: FamilyGroupManagerEntity) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/DeleteFamilyGroupManager",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertFamilyFolderFavorite(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/InsertFamilyFolderFavorite?folderName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DeleteFamilyFolderFavorite(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/DeleteFamilyFolderFavorite?folderName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async DeleteFamilyFolderFavorites(data: FamilyFolderFavoriteEntity[]) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/FamilyGroup/DeleteFamilyFolderFavorites",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const familyGroupService= new FamilyGroupService();
|
||||
export default familyGroupService;
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
import { request } from "@/utils/request";
|
||||
import type { SelectOption } from "@/data/auto/selectOption";
|
||||
|
||||
class FileTypePolicyService{
|
||||
|
||||
async FindSelectOption(data: any) {
|
||||
return request<SelectOption[]>(
|
||||
{
|
||||
url: "/FileTypePolicy/FindSelectOption?blank="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const fileTypePolicyService= new FileTypePolicyService();
|
||||
export default fileTypePolicyService;
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
import { request,download } from "@/utils/request";
|
||||
import type { PublishAudioData } from "@/data/auto/publishAudioData";
|
||||
import type { PublishAudioSearchCriteria } from "@/data/auto/publishAudioSearchCriteria";
|
||||
import type { PublishAudioResultData } from "@/data/auto/publishAudioResultData";
|
||||
import type { PublishData } from "@/data/auto/publishData";
|
||||
|
||||
class PublishAudioService{
|
||||
|
||||
async FindByKey(data: string) {
|
||||
return request<PublishAudioData>(
|
||||
{
|
||||
url: "/PublishAudio/FindByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindBySearchCriteria(data: PublishAudioSearchCriteria) {
|
||||
return request<PublishAudioResultData>(
|
||||
{
|
||||
url: "/PublishAudio/FindBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindPublishAudioDefault() {
|
||||
return request<PublishAudioData>(
|
||||
{
|
||||
url: "/PublishAudio/FindPublishAudioDefault",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async PrintBySearchCriteria(data: PublishAudioSearchCriteria) {
|
||||
return download(
|
||||
{
|
||||
url: "/PublishAudio/PrintBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
filename:'PublishAudio'
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Insert(data: PublishAudioData) {
|
||||
return request<PublishAudioData>(
|
||||
{
|
||||
url: "/PublishAudio/Insert",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Update(data: PublishAudioData) {
|
||||
return request<PublishAudioData>(
|
||||
{
|
||||
url: "/PublishAudio/Update",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Delete(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishAudio/Delete?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertPublishAudioDetail(data: PublishData) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishAudio/InsertPublishAudioDetail",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const publishAudioService= new PublishAudioService();
|
||||
export default publishAudioService;
|
||||
@@ -0,0 +1,114 @@
|
||||
|
||||
import { request,download } from "@/utils/request";
|
||||
import type { PublishPhotoData } from "@/data/auto/publishPhotoData";
|
||||
import type { PublishPhotoSearchCriteria } from "@/data/auto/publishPhotoSearchCriteria";
|
||||
import type { PublishPhotoResultData } from "@/data/auto/publishPhotoResultData";
|
||||
import type { PublishPhotoDetailEntity } from "@/data/auto/publishPhotoDetailEntity";
|
||||
import type { PublishData } from "@/data/auto/publishData";
|
||||
|
||||
class PublishPhotoService{
|
||||
|
||||
async FindByKey(data: string) {
|
||||
return request<PublishPhotoData>(
|
||||
{
|
||||
url: "/PublishPhoto/FindByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindBySearchCriteria(data: PublishPhotoSearchCriteria) {
|
||||
return request<PublishPhotoResultData>(
|
||||
{
|
||||
url: "/PublishPhoto/FindBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async PrintBySearchCriteria(data: PublishPhotoSearchCriteria) {
|
||||
return download(
|
||||
{
|
||||
url: "/PublishPhoto/PrintBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
filename:'PublishPhoto'
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Insert(data: PublishPhotoData) {
|
||||
return request<PublishPhotoData>(
|
||||
{
|
||||
url: "/PublishPhoto/Insert",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Update(data: PublishPhotoData) {
|
||||
return request<PublishPhotoData>(
|
||||
{
|
||||
url: "/PublishPhoto/Update",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Delete(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishPhoto/Delete?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindPublishPhotoDetailByPublishName(data: string) {
|
||||
return request<PublishPhotoDetailEntity[]>(
|
||||
{
|
||||
url: "/PublishPhoto/FindPublishPhotoDetailByPublishName?publishName="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindPublishPhotoDetail() {
|
||||
return request<PublishPhotoDetailEntity[]>(
|
||||
{
|
||||
url: "/PublishPhoto/FindPublishPhotoDetail",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertPublishPhotoDetail(data: PublishData) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishPhoto/InsertPublishPhotoDetail",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertPublishPhotoDetailByFamilyGroup(data: PublishData) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishPhoto/InsertPublishPhotoDetailByFamilyGroup",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const publishPhotoService= new PublishPhotoService();
|
||||
export default publishPhotoService;
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
import { request,download } from "@/utils/request";
|
||||
import type { PublishVideoData } from "@/data/auto/publishVideoData";
|
||||
import type { PublishVideoSearchCriteria } from "@/data/auto/publishVideoSearchCriteria";
|
||||
import type { PublishVideoResultData } from "@/data/auto/publishVideoResultData";
|
||||
import type { PublishData } from "@/data/auto/publishData";
|
||||
|
||||
class PublishVideoService{
|
||||
|
||||
async FindByKey(data: string) {
|
||||
return request<PublishVideoData>(
|
||||
{
|
||||
url: "/PublishVideo/FindByKey?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindBySearchCriteria(data: PublishVideoSearchCriteria) {
|
||||
return request<PublishVideoResultData>(
|
||||
{
|
||||
url: "/PublishVideo/FindBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async FindPublishVideoDefault() {
|
||||
return request<PublishVideoData>(
|
||||
{
|
||||
url: "/PublishVideo/FindPublishVideoDefault",
|
||||
method: "post",
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async PrintBySearchCriteria(data: PublishVideoSearchCriteria) {
|
||||
return download(
|
||||
{
|
||||
url: "/PublishVideo/PrintBySearchCriteria",
|
||||
method: "post",
|
||||
data,
|
||||
filename:'PublishVideo'
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Insert(data: PublishVideoData) {
|
||||
return request<PublishVideoData>(
|
||||
{
|
||||
url: "/PublishVideo/Insert",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Update(data: PublishVideoData) {
|
||||
return request<PublishVideoData>(
|
||||
{
|
||||
url: "/PublishVideo/Update",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async Delete(data: string) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishVideo/Delete?key="+data,
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
async InsertPublishVideoDetail(data: PublishData) {
|
||||
return request<any>(
|
||||
{
|
||||
url: "/PublishVideo/InsertPublishVideoDetail",
|
||||
method: "post",
|
||||
data,
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const publishVideoService= new PublishVideoService();
|
||||
export default publishVideoService;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-reset="onReset" @use-pagination="onPagination" :scrollx="400" :is-modal="isModal"
|
||||
:loading="loading" :pagination="result" :rowSelectionType="selectionType" @on-row-dblclick="onRowDblclick"
|
||||
@on-select-change="onSelectChange">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === DmsFileUploadViewDisplayData.FILE_TAG">
|
||||
{{ useFileTypePolicy().GetComposeMessage(record.FileType) }}
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { DmsFileResultData } from "@/data/auto/dmsFileResultData";
|
||||
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import dmsFileService from "@/service/master/dmsFileService";
|
||||
import { useFileTypePolicy } from "@/hooks/useFileTypePolicy"
|
||||
import { DmsFileSearchCriteria } from "@/data/auto/dmsFileSearchCriteria";
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { title } from "process";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
|
||||
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
//================props================
|
||||
const props = defineProps({
|
||||
filetype: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
//================inject================
|
||||
//报表名称(layout)
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
const masterOperationToEnquiryMethod = inject(masterOperationToEnquiryMethodKey);
|
||||
|
||||
const modelOption = masterOperationToEnquiryMethod?.getOperationToEnquiryModelOption() as MasterOperationToEnquiryModelOption;
|
||||
|
||||
//当前是弹出的Modal(page)
|
||||
const isModal = ref(inject("isModalDmsFile", false) as boolean);
|
||||
//初始化查询条件的值(page)
|
||||
const initBindOptions = ref((modelOption ? modelOption.initBindOptionsDmsFile : []) as BindOption[]);
|
||||
|
||||
//记录单选还是多选(page)
|
||||
const selectionType = ref(inject("selectionTypeDmsFile", 'radio') as string);
|
||||
//================inject================
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: "名称",
|
||||
dataIndex: DmsFileUploadViewDisplayData.ORG_FILE_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "文件类型",
|
||||
dataIndex: DmsFileUploadViewDisplayData.FILE_TAG,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
}
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
const datas = ref<DmsFileUploadViewDisplayData[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<DmsFileResultData>(new DmsFileResultData());
|
||||
const currentFilter = ref<SearchFilter[]>([]);
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<DmsFileSearchCriteria>(new DmsFileSearchCriteria());
|
||||
|
||||
const keys = ref<DmsFileUploadViewDisplayData[]>([]);
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
//初始化查询条件UI
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
await initBindOption();
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: DmsFileUploadViewDisplayData[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: DmsFileUploadViewDisplayData) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(DmsFileUploadViewDisplayData.DB_ORG_FILE_NAME, '名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
let rps: SelectOption[] = await useFileTypePolicy().getSelectOption(true);
|
||||
bindOption = ubo.getBindSelectOption(DmsFileUploadViewDisplayData.DB_FILE_TAG, '文件类型', SearchFilterTypePolicy.SINGLE_SELECTION, SearchFilterOperatorPolicy.SINGLE, rps);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: DmsFileSearchCriteria = new DmsFileSearchCriteria();
|
||||
currentFilter.value = filters;
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: DmsFileSearchCriteria) => {
|
||||
data.value = await dmsFileService.FindDatasBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: DmsFileSearchCriteria = new DmsFileSearchCriteria();
|
||||
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination"
|
||||
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
@on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
|
||||
</template>
|
||||
<template #footer>
|
||||
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { FamilyGroupResultData } from "@/data/auto/familyGroupResultData";
|
||||
import { FamilyFolderFavoriteViewEntity } from "@/data/auto/familyFolderFavoriteViewEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
|
||||
import familyGroupService from "@/service/master/familyGroupService";
|
||||
import { FamilyGroupManagerUserSearchCriteria } from "@/data/auto/familyGroupManagerUserSearchCriteria";
|
||||
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { title } from "process";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
//================inject================
|
||||
//报表名称
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
|
||||
//当前是弹出的Modal,还是Page
|
||||
const isModal = ref(inject("isModalShare", false) as boolean);
|
||||
//初始化查询条件的值
|
||||
const initBindOptions = ref(inject("initBindOptionsShare", []) as BindOption[]);
|
||||
//记录单选还是多选
|
||||
const selectionType = ref(inject("selectionTypeShare", 'checkbox') as string);
|
||||
|
||||
//================inject================
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const isEdit = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
width: '30px',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
sequence: 0,
|
||||
hidden: 'N',
|
||||
format: ''
|
||||
},
|
||||
{
|
||||
title: "群组名称",
|
||||
dataIndex: FamilyFolderFavoriteViewEntity.FAMILY_LOCAL_NAME,
|
||||
sorter: true,
|
||||
width: '65px',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "顶级目录",
|
||||
dataIndex: FamilyFolderFavoriteViewEntity.TOP_FOLDER_LOCAL_NAME,
|
||||
sorter: false,
|
||||
width: '80px',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "目录",
|
||||
dataIndex: FamilyFolderFavoriteViewEntity.FOLDER_LOCAL_NAME,
|
||||
sorter: false,
|
||||
width: '80px',
|
||||
sequence: 3,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "目录描述",
|
||||
dataIndex: FamilyFolderFavoriteViewEntity.NOTICE,
|
||||
sorter: false,
|
||||
width: '80px',
|
||||
sequence: 4,
|
||||
hidden: 'N'
|
||||
},
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
const datas = ref<FamilyFolderFavoriteViewEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<FamilyGroupResultData>(new FamilyGroupResultData());
|
||||
const currentFilter = ref<SearchFilter[]>([]);
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<FamilyGroupManagerUserSearchCriteria>(new FamilyGroupManagerUserSearchCriteria());
|
||||
|
||||
const keys = ref<FamilyFolderFavoriteViewEntity[]>([]);
|
||||
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: FamilyFolderFavoriteViewEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(FamilyFolderFavoriteViewEntity.DB_FAMILY_LOCAL_NAME, '群组名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CN_CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(FamilyFolderFavoriteViewEntity.DB_FOLDER_LOCAL_NAME, '目录名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CN_CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria();
|
||||
currentFilter.value = filters;
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onPrint = (async () => {
|
||||
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria();
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await familyGroupService.FamilyFolderFavoriteBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: FamilyGroupManagerUserSearchCriteria) => {
|
||||
try {
|
||||
data.value = await familyGroupService.FamilyFolderFavoriteBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Favorites;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: FamilyGroupManagerUserSearchCriteria = new FamilyGroupManagerUserSearchCriteria();
|
||||
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,303 @@
|
||||
<template>
|
||||
|
||||
<dragModal v-model:open="modal.showModal" :title="title" @cancel="handleCance" :mask-closable="false"
|
||||
@ok="handleSubmit">
|
||||
<hr><br>
|
||||
<a-form name="basic" autocomplete="off" :rules="rules" :model="modal.data" ref="formRef">
|
||||
<a-row :wrap="false">
|
||||
<a-col flex="none">
|
||||
<div style="padding: 0 "><a-input flex="none" readonly value="上一层文件夹" class="site-input-split"
|
||||
style="width: 160px;border-radius:0; border-top-left-radius: 5pt 5pt;
|
||||
border-bottom-left-radius: 5pt 5pt;
|
||||
pointer-events: none" /></div>
|
||||
</a-col>
|
||||
<a-col flex="auto">
|
||||
<a-form-item name="FilePath">
|
||||
<a-input disabled v-model:value="modal.data.FilePath" flex="auto" style="border-radius:0; border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt; border-left: 0;text-align: left" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :wrap="false">
|
||||
<a-col flex="none">
|
||||
<div style="padding: 0 "><a-input flex="none" readonly value="文件夹名称" class="site-input-split" style="width: 160px;border-radius:0; border-top-left-radius: 5pt 5pt;
|
||||
border-bottom-left-radius: 5pt 5pt;
|
||||
pointer-events: none" /></div>
|
||||
</a-col>
|
||||
<a-col flex="auto">
|
||||
<a-form-item name="FileName" :rules="[{ required: true, message: '请输入文件夹名称' }]">
|
||||
<a-input :disabled="isMove" required v-model:value="modal.data.FileName" flex="auto" style="border-radius:0; border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt; border-left: 0;text-align: left" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :wrap="false" v-if="isFamilyGroup">
|
||||
<a-col flex="none">
|
||||
<div style="padding: 0 "><a-input flex="none" readonly value="描述" class="site-input-split" style="width: 160px;border-radius:0; border-top-left-radius: 5pt 5pt;
|
||||
border-bottom-left-radius: 5pt 5pt;
|
||||
pointer-events: none" /></div>
|
||||
</a-col>
|
||||
<a-col flex="auto">
|
||||
<a-form-item name="FileName" :rules="[{ required: true, message: '请输入文件夹描述' }]">
|
||||
<a-input :disabled="isMove" v-model:value="modal.Notice" flex="auto" style="border-radius:0; border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt; border-left: 0;text-align: left" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-tree v-if="isMove" v-model:expandedKeys="expandedKeys" :show-icon="true" @select="select"
|
||||
:tree-data="treeItems">
|
||||
</a-tree>
|
||||
</dragModal>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, watchEffect, inject, reactive, ref, VNode, h, unref, onMounted, onBeforeMount } from "vue";
|
||||
import type { Rule } from "ant-design-vue/es/form";
|
||||
import { DmsFileEntity } from "@/data/auto/dmsFileEntity";
|
||||
import dmsFileService from "@/service/master/dmsFileService";
|
||||
import dragModal from "@/components/basic/DragModal.vue"
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import { useYesNoPolicy } from "@/hooks/useYesNoPolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { DmsFolderData } from "@/data/auto/dmsFolderData";
|
||||
import { DmsFolderEntity } from "@/data/auto/dmsFolderEntity";
|
||||
import { DmsFolderMapEntity } from "@/data/auto/dmsFolderMapEntity";
|
||||
import { FamilyDmsFileViewEntity } from "@/data/auto/familyDmsFileViewEntity";
|
||||
|
||||
import {
|
||||
HomeTwoTone,
|
||||
FolderOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
|
||||
const emit = defineEmits(['onSubmit']);
|
||||
|
||||
const yesNoPolicy = ref<SelectOption[]>([]);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
yesNoPolicy.value = await useYesNoPolicy().getSelectOption(false);
|
||||
})
|
||||
|
||||
const modal = reactive({
|
||||
loading: false,
|
||||
showModal: false,
|
||||
FilePathValue: '',
|
||||
Notice: '',
|
||||
data: new DmsFileEntity(),
|
||||
});
|
||||
|
||||
|
||||
const formRef = ref();
|
||||
|
||||
const dmsFolderModal = inject<boolean>("dmsFolderModal");
|
||||
const title = ref(inject<string>("dmsFolderTitle", '新增文件夹'));
|
||||
const isRename = ref(inject<boolean>("dmsFolderIsRename", false));
|
||||
const isMove = ref(inject<boolean>("dmsFolderIsMove", false));
|
||||
const isFamilyGroup = ref(inject<boolean>("dmsFolderIsFamilyGroup", false));
|
||||
const dmsFolderFamilyName = ref(inject<string>("dmsFolderFamilyName", ''));
|
||||
|
||||
const entity = ref(inject<DmsFileEntity>("DmsFileEntity", new DmsFileEntity()));
|
||||
|
||||
modal.showModal = dmsFolderModal!;
|
||||
watch(entity, async () => {
|
||||
modal.data = new DmsFileEntity();
|
||||
if (entity.value) {
|
||||
modal.data.FilePath = entity.value.FilePath;
|
||||
|
||||
if (isRename.value) {
|
||||
modal.data.FileId = entity.value.FileId;
|
||||
modal.data.FileName = entity.value.FileName;
|
||||
}
|
||||
else if (isMove.value) {
|
||||
modal.FilePathValue = entity.value.FilePath;
|
||||
modal.data.FileId = entity.value.FileId;
|
||||
modal.data.FileName = entity.value.OrgFileName;
|
||||
initTree(entity.value.FileName);
|
||||
}
|
||||
else {
|
||||
modal.FilePathValue = entity.value.OrgFileName;
|
||||
modal.data.FileName = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
export interface ContextMenuItem {
|
||||
title: string;
|
||||
key?: string;
|
||||
icon?: VNode;
|
||||
children?: ContextMenuItem[];
|
||||
type?: string;
|
||||
item: ContextItem;
|
||||
order?: number;
|
||||
}
|
||||
|
||||
export interface ContextItem {
|
||||
router?: string;
|
||||
}
|
||||
|
||||
const treeItems: ContextMenuItem[] = reactive([]);
|
||||
|
||||
const initTree = async (owner: string) => {
|
||||
treeItems.splice(0, treeItems.length);
|
||||
expandedKeys.value.splice(0, treeItems.length);
|
||||
let fd: DmsFolderData = await dmsFileService.FindDmsFolderData();
|
||||
if (fd == null || fd.DmsFolders == null || fd.DmsFoldersMaps.length == 0) return;
|
||||
|
||||
let topTree: DmsFolderEntity = fd.DmsFolders.filter(x => x.CreatedBy == x.FolderLocalName)[0];
|
||||
let parent: ContextMenuItem;
|
||||
|
||||
parent = getMenuItem(topTree.FolderLocalName, 0, topTree.FolderName, h(HomeTwoTone), [], null!, { router: '/' });
|
||||
|
||||
findSon(parent, owner, topTree.FolderName, fd);
|
||||
|
||||
treeItems.push(parent);
|
||||
|
||||
expandedKeys.value.push(topTree.FolderName);
|
||||
};
|
||||
|
||||
const findSon = (parentItem: ContextMenuItem, owner: string, parentFolderName: string, fd: DmsFolderData) => {
|
||||
|
||||
fd.DmsFoldersMaps.forEach(element => {
|
||||
if (element.FolderNameParent == parentFolderName && element.FolderNameSon != owner) {
|
||||
let parent: ContextMenuItem;
|
||||
if (fd.DmsFolders.filter(x => x.FolderName == element.FolderNameSon).length > 0) {
|
||||
let topTree: DmsFolderEntity = fd.DmsFolders.filter(x => x.FolderName == element.FolderNameSon)[0];
|
||||
parent = getMenuItem(topTree.FolderLocalName, 0, topTree.FolderName, h(FolderOutlined), [], null!, { router: '/' });
|
||||
parentItem.children?.push(parent);
|
||||
expandedKeys.value.push(topTree.FolderName);
|
||||
findSon(parent, owner, element.FolderNameSon, fd);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getMenuItem(
|
||||
title: string,
|
||||
order: number,
|
||||
key?: string,
|
||||
icon?: VNode,
|
||||
children?: ContextMenuItem[],
|
||||
type?: string | "group",
|
||||
item?: ContextItem,
|
||||
): ContextMenuItem {
|
||||
return {
|
||||
key,
|
||||
order,
|
||||
icon,
|
||||
children,
|
||||
title,
|
||||
type,
|
||||
item
|
||||
} as ContextMenuItem;
|
||||
}
|
||||
|
||||
|
||||
const select = (treeKey: string, e: any) => {
|
||||
//console.log(treeKey);
|
||||
modal.FilePathValue = treeKey[0];
|
||||
// console.log(e.selectedNodes[0].title);
|
||||
modal.data.FilePath = e.selectedNodes[0].title;
|
||||
};
|
||||
|
||||
const expandedKeys = ref<string[]>([]);
|
||||
|
||||
const validatePass = async (_rule: Rule, value: string) => {
|
||||
console.log(value);
|
||||
// if (value !== state.LoginData.UserPassword) {
|
||||
// return Promise.reject(t("login.register.twoDifferentPasswords"));
|
||||
// } else {
|
||||
// return Promise.resolve();
|
||||
// }
|
||||
};
|
||||
|
||||
const rules: Record<string, Rule[]> = {
|
||||
//ConfirmNewPassword: [{ validator: validatePass, trigger: "change" }],
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
modal.loading = true;
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(async () => {
|
||||
if (isRename.value) {
|
||||
await dmsFileService.UpdateDmsFolder(modal.data);
|
||||
}
|
||||
else if (isMove.value) {
|
||||
modal.data.FilePath = modal.FilePathValue;
|
||||
|
||||
await dmsFileService.MoveDmsFolder(modal.data);
|
||||
}
|
||||
else if (isFamilyGroup.value) {
|
||||
let dms: FamilyDmsFileViewEntity = new FamilyDmsFileViewEntity();
|
||||
dms.FilePath = modal.FilePathValue;
|
||||
dms.FolderLocalName = modal.data.FileName;
|
||||
dms.FamilyName = dmsFolderFamilyName.value;
|
||||
dms.Notice =modal.Notice;
|
||||
|
||||
await dmsFileService.CreateFamilyDmsFolder(dms);
|
||||
}
|
||||
else {
|
||||
modal.data.FilePath = modal.FilePathValue;
|
||||
await dmsFileService.CreateDmsFolder(modal.data);
|
||||
}
|
||||
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '记录修改成功',
|
||||
placement: "topRight",
|
||||
});
|
||||
emit('onSubmit', null);
|
||||
modal.showModal = false;
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
} catch (error) {
|
||||
} finally {
|
||||
modal.loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleCance = async () => {
|
||||
entity.value = null!;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.draggable-modal .ant-select-single .ant-select-selector {
|
||||
border-top-left-radius: 0pt 0pt;
|
||||
border-bottom-left-radius: 0pt 0pt;
|
||||
border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
|
||||
.draggable-modal .ant-select-multiple .ant-select-selector {
|
||||
border-top-left-radius: 0pt 0pt;
|
||||
border-bottom-left-radius: 0pt 0pt;
|
||||
border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
|
||||
.draggable-modal .ant-picker {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.draggable-modal .ant-select-selector {
|
||||
background-color: #f3e97a !important;
|
||||
}
|
||||
|
||||
.draggable-modal .ant-input-number-input {
|
||||
border-top-left-radius: 0pt 0pt;
|
||||
border-bottom-left-radius: 0pt 0pt;
|
||||
border-top-right-radius: 5pt 5pt;
|
||||
border-bottom-right-radius: 5pt 5pt;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination" :scrollx="400"
|
||||
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
@on-row-dblclick="onRowDblclick" @on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === PublishAudioEntity.PUBLISH_NAME">
|
||||
<a-button type="link" block @click.prevent="onViewAudioPreview">{{ record.PublishName }}</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === PublishAudioEntity.DEFAULT_INDC">
|
||||
<template v-if="record.DefaultIndc == 'Y'">
|
||||
<span>是</span>
|
||||
</template>
|
||||
<template v-else> <span>否</span></template>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onAmend">修改</a-button>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)"
|
||||
@click.prevent="onViewAudioPreview">音乐厅</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { PublishAudioResultData } from "@/data/auto/publishAudioResultData";
|
||||
import { PublishAudioEntity } from "@/data/auto/publishAudioEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import publishAudioService from "@/service/master/publishAudioService";
|
||||
import { useYesNoPolicy } from "@/hooks/useYesNoPolicy"
|
||||
import { PublishAudioSearchCriteria } from "@/data/auto/publishAudioSearchCriteria";
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { title } from "process";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
import { useLoginProfileStore } from "@/store/modules/loginProfile";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
//================inject================
|
||||
//报表名称(layout)
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
//当前是弹出的Modal(page)
|
||||
const isModal = ref(inject("isModalPublishAudio", false) as boolean);
|
||||
//初始化查询条件的值(page)
|
||||
const initBindOptions = ref(inject("initBindOptionsPublishAudio", []) as BindOption[]);
|
||||
//记录单选还是多选(page)
|
||||
const selectionType = ref(inject("selectionTypePublishAudio", 'radio') as string);
|
||||
//================inject================
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: "专辑编号",
|
||||
dataIndex: PublishAudioEntity.PUBLISH_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "专辑名称",
|
||||
dataIndex: PublishAudioEntity.PUBLISH_LOCAL_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "专辑描述",
|
||||
dataIndex: PublishAudioEntity.NOTICE,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "默认",
|
||||
dataIndex: PublishAudioEntity.DEFAULT_INDC,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
}
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
const datas = ref<PublishAudioEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<PublishAudioResultData>(new PublishAudioResultData());
|
||||
const currentFilter = ref<SearchFilter[]>([]);
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<PublishAudioSearchCriteria>(new PublishAudioSearchCriteria());
|
||||
|
||||
const keys = ref<PublishAudioEntity[]>([]);
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
//初始化查询条件UI
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: PublishAudioEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: PublishAudioEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
router.push({ name: "PublishAudioOperation", params: { id: record.PublishName, mode: 'view' } });
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onViewAudioPreview = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "AudioPreviews", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "PublishAudioOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "PublishAudioOperation", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
|
||||
let userLoginProfile = useLoginProfileStore();
|
||||
|
||||
if (keys.value[0].OwnerName != userLoginProfile.getUsername()) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '你不是发布者,不能修改!',
|
||||
placement: "topRight",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
router.push({ name: "PublishAudioOperation", params: { id: keys.value[0].PublishName, mode: 'amend' } });
|
||||
})
|
||||
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(PublishAudioEntity.DB_PUBLISH_NAME, '专辑编号', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
bindOption = ubo.getBindOption(PublishAudioEntity.DB_PUBLISH_LOCAL_NAME, '专辑名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: PublishAudioSearchCriteria = new PublishAudioSearchCriteria();
|
||||
currentFilter.value = filters;
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onPrint = (async () => {
|
||||
let c: PublishAudioSearchCriteria = new PublishAudioSearchCriteria();
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await publishAudioService.PrintBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: PublishAudioSearchCriteria) => {
|
||||
if (isModal.value) {
|
||||
c.IsModal = true;
|
||||
}
|
||||
data.value = await publishAudioService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: PublishAudioSearchCriteria = new PublishAudioSearchCriteria();
|
||||
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination" :scrollx="400"
|
||||
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
@on-row-dblclick="onRowDblclick" @on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === PublishPhotoEntity.PUBLISH_NAME">
|
||||
<a-button type="link" block @click.prevent="onViewPreview">{{ record.PublishName }}</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === PublishPhotoEntity.DEFAULT_INDC">
|
||||
<template v-if="record.DefaultIndc == 'Y'">
|
||||
<span>是</span>
|
||||
</template>
|
||||
<template v-else> <span>否</span></template>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onAmend">修改</a-button>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)"
|
||||
@click.prevent="onViewPreview">相册展览</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { PublishPhotoResultData } from "@/data/auto/publishPhotoResultData";
|
||||
import { PublishPhotoEntity } from "@/data/auto/publishPhotoEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import publishPhotoService from "@/service/master/publishPhotoService";
|
||||
import { useYesNoPolicy } from "@/hooks/useYesNoPolicy"
|
||||
import { PublishPhotoSearchCriteria } from "@/data/auto/publishPhotoSearchCriteria";
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { title } from "process";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
import { useLoginProfileStore } from "@/store/modules/loginProfile";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
//================inject================
|
||||
//报表名称(layout)
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
//当前是弹出的Modal(page)
|
||||
const isModal = ref(inject("isModalPublishPhoto", false) as boolean);
|
||||
//初始化查询条件的值(page)
|
||||
const initBindOptions = ref(inject("initBindOptionsPublishPhoto", []) as BindOption[]);
|
||||
//记录单选还是多选(page)
|
||||
const selectionType = ref(inject("selectionTypePublishPhoto", 'radio') as string);
|
||||
//================inject================
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: "相册编号",
|
||||
dataIndex: PublishPhotoEntity.PUBLISH_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "相册名称",
|
||||
dataIndex: PublishPhotoEntity.PUBLISH_LOCAL_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "相册描述",
|
||||
dataIndex: PublishPhotoEntity.NOTICE,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "默认",
|
||||
dataIndex: PublishPhotoEntity.DEFAULT_INDC,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
}
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
const datas = ref<PublishPhotoEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<PublishPhotoResultData>(new PublishPhotoResultData());
|
||||
const currentFilter = ref<SearchFilter[]>([]);
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<PublishPhotoSearchCriteria>(new PublishPhotoSearchCriteria());
|
||||
|
||||
const keys = ref<PublishPhotoEntity[]>([]);
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
//初始化查询条件UI
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: PublishPhotoEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: PublishPhotoEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
router.push({ name: "PublishPhotoOperation", params: { id: record.PublishName, mode: 'view' } });
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onViewPreview = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "Previews", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "PublishPhotoOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "PublishPhotoOperation", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
|
||||
let userLoginProfile = useLoginProfileStore();
|
||||
|
||||
if (keys.value[0].OwnerName != userLoginProfile.getUsername()) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '你不是发布者,不能修改!',
|
||||
placement: "topRight",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
router.push({ name: "PublishPhotoOperation", params: { id: keys.value[0].PublishName, mode: 'amend' } });
|
||||
})
|
||||
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(PublishPhotoEntity.DB_PUBLISH_NAME, '相册编号', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
bindOption = ubo.getBindOption(PublishPhotoEntity.DB_PUBLISH_LOCAL_NAME, '相册名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: PublishPhotoSearchCriteria = new PublishPhotoSearchCriteria();
|
||||
currentFilter.value = filters;
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onPrint = (async () => {
|
||||
let c: PublishPhotoSearchCriteria = new PublishPhotoSearchCriteria();
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await publishPhotoService.PrintBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: PublishPhotoSearchCriteria) => {
|
||||
if (isModal.value) {
|
||||
c.IsModal = true;
|
||||
}
|
||||
data.value = await publishPhotoService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Publishs;
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: PublishPhotoSearchCriteria = new PublishPhotoSearchCriteria();
|
||||
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination" :scrollx="400"
|
||||
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
@on-row-dblclick="onRowDblclick" @on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === PublishVideoEntity.PUBLISH_NAME">
|
||||
<a-button type="link" block @click.prevent="onViewVideoPreview">{{ record.PublishName }}</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === PublishVideoEntity.DEFAULT_INDC">
|
||||
<template v-if="record.DefaultIndc == 'Y'">
|
||||
<span>是</span>
|
||||
</template>
|
||||
<template v-else> <span>否</span></template>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)" @click.prevent="onAmend">修改</a-button>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length > 0)"
|
||||
@click.prevent="onViewVideoPreview">影视厅</a-button>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
|
||||
import { PublishVideoResultData } from "@/data/auto/publishVideoResultData";
|
||||
import { PublishVideoEntity } from "@/data/auto/publishVideoEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import publishVideoService from "@/service/master/publishVideoService";
|
||||
import { useYesNoPolicy } from "@/hooks/useYesNoPolicy"
|
||||
import { PublishVideoSearchCriteria } from "@/data/auto/publishVideoSearchCriteria";
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { title } from "process";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, masterOperationToEnquiryMethodKey, MasterOperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
import { useLoginProfileStore } from "@/store/modules/loginProfile";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
//================inject================
|
||||
//报表名称(layout)
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
//当前是弹出的Modal(page)
|
||||
const isModal = ref(inject("isModalPublishVideo", false) as boolean);
|
||||
//初始化查询条件的值(page)
|
||||
const initBindOptions = ref(inject("initBindOptionsPublishVideo", []) as BindOption[]);
|
||||
//记录单选还是多选(page)
|
||||
const selectionType = ref(inject("selectionTypePublishVideo", 'radio') as string);
|
||||
//================inject================
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
const canAmend = ref<boolean>(false);
|
||||
const canDelete = ref<boolean>(false);
|
||||
const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: "专辑编号",
|
||||
dataIndex: PublishVideoEntity.PUBLISH_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "专辑名称",
|
||||
dataIndex: PublishVideoEntity.PUBLISH_LOCAL_NAME,
|
||||
sorter: true,
|
||||
fixed: 'left',
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "专辑描述",
|
||||
dataIndex: PublishVideoEntity.NOTICE,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "默认",
|
||||
dataIndex: PublishVideoEntity.DEFAULT_INDC,
|
||||
sorter: true,
|
||||
width: '25%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
}
|
||||
]);
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
const datas = ref<PublishVideoEntity[]>([]);
|
||||
const pagingParams = ref<PagingParams>({ pageSize: 20, page: 1 });
|
||||
const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
|
||||
const data = ref<PublishVideoResultData>(new PublishVideoResultData());
|
||||
const currentFilter = ref<SearchFilter[]>([]);
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<PublishVideoSearchCriteria>(new PublishVideoSearchCriteria());
|
||||
|
||||
const keys = ref<PublishVideoEntity[]>([]);
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
|
||||
//================provide================
|
||||
//初始化查询条件UI
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
);
|
||||
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
|
||||
const onSelectChange = ((selected: PublishVideoEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
|
||||
const onRowDblclick = ((e: any, record: PublishVideoEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
router.push({ name: "PublishVideoOperation", params: { id: record.PublishName, mode: 'view' } });
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onViewVideoPreview = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "VideoPreviews", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "PublishVideoOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "PublishVideoOperation", params: { id: keys.value[0].PublishName, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
let userLoginProfile = useLoginProfileStore();
|
||||
|
||||
if (keys.value[0].OwnerName != userLoginProfile.getUsername()) {
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '你不是发布者,不能修改!',
|
||||
placement: "topRight",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
router.push({ name: "PublishVideoOperation", params: { id: keys.value[0].PublishName, mode: 'amend' } });
|
||||
})
|
||||
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(PublishVideoEntity.DB_PUBLISH_NAME, '专辑编号', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
bindOption = ubo.getBindOption(PublishVideoEntity.DB_PUBLISH_LOCAL_NAME, '专辑名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
|
||||
let c: PublishVideoSearchCriteria = new PublishVideoSearchCriteria();
|
||||
currentFilter.value = filters;
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
|
||||
const onPrint = (async () => {
|
||||
let c: PublishVideoSearchCriteria = new PublishVideoSearchCriteria();
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await publishVideoService.PrintBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const findBySearchCriteria = (async (c: PublishVideoSearchCriteria) => {
|
||||
if (isModal.value) {
|
||||
c.IsModal = true;
|
||||
}
|
||||
data.value = await publishVideoService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
})
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: PublishVideoSearchCriteria = new PublishVideoSearchCriteria();
|
||||
|
||||
if (currentFilter.value.length > 0)
|
||||
c.Filter = currentFilter.value;
|
||||
else c.Filter = [];
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<dragModal :width="modal.width" v-model:open="modal.showModal" :title="title" :mask-closable="false">
|
||||
<vue3VideoPlay ref="videoPlayerM3u8" v-if="videoType == 'm3u8'" :title="title" :src="modal.videoSrc" type="m3u8"
|
||||
:autoPlay="true" />
|
||||
<vue3VideoPlay ref="videoPlayerMp4" v-else :title="title" :src="modal.videoSrc" type="video/mp4"
|
||||
:autoPlay="true" />
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="handleSubmit">关闭</a-button>
|
||||
</template>
|
||||
</dragModal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, watchEffect, inject, reactive, ref, VNode, h, unref, onMounted, onBeforeMount } from "vue";
|
||||
import dragModal from "@/components/basic/DragModal.vue"
|
||||
|
||||
const modal = reactive({
|
||||
loading: false,
|
||||
showModal: false,
|
||||
videoSrc: '',
|
||||
width: '850px'
|
||||
});
|
||||
|
||||
const videoPlayerM3u8 = ref()
|
||||
const videoPlayerMp4 = ref()
|
||||
|
||||
const title = ref(inject<string>("videoPlayTitle", '视频播放'));
|
||||
|
||||
const videoPlayModal = inject<boolean>("videoPlayModal");
|
||||
const videoSrc = inject<string>("videoSrc");
|
||||
|
||||
|
||||
modal.showModal = videoPlayModal!;
|
||||
modal.videoSrc = videoSrc!;
|
||||
|
||||
|
||||
import { bsInfo } from "@/utils/browser"
|
||||
|
||||
if (bsInfo.size.sm) {
|
||||
modal.width = '350px';
|
||||
}
|
||||
else {
|
||||
modal.width = '850px';
|
||||
}
|
||||
|
||||
const videoType = ref(inject<string>("videoType", 'm3u8'));
|
||||
|
||||
|
||||
//const videoSrc = ref('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8');
|
||||
// 视频播放器配置
|
||||
const options = reactive({
|
||||
src: modal.videoSrc, //视频源
|
||||
})
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
|
||||
modal.loading = true;
|
||||
modal.showModal = false;
|
||||
|
||||
// console.log('-----------close video player -----------')
|
||||
if (videoType.value == 'm3u8') {
|
||||
videoPlayerM3u8.value?.pause();
|
||||
videoPlayerM3u8.value?.removeAttribute('src');
|
||||
videoPlayerM3u8.value?.load();
|
||||
}
|
||||
else {
|
||||
videoPlayerMp4.value?.pause();
|
||||
videoPlayerMp4.value?.removeAttribute('src');
|
||||
videoPlayerMp4.value?.load();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
} finally {
|
||||
modal.loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in new issue
Block a user