分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-05-12 efe99fc88261862068a7e8f1be53d0b48ac17a53
添加时间管理功能,可在浏览器修改时间
已修改1个文件
已添加13个文件
430 ■■■■■ 文件已修改
代码管理/PCS/WCS_Client/src/extension/widesea_wcs/wcs/dt_management_time.js 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/router/viewGird.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/wcs/dt_management_time.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/WCS/dt_management_time.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/WCS/partial/dt_management_time.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/MappingConfiguration/WCS/dt_management_timeMapConfig.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IRepositories/WCS/Idt_management_timeRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/WCS/Idt_management_timeService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/WCS/Partial/Idt_management_timeService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Repositories/WCS/dt_management_timeRepository.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/WCS/Partial/dt_management_timeService.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/WCS/dt_management_timeService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_management_timeController.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/dt_management_timeController.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Client/src/extension/widesea_wcs/wcs/dt_management_time.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
/*****************************************************************************************
**  Author:jxx 2022
**  QQ:283591387
**完整文档见:http://v2.volcore.xyz/document/api ã€ä»£ç ç”Ÿæˆé¡µé¢ViewGrid】
**常用示例见:http://v2.volcore.xyz/document/vueDev
**后台操作见:http://v2.volcore.xyz/document/netCoreDev
*****************************************************************************************/
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridBody: '',
    gridFooter: '',
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
    modelFooter: ''
  },
  tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  methods: {
     //下面这些方法可以保留也可以删除
    onInit() {  //框架初始化配置前,
        //示例:在按钮的最前面添加一个按钮
        //   this.buttons.unshift({  //也可以用push或者splice方法来修改buttons数组
        //     name: '按钮', //按钮名称
        //     icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档)
        //     type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button
        //     onClick: function () {
        //       this.$Message.success('点击了按钮');
        //     }
        //   });
        //示例:设置修改新建、编辑弹出框字段标签的长度
        // this.boxOptions.labelWidth = 150;
    },
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
      //返回false,则不会执行查询
      return true;
    },
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
      return true;
    },
    updateBefore(formData) {
      //编辑保存前formData为对象,包括明细表、删除行的Id
      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段='xxx';
      //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看:console.log(this.editFormOptions)
    }
  }
};
export default extension;
´úÂë¹ÜÀí/PCS/WCS_Client/src/router/viewGird.js
@@ -213,6 +213,10 @@
        path: '/dt_mes_detail_hty',
        name: 'dt_mes_detail_hty',
        component: () => import('@/views/widesea_wcs/tomes/dt_mes_detail_hty.vue')
    }    ,{
        path: '/dt_management_time',
        name: 'dt_management_time',
        component: () => import('@/views/widesea_wcs/wcs/dt_management_time.vue')
    }]
export default viewgird
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/wcs/dt_management_time.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
<!--
*Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wcs/wcs/dt_management_time.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/widesea_wcs/wcs/dt_management_time.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'management_id',
                footer: "Foots",
                cnName: '时间管理',
                name: 'wcs/dt_management_time',
                url: "/dt_management_time/",
                sortName: "management_id"
            });
            const editFormFields = ref({"management_numericalvalue":""});
            const editFormOptions = ref([[{"title":"数值","required":true,"field":"management_numericalvalue","type":"text"}]]);
            const searchFormFields = ref({"management_remark":""});
            const searchFormOptions = ref([[{"title":"说明","field":"management_remark","type":"like"}]]);
            const columns = ref([{field:'management_id',title:'主键',type:'int',width:80,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'management_name',title:'名称',type:'string',width:110,require:true,align:'left',sort:true},
                       {field:'management_numericalvalue',title:'数值',type:'int',width:80,require:true,align:'left'},
                       {field:'management_unitoftime',title:'时间单位',type:'string',width:110,require:true,align:'left'},
                       {field:'management_remark',title:'说明',type:'string',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/WCS/dt_management_time.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    [Entity(TableCnName = "时间管理",TableName = "dt_management_time")]
    public partial class dt_management_time:BaseEntity
    {
        /// <summary>
       ///主键
       /// </summary>
       [Key]
       [Display(Name ="主键")]
       [Column(TypeName="int")]
       [Required(AllowEmptyStrings=false)]
       public int management_id { get; set; }
       /// <summary>
       ///名称
       /// </summary>
       [Display(Name ="名称")]
       [MaxLength(100)]
       [Column(TypeName="nvarchar(100)")]
       [Required(AllowEmptyStrings=false)]
       public string management_name { get; set; }
       /// <summary>
       ///数值
       /// </summary>
       [Display(Name ="数值")]
       [Column(TypeName="int")]
       [Editable(true)]
       [Required(AllowEmptyStrings=false)]
       public int management_numericalvalue { get; set; }
       /// <summary>
       ///时间单位
       /// </summary>
       [Display(Name ="时间单位")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Required(AllowEmptyStrings=false)]
       public string management_unitoftime { get; set; }
       /// <summary>
       ///说明
       /// </summary>
       [Display(Name ="说明")]
       [MaxLength(100)]
       [Column(TypeName="nvarchar(100)")]
       public string management_remark { get; set; }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/WCS/partial/dt_management_time.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    public partial class dt_management_time
    {
        //此处配置字段(字段配置见此model的另一个partial),如果表中没有此字段请加上 [NotMapped]属性,否则会异常
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/MappingConfiguration/WCS/dt_management_timeMapConfig.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
using WIDESEA_Entity.MappingConfiguration;
using WIDESEA_Entity.DomainModels;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace WIDESEA_Entity.MappingConfiguration
{
    public class dt_management_timeMapConfig : EntityMappingConfiguration<dt_management_time>
    {
        public override void Map(EntityTypeBuilder<dt_management_time>
        builderTable)
        {
          //b.Property(x => x.StorageName).HasMaxLength(45);
        }
     }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IRepositories/WCS/Idt_management_timeRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹Idt_management_timeRepository编写接口
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Extensions.AutofacManager;
namespace WIDESEA_WCS.IRepositories
{
    public partial interface Idt_management_timeRepository : IDependency,IRepository<dt_management_time>
    {
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/WCS/Idt_management_timeService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WCS.IServices
{
    public partial interface Idt_management_timeService : IService<dt_management_time>
    {
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/WCS/Partial/Idt_management_timeService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
/*
*所有关于dt_management_time类的业务代码接口应在此处编写
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
namespace WIDESEA_WCS.IServices
{
    public partial interface Idt_management_timeService
    {
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Repositories/WCS/dt_management_timeRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹dt_management_timeRepository编写代码
 */
using WIDESEA_WCS.IRepositories;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WCS.Repositories
{
    public partial class dt_management_timeRepository : RepositoryBase<dt_management_time> , Idt_management_timeRepository
    {
    public dt_management_timeRepository(VOLContext dbContext)
    : base(dbContext)
    {
    }
    public static Idt_management_timeRepository Instance
    {
      get {  return AutofacContainerModule.GetService<Idt_management_timeRepository>(); } }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/WCS/Partial/dt_management_timeService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
/*
 *所有关于dt_management_time类的业务代码应在此处编写
*可使用repository.调用常用方法,获取EF/Dapper等信息
*如果需要事务请使用repository.DbContextBeginTransaction
*也可使用DBServerProvider.手动获取数据库相关信息
*用户信息、权限、角色等使用UserContext.Current操作
*dt_management_timeService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
using System.Linq;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
using WIDESEA_Core.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_WCS.IRepositories;
namespace WIDESEA_WCS.Services
{
    public partial class dt_management_timeService
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly Idt_management_timeRepository _repository;//访问数据库
        [ActivatorUtilitiesConstructor]
        public dt_management_timeService(
            Idt_management_timeRepository dbRepository,
            IHttpContextAccessor httpContextAccessor
            )
        : base(dbRepository)
        {
            _httpContextAccessor = httpContextAccessor;
            _repository = dbRepository;
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
  }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/WCS/dt_management_timeService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
/*
 *Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖
 *所有业务编写全部应在Partial文件夹下dt_management_timeService与Idt_management_timeService中编写
 */
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.IServices;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WCS.Services
{
    public partial class dt_management_timeService : ServiceBase<dt_management_time, Idt_management_timeRepository>
    , Idt_management_timeService, IDependency
    {
    public dt_management_timeService(Idt_management_timeRepository repository)
    : base(repository)
    {
    Init(repository);
    }
    public static Idt_management_timeService Instance
    {
      get { return AutofacContainerModule.GetService<Idt_management_timeService>(); } }
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_management_timeController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
/*
 *接口编写处...
*如果接口需要做Action的权限验证,请在Action上使用属性
*如: [ApiActionPermission("dt_management_time",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IServices;
namespace WIDESEA_WCS.Controllers
{
    public partial class dt_management_timeController
    {
        private readonly Idt_management_timeService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        [ActivatorUtilitiesConstructor]
        public dt_management_timeController(
            Idt_management_timeService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/dt_management_timeController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果要增加方法请在当前目录下Partial文件夹dt_management_timeController编写
 */
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.Controllers.Basic;
using WIDESEA_Entity.AttributeManager;
using WIDESEA_WCS.IServices;
namespace WIDESEA_WCS.Controllers
{
    [Route("api/dt_management_time")]
    [PermissionTable(Name = "dt_management_time")]
    public partial class dt_management_timeController : ApiBaseController<Idt_management_timeService>
    {
        public dt_management_timeController(Idt_management_timeService service)
        : base(service)
        {
        }
    }
}