已添加87个文件
已重命名522个文件
已复制81个文件
已删除34个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ¥è¯¢åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class GetWmsContainersInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråå»ºåæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerCreateDto : WmsContainerCreateOrUpdateDtoBase |
| | | { |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråå»ºææ´æ°åºç±» |
| | | /// </summary> |
| | | public abstract class WmsContainerCreateOrUpdateDtoBase : ExtensibleEntityDto |
| | | { |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public virtual string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerCreateOrUpdateDtoBase"/> class. |
| | | /// </summary> |
| | | public WmsContainerCreateOrUpdateDtoBase() : base(false) |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ°æ®åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public virtual string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Gets the export data. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ´æ°åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | public class WmsContainerUpdateDto : WmsContainerCreateOrUpdateDtoBase, IHasConcurrencyStamp |
| | | { |
| | | /// <summary> |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MiniExcelLibs.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerså¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsContainersExportModel |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WorkSectionExportModel |
| | | { |
| | | [ExcelColumn(Name = "åç§°", Width = 25)] |
| | | public virtual string Name { get; set; } |
| | | |
| | | [ExcelColumn(Name = "ç¼å·", Width = 25)] |
| | | public virtual string Code { get; set; } |
| | | |
| | | [ExcelColumn(Name = "夿³¨", Width = 25)] |
| | | public virtual string Remark { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers.WmsContainersExportModel; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainers导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsContainersImportModel |
| | | { |
| | | private List<WmsContainerImportModel> _wmscontainers = new(); |
| | | |
| | | public List<WmsContainerImportModel> WmsContainers |
| | | { |
| | | get => _wmscontainers; |
| | | set |
| | | { |
| | | _wmscontainers = value; |
| | | var rowIndex = 2; |
| | | _wmscontainers?.ForEach(x => x.RowIndex = rowIndex++); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WmsContainer导å
¥æ¨¡å |
| | | /// </summary> |
| | | public class WmsContainerImportModel : WorkSectionExportModel |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowIndex { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using Volo.Abp.Application.Services; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineråºç¨æå¡ |
| | | /// </summary> |
| | | public interface IWmsContainerAppService : ICrudAppService<WmsContainerDto, Guid, GetWmsContainersInput, WmsContainerCreateDto, WmsContainerUpdateDto> |
| | | { |
| | | /// <summary> |
| | | /// Clones the asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsContainerDto>> CloneAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Deletes the many asynchronous. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | Task DeleteManyAsync(IEnumerable<Guid> ids); |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort asynchronous. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <returns></returns> |
| | | Task AdjustSortAsync(Guid id, int sort); |
| | | |
| | | /// <summary> |
| | | /// Imports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(WmsContainersImportModel input); |
| | | |
| | | /// <summary> |
| | | /// Exports the asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | /// <returns></returns> |
| | | Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsContainersInput input); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | | /// <inheritdoc /> |
| | | public class WmsContainerAppService : CMSPluginAppService, IWmsContainerAppService |
| | | { |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="wmscontainerRepository">The task job repository.</param> |
| | | public WmsContainerAppService(IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(await _wmscontainerRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsContainerDto>> GetListAsync(GetWmsContainersInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var count = await _wmscontainerRepository.GetCountAsync(input.Filter, specification); |
| | | var list = await _wmscontainerRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsContainerDto>(count, ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> CreateAsync(WmsContainerCreateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await _wmscontainerRepository.NameExistAsync(input.Name); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Name]); |
| | | } |
| | | |
| | | var maxSort = await _wmscontainerRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmscontainer = new WmsContainer(GuidGenerator.Create(), input.Code, input.Name, sort, input.Remark); |
| | | input.MapExtraPropertiesTo(wmscontainer, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await _wmscontainerRepository.InsertAsync(wmscontainer); |
| | | |
| | | if (input.Sort.HasValue && wmscontainer.Sort != maxSort) |
| | | { |
| | | await AdjustSortAsync(wmscontainer.Id, wmscontainer.Sort); |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(wmscontainer); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainerDto> UpdateAsync(Guid id, WmsContainerUpdateDto input) |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var wmscontainer = await _wmscontainerRepository.GetAsync(id); |
| | | var exist = await _wmscontainerRepository.NameExistAsync(input.Name, wmscontainer.Id); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Name]); |
| | | } |
| | | |
| | | wmscontainer.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmscontainer, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmscontainer.Update(input.Code, input.Name, input.Remark); |
| | | |
| | | await _wmscontainerRepository.UpdateAsync(wmscontainer); |
| | | |
| | | return ObjectMapper.Map<WmsContainer, WmsContainerDto>(wmscontainer); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsContainerDto>> CloneAsync(IEnumerable<Guid> ids) |
| | | { |
| | | var wmscontainers = new List<WmsContainer>(); |
| | | if (ids != null) |
| | | { |
| | | var sort = await _wmscontainerRepository.GetMaxSortAsync(); |
| | | foreach (var id in ids) |
| | | { |
| | | var wmscontainer = await _wmscontainerRepository.FindAsync(id); |
| | | if (wmscontainer != null) |
| | | { |
| | | var name = wmscontainer.Name + WmsContainerConsts.CloneTag; |
| | | var notExist = false; |
| | | while (!notExist) |
| | | { |
| | | var exist = await _wmscontainerRepository.NameExistAsync(name); |
| | | if (exist || wmscontainers.Any(x => x.Name == name)) |
| | | { |
| | | name += WmsContainerConsts.CloneTag; |
| | | continue; |
| | | } |
| | | |
| | | notExist = true; |
| | | } |
| | | |
| | | wmscontainer = await _wmscontainerRepository.InsertAsync(wmscontainer.Clone(GuidGenerator.Create(), name, sort++)); |
| | | wmscontainers.Add(wmscontainer); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(wmscontainers); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmscontainerRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | { |
| | | foreach (var id in ids) |
| | | { |
| | | await DeleteAsync(id); |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmscontainerRepository.GetListAsync(nameof(WmsContainer.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | | list.ForEach(x => x.AdjustSort(initSort++)); |
| | | var entity = list.FirstOrDefault(x => x.Id == id); |
| | | if (entity != null) |
| | | { |
| | | if (sort == 1) |
| | | { |
| | | list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | } |
| | | else if (entity.Sort > sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | else if (entity.Sort < sort) |
| | | { |
| | | list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); |
| | | list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); |
| | | } |
| | | |
| | | entity.AdjustSort(sort); |
| | | } |
| | | } |
| | | |
| | | await _wmscontainerRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task ImportAsync(WmsContainersImportModel input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | var wmscontainerCreateDtos = new List<(int RowIndex, WmsContainerCreateDto Item)>(); |
| | | var wmscontainerUpdateDtos = new List<(int RowIndex, Guid Id, WmsContainerUpdateDto Item)>(); |
| | | var wmscontainers = input.WmsContainers; |
| | | |
| | | if (wmscontainers != null && wmscontainers.Any()) |
| | | { |
| | | #region 导å
¥æ ¡éª |
| | | |
| | | // 夿åç§°æ¯å¦éå¤ï¼å¹¶è¾åºç¬¬å è¡éå¤ |
| | | var duplicateWmsContainers = wmscontainers.GroupBy(x => x.Name).Where(x => x.Count() > 1).ToList(); |
| | | if (duplicateWmsContainers?.Any() == true) |
| | | { |
| | | var duplicateWmsContainerMsgs = duplicateWmsContainers.Select(x => $"第 {string.Join(",", x.Select(x => x.RowIndex))} è¡ï¼{x.Key} åç§°éå¤"); |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ {string.Join(",", duplicateWmsContainerMsgs)}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | foreach (var wmscontainer in wmscontainers) |
| | | { |
| | | if (wmscontainer.Code.IsNullOrWhiteSpace() && wmscontainer.Name.IsNullOrWhiteSpace()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (wmscontainer.Name.IsNullOrWhiteSpace()) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainer.RowIndex}è¡ï¼WmsContaineråç§°ä¸è½ä¸ºç©º"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldWmsContainer = await _wmscontainerRepository.FindByNameAsync(wmscontainer.Name); |
| | | if (oldWmsContainer != null) |
| | | { |
| | | var wmscontainerUpdateDto = new WmsContainerUpdateDto |
| | | { |
| | | Code = wmscontainer.Code, |
| | | Name = wmscontainer.Name, |
| | | Remark = wmscontainer.Remark, |
| | | }; |
| | | |
| | | wmscontainerUpdateDtos.Add((wmscontainer.RowIndex, oldWmsContainer.Id, wmscontainerUpdateDto)); |
| | | } |
| | | else |
| | | { |
| | | var wmscontainerCreateDto = new WmsContainerCreateDto |
| | | { |
| | | Code = wmscontainer.Code, |
| | | Name = wmscontainer.Name, |
| | | Remark = wmscontainer.Remark, |
| | | }; |
| | | |
| | | wmscontainerCreateDtos.Add((wmscontainer.RowIndex, wmscontainerCreateDto)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ°å¢ |
| | | foreach (var wmscontainerDto in wmscontainerCreateDtos) |
| | | { |
| | | try |
| | | { |
| | | await CreateAsync(wmscontainerDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainerDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | // æ´æ° |
| | | foreach (var wmscontainerDto in wmscontainerUpdateDtos) |
| | | { |
| | | try |
| | | { |
| | | await UpdateAsync(wmscontainerDto.Id, wmscontainerDto.Item); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | var errorMsg = $"导å
¥å¤±è´¥ï¼é
ç½®ï¼ç¬¬{wmscontainerDto.RowIndex}è¡ï¼{e.Message}ï¼ç»æ¢å¯¼å
¥"; |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsContainersInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var list = await _wmscontainerRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["é
ç½®"] = result.Select(x => x.GetExportData()).ToList(), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsContainerå表" : result.Count == 1 ? result.First()?.Name : "WmsContainer模ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Checks the create or update dto asynchronous. |
| | | /// </summary> |
| | | /// <param name="input">The input.</param> |
| | | protected Task CheckCreateOrUpdateDtoAsync(WmsContainerCreateOrUpdateDtoBase input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.Code, "ç¼å·", WmsContainerConsts.MaxCodeLength); |
| | | Check.NotNullOrWhiteSpace(input.Name, "åç§°", WmsContainerConsts.MaxNameLength); |
| | | Check.Length(input.Remark, "夿³¨", WmsContainerConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Volo.Abp.ObjectExtending; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.MapperProfiles; |
| | | |
| | | /// <summary> |
| | | /// AutoMapperé
ç½® |
| | | /// </summary> |
| | | /// <seealso cref="AutoMapper.Profile" /> |
| | | public class WmsContainerAutoMapperProfile : Profile |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerAutoMapperProfile"/> class. |
| | | /// </summary> |
| | | public WmsContainerAutoMapperProfile() |
| | | { |
| | | /* You can configure your AutoMapper mapping configuration here. |
| | | * Alternatively, you can split your mapping configurations |
| | | * into multiple profile classes for a better organization. */ |
| | | CreateMap<WmsContainer, WmsContainerDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContainer常éå®ä¹ |
| | | /// </summary> |
| | | public static class WmsContainerConsts |
| | | { |
| | | public const string CloneTag = "_坿¬"; |
| | | public static int MaxCodeLength { get; set; } = 64; |
| | | public static int MaxNameLength { get; set; } = 64; |
| | | public static int MaxRemarkLength { get; set; } = 256; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineräºä»¶åæ°å¯¹è±¡ |
| | | /// </summary> |
| | | [Serializable] |
| | | public class WmsContainerEto |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerEto"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsContainerEto(string name) |
| | | { |
| | | Name = name; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public string Name { get; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.EventBus.Distributed; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.EventHandlers; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineräºä»¶å¤çç¨åº |
| | | /// </summary> |
| | | public class WmsContainerEventHandler : IDistributedEventHandler<WmsContainerEto>, ITransientDependency |
| | | { |
| | | /// <inheritdoc /> |
| | | public Task HandleEventAsync(WmsContainerEto eventData) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | |
| | | /// <summary> |
| | | /// WmsContainerä»å¨ |
| | | /// </summary> |
| | | public interface IWmsContainerRepository : IBasicRepository<WmsContainer, Guid> |
| | | { |
| | | /// <summary> |
| | | /// Finds the by name asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<WmsContainer> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Names the exist asynchronous. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <returns></returns> |
| | | Task<bool> NameExistAsync(string name, Guid? id = null); |
| | | |
| | | /// <summary> |
| | | /// Gets the maximum sort asynchronous. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | /// <summary> |
| | | /// Gets the list asynchronous. |
| | | /// </summary> |
| | | /// <param name="sorting">The sorting.</param> |
| | | /// <param name="maxResultCount">The maximum result count.</param> |
| | | /// <param name="skipCount">The skip count.</param> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsContainer>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | | /// </summary> |
| | | /// <param name="filter">The filter.</param> |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Domain.Entities.Auditing; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainer |
| | | /// </summary> |
| | | public class WmsContainer : FullAuditedAggregateRoot<Guid> |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainer"/> class. |
| | | /// </summary> |
| | | protected WmsContainer() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainer"/> class. |
| | | /// </summary> |
| | | /// <param name="id">The identifier.</param> |
| | | /// <param name="code">The code.</param> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="sort">The sort.</param> |
| | | /// <param name="remark">The remark.</param> |
| | | public WmsContainer(Guid id, string code, string name, int sort = 0, string remark = null) : base(id) |
| | | { |
| | | Code = Check.NotNullOrWhiteSpace(code, "ç¼å·", WmsContainerConsts.MaxCodeLength); |
| | | Name = Check.NotNullOrWhiteSpace(name, "åç§°", WmsContainerConsts.MaxNameLength); |
| | | Sort = sort; |
| | | Remark = Check.Length(remark, "夿³¨", WmsContainerConsts.MaxRemarkLength); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç¼å· |
| | | /// </summary> |
| | | public virtual string Code { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | public virtual string Name { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public virtual int Sort { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public virtual string Remark { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public virtual bool? IsDisabled { get; protected set; } |
| | | |
| | | /// <summary> |
| | | /// Updates the specified code. |
| | | /// </summary> |
| | | /// <param name="code">The code.</param> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="remark">The remark.</param> |
| | | public virtual void Update(string code, string name, string remark = null, bool? isDisabled = null) |
| | | { |
| | | Code = Check.NotNullOrWhiteSpace(code, "ç¼å·", WmsContainerConsts.MaxCodeLength); |
| | | Name = Check.NotNullOrWhiteSpace(name, "åç§°", WmsContainerConsts.MaxNameLength); |
| | | Remark = Check.Length(remark, "夿³¨", WmsContainerConsts.MaxRemarkLength); |
| | | IsDisabled = isDisabled ?? IsDisabled; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Adjusts the sort. |
| | | /// </summary> |
| | | /// <param name="sort">The sort.</param> |
| | | public void AdjustSort(int sort) |
| | | { |
| | | Sort = sort; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Clones the specified create. |
| | | /// </summary> |
| | | /// <param name="create">The create.</param> |
| | | /// <param name="name">The name.</param> |
| | | /// <param name="i">The i.</param> |
| | | /// <returns></returns> |
| | | public WmsContainer Clone(Guid create, string name, int i) |
| | | { |
| | | return new WmsContainer(create, Code, name, i, Remark); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Guids; |
| | | using Volo.Abp.Uow; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerç§åæ°æ®æä¾ç¨åº |
| | | /// </summary> |
| | | public class WmsContainerDataSeedContributor : IDataSeedContributor, ITransientDependency |
| | | { |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | private readonly IGuidGenerator _guidGenerator; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerDataSeedContributor"/> class. |
| | | /// </summary> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="guidGenerator">The unique identifier generator.</param> |
| | | /// <param name="wmscontainerRepository">The work section repository.</param> |
| | | public WmsContainerDataSeedContributor(IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator, IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | _guidGenerator = guidGenerator; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task SeedAsync(DataSeedContext context) |
| | | { |
| | | if (context.Properties.ContainsKey(CMSPluginDbProperties.ConnectionStringName) && context.Properties[CMSPluginDbProperties.ConnectionStringName]?.ToString() == CMSPluginDbProperties.ConnectionStringName) |
| | | { |
| | | try |
| | | { |
| | | //using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | //await unitofWork.SaveChangesAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | } |
| | | } |
| | | |
| | | if (context.Properties.ContainsKey("SeedTestData") && context.Properties["SeedTestData"]?.ToString() == "SeedTestData") |
| | | { |
| | | try |
| | | { |
| | | await SeedWmsContainerDataAsync(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Console.WriteLine(e.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Seeds the work section data asynchronous. |
| | | /// </summary> |
| | | private async Task SeedWmsContainerDataAsync() |
| | | { |
| | | using var unitofWork = _unitOfWorkManager.Begin(requiresNew: true); |
| | | if (await _wmscontainerRepository.GetCountAsync() == 0) |
| | | { |
| | | var WmsContainers = new List<WmsContainer>(); |
| | | for (int i = 1; i <= 80; i++) |
| | | { |
| | | var wmscontainer = new WmsContainer(_guidGenerator.Create(), $"WmsContainer_Code{i}", $"WmsContainer_Name{i}", i, $"WmsContainer_Remark{i}"); |
| | | WmsContainers.Add(wmscontainer); |
| | | } |
| | | |
| | | await _wmscontainerRepository.InsertManyAsync(WmsContainers); |
| | | await unitofWork.SaveChangesAsync(); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Domain.WmsContainers |
| | | { |
| | | /// <summary> |
| | | /// WmsContainerè§çº¦ |
| | | /// </summary> |
| | | public class WmsContainerSpecification : Volo.Abp.Specifications.Specification<WmsContainer> |
| | | { |
| | | private readonly string _name; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerSpecification"/> class. |
| | | /// </summary> |
| | | public WmsContainerSpecification() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerSpecification"/> class. |
| | | /// </summary> |
| | | /// <param name="name">The name.</param> |
| | | public WmsContainerSpecification(string name = null) |
| | | { |
| | | _name = name; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override Expression<Func<WmsContainer, bool>> ToExpression() |
| | | { |
| | | Expression<Func<WmsContainer, bool>> expression = c => 1 == 1; |
| | | |
| | | if (_name != null) |
| | | { |
| | | expression = expression.And(c => c.Name == _name); |
| | | } |
| | | |
| | | return expression; |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/CMSPluginEfCoreEntityExtensionMappings.cs ÐÞ¸Ä |
| | |
| | | * Example: Map a property to a table field: |
| | | |
| | | ObjectExtensionManager.Instance |
| | | .MapEfCoreProperty<WmsPlace, string>( |
| | | .MapEfCoreProperty<WmsContainer, string>( |
| | | "MyProperty", |
| | | (entityBuilder, propertyBuilder) => |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsContainer> IncludeDetails(this IQueryable<WmsContainer> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmscontainer. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsContainer(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsContainer>(b => |
| | | { |
| | | //Configure table & schema name |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsContainers").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("WmsContainer"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | //Properties |
| | | b.Property(x => x.Code).HasMaxLength(WmsContainerConsts.MaxCodeLength).IsRequired().HasComment("ç¼ç "); |
| | | b.Property(x => x.Name).HasMaxLength(WmsContainerConsts.MaxNameLength).IsRequired().HasComment("åç§°"); |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsContainerConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | |
| | | b.HasIndex(u => u.Name); |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.Specifications; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories; |
| | | |
| | | /// <inheritdoc /> |
| | | public class EfCoreWmsContainerRepository : EfCoreRepository<ICMSPluginDbContext, WmsContainer, Guid>, IWmsContainerRepository |
| | | { |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="EfCoreWmsContainerRepository"/> class. |
| | | /// </summary> |
| | | /// <param name="dbContextProvider">The database context provider.</param> |
| | | public EfCoreWmsContainerRepository(IDbContextProvider<ICMSPluginDbContext> dbContextProvider) |
| | | : base(dbContextProvider) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<WmsContainer> FindByNameAsync(string name, CancellationToken cancellationToken = default) |
| | | { |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails() |
| | | .OrderBy(t => t.Sort) |
| | | .FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<bool> NameExistAsync(string name, Guid? id = null) |
| | | { |
| | | return await (await GetDbSetAsync()).WhereIf(id.HasValue, p => p.Id != id).AnyAsync(x => x.Name == name); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<int> GetMaxSortAsync() |
| | | { |
| | | var hasAny = await (await GetQueryableAsync()).AnyAsync(); |
| | | if (!hasAny) |
| | | { |
| | | return 1; |
| | | } |
| | | |
| | | var sort = await (await GetQueryableAsync()).MaxAsync(x => x.Sort); |
| | | return sort + 1; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<List<WmsContainer>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.Name.Contains(filter)) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsContainer.Sort) : sorting) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<long> GetCountAsync(string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.Name.Contains(filter)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override async Task<IQueryable<WmsContainer>> WithDetailsAsync() |
| | | { |
| | | return (await GetQueryableAsync()).IncludeDetails(); |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/appsettings.json ÐÞ¸Ä |
| | |
| | | { |
| | | "ConnectionStrings": { |
| | | "Default": "Server=127.0.0.1;Database=CMS.Plugin.HIAWms;User ID=root;Password=123abc.com" |
| | | "Default": "Server=127.0.0.1;Database=CMS.Plugin.HIAWms;User ID=root;Password=123456" |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.MySQL/CMS.Plugin.HIAWms.MySQL.csproj ÐÞ¸Ä |
| | |
| | | <ProjectReference Include="..\CMS.Plugin.HIAWms.EntityFrameworkCore\CMS.Plugin.HIAWms.EntityFrameworkCore.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Migrations\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.MySQL/CMSPluginDbContext.cs ÐÞ¸Ä |
| | |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsMaterial(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsContainer(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.PostgreSql/CMSPluginDbContext.cs ÐÞ¸Ä |
| | |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsMaterial(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsContainer(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
| | | //builder.Entity<YourEntity>(b => |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms.SqlServer/CMSPluginDbContext.cs ÐÞ¸Ä |
| | |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsMaterial(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsContainer(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/Apis/IHIAWmsExternalApi.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using WebApiClientCore.Attributes; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Apis |
| | |
| | | /// CreateAsync |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("api/v1/hiawms/wmsplace")] |
| | | Task<WmsPlaceDto> CreateAsync([JsonContent] WmsPlaceCreateDto input); |
| | | [HttpPost("api/v1/hiawms/wmscontainer")] |
| | | Task<WmsContainerDto> CreateAsync([JsonContent] WmsContainerCreateDto input); |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj ÐÞ¸Ä |
| | |
| | | <None Remove="appsettings.json" /> |
| | | <None Remove="Flows\50001_1.pfd" /> |
| | | <None Remove="Flows\FlowInfo.xml" /> |
| | | <None Remove="Resources\Templates\WmsPlaceå¯¼åºæ¨¡æ¿.xlsx" /> |
| | | <None Remove="Resources\Templates\WmsContainerå¯¼åºæ¨¡æ¿.xlsx" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <EmbeddedResource Include="Resources\Templates\WmsPlaceå¯¼åºæ¨¡æ¿.xlsx"> |
| | | <EmbeddedResource Include="Resources\Templates\WmsContainerå¯¼åºæ¨¡æ¿.xlsx"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | </ItemGroup> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using MiniExcelLibs; |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Controller |
| | | { |
| | | /// <summary> |
| | | /// WmsContaineræå¡ |
| | | /// </summary> |
| | | [ApiController] |
| | | [TypeFilter(typeof(CMSLanguageFilter))] |
| | | [TypeFilter(typeof(CMSUowActionFilter))] |
| | | [TypeFilter(typeof(CMSAuditActionFilter))] |
| | | [TypeFilter(typeof(CMSExceptionFilter))] |
| | | [Route("api/v{version:apiVersion}/HIAWms/[controller]")] |
| | | public class WmsContainerController : ControllerBase |
| | | { |
| | | private readonly IWmsContainerAppService _wmscontainerAppService; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsContainerController"/> class. |
| | | /// </summary> |
| | | /// <param name="wmscontainerAppService">The wmscontainer application service.</param> |
| | | public WmsContainerController(IWmsContainerAppService wmscontainerAppService) |
| | | { |
| | | _wmscontainerAppService = wmscontainerAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsContainerDto> GetAsync(Guid id) |
| | | { |
| | | return _wmscontainerAppService.GetAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åwmscontainerçå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public virtual Task<PagedResultDto<WmsContainerDto>> GetListAsync([FromQuery] GetWmsContainersInput input) |
| | | { |
| | | return _wmscontainerAppService.GetListAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建wmscontainer. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | public virtual Task<WmsContainerDto> CreateAsync(WmsContainerCreateDto input) |
| | | { |
| | | return _wmscontainerAppService.CreateAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°wmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPut] |
| | | [Route("{id}")] |
| | | public virtual Task<WmsContainerDto> UpdateAsync(Guid id, WmsContainerUpdateDto input) |
| | | { |
| | | return _wmscontainerAppService.UpdateAsync(id, input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
éWmsContainer. |
| | | /// </summary> |
| | | /// <param name="ids">Idéå.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpPost] |
| | | [Route("Clone")] |
| | | public virtual Task<List<WmsContainerDto>> CloneAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmscontainerAppService.CloneAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤wmscontainer. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | [Route("{id}")] |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return _wmscontainerAppService.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤wmscontainer. |
| | | /// </summary> |
| | | /// <param name="ids">The ids.</param> |
| | | /// <returns></returns> |
| | | //[Authorize] |
| | | [HttpDelete] |
| | | public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids) |
| | | { |
| | | return _wmscontainerAppService.DeleteManyAsync(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°æ´æåº. |
| | | /// </summary> |
| | | /// <param name="id">æ è¯ç¬¦.</param> |
| | | /// <returns></returns> |
| | | [HttpPut] |
| | | [Route("{id}/AdjustSort/{sort}")] |
| | | public virtual Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | return _wmscontainerAppService.AdjustSortAsync(id, sort); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导å
¥wmscontainer. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("Import")] |
| | | public virtual async Task<IActionResult> ImportAsync(IFormFile file) |
| | | { |
| | | using var stream = new MemoryStream(); |
| | | await file.CopyToAsync(stream); |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmscontainerRows = sheetNames.Contains("é
ç½®") ? MiniExcel.Query<WmsContainersImportModel.WmsContainerImportModel>(stream, sheetName: "é
ç½®").ToList() : new(); |
| | | |
| | | if (!wmscontainerRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | await _wmscontainerAppService.ImportAsync(new WmsContainersImportModel |
| | | { |
| | | WmsContainers = wmscontainerRows, |
| | | }); |
| | | |
| | | return Ok(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导åºwmscontainer. |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsContainersInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmscontainerAppService.ExportAsync(input); |
| | | var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WmsContainerå¯¼åºæ¨¡æ¿.xlsx"); |
| | | if (!System.IO.File.Exists(templatePath)) |
| | | { |
| | | templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WmsContainerå¯¼åºæ¨¡æ¿.xlsx"); |
| | | } |
| | | |
| | | var memoryStream = new MemoryStream(); |
| | | await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets); |
| | | memoryStream.Seek(0L, SeekOrigin.Begin); |
| | | return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" }; |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/EventHandlers/HIAWmsEventHandler.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.MesSuite.Abstractions.Events; |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.ProcessManagement.Abstractions.Models; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | |
| | | { |
| | | if (eventData.Activity.Equals("æ¥éª¤åç§°")) |
| | | { |
| | | _logger.LogInformation($"WmsPlaceEventHandler: Activity={eventData.Activity}"); |
| | | _logger.LogInformation($"WmsContainerEventHandler: Activity={eventData.Activity}"); |
| | | |
| | | var serialNumber = eventData?.FlowItems[FlowItemCollection.SerialNumber]?.ToString(); |
| | | |
| | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmsplaceRepository = scope.ServiceProvider.GetRequiredService<IWmsPlaceRepository>(); |
| | | var count = await wmsplaceRepository.GetCountAsync(); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/FlowProcessors/HIAWmsFlowProcessor.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.FlowManagement.Abstractions; |
| | | using CMS.Plugin.FlowManagement.Abstractions.Models; |
| | | using CMS.Plugin.MesSuite.Abstractions.Models; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.OrderManagement.Abstractions.Models; |
| | | using CMS.Plugin.ProcessManagement.Abstractions.Models; |
| | | using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; |
| | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmsplaceRepository = scope.ServiceProvider.GetRequiredService<IWmsPlaceRepository>(); |
| | | var count = await wmsplaceRepository.GetCountAsync(); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/Jobs/HIAWmsJob.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Microsoft.Extensions.Logging; |
| | | using Volo.Abp.BackgroundJobs; |
| | | using Volo.Abp.DependencyInjection; |
| | |
| | | { |
| | | private readonly ILogger<HIAWmsJob> _logger; |
| | | private readonly IUnitOfWorkManager _unitOfWorkManager; |
| | | private readonly IWmsPlaceRepository _wmsplaceRepository; |
| | | private readonly IWmsContainerRepository _wmscontainerRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="HIAWmsJob"/> class. |
| | | /// </summary> |
| | | /// <param name="logger">The logger.</param> |
| | | /// <param name="unitOfWorkManager">The unit of work manager.</param> |
| | | /// <param name="wmsplaceRepository">My entity name repository.</param> |
| | | public HIAWmsJob(ILogger<HIAWmsJob> logger, IUnitOfWorkManager unitOfWorkManager, IWmsPlaceRepository wmsplaceRepository) |
| | | /// <param name="wmscontainerRepository">My entity name repository.</param> |
| | | public HIAWmsJob(ILogger<HIAWmsJob> logger, IUnitOfWorkManager unitOfWorkManager, IWmsContainerRepository wmscontainerRepository) |
| | | { |
| | | _logger = logger; |
| | | _unitOfWorkManager = unitOfWorkManager; |
| | | _wmsplaceRepository = wmsplaceRepository; |
| | | _wmscontainerRepository = wmscontainerRepository; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public override void Execute(HIAWmsArgs args) |
| | | { |
| | | using var uow = _unitOfWorkManager.Begin(requiresNew: true); |
| | | var count = _wmsplaceRepository.GetCountAsync().GetAwaiter().GetResult(); |
| | | var count = _wmscontainerRepository.GetCountAsync().GetAwaiter().GetResult(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // uow.SaveChangesAsync().GetAwaiter().GetResult(); |
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/ProjectService/HIAWmsProjectService.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.FlowManagement.Abstractions.FlowBusiness; |
| | | using CMS.Plugin.HIAWms.Apis; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Jobs; |
| | | using CMS.Project; |
| | | using CMS.Project.Abstractions; |
| | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmsplaceRepository = scope.ServiceProvider.GetRequiredService<IWmsPlaceRepository>(); |
| | | var count = await wmsplaceRepository.GetCountAsync(); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
| | |
| | | /// </summary> |
| | | private async Task ExecuteExternalApiAsync() |
| | | { |
| | | |
| | | try |
| | | { |
| | | await _serviceProvider.GetRequiredService<IHIAWmsExternalApi>().CreateAsync(new WmsContainerCreateDto |
| | | { |
| | | Name = "WmsContainer_Name", |
| | | Code = "WmsContainer_Code", |
| | | }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | _logger.LogException(e); |
| | | } |
| | | } |
| | | } |
| | | } |
copy from "WMS/server/src/CMS.Plugin.HIAWms/Resources/Templates/Sample\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
copy to "HIAWms/server/src/CMS.Plugin.HIAWms/Resources/Templates/WmsContainer\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
Binary files differ
ÎļþÃû´Ó WMS/server/src/CMS.Plugin.HIAWms/Services/HIAWmsFlowService.cs ÐÞ¸Ä |
| | |
| | | using CMS.Plugin.HIAWms.Abstractions; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Logging; |
| | | using SYC.Flow.Kernel; |
| | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | var wmsplaceRepository = scope.ServiceProvider.GetRequiredService<IWmsPlaceRepository>(); |
| | | var count = await wmsplaceRepository.GetCountAsync(); |
| | | var wmscontainerRepository = scope.ServiceProvider.GetRequiredService<IWmsContainerRepository>(); |
| | | var count = await wmscontainerRepository.GetCountAsync(); |
| | | |
| | | // å¦æææ´æ°æ°æ®åºæä½ï¼éæäº¤ä¿å |
| | | // await uow.SaveChangesAsync(); |
ÎļþÃû´Ó WMS/web/README.md ÐÞ¸Ä |
| | |
| | | onClick={onAddProcess} |
| | | type="primary" |
| | | > |
| | | æ·»å MyEntityName |
| | | æ·»å WmsContainer |
| | | </IconButton> |
| | | |
| | | ``` |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/Sample.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { Sample } from '../Models/Sample' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useSample = (props: any, ctx?: any) => { |
| | | const sample = injectModel<Sample>('sample') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const sampleColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await sample.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await sample.deleteSamples(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddSample = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmSample = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/sample/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | sampleColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmSample, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddSample, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/SampleDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { SampleDrawer } from '../Models/SampleDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useSampleDrawer = (props: any, ctx?: any) => { |
| | | const sampleDrawer = |
| | | injectModel<SampleDrawer>('sampleDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await sampleDrawer.addSample(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await sampleDrawer.updateSample(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await sampleDrawer.getSampleDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsArea.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsArea } from '../Models/WmsArea' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsArea = (props: any, ctx?: any) => { |
| | | const wmsarea = injectModel<WmsArea>('wmsarea') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsareaColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsarea.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsarea.deleteWmsAreas(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsArea = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsArea = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsarea/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsareaColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsArea, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsArea, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsAreaDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsAreaDrawer } from '../Models/WmsAreaDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsAreaDrawer = (props: any, ctx?: any) => { |
| | | const wmsareaDrawer = |
| | | injectModel<WmsAreaDrawer>('wmsareaDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsareaDrawer.addWmsArea(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsareaDrawer.updateWmsArea(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsareaDrawer.getWmsAreaDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ÐÞ¸Ä |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsContainer } from '../Models/WmsContainer' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsContainer = (props: any, ctx?: any) => { |
| | | const wmscontainer = injectModel<WmsContainer>('wmscontainer') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmscontainerColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmscontainer.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmscontainer.deleteWmsContainers(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsContainer = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmscontainer/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmscontainerColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsContainer, |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ÐÞ¸Ä |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsContainerDrawer } from '../Models/WmsContainerDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsContainerDrawer = (props: any, ctx?: any) => { |
| | | const wmscontainerDrawer = |
| | | injectModel<WmsContainerDrawer>('wmscontainerDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmscontainerDrawer.addWmsContainer(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmscontainerDrawer.updateWmsContainer(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmscontainerDrawer.getWmsContainerDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsMaterial.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsMaterial } from '../Models/WmsMaterial' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsMaterial = (props: any, ctx?: any) => { |
| | | const wmsmaterial = injectModel<WmsMaterial>('wmsmaterial') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsmaterialColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsmaterial.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsmaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsMaterial = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsMaterial = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsmaterial/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsmaterialColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsMaterial, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsMaterialDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsMaterialDrawer = (props: any, ctx?: any) => { |
| | | const wmsmaterialDrawer = |
| | | injectModel<WmsMaterialDrawer>('wmsmaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsmaterialDrawer.addWmsMaterial(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsmaterialDrawer.updateWmsMaterial(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsmaterialDrawer.getWmsMaterialDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsPlace.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsPlace } from '../Models/WmsPlace' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsPlace = (props: any, ctx?: any) => { |
| | | const wmsplace = injectModel<WmsPlace>('wmsplace') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsplaceColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsplace.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsplace.deleteWmsPlaces(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsPlace = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsPlace = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsplace/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsplaceColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsPlace, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsPlace, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsPlaceDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsPlaceDrawer } from '../Models/WmsPlaceDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsPlaceDrawer = (props: any, ctx?: any) => { |
| | | const wmsplaceDrawer = |
| | | injectModel<WmsPlaceDrawer>('wmsplaceDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsplaceDrawer.addWmsPlace(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsplaceDrawer.updateWmsPlace(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsplaceDrawer.getWmsPlaceDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsStore.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsStore } from '../Models/WmsStore' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsStore = (props: any, ctx?: any) => { |
| | | const wmsstore = injectModel<WmsStore>('wmsstore') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsstoreColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsstore.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsstore.deleteWmsStores(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsStore = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsStore = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsstore/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsstoreColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsStore, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsStore, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/app/template/HIAWms/Controllers/WmsStoreDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsStoreDrawer } from '../Models/WmsStoreDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsStoreDrawer = (props: any, ctx?: any) => { |
| | | const wmsstoreDrawer = |
| | | injectModel<WmsStoreDrawer>('wmsstoreDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsstoreDrawer.addWmsStore(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsstoreDrawer.updateWmsStore(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsstoreDrawer.getWmsStoreDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteSamples, |
| | | addSample, |
| | | cloneData, |
| | | } from './Service/Sample' |
| | | |
| | | export class Sample extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteSamples(ids: string[]) { |
| | | return deleteSamples(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addSample(data: Record<string, any>) { |
| | | return addSample(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addSample, |
| | | getSample, |
| | | updateSample, |
| | | } from './Service/SampleDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class SampleDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | sample: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addSample(data: Record<string, any>) { |
| | | return addSample(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateSample(id: string, data: Record<string, any>) { |
| | | return updateSample(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getSampleDetail(current: any, id?: string) { |
| | | return getSample(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addSample = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteSamples = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/sample', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addSample = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getSample = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/sample/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateSample = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/sample/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsArea = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsAreas = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsarea', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsArea = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsArea = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsarea/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsArea = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsarea/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsContainer = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsContainers = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmscontainer', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsContainer = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsContainer = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmscontainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmscontainer/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterials = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsmaterial', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsmaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsmaterial/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsPlace = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsPlaces = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsplace', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsPlace = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsPlace = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsplace/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsPlace = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsplace/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsStore = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsStores = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsstore', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsStore = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsStore = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsstore/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsStore = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsstore/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsAreas, |
| | | addWmsArea, |
| | | cloneData, |
| | | } from './Service/WmsArea' |
| | | |
| | | export class WmsArea extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsAreas(ids: string[]) { |
| | | return deleteWmsAreas(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsArea(data: Record<string, any>) { |
| | | return addWmsArea(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsArea, |
| | | getWmsArea, |
| | | updateWmsArea, |
| | | } from './Service/WmsAreaDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsAreaDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsarea: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsArea(data: Record<string, any>) { |
| | | return addWmsArea(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsArea(id: string, data: Record<string, any>) { |
| | | return updateWmsArea(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsAreaDetail(current: any, id?: string) { |
| | | return getWmsArea(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsContainers, |
| | | addWmsContainer, |
| | | cloneData, |
| | | } from './Service/WmsContainer' |
| | | |
| | | export class WmsContainer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsContainers(ids: string[]) { |
| | | return deleteWmsContainers(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsContainer(data: Record<string, any>) { |
| | | return addWmsContainer(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsContainer, |
| | | getWmsContainer, |
| | | updateWmsContainer, |
| | | } from './Service/WmsContainerDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsContainerDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmscontainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsContainer(data: Record<string, any>) { |
| | | return addWmsContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsContainerDetail(current: any, id?: string) { |
| | | return getWmsContainer(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterials, |
| | | addWmsMaterial, |
| | | cloneData, |
| | | } from './Service/WmsMaterial' |
| | | |
| | | export class WmsMaterial extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterials(ids: string[]) { |
| | | return deleteWmsMaterials(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | } from './Service/WmsMaterialDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsmaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsPlaces, |
| | | addWmsPlace, |
| | | cloneData, |
| | | } from './Service/WmsPlace' |
| | | |
| | | export class WmsPlace extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsPlaces(ids: string[]) { |
| | | return deleteWmsPlaces(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsPlace(data: Record<string, any>) { |
| | | return addWmsPlace(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsPlace, |
| | | getWmsPlace, |
| | | updateWmsPlace, |
| | | } from './Service/WmsPlaceDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsPlaceDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsplace: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsPlace(data: Record<string, any>) { |
| | | return addWmsPlace(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsPlace(id: string, data: Record<string, any>) { |
| | | return updateWmsPlace(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsPlaceDetail(current: any, id?: string) { |
| | | return getWmsPlace(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsStores, |
| | | addWmsStore, |
| | | cloneData, |
| | | } from './Service/WmsStore' |
| | | |
| | | export class WmsStore extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsStores(ids: string[]) { |
| | | return deleteWmsStores(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsStore(data: Record<string, any>) { |
| | | return addWmsStore(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsStore, |
| | | getWmsStore, |
| | | updateWmsStore, |
| | | } from './Service/WmsStoreDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsStoreDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsstore: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsStore(data: Record<string, any>) { |
| | | return addWmsStore(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsStore(id: string, data: Record<string, any>) { |
| | | return updateWmsStore(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsStoreDetail(current: any, id?: string) { |
| | | return getWmsStore(id || current?.id) |
| | | } |
| | | } |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Views/MyPluginName.module.scss ÐÞ¸Ä |
| | |
| | | .MyPluginName { |
| | | .HIAWms { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Views/MyPluginName.tsx ÐÞ¸Ä |
| | |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './MyPluginName.module.scss' |
| | | // import MyEntityName from './Pages/MyEntityName/MyEntityName' |
| | | import styles from './HIAWms.module.scss' |
| | | // import WmsContainer from './Pages/WmsContainer/WmsContainer' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyPluginName', |
| | | name: 'HIAWms', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const MyEntityName = markRaw(module.default) |
| | | const WmsContainer = markRaw(module.default) |
| | | tabData.value.push({ |
| | | label: name, |
| | | name, |
| | | component: MyEntityName, |
| | | component: WmsContainer, |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.MyPluginName}> |
| | | <div class={styles.HIAWms}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['MyEntityName'] = r)} |
| | | ref={(r: any) => (rf.value['WmsContainer'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ÐÞ¸Ä |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './SampleDrawer.module.scss' |
| | | import { useSampleDrawer } from '../../../../Controllers/SampleDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useSampleDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsAreaDrawer/WmsAreaDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsAreaDrawer/WmsAreaDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsAreaDrawer.module.scss' |
| | | import { useWmsAreaDrawer } from '../../../../Controllers/WmsAreaDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsAreaDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsContainerDrawer/WmsContainerDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsContainerDrawer/WmsContainerDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsContainerDrawer.module.scss' |
| | | import { useWmsContainerDrawer } from '../../../../Controllers/WmsContainerDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsContainerDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsMaterialDrawer/WmsMaterialDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsMaterialDrawer/WmsMaterialDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsMaterialDrawer.module.scss' |
| | | import { useWmsMaterialDrawer } from '../../../../Controllers/WmsMaterialDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsMaterialDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsPlaceDrawer/WmsPlaceDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsPlaceDrawer/WmsPlaceDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsPlaceDrawer.module.scss' |
| | | import { useWmsPlaceDrawer } from '../../../../Controllers/WmsPlaceDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsPlaceDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsStoreDrawer/WmsStoreDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Dialog/WmsStoreDrawer/WmsStoreDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsStoreDrawer.module.scss' |
| | | import { useWmsStoreDrawer } from '../../../../Controllers/WmsStoreDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsStoreDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/Sample/Sample.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .sampleContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .sampleList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ÐÞ¸Ä |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './Sample.module.scss' |
| | | import { useSample } from '../../../Controllers/Sample' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import SampleDrawer from '../Dialog/SampleDrawer/SampleDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'Sample', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmSample, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddSample, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useSample(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.sampleList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/sample/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.sampleContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <SampleDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmSample} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="sample-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddSample} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="sample-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/sample/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="sample-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/sample" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsArea/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsArea/WmsArea.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsareaContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsareaList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsArea/WmsArea.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsArea.module.scss' |
| | | import { useWmsArea } from '../../../Controllers/WmsArea' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsAreaDrawer from '../Dialog/WmsAreaDrawer/WmsAreaDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsArea', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsArea, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsArea, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsArea(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsareaList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsarea/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsareaContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsAreaDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsArea} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsarea-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsArea} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsarea-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsarea/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsarea-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsarea" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsContainer/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsContainer/WmsContainer.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmscontainerContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmscontainerList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsContainer/WmsContainer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsContainer.module.scss' |
| | | import { useWmsContainer } from '../../../Controllers/WmsContainer' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsContainerDrawer from '../Dialog/WmsContainerDrawer/WmsContainerDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsContainer', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsContainer, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsContainer(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmscontainerList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmscontainer/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmscontainerContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsContainerDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsContainer} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmscontainer-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsContainer} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmscontainer-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmscontainer/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmscontainer-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmscontainer" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsMaterial/Config.ts
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ÐÞ¸Ä |
| | |
| | | .myEntityNameContent { |
| | | .wmsmaterialContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsmaterialList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsMaterial.module.scss' |
| | | import { useWmsMaterial } from '../../../Controllers/WmsMaterial' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsMaterialDrawer from '../Dialog/WmsMaterialDrawer/WmsMaterialDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsMaterial', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsMaterial, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsMaterial(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsmaterialList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsmaterial/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsmaterialContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsMaterialDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsMaterial} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsmaterial-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsMaterial} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsmaterial-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsmaterial/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsmaterial-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsmaterial" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsPlace/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsPlace/WmsPlace.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsplaceContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsplaceList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsPlace/WmsPlace.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsPlace.module.scss' |
| | | import { useWmsPlace } from '../../../Controllers/WmsPlace' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsPlaceDrawer from '../Dialog/WmsPlaceDrawer/WmsPlaceDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsPlace', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsPlace, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsPlace, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsPlace(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsplaceList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsplace/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsplaceContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsPlaceDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsPlace} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsplace-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsPlace} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsplace-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsplace/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsplace-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsplace" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsStore/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsStore/WmsStore.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsstoreContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsstoreList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/app/template/HIAWms/Views/Pages/WmsStore/WmsStore.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsStore.module.scss' |
| | | import { useWmsStore } from '../../../Controllers/WmsStore' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsStoreDrawer from '../Dialog/WmsStoreDrawer/WmsStoreDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsStore', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsStore, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsStore, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsStore(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsstoreList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsstore/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsstoreContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsStoreDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsStore} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsstore-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsStore} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsstore-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsstore/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsstore-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsstore" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "Sample" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsArea" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsContainer" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsMaterial" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsPlace" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsStore" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmscontainer-list': 'å表-å表', |
| | | 'wmscontainer-add': 'å表-æ·»å ', |
| | | 'wmscontainer-import': 'å表-导å
¥', |
| | | 'wmscontainer-output': 'å表-è¾åº', |
| | | } |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/index.ts ÐÞ¸Ä |
| | |
| | | import MyPluginName from './Views/MyPluginName' |
| | | import HIAWms from './Views/HIAWms' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'MyPluginName', |
| | | is: 'HIAWms', |
| | | name: '${{widgetName}}', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(MyPluginName), |
| | | canvasView: provider(HIAWms), |
| | | settingsView: Setting, |
| | | } |
ÎļþÃû´Ó WMS/web/app/template/MyPluginName/type/Type.d.ts ÐÞ¸Ä |
| | |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface MyEntityNameBaseType { |
| | | export interface WmsContainerBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "information-base", |
| | | "version": "1.0.0", |
| | | "files": [ |
| | | "sdk", |
| | | "packages.json" |
| | | ], |
| | | "scripts": { |
| | | "menu": "node ./script/autoMenu.js", |
| | | "dev": "npm run menu && vite --host", |
| | | "open": "vite --host --open", |
| | | "build": "node ./script/build.js", |
| | | "build:all": "npm run menu && vite build", |
| | | "build-lib": "vite build --config=vite.lib.config.ts", |
| | | "widgets": "vite build --config=vite.lib.config.ts", |
| | | "serve": "vite preview --host --port=8888", |
| | | "build-serve": "npm run build && npm run serve", |
| | | "vue-tsc": "vue-tsc --noEmit", |
| | | "test": "jest" |
| | | }, |
| | | "dependencies": { |
| | | "@fullhuman/postcss-purgecss": "^5.0.0", |
| | | "@imengyu/vue3-context-menu": "1.3.5", |
| | | "@optimize-lodash/rollup-plugin": "^4.0.4", |
| | | "@vue/cli-service": "^5.0.4", |
| | | "@vueuse/core": "^10.4.1", |
| | | "axios": "^0.24.0", |
| | | "dayjs": "^1.11.10", |
| | | "echarts": "^5.4.3", |
| | | "element-plus": "2.6.3", |
| | | "fast-xml-parser": "4.3.5", |
| | | "jsencrypt": "^3.3.2", |
| | | "koa-compose": "^4.1.0", |
| | | "lightningcss": "^1.21.7", |
| | | "lodash": "^4.17.21", |
| | | "sortablejs": "^1.15.0", |
| | | "vite-plugin-qiankun": "^1.0.15", |
| | | "vite-plugin-single-spa": "^0.1.0", |
| | | "vue": "3.4.27", |
| | | "vue-i18n": "9.1.9", |
| | | "vue-router": "4.0.11", |
| | | "vuex": "4.0.2", |
| | | "vxe-table": "4.5.9", |
| | | "vxe-table-plugin-element": "^3.1.0", |
| | | "xe-utils": "^3.5.13" |
| | | }, |
| | | "devDependencies": { |
| | | "@babel/preset-typescript": "^7.16.7", |
| | | "cross-spawn": "7.0.5", |
| | | "@types/crypto-js": "^4.1.1", |
| | | "@types/jest": "^27.4.1", |
| | | "@types/keyboardjs": "^2.5.0", |
| | | "@types/lodash": "^4.14.181", |
| | | "@types/node": "^16.11.26", |
| | | "@types/sortablejs": "^1.13.0", |
| | | "@typescript-eslint/eslint-plugin": "^5.12.1", |
| | | "@typescript-eslint/parser": "^5.12.1", |
| | | "@vitejs/plugin-vue": "^2.3.3", |
| | | "@vitejs/plugin-vue-jsx": "^3.1.0", |
| | | "@vue/compiler-sfc": "^3.2.31", |
| | | "@vue/tsconfig": "^0.4.0", |
| | | "babel-eslint": "^10.1.0", |
| | | "eslint": "^8.12.0", |
| | | "eslint-config-airbnb": "^19.0.4", |
| | | "eslint-plugin-import": "^2.25.4", |
| | | "eslint-plugin-vue": "^8.5.0", |
| | | "eslint-plugin-vue-libs": "^4.0.0", |
| | | "glob": "10.2.6", |
| | | "jest": "^27.5.1", |
| | | "kill-port": "^2.0.1", |
| | | "lmes-create-widget": "^1.0.3", |
| | | "postcss": "8.4.29", |
| | | "sass": "1.49.9", |
| | | "slash": "3.0.0", |
| | | "terser": "^5.19.4", |
| | | "ts-jest": "^27.1.3", |
| | | "typescript": "^4.5.5", |
| | | "unplugin-auto-import": "^0.16.6", |
| | | "unplugin-element-plus": "^0.1.3", |
| | | "unplugin-vue-components": "^0.25.2", |
| | | "vite": "5.1.5", |
| | | "vite-plugin-build": "^0.10.0", |
| | | "vite-plugin-css-injected-by-js": "^3.1.1", |
| | | "vite-plugin-style-import": "^2.0.0", |
| | | "vite-plugin-vue-type-imports": "^0.2.5", |
| | | "vue-tsc": "^0.3.0" |
| | | }, |
| | | "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | const { writeFileSync, rmSync } = require('fs') |
| | | const { spawn } = require('node:child_process') |
| | | const { globSync } = require('glob') |
| | | const path = require('path') |
| | | |
| | | let isSingleBuild = false |
| | | const isWin = process.platform === 'win32' |
| | | const argvPath = './script/.argv' |
| | | const widgetName = process.argv[process.argv.length - 1] |
| | | const widgetsPath = globSync(`./src/widgets/*/index.ts`) |
| | | const getWidgetNames = widgetsPath.map((file) => { |
| | | const parts = isWin |
| | | ? path.resolve(file).split('\\') |
| | | : path.resolve(file).split('/') |
| | | return parts[parts.length - 2] |
| | | }) |
| | | |
| | | if (getWidgetNames.includes(widgetName)) { |
| | | isSingleBuild = true |
| | | writeFileSync(argvPath, widgetName) |
| | | } |
| | | |
| | | const run = spawn(process.platform === 'win32' ? 'npm.cmd' : 'npm', [ |
| | | 'run', |
| | | 'build-lib', |
| | | ]) |
| | | |
| | | run.stdout.on('data', (data) => console.info(data.toString('utf8'))) |
| | | |
| | | run.stderr.on('data', (data) => console.info(data.toString('utf8'))) |
| | | |
| | | run.on('close', (code) => { |
| | | if (code == 0 && isSingleBuild) rmSync(argvPath) |
| | | }) |
ÎļþÃû´Ó WMS/web/src/cms/sdk.es.ssr.js ÐÞ¸Ä |
| | |
| | | 'system-management-update', |
| | | 'system-management-update', |
| | | 'system-management-update', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | ], |
| | | }, |
| | | }, |
| | |
| | | 'system-management-update', |
| | | 'system-management-update', |
| | | 'system-management-update', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'myEntityName-list', |
| | | 'myEntityName-add', |
| | | 'myEntityName-import', |
| | | 'myEntityName-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | 'wmscontainer-list', |
| | | 'wmscontainer-add', |
| | | 'wmscontainer-import', |
| | | 'wmscontainer-output', |
| | | ], |
| | | }, |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const menu: Record<string,any>[] = [ |
| | | { |
| | | "name": "æµè¯", |
| | | "path": "/information-base/Ress", |
| | | "patchName": "Ress", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "HIAWms", |
| | | "path": "/information-base/HIAWms", |
| | | "patchName": "HIAWms", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "API请æ±", |
| | | "path": "/information-base/Http", |
| | | "patchName": "Http", |
| | | "icon": "p", |
| | | "notPage": false |
| | | } |
| | | ]; |
| | | export const menuMap: Record<string,any> = { |
| | | "Ress": { |
| | | "name": "æµè¯", |
| | | "path": "/information-base/Ress", |
| | | "patchName": "Ress", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "HIAWms": { |
| | | "name": "HIAWms", |
| | | "path": "/information-base/HIAWms", |
| | | "patchName": "HIAWms", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "Http": { |
| | | "name": "API请æ±", |
| | | "path": "/information-base/Http", |
| | | "patchName": "Http", |
| | | "icon": "p", |
| | | "notPage": false |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | reactive, |
| | | ref, |
| | | onUnmounted, |
| | | VNode, |
| | | DirectiveBinding, |
| | | Directive, |
| | | computed, |
| | | } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import sdk from 'sdk' |
| | | import { Permission, UserInfo, Props } from './Permission.d' |
| | | |
| | | /** |
| | | * å¼åç¯å¢ |
| | | */ |
| | | const isDev = process.env.NODE_ENV === 'development' |
| | | /** |
| | | * ç»ä»¶åæé |
| | | */ |
| | | let subsPermissions: Permission[] = [] |
| | | /** |
| | | * 临æ¶ç¼åæé |
| | | */ |
| | | const permissionCodes = ref<string[]>([]) |
| | | |
| | | /** |
| | | * æ ¡éªæéï¼ååºè¦å |
| | | * @param code |
| | | * @returns |
| | | */ |
| | | const isPermission = ( |
| | | code: (typeof subsPermissions)[number]['id'], |
| | | isHint = true |
| | | ) => { |
| | | if (!permissionCodes.value.includes(code)) { |
| | | isHint && ElMessage.warning('ç¨æ·æ²¡æè¯¥æéï¼') |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | export const vPermission: { [key: string]: Directive } = { |
| | | created( |
| | | el: HTMLElement, |
| | | binding: DirectiveBinding, |
| | | vNode: VNode, |
| | | prevVNode: VNode |
| | | ) { |
| | | el.addEventListener( |
| | | 'click', |
| | | (event: Event) => { |
| | | if (!isPermission(binding.value)) { |
| | | event.stopPropagation() |
| | | return false |
| | | } |
| | | }, |
| | | true |
| | | ) |
| | | }, |
| | | } |
| | | |
| | | /** |
| | | * 设置æé |
| | | * @param permissionMap |
| | | */ |
| | | const setPermissions = (permissionMap: Record<string, string>) => { |
| | | Object.entries(permissionMap).forEach(([key, value]) => { |
| | | subsPermissions.push({ |
| | | id: key, |
| | | name: value, |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * åå§åæé |
| | | * @param props |
| | | * @param permissionMap |
| | | * @example usePermission(props, { |
| | | * 'user-add': 'æ°å¢ç¨æ·', |
| | | * }) |
| | | */ |
| | | export const usePermission = ( |
| | | props: Props | any, |
| | | permissionMap: Record<string, string> |
| | | ) => { |
| | | subsPermissions = [] |
| | | permissionCodes.value = [] |
| | | setPermissions(permissionMap) |
| | | const node = computed(() => props.node || {}) |
| | | |
| | | const page = isDev |
| | | ? { |
| | | permissions: [], |
| | | } |
| | | : // @ts-ignore |
| | | window.app.current.project?.current.page |
| | | const permission = { |
| | | id: node.value?.id, |
| | | name: node.value?.name, |
| | | subs: subsPermissions, |
| | | } |
| | | |
| | | page.permissions = page.permissions || [] |
| | | |
| | | if ( |
| | | page.permissions.every( |
| | | (item: typeof permission) => item.id !== permission.id |
| | | ) |
| | | ) { |
| | | page.permissions.push(permission) |
| | | } |
| | | const userInfo: UserInfo = isDev |
| | | ? { permissions: { all: true, widgets: [] } } |
| | | : sdk.userInfo |
| | | |
| | | const { all, widgets } = userInfo.permissions |
| | | permissionCodes.value = all |
| | | ? permission.subs.map((item: Permission) => item.id) |
| | | : widgets |
| | | |
| | | onUnmounted(() => { |
| | | if (node.value) { |
| | | const index = page.permissions.findIndex( |
| | | (f: any) => f.id === node.value?.id |
| | | ) |
| | | if (index !== -1) { |
| | | page.permissions.splice(index, 1) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | return { |
| | | isPermission, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/File.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/File.ts
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/Sample.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { Sample } from '../Models/Sample' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useSample = (props: any, ctx?: any) => { |
| | | const sample = injectModel<Sample>('sample') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const sampleColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await sample.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await sample.deleteSamples(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddSample = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmSample = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/sample/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | sampleColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmSample, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddSample, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/SampleDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { SampleDrawer } from '../Models/SampleDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useSampleDrawer = (props: any, ctx?: any) => { |
| | | const sampleDrawer = |
| | | injectModel<SampleDrawer>('sampleDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await sampleDrawer.addSample(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await sampleDrawer.updateSample(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await sampleDrawer.getSampleDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsArea.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsArea } from '../Models/WmsArea' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsArea = (props: any, ctx?: any) => { |
| | | const wmsarea = injectModel<WmsArea>('wmsarea') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsareaColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsarea.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsarea.deleteWmsAreas(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsArea = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsArea = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsarea/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsareaColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsArea, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsArea, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsAreaDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsAreaDrawer } from '../Models/WmsAreaDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsAreaDrawer = (props: any, ctx?: any) => { |
| | | const wmsareaDrawer = |
| | | injectModel<WmsAreaDrawer>('wmsareaDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsareaDrawer.addWmsArea(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsareaDrawer.updateWmsArea(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsareaDrawer.getWmsAreaDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsContainer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsContainer } from '../Models/WmsContainer' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsContainer = (props: any, ctx?: any) => { |
| | | const wmscontainer = injectModel<WmsContainer>('wmscontainer') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmscontainerColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmscontainer.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmscontainer.deleteWmsContainers(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsContainer = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmscontainer/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmscontainerColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsContainer, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsContainerDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsContainerDrawer } from '../Models/WmsContainerDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsContainerDrawer = (props: any, ctx?: any) => { |
| | | const wmscontainerDrawer = |
| | | injectModel<WmsContainerDrawer>('wmscontainerDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmscontainerDrawer.addWmsContainer(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmscontainerDrawer.updateWmsContainer(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmscontainerDrawer.getWmsContainerDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsMaterial.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsMaterial } from '../Models/WmsMaterial' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsMaterial = (props: any, ctx?: any) => { |
| | | const wmsmaterial = injectModel<WmsMaterial>('wmsmaterial') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsmaterialColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsmaterial.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsmaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsMaterial = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsMaterial = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsmaterial/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsmaterialColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsMaterial, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsMaterialDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsMaterialDrawer } from '../Models/WmsMaterialDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsMaterialDrawer = (props: any, ctx?: any) => { |
| | | const wmsmaterialDrawer = |
| | | injectModel<WmsMaterialDrawer>('wmsmaterialDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsmaterialDrawer.addWmsMaterial(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsmaterialDrawer.updateWmsMaterial(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsmaterialDrawer.getWmsMaterialDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsPlace.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsPlace } from '../Models/WmsPlace' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsPlace = (props: any, ctx?: any) => { |
| | | const wmsplace = injectModel<WmsPlace>('wmsplace') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsplaceColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsplace.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsplace.deleteWmsPlaces(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsPlace = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsPlace = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsplace/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsplaceColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsPlace, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsPlace, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsPlaceDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsPlaceDrawer } from '../Models/WmsPlaceDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsPlaceDrawer = (props: any, ctx?: any) => { |
| | | const wmsplaceDrawer = |
| | | injectModel<WmsPlaceDrawer>('wmsplaceDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsplaceDrawer.addWmsPlace(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsplaceDrawer.updateWmsPlace(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsplaceDrawer.getWmsPlaceDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsStore.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityName } from '../Models/MyEntityName' |
| | | import { WmsStore } from '../Models/WmsStore' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useMyEntityName = (props: any, ctx?: any) => { |
| | | const myEntityName = injectModel<MyEntityName>('myEntityName') |
| | | export const useWmsStore = (props: any, ctx?: any) => { |
| | | const wmsstore = injectModel<WmsStore>('wmsstore') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const myEntityNameColumns = ref<Record<string, any>>([]) |
| | | const wmsstoreColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | |
| | | { |
| | | label: 'åå»ºå¯æ¬', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await myEntityName.cloneData([row.id]) |
| | | await wmsstore.cloneData([row.id]) |
| | | ElMessage.success('åå»ºå¯æ¬æå') |
| | | tableRef.value?.getList() |
| | | }, |
| | |
| | | `æ¯å¦å é¤${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id]) |
| | | await wmsstore.deleteWmsStores(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddMyEntityName = () => { |
| | | const onAddWmsStore = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | const onConfirmMyEntityName = async () => { |
| | | const onConfirmWmsStore = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/myPluginName/myEntityName/export', |
| | | '/api/v1/hiawms/wmsstore/export', |
| | | params, |
| | | 'myPluginName' |
| | | 'hiawms' |
| | | ) |
| | | } |
| | | |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | myEntityNameColumns, |
| | | wmsstoreColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsStore, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsStore, |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts
copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsStoreDrawer.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityNameDrawer.ts ¸´ÖÆ |
| | |
| | | import { ref, onMounted, reactive, computed, Ref, watch } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { MyEntityNameDrawer } from '../Models/MyEntityNameDrawer' |
| | | import { WmsStoreDrawer } from '../Models/WmsStoreDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useMyEntityNameDrawer = (props: any, ctx?: any) => { |
| | | const myEntityNameDrawer = |
| | | injectModel<MyEntityNameDrawer>('myEntityNameDrawer') |
| | | export const useWmsStoreDrawer = (props: any, ctx?: any) => { |
| | | const wmsstoreDrawer = |
| | | injectModel<WmsStoreDrawer>('wmsstoreDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | sort: props.sort, |
| | | } |
| | | if (!current.value) { |
| | | await myEntityNameDrawer.addMyEntityName(data) |
| | | await wmsstoreDrawer.addWmsStore(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await myEntityNameDrawer.updateMyEntityName(id, data) |
| | | await wmsstoreDrawer.updateWmsStore(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | |
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = await myEntityNameDrawer.getMyEntityNameDetail(current.value) |
| | | const res = await wmsstoreDrawer.getWmsStoreDetail(current.value) |
| | | |
| | | formData.value = { |
| | | name: res.name, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteSamples, |
| | | addSample, |
| | | cloneData, |
| | | } from './Service/Sample' |
| | | |
| | | export class Sample extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteSamples(ids: string[]) { |
| | | return deleteSamples(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addSample(data: Record<string, any>) { |
| | | return addSample(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addSample, |
| | | getSample, |
| | | updateSample, |
| | | } from './Service/SampleDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class SampleDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | sample: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addSample(data: Record<string, any>) { |
| | | return addSample(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateSample(id: string, data: Record<string, any>) { |
| | | return updateSample(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getSampleDetail(current: any, id?: string) { |
| | | return getSample(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addSample = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteSamples = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/sample', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addSample = (data: any) => { |
| | | return request.post('/api/v1/hiawms/sample', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getSample = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/sample/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateSample = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/sample/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsArea = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsAreas = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsarea', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsArea = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsarea', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsArea = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsarea/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsArea = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsarea/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsContainer = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsContainers = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmscontainer', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsContainer = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmscontainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsContainer = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmscontainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmscontainer/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterials = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsmaterial', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterial = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsmaterial', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterial = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsmaterial/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterial = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsmaterial/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsPlace = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsPlaces = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsplace', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsPlace = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsplace', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsPlace = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsplace/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsPlace = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsplace/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsStore = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsStores = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/hiawms/wmsstore', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore/clone', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsStore = (data: any) => { |
| | | return request.post('/api/v1/hiawms/wmsstore', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsStore = (id: string) => { |
| | | return request.get(`/api/v1/hiawms/wmsstore/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsStore = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/hiawms/wmsstore/${id}`, data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsAreas, |
| | | addWmsArea, |
| | | cloneData, |
| | | } from './Service/WmsArea' |
| | | |
| | | export class WmsArea extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsAreas(ids: string[]) { |
| | | return deleteWmsAreas(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsArea(data: Record<string, any>) { |
| | | return addWmsArea(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsArea, |
| | | getWmsArea, |
| | | updateWmsArea, |
| | | } from './Service/WmsAreaDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsAreaDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsarea: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsArea(data: Record<string, any>) { |
| | | return addWmsArea(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsArea(id: string, data: Record<string, any>) { |
| | | return updateWmsArea(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsAreaDetail(current: any, id?: string) { |
| | | return getWmsArea(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsContainers, |
| | | addWmsContainer, |
| | | cloneData, |
| | | } from './Service/WmsContainer' |
| | | |
| | | export class WmsContainer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsContainers(ids: string[]) { |
| | | return deleteWmsContainers(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsContainer(data: Record<string, any>) { |
| | | return addWmsContainer(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsContainer, |
| | | getWmsContainer, |
| | | updateWmsContainer, |
| | | } from './Service/WmsContainerDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsContainerDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmscontainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsContainer(data: Record<string, any>) { |
| | | return addWmsContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsContainerDetail(current: any, id?: string) { |
| | | return getWmsContainer(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterials, |
| | | addWmsMaterial, |
| | | cloneData, |
| | | } from './Service/WmsMaterial' |
| | | |
| | | export class WmsMaterial extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterials(ids: string[]) { |
| | | return deleteWmsMaterials(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterial, |
| | | getWmsMaterial, |
| | | updateWmsMaterial, |
| | | } from './Service/WmsMaterialDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsmaterial: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterial(data: Record<string, any>) { |
| | | return addWmsMaterial(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterial(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterial(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialDetail(current: any, id?: string) { |
| | | return getWmsMaterial(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsPlaces, |
| | | addWmsPlace, |
| | | cloneData, |
| | | } from './Service/WmsPlace' |
| | | |
| | | export class WmsPlace extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsPlaces(ids: string[]) { |
| | | return deleteWmsPlaces(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsPlace(data: Record<string, any>) { |
| | | return addWmsPlace(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsPlace, |
| | | getWmsPlace, |
| | | updateWmsPlace, |
| | | } from './Service/WmsPlaceDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsPlaceDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsplace: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsPlace(data: Record<string, any>) { |
| | | return addWmsPlace(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsPlace(id: string, data: Record<string, any>) { |
| | | return updateWmsPlace(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsPlaceDetail(current: any, id?: string) { |
| | | return getWmsPlace(id || current?.id) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsStores, |
| | | addWmsStore, |
| | | cloneData, |
| | | } from './Service/WmsStore' |
| | | |
| | | export class WmsStore extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsStores(ids: string[]) { |
| | | return deleteWmsStores(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsStore(data: Record<string, any>) { |
| | | return addWmsStore(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsStore, |
| | | getWmsStore, |
| | | updateWmsStore, |
| | | } from './Service/WmsStoreDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsStoreDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsstore: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsStore(data: Record<string, any>) { |
| | | return addWmsStore(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsStore(id: string, data: Record<string, any>) { |
| | | return updateWmsStore(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsStoreDetail(current: any, id?: string) { |
| | | return getWmsStore(id || current?.id) |
| | | } |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/MyPluginName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/HIAWms.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/MyPluginName.module.scss ¸´ÖÆ |
| | |
| | | .MyPluginName { |
| | | .HIAWms { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
ÎļþÃû´Ó WMS/web/src/widgets/MyPluginName/Views/MyPluginName.tsx ÐÞ¸Ä |
| | |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './MyPluginName.module.scss' |
| | | // import MyEntityName from './Pages/MyEntityName/MyEntityName' |
| | | import styles from './HIAWms.module.scss' |
| | | // import WmsContainer from './Pages/WmsContainer/WmsContainer' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyPluginName', |
| | | name: 'HIAWms', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const MyEntityName = markRaw(module.default) |
| | | const WmsContainer = markRaw(module.default) |
| | | tabData.value.push({ |
| | | label: name, |
| | | name, |
| | | component: MyEntityName, |
| | | component: WmsContainer, |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.MyPluginName}> |
| | | <div class={styles.HIAWms}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['MyEntityName'] = r)} |
| | | ref={(r: any) => (rf.value['WmsContainer'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/SampleDrawer/SampleDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/SampleDrawer/SampleDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './SampleDrawer.module.scss' |
| | | import { useSampleDrawer } from '../../../../Controllers/SampleDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useSampleDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsAreaDrawer/WmsAreaDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsAreaDrawer/WmsAreaDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsAreaDrawer.module.scss' |
| | | import { useWmsAreaDrawer } from '../../../../Controllers/WmsAreaDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsAreaDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsContainerDrawer/WmsContainerDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsContainerDrawer/WmsContainerDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsContainerDrawer.module.scss' |
| | | import { useWmsContainerDrawer } from '../../../../Controllers/WmsContainerDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsContainerDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsMaterialDrawer/WmsMaterialDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsMaterialDrawer/WmsMaterialDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsMaterialDrawer.module.scss' |
| | | import { useWmsMaterialDrawer } from '../../../../Controllers/WmsMaterialDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsMaterialDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsPlaceDrawer/WmsPlaceDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsPlaceDrawer/WmsPlaceDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsPlaceDrawer.module.scss' |
| | | import { useWmsPlaceDrawer } from '../../../../Controllers/WmsPlaceDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsPlaceDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsStoreDrawer/WmsStoreDrawer.module.scss
copy from WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Dialog/WmsStoreDrawer/WmsStoreDrawer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/Dialog/MyEntityNameDrawer/MyEntityNameDrawer.tsx ¸´ÖÆ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './MyEntityNameDrawer.module.scss' |
| | | import { useMyEntityNameDrawer } from '../../../../Controllers/MyEntityNameDrawer' |
| | | import styles from './WmsStoreDrawer.module.scss' |
| | | import { useWmsStoreDrawer } from '../../../../Controllers/WmsStoreDrawer' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useMyEntityNameDrawer(props, ctx) |
| | | } = useWmsStoreDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Sample/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Sample/Sample.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .sampleContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .sampleList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/Sample/Sample.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './Sample.module.scss' |
| | | import { useSample } from '../../../Controllers/Sample' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import SampleDrawer from '../Dialog/SampleDrawer/SampleDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'Sample', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmSample, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddSample, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useSample(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.sampleList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/sample/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.sampleContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <SampleDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmSample} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="sample-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddSample} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="sample-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/sample/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="sample-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/sample" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsArea/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsArea/WmsArea.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsareaContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsareaList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsArea/WmsArea.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsArea.module.scss' |
| | | import { useWmsArea } from '../../../Controllers/WmsArea' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsAreaDrawer from '../Dialog/WmsAreaDrawer/WmsAreaDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsArea', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsArea, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsArea, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsArea(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsareaList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsarea/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsareaContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsAreaDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsArea} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsarea-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsArea} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsarea-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsarea/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsarea-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsarea" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsContainer/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsContainer/WmsContainer.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmscontainerContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmscontainerList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsContainer/WmsContainer.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsContainer.module.scss' |
| | | import { useWmsContainer } from '../../../Controllers/WmsContainer' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsContainerDrawer from '../Dialog/WmsContainerDrawer/WmsContainerDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsContainer', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsContainer, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsContainer(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmscontainerList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmscontainer/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmscontainerContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsContainerDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsContainer} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmscontainer-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsContainer} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmscontainer-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmscontainer/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmscontainer-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmscontainer" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsMaterial/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsmaterialContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsmaterialList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsMaterial.module.scss' |
| | | import { useWmsMaterial } from '../../../Controllers/WmsMaterial' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsMaterialDrawer from '../Dialog/WmsMaterialDrawer/WmsMaterialDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsMaterial', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsMaterial, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsMaterial, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsMaterial(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsmaterialList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsmaterial/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsmaterialContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsMaterialDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsMaterial} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsmaterial-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsMaterial} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsmaterial-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsmaterial/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsmaterial-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsmaterial" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsPlace/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsPlace/WmsPlace.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsplaceContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsplaceList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsPlace/WmsPlace.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsPlace.module.scss' |
| | | import { useWmsPlace } from '../../../Controllers/WmsPlace' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsPlaceDrawer from '../Dialog/WmsPlaceDrawer/WmsPlaceDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsPlace', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsPlace, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsPlace, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsPlace(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsplaceList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsplace/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsplaceContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsPlaceDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsPlace} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsplace-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsPlace} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsplace-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsplace/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsplace-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsplace" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/Config.ts
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsStore/Config.ts
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsStore/WmsStore.module.scss
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.module.scss ¸´ÖÆ |
| | |
| | | .myEntityNameContent { |
| | | .wmsstoreContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | .myEntityNameList { |
| | | .wmsstoreList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
copy from WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
copy to HIAWms/web/src/widgets/HIAWms/Views/Pages/WmsStore/WmsStore.tsx
Îļþ´Ó WMS/web/app/template/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx ¸´ÖÆ |
| | |
| | | import { defineComponent } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import BaseTable from '@/components/Table/Table' |
| | | import styles from './MyEntityName.module.scss' |
| | | import { useMyEntityName } from '../../../Controllers/MyEntityName' |
| | | import styles from './WmsStore.module.scss' |
| | | import { useWmsStore } from '../../../Controllers/WmsStore' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer' |
| | | import WmsStoreDrawer from '../Dialog/WmsStoreDrawer/WmsStoreDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'MyEntityName', |
| | | name: 'WmsStore', |
| | | directives: { |
| | | permission: vPermission, |
| | | }, |
| | |
| | | onError, |
| | | onSearch, |
| | | onRowClick, |
| | | onConfirmMyEntityName, |
| | | onConfirmWmsStore, |
| | | onCheck, |
| | | onAddMyEntityName, |
| | | onAddWmsStore, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useMyEntityName(props, ctx) |
| | | } = useWmsStore(props, ctx) |
| | | |
| | | /** |
| | | * @returns è¡¨æ ¼ |
| | |
| | | return ( |
| | | <div |
| | | class={{ |
| | | [styles.myEntityNameList]: true, |
| | | [styles.wmsstoreList]: true, |
| | | }} |
| | | > |
| | | <BaseTable |
| | | ref={tableRef} |
| | | url={url} |
| | | sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}" |
| | | sortUrlTpl="/api/v1/hiawms/wmsstore/{id}/adjustsort/{sort}" |
| | | v-model:dataSource={dataSource.value} |
| | | columns={columns} |
| | | contextMenu={contextMenu} |
| | |
| | | } |
| | | return () => { |
| | | return ( |
| | | <div class={styles.myEntityNameContent}> |
| | | <div class={styles.wmsstoreContent}> |
| | | {/* æ·»å /ç¼è¾ */} |
| | | <MyEntityNameDrawer |
| | | <WmsStoreDrawer |
| | | v-model={dialogConfig.visible} |
| | | title={dialogConfig.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirm={onConfirmMyEntityName} |
| | | onConfirm={onConfirmWmsStore} |
| | | /> |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | <IconButton |
| | | v-permission="myEntityName-add" |
| | | v-permission="wmsstore-add" |
| | | icon="add-p" |
| | | onClick={onAddMyEntityName} |
| | | onClick={onAddWmsStore} |
| | | type="primary" |
| | | > |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | <el-upload |
| | | v-permission="myEntityName-import" |
| | | v-permission="wmsstore-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | | show-file-list={false} |
| | |
| | | onSuccess={onSuccess} |
| | | before-upload={onBeforeUpload} |
| | | headers={headers.value} |
| | | action="/api/v1/myPluginName/myEntityName/import" |
| | | action="/api/v1/hiawms/wmsstore/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="myEntityName-output" |
| | | v-permission="wmsstore-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | > |
| | |
| | | /> |
| | | </div> |
| | | <RenderBaseTable |
| | | url="/api/v1/myPluginName/myEntityName" |
| | | url="/api/v1/hiawms/wmsstore" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "Sample" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsArea" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsContainer" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsMaterial" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsPlace" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "WmsStore" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'wmscontainer-list': 'å表-å表', |
| | | 'wmscontainer-add': 'å表-æ·»å ', |
| | | 'wmscontainer-import': 'å表-导å
¥', |
| | | 'wmscontainer-output': 'å表-è¾åº', |
| | | } |
ÎļþÃû´Ó WMS/web/src/widgets/MyPluginName/index.ts ÐÞ¸Ä |
| | |
| | | import MyPluginName from './Views/MyPluginName' |
| | | import HIAWms from './Views/HIAWms' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'MyPluginName', |
| | | name: 'MyPluginName', |
| | | is: 'HIAWms', |
| | | name: 'HIAWms', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(MyPluginName), |
| | | canvasView: provider(HIAWms), |
| | | settingsView: Setting, |
| | | } |
copy from WMS/web/app/template/MyPluginName/type/Type.d.ts
copy to HIAWms/web/src/widgets/HIAWms/type/Type.d.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/type/Type.d.ts ¸´ÖÆ |
| | |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface MyEntityNameBaseType { |
| | | export interface WmsContainerBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
ÎļþÃû´Ó WMS/web/vite.config.ts ÐÞ¸Ä |
| | |
| | | |
| | | const isWin = process.platform === 'win32' |
| | | const appPath = slash(path.resolve(process.cwd(), 'app')) |
| | | |
| | | const getPort: () => Promise<string> = () => { |
| | | const runGoServer = () => { |
| | | const child: ChildProcess = crossSpawn( |
| | | isWin |
| | | ? '..\\node_modules\\lmes-create-widget\\port' |
| | | : '../node_modules/lmes-create-widget/port', |
| | | [], //æ·»å 端å£åç¯å¢åéåæ° |
| | | { |
| | | cwd: appPath, |
| | | shell: true, |
| | | env: { |
| | | ENV: 'production', |
| | | }, |
| | | } |
| | | ) |
| | | |
| | | let output = '' |
| | | return new Promise((resolve, reject) => { |
| | | // è·ååè¿ç¨çæ åè¾åº |
| | | child.stdout?.on('data', (data) => { |
| | | output += data.toString() |
| | | }) |
| | | |
| | | child.stderr?.on('data', (data) => { |
| | | console.error('stderr:', data.toString()) |
| | | }) |
| | | |
| | | child.on('close', (code) => { |
| | | if (code === 0) { |
| | | const port = output.split('\n')[0] |
| | | console.log('PROJECT_PORT:', port) |
| | | resolve(port) |
| | | } else { |
| | | reject(code) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | const runGoServer = (projectPort: string) => { |
| | | const child: ChildProcess = crossSpawn( |
| | | isWin |
| | | ? `..\\node_modules\\lmes-create-widget\\www ${projectPort}` |
| | | : `../node_modules/lmes-create-widget/www ${projectPort}`, |
| | | [], //æ·»å 端å£åç¯å¢åéåæ° |
| | | ? '..\\node_modules\\lmes-create-widget\\www' |
| | | : '../node_modules/lmes-create-widget/www', |
| | | { |
| | | stdio: 'inherit', |
| | | cwd: appPath, |
| | |
| | | process.exit(0) |
| | | } |
| | | } |
| | | const run = (projectPort: string) => { |
| | | const run = () => { |
| | | try { |
| | | runGoServer(projectPort) |
| | | runGoServer() |
| | | let lastPressTime = Date.now() |
| | | process.on('SIGINT', async () => { |
| | | const currentTime = Date.now() |
| | | if (lastPressTime && currentTime - lastPressTime < 2000) { |
| | | killGoServer(Number(projectPort)) |
| | | killGoServer(8800) |
| | | } else { |
| | | lastPressTime = Date.now() |
| | | } |
| | | }) |
| | | process.on('SIGTERM', () => { |
| | | console.log('è¿ç¨è¢« kill ç»æ¢...') |
| | | killGoServer(Number(projectPort)) |
| | | killGoServer(8800) |
| | | }) |
| | | } catch (error) { |
| | | console.error(error) |
| | | } |
| | | } |
| | | run() |
| | | // @ts-ignore |
| | | export default defineConfig(async ({ mode }) => { |
| | | const projectPort = await getPort() |
| | | run(projectPort) |
| | | export default defineConfig(({ mode }) => { |
| | | const env = loadEnv(mode, __dirname) |
| | | console.info('[mode]', mode) |
| | | console.info('[env]', env) |
| | |
| | | // requireTransform({}), |
| | | vueJsx(), |
| | | vue({ |
| | | // @ts-ignore |
| | | reactivityTransform: path.resolve(__dirname, 'src'), |
| | | }), |
| | | VueTypeImports(), |
| | |
| | | ws: true, |
| | | }, |
| | | '/projectApi': { |
| | | target: `http://127.0.0.1:${projectPort}`, |
| | | target: env.VITE_PROJECT_API_URL, |
| | | changeOrigin: true, |
| | | ws: true, |
| | | }, |
ÎļþÃû´Ó WMS/web/vite.lib.config.ts ÐÞ¸Ä |
| | |
| | | import VueTypeImports from 'vite-plugin-vue-type-imports' |
| | | const execa = require('execa') |
| | | const isWin = process.platform === 'win32' |
| | | const argvPath: string = './script/.argv' |
| | | const isSingleBuild = existsSync(argvPath) |
| | | const nodeIndex = process.env.NODE_INDEX |
| | | const baseBuildFile = './node_modules/.cache/widgets.json' |
| | | let getWidgetNames: Array<string> = [] |
| | | const argvPath: string = './script/.argv' |
| | | const isAllBuild = existsSync(argvPath) |
| | | |
| | | if (isSingleBuild) { |
| | | function getGitHash() { |
| | | return execa('git', ['rev-parse', '--short', 'HEAD']) |
| | | } |
| | | |
| | | function getGitBranch() { |
| | | return execa('git', ['rev-parse', '--abbrev-ref', 'HEAD']) |
| | | } |
| | | |
| | | function getGitUserName() { |
| | | return execa('git', ['config', 'user.name']) |
| | | } |
| | | |
| | | if (isAllBuild) { |
| | | const widgetName = readFileSync(argvPath, { encoding: 'utf8' }) |
| | | getWidgetNames.push(widgetName) |
| | | } else { |
| | | // æ§è¡å¤æ ¸å½ä»¤æå
|
| | | if (nodeIndex) { |
| | | const widgetNameMap = require(path.resolve(process.cwd(), baseBuildFile)) |
| | | getWidgetNames = widgetNameMap[nodeIndex] |
| | | } |
| | | const widgetsPath = globSync(`./src/widgets/*/index.ts`) |
| | | getWidgetNames = widgetsPath.map((file) => { |
| | | const parts = isWin |
| | | ? path.resolve(file).split('\\') |
| | | : path.resolve(file).split('/') |
| | | return parts[parts.length - 2] |
| | | }) |
| | | } |
| | | |
| | | const library: any = getWidgetNames.map((name) => { |
| | |
| | | |
| | | //@ts-ignore |
| | | export default defineConfig(async ({ mode }) => { |
| | | let commit |
| | | let branch |
| | | let userName |
| | | try { |
| | | commit = await getGitHash() |
| | | branch = await getGitBranch() |
| | | userName = await getGitUserName() |
| | | } catch (e) { |
| | | console.log(e) |
| | | } |
| | | |
| | | return { |
| | | define: { |
| | | 'process.env': process.env, |
| | | 'window.__BUILD_TIME__': `"${dayjs().format('YYYY-MM-DD HH:mm:ss')}"`, |
| | | 'window.__COMMIT__': `"${commit?.stdout}"`, |
| | | 'window.__BRANCH__': `"${branch?.stdout}"`, |
| | | 'window.__USER_NAME__': `"${userName?.stdout}"`, |
| | | }, |
| | | resolve: { |
| | | alias: { |