123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using AntDesign;
- using Microsoft.AspNetCore.Components;
- using Microsoft.AspNetCore.Components.Forms;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.Json;
- using System.Threading.Tasks;
- using wispro.sp.entity;
- using wispro.sp.web.Models;
- using wispro.sp.web.Services;
- namespace wispro.sp.web.Components
- {
- public partial class CreateAppeal
- {
- private CreateAppealModel _Model;
-
- [Inject]
- protected AppealTypeService _atService { get; set; }
-
- List<Staff> Reviewers = new List<Staff>()
- {
- new Staff(){Id =1,Name ="钟子敏"},
- new Staff(){Id =2,Name ="邢丽霞"},
- new Staff(){Id =3,Name ="李丽"},
- new Staff(){Id =4,Name ="贾凤涛"},
- };
- #region 文件上传控件设定
- List<UploadFileItem> fileList = new List<UploadFileItem>
- {
- new UploadFileItem
- {
- Id = "1",
- FileName = "客户往来邮件1.jpg",
- Url = "#",
- State = UploadState.Success
- },
- new UploadFileItem
- {
- Id = "2",
- FileName = "与客户微信聊天图片.jpg",
- Url = "#",
- State = UploadState.Success
- },
- new UploadFileItem
- {
- Id = "3",
- FileName = "附件.docx",
- Url = "#",
- State = UploadState.Success
- }
- };
- Dictionary<string, object> attrs = new Dictionary<string, object>
- {
- {"Action", "http://localhost:39476/api/AttachFiles/PostFile" },
- {"Name", "files" },
- {"Multiple", false }
- };
- void HandleChange(UploadInfo fileinfo)
- {
- //if (fileList.Count > 5)
- //{
- // fileList.RemoveRange(0, fileList.Count - 2);
- //}
- //fileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file => {
- // var result = file.GetResponse<ResponseModel>();
- // file.Url = result.url;
- //});
- }
- public class ResponseModel
- {
- public string name { get; set; }
- public string status { get; set; }
- public string url { get; set; }
- public string thumbUrl { get; set; }
- }
- #endregion
- protected override async void OnInitialized()
- {
- _Model = base.Options ?? new CreateAppealModel();
- Console.WriteLine($"Success:{JsonSerializer.Serialize(_Model)}");
- base.OnInitialized();
- }
- private void OnFinish()
- {
- Console.WriteLine($"Success:{JsonSerializer.Serialize(_Model)}");
- _ = base.FeedbackRef.CloseAsync();
- }
- private void OnCancel()
- {
- _ = base.FeedbackRef.CloseAsync();
- }
- //private void OnFinishFailed(EditContext editContext)
- //{
- // Console.WriteLine($"Failed:{JsonSerializer.Serialize(Model)}");
- //}
- }
- }
|