😎1、增加国家地名库同步 2、增加根据区划生成组织架构 3、调整组织架构种子 4、默认不发异常邮件 5、修复在线用户连接异常 6、其他优化
This commit is contained in:
parent
79c5ddcb89
commit
e614e11b76
@ -18,9 +18,9 @@
|
|||||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.1" />
|
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.1" />
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.3" />
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.4" />
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.3" />
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.4" />
|
||||||
<PackageReference Include="Furion.Pure" Version="4.9.5.3" />
|
<PackageReference Include="Furion.Pure" Version="4.9.5.4" />
|
||||||
<PackageReference Include="Hardware.Info" Version="100.1.0.1" />
|
<PackageReference Include="Hardware.Info" Version="100.1.0.1" />
|
||||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||||
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
||||||
@ -34,12 +34,12 @@
|
|||||||
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
|
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
|
||||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.4.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.5.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.7.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.7.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.166" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.166" />
|
||||||
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
||||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.4" />
|
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.4" />
|
||||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1067" />
|
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1069" />
|
||||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -77,7 +77,6 @@ public class SysWechatRefund : EntityBase
|
|||||||
[SugarColumn(ColumnDescription = "关联的商户订单状态", Length = 32)]
|
[SugarColumn(ColumnDescription = "关联的商户订单状态", Length = 32)]
|
||||||
public string OrderStatus { get; set; }
|
public string OrderStatus { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关联的商户商品编码
|
/// 关联的商户商品编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -49,6 +49,8 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
|||||||
var tenantId = (httpContext.User.FindFirst(ClaimConst.TenantId)?.Value).ToLong();
|
var tenantId = (httpContext.User.FindFirst(ClaimConst.TenantId)?.Value).ToLong();
|
||||||
var loginMode = (LoginModeEnum)(httpContext.User.FindFirst(ClaimConst.LoginMode)?.Value).ToInt();
|
var loginMode = (LoginModeEnum)(httpContext.User.FindFirst(ClaimConst.LoginMode)?.Value).ToInt();
|
||||||
var device = httpContext.GetClientDeviceInfo().Trim();
|
var device = httpContext.GetClientDeviceInfo().Trim();
|
||||||
|
|
||||||
|
if (userId < 0 || string.IsNullOrWhiteSpace(account)) return;
|
||||||
var user = new SysOnlineUser
|
var user = new SysOnlineUser
|
||||||
{
|
{
|
||||||
ConnectionId = Context.ConnectionId,
|
ConnectionId = Context.ConnectionId,
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
|||||||
new SysConfig{ Id=1300000000171, Name="图形验证码", Code=ConfigConst.SysCaptcha, Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000171, Name="图形验证码", Code=ConfigConst.SysCaptcha, Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code=ConfigConst.SysTokenExpire, Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code=ConfigConst.SysTokenExpire, Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000191, Name="RefreshToken过期时间", Code=ConfigConst.SysRefreshTokenExpire, Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000191, Name="RefreshToken过期时间", Code=ConfigConst.SysRefreshTokenExpire, Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="False", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000211, Name="域登录验证", Code=ConfigConst.SysDomainLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000211, Name="域登录验证", Code=ConfigConst.SysDomainLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000221, Name="数据校验日志", Code=ConfigConst.SysValidationLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000221, Name="数据校验日志", Code=ConfigConst.SysValidationLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code=ConfigConst.SysRegionSyncLevel, Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code=ConfigConst.SysRegionSyncLevel, Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
|
|||||||
@ -20,22 +20,11 @@ public class SysOrgSeedData : ISqlSugarEntitySeedData<SysOrg>
|
|||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId, Pid=0, Name="XXX公司", Code="1001", Type="101", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="XXX公司", TenantId=SqlSugarConst.DefaultTenantId },
|
new SysOrg{ Id=SqlSugarConst.DefaultTenantId, Pid=0, Name="系统默认", Code="1001", Type="101", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="系统默认", TenantId=SqlSugarConst.DefaultTenantId },
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 1, Pid=SqlSugarConst.DefaultTenantId, Name="市场部", Code="100101", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 1, Pid=SqlSugarConst.DefaultTenantId, Name="市场部", Code="100101", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 2, Pid=SqlSugarConst.DefaultTenantId, Name="研发部", Code="100102", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="研发部", TenantId=SqlSugarConst.DefaultTenantId },
|
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 2, Pid=SqlSugarConst.DefaultTenantId, Name="开发部", Code="100102", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="开发部", TenantId=SqlSugarConst.DefaultTenantId },
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 3, Pid=SqlSugarConst.DefaultTenantId, Name="财务部", Code="100103", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="财务部", TenantId=SqlSugarConst.DefaultTenantId },
|
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 3, Pid=SqlSugarConst.DefaultTenantId, Name="售后部", Code="100103", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="售后部", TenantId=SqlSugarConst.DefaultTenantId },
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 4, Pid=SqlSugarConst.DefaultTenantId, Name="财务部1", Code="10010301", Level=3, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="财务部1", TenantId=SqlSugarConst.DefaultTenantId },
|
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 4, Pid=SqlSugarConst.DefaultTenantId, Name="其他", Code="10010301", Level=3, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="其他", TenantId=SqlSugarConst.DefaultTenantId },
|
||||||
new SysOrg{ Id=SqlSugarConst.DefaultTenantId + 5, Pid=SqlSugarConst.DefaultTenantId, Name="财务部2", Code="10010302", Level=3, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="财务部2", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
|
|
||||||
new SysOrg{ Id=1300000000201, Pid=0, Name="分公司1", Code="1002", Type="201", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="分公司1", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000202, Pid=1300000000201, Name="市场部", Code="100201", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000203, Pid=1300000000201, Name="研发部", Code="100202", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="研发部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000204, Pid=1300000000201, Name="财务部", Code="100203", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="财务部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
|
|
||||||
new SysOrg{ Id=1300000000301, Pid=0, Name="分公司2", Code="1003", Type="201", Level=1, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="分公司2", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000302, Pid=1300000000301, Name="市场部", Code="100301", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000303, Pid=1300000000301, Name="研发部", Code="100302", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
new SysOrg{ Id=1300000000304, Pid=1300000000301, Name="财务部", Code="100303", Level=2, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), Remark="市场部", TenantId=SqlSugarConst.DefaultTenantId },
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,3 +57,16 @@ public class SyncInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string City { get; set; }
|
public string City { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GenOrgInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 区域Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成层级
|
||||||
|
/// </summary>
|
||||||
|
public int Level { get; set; }
|
||||||
|
}
|
||||||
@ -335,11 +335,60 @@ public class SysRegionService : IDynamicApiController, ITransient
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成组织架构
|
/// 生成组织架构
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("生成组织架构")]
|
[DisplayName("生成组织架构")]
|
||||||
public async Task GenOrg(long Id)
|
public async Task GenOrg(GenOrgInput input)
|
||||||
{
|
{
|
||||||
await Task.CompletedTask;
|
var region = await _sysRegionRep.GetByIdAsync(input.Id);
|
||||||
|
var orgRep = _sysRegionRep.ChangeRepository<SqlSugarRepository<SysOrg>>();
|
||||||
|
if (!await orgRep.IsAnyAsync(u => u.Id == region.Pid))
|
||||||
|
region.Pid = 0;
|
||||||
|
|
||||||
|
var regionList = await GetRegionListByLevel(region, input.Level);
|
||||||
|
var orgList = regionList.Adapt<List<SysOrg>>();
|
||||||
|
await orgRep.InsertOrUpdateAsync(orgList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据层级获取行政区域数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="region"></param>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<List<SysRegion>> GetRegionListByLevel(SysRegion region, int level)
|
||||||
|
{
|
||||||
|
var regionList = new List<SysRegion>();
|
||||||
|
if (level > 5) level = 5;
|
||||||
|
regionList.Add(region);
|
||||||
|
|
||||||
|
if (level == 1) return regionList;
|
||||||
|
var regionList2 = await GetList(new RegionInput { Id = region.Id });
|
||||||
|
regionList.AddRange(regionList2);
|
||||||
|
|
||||||
|
if (level == 2) return regionList;
|
||||||
|
foreach (var item in regionList2)
|
||||||
|
{
|
||||||
|
var regionList3 = await GetList(new RegionInput { Id = item.Id });
|
||||||
|
if (regionList3 == null) continue;
|
||||||
|
regionList.AddRange(regionList3);
|
||||||
|
|
||||||
|
if (level == 3) continue;
|
||||||
|
foreach (var item3 in regionList3)
|
||||||
|
{
|
||||||
|
var regionList4 = await GetList(new RegionInput { Id = item3.Id });
|
||||||
|
if (regionList4 == null) continue;
|
||||||
|
regionList.AddRange(regionList4);
|
||||||
|
|
||||||
|
if (level == 4) continue;
|
||||||
|
foreach (var item4 in regionList4)
|
||||||
|
{
|
||||||
|
var regionList5 = await GetList(new RegionInput { Id = item4.Id });
|
||||||
|
if (regionList5 == null) continue;
|
||||||
|
regionList.AddRange(regionList5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return regionList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.1 KiB |
@ -87,7 +87,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
||||||
"@typescript-eslint/parser": "^8.1.0",
|
"@typescript-eslint/parser": "^8.1.0",
|
||||||
"@vitejs/plugin-vue": "^5.1.2",
|
"@vitejs/plugin-vue": "^5.1.2",
|
||||||
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
||||||
"@vue/compiler-sfc": "^3.4.37",
|
"@vue/compiler-sfc": "^3.4.37",
|
||||||
"code-inspector-plugin": "^0.15.2",
|
"code-inspector-plugin": "^0.15.2",
|
||||||
"eslint": "^9.9.0",
|
"eslint": "^9.9.0",
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import { AdminResultInt64 } from '../models';
|
|||||||
import { AdminResultListSysRegion } from '../models';
|
import { AdminResultListSysRegion } from '../models';
|
||||||
import { AdminResultSqlSugarPagedListSysRegion } from '../models';
|
import { AdminResultSqlSugarPagedListSysRegion } from '../models';
|
||||||
import { DeleteRegionInput } from '../models';
|
import { DeleteRegionInput } from '../models';
|
||||||
|
import { GenOrgInput } from '../models';
|
||||||
import { PageRegionInput } from '../models';
|
import { PageRegionInput } from '../models';
|
||||||
import { SyncInput } from '../models';
|
import { SyncInput } from '../models';
|
||||||
import { UpdateRegionInput } from '../models';
|
import { UpdateRegionInput } from '../models';
|
||||||
@ -131,17 +132,12 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 生成组织架构
|
* @summary 生成组织架构
|
||||||
* @param {number} id
|
* @param {GenOrgInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysRegionGenOrgIdPost: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysRegionGenOrgPost: async (body?: GenOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
// verify required parameter 'id' is not null or undefined
|
const localVarPath = `/api/sysRegion/genOrg`;
|
||||||
if (id === null || id === undefined) {
|
|
||||||
throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysRegionGenOrgIdPost.');
|
|
||||||
}
|
|
||||||
const localVarPath = `/api/sysRegion/genOrg/{id}`
|
|
||||||
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
let baseOptions;
|
let baseOptions;
|
||||||
@ -161,6 +157,8 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
for (const key in localVarQueryParameter) {
|
for (const key in localVarQueryParameter) {
|
||||||
query.set(key, localVarQueryParameter[key]);
|
query.set(key, localVarQueryParameter[key]);
|
||||||
@ -171,6 +169,8 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||||
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
@ -462,12 +462,12 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 生成组织架构
|
* @summary 生成组织架构
|
||||||
* @param {number} id
|
* @param {GenOrgInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysRegionGenOrgIdPost(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
async apiSysRegionGenOrgPost(body?: GenOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||||
const localVarAxiosArgs = await SysRegionApiAxiosParamCreator(configuration).apiSysRegionGenOrgIdPost(id, options);
|
const localVarAxiosArgs = await SysRegionApiAxiosParamCreator(configuration).apiSysRegionGenOrgPost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
@ -575,12 +575,12 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 生成组织架构
|
* @summary 生成组织架构
|
||||||
* @param {number} id
|
* @param {GenOrgInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysRegionGenOrgIdPost(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
async apiSysRegionGenOrgPost(body?: GenOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
return SysRegionApiFp(configuration).apiSysRegionGenOrgIdPost(id, options).then((request) => request(axios, basePath));
|
return SysRegionApiFp(configuration).apiSysRegionGenOrgPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -667,13 +667,13 @@ export class SysRegionApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 生成组织架构
|
* @summary 生成组织架构
|
||||||
* @param {number} id
|
* @param {GenOrgInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysRegionApi
|
* @memberof SysRegionApi
|
||||||
*/
|
*/
|
||||||
public async apiSysRegionGenOrgIdPost(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
public async apiSysRegionGenOrgPost(body?: GenOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
return SysRegionApiFp(this.configuration).apiSysRegionGenOrgIdPost(id, options).then((request) => request(this.axios, this.basePath));
|
return SysRegionApiFp(this.configuration).apiSysRegionGenOrgPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
38
Web/src/api-services/models/gen-org-input.ts
Normal file
38
Web/src/api-services/models/gen-org-input.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Admin.NET 通用权限开发平台
|
||||||
|
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface GenOrgInput
|
||||||
|
*/
|
||||||
|
export interface GenOrgInput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域Id
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof GenOrgInput
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成层级
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof GenOrgInput
|
||||||
|
*/
|
||||||
|
level?: number;
|
||||||
|
}
|
||||||
@ -196,6 +196,7 @@ export * from './filter-operator-enum';
|
|||||||
export * from './finish-status-enum';
|
export * from './finish-status-enum';
|
||||||
export * from './from';
|
export * from './from';
|
||||||
export * from './gen-auth-url-input';
|
export * from './gen-auth-url-input';
|
||||||
|
export * from './gen-org-input';
|
||||||
export * from './gender-enum';
|
export * from './gender-enum';
|
||||||
export * from './generate-qrimage-input';
|
export * from './generate-qrimage-input';
|
||||||
export * from './generate-qrimage-output';
|
export * from './generate-qrimage-output';
|
||||||
|
|||||||
@ -85,18 +85,18 @@ export interface PageSysWechatPayInput {
|
|||||||
/**
|
/**
|
||||||
* order_id
|
* order_id
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof PageSysWechatPayInput
|
* @memberof PageSysWechatPayInput
|
||||||
*/
|
*/
|
||||||
orderId?: number | null;
|
orderId?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* order_status
|
* order_status
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof PageSysWechatPayInput
|
* @memberof PageSysWechatPayInput
|
||||||
*/
|
*/
|
||||||
orderStatus?: number | null;
|
orderStatus?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* out_trade_number
|
* out_trade_number
|
||||||
|
|||||||
@ -55,18 +55,18 @@ export interface RefundRequestInput {
|
|||||||
/**
|
/**
|
||||||
* 关联的商户订单号
|
* 关联的商户订单号
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof RefundRequestInput
|
* @memberof RefundRequestInput
|
||||||
*/
|
*/
|
||||||
orderId?: number;
|
orderId?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof RefundRequestInput
|
* @memberof RefundRequestInput
|
||||||
*/
|
*/
|
||||||
orderStatus?: number;
|
orderStatus?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的商户商品编码
|
* 关联的商户商品编码
|
||||||
|
|||||||
@ -87,18 +87,18 @@ export interface SysWechatPay {
|
|||||||
/**
|
/**
|
||||||
* 关联的商户订单号
|
* 关联的商户订单号
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof SysWechatPay
|
* @memberof SysWechatPay
|
||||||
*/
|
*/
|
||||||
orderId?: number;
|
orderId?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof SysWechatPay
|
* @memberof SysWechatPay
|
||||||
*/
|
*/
|
||||||
orderStatus?: number;
|
orderStatus?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户号
|
* 微信商户号
|
||||||
|
|||||||
@ -63,16 +63,16 @@ export interface WechatPayTransactionInput {
|
|||||||
/**
|
/**
|
||||||
* 关联的商户订单号
|
* 关联的商户订单号
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof WechatPayTransactionInput
|
* @memberof WechatPayTransactionInput
|
||||||
*/
|
*/
|
||||||
orderId?: number;
|
orderId?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的商户订单付款状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
* 关联的商户订单付款状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {string}
|
||||||
* @memberof WechatPayTransactionInput
|
* @memberof WechatPayTransactionInput
|
||||||
*/
|
*/
|
||||||
orderStatus?: number;
|
orderStatus?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<span> {{ props.title }} </span>
|
<span> {{ props.title }} </span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div style="color: red; padding: 15px 15px; background: #faecd8; margin-bottom: 10px">
|
<div style="color: red; padding: 10px 10px; background: #faecd8; margin-bottom: 10px">
|
||||||
<el-icon style="transform: translateY(2px)"><ele-Bell /></el-icon>
|
<el-icon style="transform: translateY(2px)"><ele-Bell /></el-icon>
|
||||||
<span> 如果是在前端生成的实体/表(在生成表选择项里面找不到),请重启后台服务后再进行代码生成。 </span>
|
<span> 如果是在前端生成的实体/表(在生成表选择项里面找不到),请重启后台服务后再进行代码生成。 </span>
|
||||||
</div>
|
</div>
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<div>
|
<div>
|
||||||
生成表
|
生成表
|
||||||
<el-tooltip raw-content content="如果是在前端生成的实体/表(在生成表选择项里面找不到),请重启后台服务后再进行代码生成。" placement="top">
|
<el-tooltip raw-content content="如果是在前端生成的实体/表(在生成表选择项里面找不到),请重启后台服务后再进行代码生成。" placement="top">
|
||||||
<SvgIcon name="fa fa-question-circle-o" :size="16" />
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-QuestionFilled /></el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -135,6 +135,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="接口模式" prop="isApiService">
|
<el-form-item label="接口模式" prop="isApiService">
|
||||||
|
<template v-slot:label>
|
||||||
|
<div>
|
||||||
|
接口模式
|
||||||
|
<el-tooltip raw-content content="API Service 模式是自动生成前端接口请求文件,推荐此模式。不使用则是指自定义前端接口请求。" placement="top">
|
||||||
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-QuestionFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<el-radio-group v-model="state.ruleForm.isApiService">
|
<el-radio-group v-model="state.ruleForm.isApiService">
|
||||||
<el-radio :value="true">使用API Service</el-radio>
|
<el-radio :value="true">使用API Service</el-radio>
|
||||||
<el-radio :value="false">不使用</el-radio>
|
<el-radio :value="false">不使用</el-radio>
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
>
|
>
|
||||||
<template #default="{ node }">
|
<template #default="{ node }">
|
||||||
<el-icon v-if="node.level == 1" size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-School /></el-icon>
|
<el-icon v-if="node.level == 1" size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-School /></el-icon>
|
||||||
<el-icon v-else-if="node.level == 2" size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-PriceTag /></el-icon>
|
<el-icon v-else-if="node.level == 2" size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-Refrigerator /></el-icon>
|
||||||
<el-icon v-else size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-CollectionTag /></el-icon>
|
<el-icon v-else size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-CollectionTag /></el-icon>
|
||||||
{{ node.label }}
|
{{ node.label }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
97
Web/src/views/system/region/component/genOrgLevel.vue
Normal file
97
Web/src/views/system/region/component/genOrgLevel.vue
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sys-region-container">
|
||||||
|
<el-dialog v-model="state.isShowDialog" draggable overflow destroy-on-close width="500px">
|
||||||
|
<template #header>
|
||||||
|
<div style="color: #fff">
|
||||||
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
|
<span> {{ props.title }} </span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div style="color: red; padding: 10px 10px; background: #faecd8; margin-bottom: 10px">
|
||||||
|
<el-icon style="transform: translateY(2px)"><ele-Bell /></el-icon>
|
||||||
|
<span> 只会更新和新增组织架构,不会删除已有的组织架构数据! </span>
|
||||||
|
</div>
|
||||||
|
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto" label-position="top">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
|
<el-form-item label="选择层级" prop="level" :rules="[{ required: true, message: '请选择层级', trigger: 'blur' }]">
|
||||||
|
<el-select v-model="state.ruleForm.level" filterable clearable class="w100">
|
||||||
|
<el-option :label="1" :value="1" />
|
||||||
|
<el-option :label="2" :value="2" />
|
||||||
|
<el-option :label="3" :value="3" />
|
||||||
|
<el-option :label="4" :value="4" />
|
||||||
|
<el-option :label="5" :value="5" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" v-loading="state.loading" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
|
import { ElMessage, ElNotification } from 'element-plus';
|
||||||
|
|
||||||
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
|
import { SysRegionApi } from '/@/api-services/api';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: String,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(['handleQuery']);
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
loading: false,
|
||||||
|
ruleForm: { level: 3 } as any,
|
||||||
|
isShowDialog: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (id: any) => {
|
||||||
|
if (!id) ElMessage.error('行政区域数据错误!');
|
||||||
|
state.ruleForm.id = id;
|
||||||
|
ruleFormRef.value?.resetFields();
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits('handleQuery');
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消
|
||||||
|
const cancel = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const submit = () => {
|
||||||
|
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: '努力生成中...',
|
||||||
|
type: 'success',
|
||||||
|
position: 'bottom-right',
|
||||||
|
});
|
||||||
|
state.loading = true;
|
||||||
|
await getAPI(SysRegionApi).apiSysRegionGenOrgPost(state.ruleForm);
|
||||||
|
closeDialog();
|
||||||
|
|
||||||
|
ElMessage.success('生成成功');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出对象
|
||||||
|
defineExpose({ openDialog });
|
||||||
|
</script>
|
||||||
87
Web/src/views/system/region/component/syncMcaParam.vue
Normal file
87
Web/src/views/system/region/component/syncMcaParam.vue
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sys-region-container">
|
||||||
|
<el-dialog v-model="state.isShowDialog" draggable overflow destroy-on-close width="500px">
|
||||||
|
<template #header>
|
||||||
|
<div style="color: #fff">
|
||||||
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
|
<span> {{ props.title }} </span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto" label-position="top">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
|
<el-form-item label="指定区划代码" prop="code" :rules="[{ required: true, message: '区划代码不能为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="state.ruleForm.code" placeholder="指定区划代码" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<a href="https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html" target="_blank" style="float: left">查看区划代码:国家统计局</a>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" v-loading="state.loading" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
|
import { ElMessage, ElNotification } from 'element-plus';
|
||||||
|
|
||||||
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
|
import { SysRegionApi } from '/@/api-services/api';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: String,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(['handleQuery']);
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
loading: false,
|
||||||
|
ruleForm: {} as any,
|
||||||
|
isShowDialog: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = () => {
|
||||||
|
state.ruleForm.code = '';
|
||||||
|
ruleFormRef.value?.resetFields();
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits('handleQuery');
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消
|
||||||
|
const cancel = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const submit = () => {
|
||||||
|
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: '努力同步中...',
|
||||||
|
type: 'success',
|
||||||
|
position: 'bottom-right',
|
||||||
|
});
|
||||||
|
state.loading = true;
|
||||||
|
await getAPI(SysRegionApi).apiSysRegionSyncRegionMcaCodePost(state.ruleForm.code);
|
||||||
|
closeDialog();
|
||||||
|
|
||||||
|
ElMessage.success('生成成功');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出对象
|
||||||
|
defineExpose({ openDialog });
|
||||||
|
</script>
|
||||||
99
Web/src/views/system/region/component/syncStatsParam.vue
Normal file
99
Web/src/views/system/region/component/syncStatsParam.vue
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sys-region-container">
|
||||||
|
<el-dialog v-model="state.isShowDialog" draggable overflow destroy-on-close width="500px">
|
||||||
|
<template #header>
|
||||||
|
<div style="color: #fff">
|
||||||
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
|
<span> {{ props.title }} </span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div style="color: red; padding: 10px 10px; background: #faecd8; margin-bottom: 10px">
|
||||||
|
<el-icon style="transform: translateY(2px)"><ele-Bell /></el-icon>
|
||||||
|
<span> 不建议不指定任何省市名称直接生成全国区划数据,数据超大! </span>
|
||||||
|
</div>
|
||||||
|
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto" label-position="top">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
|
<el-form-item label="省级名称">
|
||||||
|
<el-input v-model="state.ruleForm.province" placeholder="指定省级名称" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
|
<el-form-item label="市级名称">
|
||||||
|
<el-input v-model="state.ruleForm.city" placeholder="指定市级名称" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<a href="https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html" target="_blank" style="float: left">查看区划名称:国家统计局</a>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
<el-button type="primary" v-loading="state.loading" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref } from 'vue';
|
||||||
|
import { ElMessage, ElNotification } from 'element-plus';
|
||||||
|
|
||||||
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
|
import { SysRegionApi } from '/@/api-services/api';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: String,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(['handleQuery']);
|
||||||
|
const ruleFormRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
loading: false,
|
||||||
|
ruleForm: {} as any,
|
||||||
|
isShowDialog: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = () => {
|
||||||
|
ruleFormRef.value?.resetFields();
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits('handleQuery');
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消
|
||||||
|
const cancel = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const submit = () => {
|
||||||
|
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
if (!state.ruleForm.city || !state.ruleForm.province) {
|
||||||
|
ElMessage.error('不能单独指定市级!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: '努力同步中...',
|
||||||
|
type: 'success',
|
||||||
|
position: 'bottom-right',
|
||||||
|
});
|
||||||
|
state.loading = true;
|
||||||
|
await getAPI(SysRegionApi).apiSysRegionSyncRegionStatsPost(state.ruleForm);
|
||||||
|
closeDialog();
|
||||||
|
|
||||||
|
ElMessage.success('生成成功');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出对象
|
||||||
|
defineExpose({ openDialog });
|
||||||
|
</script>
|
||||||
@ -64,6 +64,9 @@
|
|||||||
</splitpanes>
|
</splitpanes>
|
||||||
|
|
||||||
<EditRegion ref="editRegionRef" :title="state.title" @handleQuery="handleQuery" />
|
<EditRegion ref="editRegionRef" :title="state.title" @handleQuery="handleQuery" />
|
||||||
|
<SyncStatsParam ref="syncStatsParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||||
|
<SyncMcaParam ref="syncMcaParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||||
|
<GenOrgLevel ref="genOrgLevelRef" :title="state.title" @handleQuery="handleQuery" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -78,6 +81,9 @@ import 'splitpanes/dist/splitpanes.css';
|
|||||||
|
|
||||||
import RegionTree from '/@/views/system/region/component/regionTree.vue';
|
import RegionTree from '/@/views/system/region/component/regionTree.vue';
|
||||||
import EditRegion from '/@/views/system/region/component/editRegion.vue';
|
import EditRegion from '/@/views/system/region/component/editRegion.vue';
|
||||||
|
import SyncStatsParam from '/@/views/system/region/component/syncStatsParam.vue';
|
||||||
|
import SyncMcaParam from '/@/views/system/region/component/syncMcaParam.vue';
|
||||||
|
import GenOrgLevel from '/@/views/system/region/component/genOrgLevel.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysRegionApi } from '/@/api-services/api';
|
import { SysRegionApi } from '/@/api-services/api';
|
||||||
@ -85,6 +91,9 @@ import { SysRegion, PageRegionInput } from '/@/api-services/models';
|
|||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editRegionRef = ref<InstanceType<typeof EditRegion>>();
|
const editRegionRef = ref<InstanceType<typeof EditRegion>>();
|
||||||
|
const syncStatsParamRef = ref<InstanceType<typeof SyncStatsParam>>();
|
||||||
|
const syncMcaParamRef = ref<InstanceType<typeof SyncMcaParam>>();
|
||||||
|
const genOrgLevelRef = ref<InstanceType<typeof GenOrgLevel>>();
|
||||||
const regionTreeRef = ref<InstanceType<typeof RegionTree>>();
|
const regionTreeRef = ref<InstanceType<typeof RegionTree>>();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@ -223,57 +232,20 @@ const handleNodeChange = async (node: any) => {
|
|||||||
|
|
||||||
// 同步国家统计局
|
// 同步国家统计局
|
||||||
const syncRegionStats = async () => {
|
const syncRegionStats = async () => {
|
||||||
ElMessageBox.confirm('确认同步国家统计局行政区域数据?', '提示', {
|
state.title = '同步国家统计局行政区域数据';
|
||||||
confirmButtonText: '确定',
|
syncStatsParamRef.value?.openDialog();
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
ElNotification({
|
|
||||||
title: '提示',
|
|
||||||
message: '努力同步中...',
|
|
||||||
type: 'success',
|
|
||||||
position: 'bottom-right',
|
|
||||||
});
|
|
||||||
await getAPI(SysRegionApi).apiSysRegionSyncRegionStatsPost(); // { timeout: 1000 * 60 * 30 }
|
|
||||||
await handleQuery();
|
|
||||||
ElMessage.success('同步成功');
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 同步国家地名信息库
|
// 同步国家地名信息库
|
||||||
const syncRegionMca = async () => {
|
const syncRegionMca = async () => {
|
||||||
ElMessageBox.confirm('确认同步国家地名信息库行政区域数据?', '提示', {
|
state.title = '同步国家地名信息库行政区域数据';
|
||||||
confirmButtonText: '确定',
|
syncMcaParamRef.value?.openDialog();
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
ElNotification({
|
|
||||||
title: '提示',
|
|
||||||
message: '努力同步中...',
|
|
||||||
type: 'success',
|
|
||||||
position: 'bottom-right',
|
|
||||||
});
|
|
||||||
await getAPI(SysRegionApi).apiSysRegionSyncRegionMcaCodePost(110100000000);
|
|
||||||
await handleQuery();
|
|
||||||
ElMessage.success('同步成功');
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 生成组织架构
|
// 生成组织架构
|
||||||
const genOrg = (row: any) => {
|
const genOrg = (row: any) => {
|
||||||
ElMessageBox.confirm('确认生成/更新系统组织架构?', '提示', {
|
state.title = '生成/更新系统组织架构';
|
||||||
confirmButtonText: '确定',
|
genOrgLevelRef.value?.openDialog(row.id);
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await getAPI(SysRegionApi).apiSysRegionGenOrgIdPost(row.id);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 全部展开
|
// 全部展开
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user