Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2021-12-30 15:53:05 +08:00
11 changed files with 841 additions and 186 deletions

View File

@ -1,12 +1,13 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Menu } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { MenuManagerService } from './../../services/menu-manager.service';
@Component({
selector: 'app-menu-manager-components-index',
templateUrl: './index.component.html',
styleUrls: ['./index.component.less'],
styleUrls: ['./index.component.less']
})
export class MenuManagerComponentsIndexComponent implements OnInit {
selectedPlatform!: { name: string; appId: string; enName: string };
@ -17,9 +18,9 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
dropType = {
dropPrev: true,
dropNext: true,
dropInner: true,
dropInner: true
};
constructor(public service: MenuManagerService, private modal: NzModalService) { }
constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private modal: NzModalService) {}
ngOnInit(): void {
this.initData();
@ -27,13 +28,10 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
initData(): void {
this.platforms = [
{ name: '运维平台', appId: 'D40B4EFC33FC4803864934872A11B0CE', enName: 'scm-soc-ui' },
{ name: '运营后台', appId: '2537B72DDA534361AE4931903F0BFEB3', enName: 'scm-ows-ui' },
{ name: '供应商平台', appId: '0CEE254099064665872B777CF9FCBB6B', enName: 'scm-cvc-ui' },
// { name: '代理商平台', appId: '737BB699C8894B2D81F21FC667A21169', enName: 'scm-cac-ui' },
// { name: '分销商平台', appId: '0D00C7CC306A4CACA5AF95BBD1251980', enName: 'scm-cdc-ui' },
// { name: '开放平台', appId: '7B216DD933CB4922BD9094ED8F96B0B4', enName: 'scm-opc-ui' },
{ name: '货主PC', appId: 'A48F72F0A304427F921794BAD86B3522', enName: 'tms-smc-web' },
{ name: '运营后台', appId: this.envSrv.env.appId, enName: 'tms-obc-web' }
];
this.selectedPlatform = this.platforms[0];
}
platformChange(e: { name: string; appId: string }) {
@ -46,41 +44,40 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
}
loadMenus(appId: string) {
this.service.request(this.service.$api_get_all, { appId }, 'POST', true, 'FORM').subscribe((res) => {
this.service.request(this.service.$api_get_all, { appId }, 'POST', true, 'FORM').subscribe(res => {
console.log(res);
this.menus = res;
});
}
editValueChange(event: any) {
console.log('editChanged', event);
}
menuImport() {
if (!this.selectedPlatform) {
return;
}
this.service.http.request('GET', `assets/tmp/_mock/platform/${this.selectedPlatform.enName}.json`).subscribe((res: any) => {
// console.log(res);
this.service.http.request('GET', `assets/mocks/platform/${this.selectedPlatform.enName}.json`).subscribe((res: any) => {
this.addMenu(res.menu);
});
}
addMenu(menus: Array<Menu>, parentId: string = '') {
menus.forEach((r) => {
menus.forEach(r => {
if (parentId !== '') {
r.parentId = parentId;
}
this.service.request(this.service.$api_get_one, { appId: this.selectedPlatform.appId, i18n: r.i18n }).subscribe((res) => {
this.service.request(this.service.$api_get_one, { appId: this.selectedPlatform.appId }, 'POST', false).subscribe(res => {
// 如果res.data存在则更新菜单
if (res.data) {
r.id = res.data.id;
}
this.service
.addOne({ appId: this.selectedPlatform.appId, ...r, isLeaf: !(r.children && r.children.length > 0) })
.subscribe((result) => {
.subscribe(result => {
if (result) {
if (r.children && r.children.length > 0) {
this.addMenu(r.children, result.id);
@ -90,12 +87,10 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
});
});
this.loadMenus(this.selectedPlatform.appId);
// this.loadMenus(this.selectedPlatform.appId);
}
addMenuRecursion() {
}
addMenuRecursion() {}
delMenu(appId: string, menus: Array<Menu>) {
if (!menus || menus.length === 0) {
@ -105,16 +100,16 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
if (menus.length > 1) {
notice = `确认删除勾选的${menus.length}行菜单记录?`;
}
const ids = menus.map((r) => r.id);
const ids = menus.map(r => r.id);
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>${notice}</b><br>是否删除?`,
nzOnOk: () =>
this.service.delMany(ids).subscribe((res) => {
this.service.delMany(ids).subscribe(res => {
if (res === true) {
this.service.msgSrv.success('删除成功!');
}
}),
})
});
}
}

View File

@ -6,13 +6,13 @@ import { BaseService } from '@shared';
})
export class MenuManagerService extends BaseService {
// 新增/更新菜单
$api_add_one = `/scm/cuc/cuc/functionInfo/saveFunctionInfo`;
$api_add_one = `/api/mdc/cuc/functionInfo/saveFunctionInfo`;
// 根据应用ID获取所有菜单
$api_get_all = `/scm/cuc/cuc/functionInfo/getAllFunctionInfoByAppId`;
// 根据i18n和应用ID获取菜单
$api_get_one = `/scm/cuc/cuc/functionInfo/getFunctionsInfoByI18n?_allow_badcode=true`;
// 根据应用ID获取菜单
$api_get_one = `/api/mdc/cuc/functionInfo/getAllFunctionInfoByAppId?_allow_badcode=true`;
// 删除多个菜单
$api_del_many = `/scm/cuc/cuc/functionInfo/deletebatchFunctionInfo`;

View File

@ -1,132 +0,0 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root',
})
export class UserService extends BaseService {
// 保存单个实例接口地址
$api_save_one = '/tms/cuc/oaUserHarvestAddress/save';
// 保存多个实例接口地址
$api_save_many = '';
// 删除一个实例接口地址
$api_del_one = '';
// 删除多个实例接口地址
$api_del_many = '/tms/cuc/oaUserHarvestAddress/deletebatch';
// 获取单个实例接口地址
$api_get_one = '/bcp/cuc/cuc/userInfo/getUserDetailByUserId';
// 获取多个实例接口地址
$api_get_many = '';
// 获取实例分页数据接口地址
$api_get_page = '/bcp/cuc/cuc/userInfo/getUserInfoListPage';
// 导出接口地址
$api_export = '/bcp/cuc/cuc/userInfo/exportUserList';
// 导入接口地址
$api_import = '';
// 导入模板下载地址
$api_import_download_tpl = '';
// 获取项目列表
$api_getProjectInfoList = '/scm/cuc/cuc/projectInfo/getProjectInfoList';
// 根据项目获取应用列表
$api_getAppInfoListByProjectId = '/scm/cuc/cuc/appInfo/getAppInfoListByProjectId';
// 根据应用获取菜单列表
$api_getAllFunctionInfoByAppId = '/scm/cuc/cuc/functionInfo/getAllFunctionInfoByAppId';
// 获取菜单已拥有的按钮
$api_getFunctionButtonInfo = '/scm/cuc/cuc/functionButton/getFunctionButtonInfo';
// 获取菜单已拥有的数据字典
$api_getFunctionDataInfo = '/scm/cuc/cuc/functionData/getFunctionDataInfo';
// 获取所有按钮
$api_getButtonInfoList = '/scm/cuc/cuc/buttonInfo/getButtonInfoList';
// 获取按钮列表
$api_getButtonInfoPage = '/scm/cuc/cuc/buttonInfo/getButtonInfoPage';
// 新增编辑按钮信息
$api_saveButtonInfo = '/scm/cuc/cuc/buttonInfo/saveButtonInfo';
// 查看菜单信息
$api_getFunctionInfo = '/scm/cuc/cuc/functionInfo/getFunctionInfo';
// 删除
$api_deletebatchButton = '/scm/cuc/cuc/buttonInfo/deletebatchButton';
// 新增 and 编辑
$api_saveFunctionInfo = '/scm/cuc/cuc/functionInfo/saveFunctionInfo';
// 删除菜单(含多个)
$api_deletebatchFunctionInfo = '/scm/cuc/cuc/functionInfo/deletebatchFunctionInfo';
// 字典列表
$api_getDictTree = '/scce/pbc/pbc/dict/getDictTree';
// 删除字典
$api_delete = '/scce/pbc/pbc/dict/delete';
// 删除字典选项
$api_deleteById = '/scce/pbc/pbc/dictItems/deleteById';
// 字典详情
$api_getDictItemsByDictId = '/scce/pbc/pbc/dictItems/getDictItemsByDictId';
// 编辑字典
$api_dictUpdate = '/scce/pbc/pbc/dict/update';
// 新增字典
$api_dictSave = '/scce/pbc/pbc/dict/save';
// 编辑字典选项
$api_dictItemsUpdate = '/scce/pbc/pbc/dictItems/update';
// 新增字典选项
$api_dictItemsSave = '/scce/pbc/pbc/dictItems/save';
// 角色模板列表查询
$api_getRoleTemplateInfoList = '/scm/cuc/cuc/roleTemplateInfo/getRoleTemplateInfoList';
// 删除角色模板(含多个)
$api_removeRoleTemplateInfo = '/scm/cuc/cuc/roleTemplateInfo/removeRoleTemplateInfo';
// 编辑角色模板信息
$api_updateRoleTemplateInfo = '/scm/cuc/cuc/roleTemplateInfo/updateRoleTemplateInfo';
// 获取角色详情
$api_getRoleInfo = '/scm/cuc/cuc/roleInfo/getRoleInfo';
// 角色列表
$api_getAppRoleInfoList = '/scm/cuc/cuc/roleInfo/getAppRoleInfoList';
// 删除角色
$api_removeRoleInfo = '/scm/cuc/cuc/roleInfo/removeRoleInfo';
// 编辑角色
$api_updateRoleInfo = '/scm/cuc/cuc/roleInfo/updateRoleInfo';
// 获取角色模板详情
$api_getRoleTemplateInfo = '/scm/cuc/cuc/roleTemplateInfo/getRoleTemplateInfo';
// 获取角色模板权限
$api_getRoleTemplateAuthority = '/scm/cuc/cuc/roleTemplateInfo/getRoleTemplateAuthority';
// 角色菜单下已拥有按钮权限
$api_getRoleFunctionButtonAuthority = '/scm/cuc/cuc/roleAuthority/getRoleFunctionButtonAuthority';
// 角色菜单下已拥有数据权限
$api_getRoleFunctionDataAuthorit = '/scm/cuc/cuc/roleAuthority/getRoleFunctionDataAuthority';
// 用户角色关系列表
$api_getUserRoleList = '/scm/cuc/cuc/userAuthority/getUserRoleList';
// 删除用户角色关系列表
$api_deleteUserAuthority = '/scm/cuc/cuc/userAuthority/deleteUserAuthority';
// 用户列表
$api_getUserListPage = '/scm/cuc/cuc/userBasicInfo/getUserListPage';
// 获取所有应用
$api_getAppList = '/scm/cuc/cuc/appInfo/getAppList';
// 用户详情
$api_getUserInfo = '/scm/cuc/cuc/userBasicInfo/getUserInfo';
// 获取用户下所有应用
$api_getAppInfoByUserId = '/scm/cuc/cuc/userApp/getAppInfoByUserId';
// 获取用户下所有企业
$api_getUserEnterpriseList = '/scm/cuc/cuc/userEnterprise/getUserEnterpriseList';
// 应用用户列表
$api_getAppUserList = '/scm/cuc/cuc/userApp/getAppUserList';
// 新增应用用户
$api_saveAppUser = '/scm/cuc/cuc/userApp/saveAppUser';
// 编辑应用用户信息
$api_updateAppUser = '/scm/cuc/cuc/userApp/updateAppUser';
// 删除应用用户
$api_deleteAppUser = '/scm/cuc/cuc/userApp/deleteAppUser';
// 获取应用列表
$api_getAppListByLesseeId = '/scm/cuc/cuc/appInfo/getAppListByLesseeId';
// 获取应用用户详情
$api_getAppUser = '/scm/cuc/cuc/userApp/getAppUser';
// 重置密码
$api_resetPw = '/scm/cuc/cuc/userBasicInfo/resetPassword';
// 冻结或恢复应用用户
$api_userApp_freezeOrResume = '/scm/cuc/cuc/userApp/freezeOrResume';
// 新增角色
$api_roleInfo_saveRoleInfo = '/scm/cuc/cuc/roleInfo/saveRoleInfo';
// 编辑角色
$api_roleInfo_updateRoleInfo = '/scm/cuc/cuc/roleInfo/updateRoleInfo';
// 冻结或恢复角色
$api_roleInfo_freezeOrResume = '/scm/cuc/cuc/roleInfo/freezeOrResume';
// 获取角色下用户列表
$api_getRoleUserList = '/scm/cuc/cuc/userAuthority/getRoleUserList';
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -31,7 +31,7 @@ export class StaffManagementComponent implements OnInit {
{ title: '', index: 'key', type: 'checkbox' },
{ title: '员工姓名', index: 'name' },
{ title: '手机号码', index: 'telephone' },
{ title: '角色', render: 'description' },
{ title: '角色', index: 'roleName' },
{
title: '最后登录时间',
index: 'lastLoginDate',
@ -136,7 +136,7 @@ export class StaffManagementComponent implements OnInit {
staffAction(item?: any) {
const modal = this.nzModalService.create({
nzContent: SystemStaffStaffModalComponent,
nzComponentParams: item ? { i: { ...item } } : { i: { userId: 0 } },
nzComponentParams: item ? { i: { ...item, roleId: (item.roleId as string)?.split(',') || [] } } : { i: { userId: 0 } },
nzFooter: null
});
modal.afterClose.subscribe(res => {

View File

@ -3,6 +3,7 @@ import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
import { SystemService } from '../../../services/system.service';
@Component({
@ -53,22 +54,24 @@ export class SystemStaffStaffModalComponent implements OnInit {
placeholder: '请选择员工角色',
mode: 'multiple',
maxMultipleCount: 5,
// asyncData: () => {
// return this.service.request(this.service.$api_getAppRoleList).pipe(
// map((res: any) => {
// this.roleList = res;
// return res.map((item: any) => {
// return { label: item.roleName, value: item.id };
// });
// }),
// );
// },
asyncData: () => {
return this.service.request(this.service.$api_getAppRoleList).pipe(
map((res: any) => {
this.roleList = res;
return res.map((item: any) => {
return { label: item.roleName, value: item.id };
});
}),
);
},
change: (i: any) => {
this.sf.value.roleIds = i;
this.sf?.setValue('/roleIds', i);
console.log(i);
// this.sf.value.roleIds = i;
// this.sf?.setValue('/roleIds', i);
}
},
default: staff?.roleIds
default: staff?.roleId
}
},
required: ['staffName', 'telephone']
@ -90,7 +93,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
const params: any = {
...this.sf.value,
enterpriseId: 0,
roleId: []
};
this.service.request(this.service.$api_add_staff, params).subscribe(res => {
if (res) {
@ -102,7 +104,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
const params: any = {
appUserId: this.i.appUserId,
...this.sf.value,
roleId: []
};
this.service.request(this.service.$api_edit_staff, params).subscribe(res => {
if (res) {

View File

@ -34,6 +34,8 @@ export class SystemService extends BaseService {
$api_dalete_role = '/api/mdc/cuc/roleInfo/removeRoleInfo';
// 获取角色详情
$api_getRoleInfo = '/api/mdc/cuc/roleInfo/getRoleInfo';
// 获取角色列表
$api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList';
// 查询字典选项列表
$api_get_dict_page = '/api/mdc/pbc/dictItems/list/page';

View File

@ -184,7 +184,7 @@ export class InvoiceDetailComponent implements OnInit {
{ title: '单位', render: 'vatunit' },
{ title: '数量', render: 'vatqty' },
{ title: '金额', index: 'vatnotax' },
{ title: '税率', index: 'callNo' },
{ title: '税率', index: 'vatrate' },
{ title: '税额', index: 'vattax' }
];
}

View File

@ -47,7 +47,7 @@ export class InvoicedListComponent implements OnInit {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.callNo, 0);
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.vatnotax, 0);
break;
}
}
@ -178,9 +178,9 @@ export class InvoicedListComponent implements OnInit {
{ title: '网络货运人', index: 'ltdId', width: 120 },
{ title: '购买人', index: 'artoname', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90 },
{ title: '价税合计', index: 'callNo', width: 100 },
{ title: '金额', index: 'disvatnotax', width: 90 },
{ title: '税率', index: 'callNo', width: 90 },
{ title: '价税合计', index: 'vatmoney', width: 100 },
{ title: '金额', index: 'vatnotax', width: 90 },
{ title: '税率', index: 'vatrate', width: 90 },
{ title: '税额', index: 'disvattax', width: 90 },
{ title: '开票日期', index: 'invoicedate', type: 'date', width: 150 },
{

View File

@ -10,14 +10,43 @@ const TinyMce = NgxTinymceModule.forRoot({
config: {
language_url: 'assets/tinymce/langs/zh_CN.js',
language: 'zh_CN',
placeholder: '请输入内容',
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste imagetools wordcount'
'advlist autolink link image lists charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'table emoticons template paste help'
],
toolbar:
'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' +
'bullist numlist outdent indent | link image | print preview media fullscreen | ' +
'forecolor backcolor emoticons | help',
menu: {
favs: { title: '常用', items: 'code visualaid | searchreplace | emoticons' }
},
menubar: 'favs file edit view insert format tools table help',
content_css: 'css/content.css',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
automatic_uploads: false,
images_upload_url: apiConf.fileUpload,
paste_block_drop: false,
paste_data_images: true,
image_advtab: true,
color_cols: 4,
font_formats:
'宋体=simsun,serif;' +
'仿宋=FangSong,serif;' +
'新宋体=NSimSun,serif;' +
'黑体=SimHei,serif;' +
'楷体=KaiTi,serif;' +
'微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;' +
'隶书=LiSu,serif;' +
'幼圆=YouYuan,serif;' +
'华文细黑=STXihei,serif;' +
'华文楷体=STKaiti,serif;' +
'华文宋体=STSong,serif;' +
// 默认字体
'Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats',
fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt'
}
});