Browse Source

update

master
wanggang 1 year ago
parent
commit
e89e48b1dd
  1. 24
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/pages/component.html
  2. 66
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  3. 56
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiService.cs

24
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/assets/demo/pages/component.html

@ -28,7 +28,7 @@
const simpleComponent = {
components: {},//组件注册
template: `<label>子组件:<input type="text" v-model="model.value"></label>
<button @click="$emit('click','call parent method from child')">click</button>`,
<button @click="onClick">click</button>`,
props: ['modelValue'],
emit: ["update:modelValue"],
setup(props, context) {
@ -39,10 +39,18 @@
alert('child method');
}
const callback = (result) => {
alert(`paretn method callback: ${result}`);
}
const onClick = () => {
context.emit('click', 'call parent method from child', callback)
};
context.expose({ childMethod });
return {
model,
childMethod
childMethod,
onClick
};
}
};
@ -59,11 +67,21 @@
value: "test"
});
const onClick = () => {
console.log(props, context);
childRef.value.childMethod();
};
const parentMethod = o => alert(o);
const parentMethod = (o, callback) => {
alert(o);
callback('from parent');
};
onMounted(() => {
console.log(childRef.value)
});
return {
model,
childRef,
onClick,
parentMethod
};

66
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -0,0 +1,66 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{
string Test();
void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
Task<PagedResultDto<VmiBalance>> Query(RequestDto request);
}
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency
{
private readonly INormalEfCoreRepository<VmiBalance, Guid> _repository;
public VmiAppService(INormalEfCoreRepository<VmiBalance, Guid> repository)
{
this._repository = repository;
}
[HttpPost]
public void Invoke()
{
Console.WriteLine($"{nameof(VmiAppService)}:{DateTime.Now}");
}
[HttpPost]
public void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
[HttpPost]
public void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Query(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
//var dtos = ObjectMapper.Map<List<CodeSetting>, List<CodeSettingDto>>(entities);
return new PagedResultDto<VmiBalance>(totalCount, entities);
}
[HttpGet]
public string Test()
{
return "Test";
}
}

56
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiService.cs

@ -1,56 +0,0 @@
using System;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{
string Test();
void In();
void Out();
IQueryable<VmiBalance> Query();
}
[ApiExplorerSettings(IgnoreApi = true)]
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class VmiService : IVmiService
{
[NonAction]
public void Invoke()
{
Console.WriteLine($"{nameof(VmiService)}:{DateTime.Now}");
}
[NonAction]
public void In()
{
throw new System.NotImplementedException();
}
[NonAction]
public void Out()
{
throw new System.NotImplementedException();
}
[HttpPost]
public IQueryable<VmiBalance> Query()
{
throw new System.NotImplementedException();
}
[HttpGet]
public string Test()
{
return "Test";
}
}
Loading…
Cancel
Save