Commit 248c7d6d9f0ce9f2dfb4fdf99dcc96b05ee0ef52
Merge branch 'dev' of http://172.16.29.40:8010/MES/IOT into dev
Showing
21 changed files
with
1964 additions
and
112 deletions
sys/Hh.Mes.POJO/WebEntity/base/base_sim.cs
0 → 100644
1 | +using System; | |
2 | +using SqlSugar; | |
3 | + | |
4 | +namespace Hh.Mes.POJO.Entity | |
5 | +{ | |
6 | + [SugarTable("base_sim")] | |
7 | + public partial class base_sim | |
8 | + { | |
9 | + /// <summary> | |
10 | + /// 主键 | |
11 | + /// </summary> | |
12 | + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] | |
13 | + public int id { get; set; } | |
14 | + | |
15 | + /// <summary> | |
16 | + /// 卡号 | |
17 | + /// </summary> | |
18 | + [SugarColumn(Length = 50, ColumnDescription = "卡号", IsNullable = true)] | |
19 | + public string simNumber { get; set; } | |
20 | + | |
21 | + /// <summary> | |
22 | + /// ip | |
23 | + /// </summary> | |
24 | + [SugarColumn(Length = 50, ColumnDescription = "ip", IsNullable = true)] | |
25 | + public string ip { get; set; } | |
26 | + | |
27 | + /// <summary> | |
28 | + /// 供应商默认值长沙华恒机器人 | |
29 | + /// </summary> | |
30 | + [SugarColumn(Length = 50, ColumnDescription = "供应商默认值长沙华恒机器人", IsNullable = true)] | |
31 | + public string suppliersInfo { get; set; } | |
32 | + | |
33 | + /// <summary> | |
34 | + /// 出厂日期 | |
35 | + /// </summary> | |
36 | + [SugarColumn(ColumnDescription = "出厂日期", IsNullable = true)] | |
37 | + public DateTime factoryDate { get; set; } | |
38 | + | |
39 | + [SugarColumn(Length = 500, IsNullable = true)] | |
40 | + public string remarks { get; set; } | |
41 | + | |
42 | + /// <summary> | |
43 | + /// 0删除 1启用 | |
44 | + /// </summary> | |
45 | + [SugarColumn(ColumnDescription = "0删除 1启用", IsNullable = true)] | |
46 | + public int isDelete { get; set; } | |
47 | + | |
48 | + [SugarColumn(IsNullable = true)] | |
49 | + public DateTime createTime { get; set; } | |
50 | + | |
51 | + /// <summary> | |
52 | + /// createBy | |
53 | + /// </summary> | |
54 | + [SugarColumn(Length = 100, ColumnDescription = "createBy", IsNullable = true)] | |
55 | + public string createBy { get; set; } | |
56 | + | |
57 | + /// <summary> | |
58 | + /// updateTime | |
59 | + /// </summary> | |
60 | + [SugarColumn(ColumnDescription = "updateTime", IsNullable = true)] | |
61 | + public DateTime updateTime { get; set; } | |
62 | + | |
63 | + /// <summary> | |
64 | + /// updateBy | |
65 | + /// </summary> | |
66 | + [SugarColumn(Length = 100, ColumnDescription = "updateBy", IsNullable = true)] | |
67 | + public string updateBy { get; set; } | |
68 | + | |
69 | + } | |
70 | +} | |
0 | 71 | \ No newline at end of file |
... | ... |
sys/Hh.Mes.POJO/WebEntity/base/base_sim_equipment_rel.cs
0 → 100644
1 | +using System; | |
2 | +using SqlSugar; | |
3 | + | |
4 | +namespace Hh.Mes.POJO.Entity | |
5 | +{ | |
6 | + [SugarTable("base_sim_equipment_rel")] | |
7 | + public partial class base_sim_equipment_rel | |
8 | + { | |
9 | + /// <summary> | |
10 | + /// 主键 | |
11 | + /// </summary> | |
12 | + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] | |
13 | + public int id { get; set; } | |
14 | + | |
15 | + /// <summary> | |
16 | + /// sim卡号 | |
17 | + /// </summary> | |
18 | + [SugarColumn(Length = 50, ColumnDescription = "sim卡号", IsNullable = true)] | |
19 | + public string simNumber { get; set; } | |
20 | + | |
21 | + /// <summary> | |
22 | + /// 项目keys | |
23 | + /// </summary> | |
24 | + [SugarColumn(ColumnDescription = "项目keys", IsNullable = true)] | |
25 | + public Guid projectKey { get; set; } | |
26 | + | |
27 | + /// <summary> | |
28 | + /// 设备编码 | |
29 | + /// </summary> | |
30 | + [SugarColumn(Length = 50, ColumnDescription = "设备编码", IsNullable = true)] | |
31 | + public string equipmentCode { get; set; } | |
32 | + | |
33 | + } | |
34 | +} | |
0 | 35 | \ No newline at end of file |
... | ... |
sys/Hh.Mes.POJO/WebEntity/equipment/base_equipment.cs
... | ... | @@ -30,12 +30,12 @@ namespace Hh.Mes.POJO.Entity |
30 | 30 | [SugarColumn(Length = 100, ColumnDescription = "设备名称", IsNullable = true)] |
31 | 31 | public string equipmentName { get; set; } |
32 | 32 | |
33 | - [SugarColumn(Length = 20, IsNullable = true)] | |
33 | + /// <summary> | |
34 | + /// 设备类型编码 | |
35 | + /// </summary> | |
36 | + [SugarColumn(Length = 20, ColumnDescription = "设备类型编码", IsNullable = true)] | |
34 | 37 | public string equipmentTypeCode { get; set; } |
35 | 38 | |
36 | - [SugarColumn(Length = 20, IsNullable = true)] | |
37 | - public string equipmentTypeName { get; set; } | |
38 | - | |
39 | 39 | /// <summary> |
40 | 40 | /// 维护规则Id |
41 | 41 | /// </summary> |
... | ... | @@ -95,5 +95,8 @@ namespace Hh.Mes.POJO.Entity |
95 | 95 | /// </summary> |
96 | 96 | [SugarColumn(Length = 100, ColumnDescription = "updateBy", IsNullable = true)] |
97 | 97 | public string updateBy { get; set; } |
98 | + | |
99 | + [SugarColumn(ColumnDescription = "出厂时间", IsNullable = true)] | |
100 | + public DateTime startTime { get; set; } | |
98 | 101 | } |
99 | 102 | } |
100 | 103 | \ No newline at end of file |
... | ... |
sys/Hh.Mes.Service/ApiService/UpstreamDown/UpstreamSendEquipment.cs
... | ... | @@ -34,7 +34,6 @@ namespace Hh.Mes.Service.ApiService |
34 | 34 | equipmentCode = entity.equipment_code, |
35 | 35 | equipmentName = entity.equipment_name, |
36 | 36 | equipmentTypeCode = entity.equipmentType_code, |
37 | - equipmentTypeName = entity.equipmentType_Name, | |
38 | 37 | ip = entity.ip, |
39 | 38 | destinationArea = entity.destination_area, |
40 | 39 | remark = entity.remark, |
... | ... |
sys/Hh.Mes.Service/WebService/Base/BaseSimEquipmentRelService.cs
0 → 100644
1 | +using Hh.Mes.Common.Infrastructure; | |
2 | +using Hh.Mes.Common.log; | |
3 | +using Hh.Mes.Common.Request; | |
4 | +using Hh.Mes.POJO.Entity; | |
5 | +using Hh.Mes.POJO.Response; | |
6 | +using Hh.Mes.Service.Repository; | |
7 | +using SqlSugar; | |
8 | +using System; | |
9 | +using System.Collections.Generic; | |
10 | +using System.Linq; | |
11 | +using System.Linq.Expressions; | |
12 | +using Hh.Mes.Pojo.System; | |
13 | + | |
14 | +namespace Hh.Mes.Service.Base | |
15 | +{ | |
16 | + public class BaseSimEquipmentRelService : RepositorySqlSugar<base_sim_equipment_rel> | |
17 | + { | |
18 | + public dynamic Load(PageReq pageReq, base_sim_equipment_rel entity) | |
19 | + { | |
20 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
21 | + { | |
22 | + var result = new Response<List<base_sim_equipment_rel>>(); | |
23 | + var expression = LinqWhere(entity); | |
24 | + //先组合查询表达式 | |
25 | + var query = Context.Queryable<base_sim_equipment_rel>().Where(expression); | |
26 | + //Exel为ture就不分页,因为导出的话是全部导出 | |
27 | + if (pageReq != null) | |
28 | + { | |
29 | + int total = 0; | |
30 | + result.Result = query.ToOffsetPage(pageReq.page, pageReq.limit, ref total); | |
31 | + result.Count = total; | |
32 | + } | |
33 | + else | |
34 | + { | |
35 | + result.Result = query.ToList(); | |
36 | + result.Count = result.Result.Count(); | |
37 | + } | |
38 | + return result; | |
39 | + }, catchRetrunValue: "list"); | |
40 | + } | |
41 | + | |
42 | + public dynamic Ins(base_sim_equipment_rel entity) | |
43 | + { | |
44 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
45 | + { | |
46 | + var response = new Response(); | |
47 | + //entity.createBy = sysWebUser?.Account; | |
48 | + //entity.createTime = DateTime.Now; | |
49 | + response.Status = Add(entity); | |
50 | + if (!response.Status)response.Message = SystemVariable.dataActionError; | |
51 | + return response; | |
52 | + }); | |
53 | + } | |
54 | + | |
55 | + public dynamic Upd(base_sim_equipment_rel entity) | |
56 | + { | |
57 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
58 | + { | |
59 | + var response = new Response(); | |
60 | + //entity.updateBy = sysWebUser?.Account; | |
61 | + //entity.updateTime = DateTime.Now; | |
62 | + response.Status = Update(entity); | |
63 | + if (!response.Status) response.Message = SystemVariable.dataActionError; | |
64 | + return response; | |
65 | + }); | |
66 | + } | |
67 | + | |
68 | + public dynamic DelByIds(int[] ids) | |
69 | + { | |
70 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
71 | + { | |
72 | + var response = new Response(); | |
73 | + Context.Deleteable<base_sim_equipment_rel>(t => ids.Contains(t.id)).ExecuteCommand(); | |
74 | + return response; | |
75 | + }); | |
76 | + } | |
77 | + | |
78 | + public Response ExportData(base_sim_equipment_rel entity) | |
79 | + { | |
80 | + return Load(null, entity); | |
81 | + } | |
82 | + | |
83 | + public Expression<Func<base_sim_equipment_rel, bool>> LinqWhere(base_sim_equipment_rel model) | |
84 | + { | |
85 | + try | |
86 | + { | |
87 | + var exp = Expressionable.Create<base_sim_equipment_rel>(); | |
88 | + //数据过滤条件 | |
89 | + //if (!string.IsNullOrWhiteSpace(model.XXX)) exp.And(x => x.XXX.Contains(model.XXX)); | |
90 | + if (!string.IsNullOrWhiteSpace(model.simNumber)) | |
91 | + { | |
92 | + exp.And(x => x.simNumber.Contains(model.simNumber)); | |
93 | + } | |
94 | + if (!string.IsNullOrWhiteSpace(model.equipmentCode)) | |
95 | + { | |
96 | + exp.And(x => x.equipmentCode.Contains(model.equipmentCode)); | |
97 | + } | |
98 | + return exp.ToExpression();//拼接表达式 | |
99 | + } | |
100 | + catch (Exception ex) | |
101 | + { | |
102 | + throw new Exception($"{ex.Message}"); | |
103 | + } | |
104 | + } | |
105 | + } | |
106 | +} | |
0 | 107 | \ No newline at end of file |
... | ... |
sys/Hh.Mes.Service/WebService/Base/BaseSimService.cs
0 → 100644
1 | +using Hh.Mes.Common.Infrastructure; | |
2 | +using Hh.Mes.Common.log; | |
3 | +using Hh.Mes.Common.Request; | |
4 | +using Hh.Mes.POJO.Entity; | |
5 | +using Hh.Mes.POJO.Response; | |
6 | +using Hh.Mes.Service.Repository; | |
7 | +using SqlSugar; | |
8 | +using System; | |
9 | +using System.Collections.Generic; | |
10 | +using System.Linq; | |
11 | +using System.Linq.Expressions; | |
12 | +using Hh.Mes.Pojo.System; | |
13 | + | |
14 | +namespace Hh.Mes.Service.Base | |
15 | +{ | |
16 | + public class BaseSimService : RepositorySqlSugar<base_sim> | |
17 | + { | |
18 | + public dynamic Load(PageReq pageReq, base_sim entity) | |
19 | + { | |
20 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
21 | + { | |
22 | + var result = new Response<List<base_sim>>(); | |
23 | + var expression = LinqWhere(entity); | |
24 | + //先组合查询表达式 | |
25 | + var query = Context.Queryable<base_sim>().Where(expression); | |
26 | + //Exel为ture就不分页,因为导出的话是全部导出 | |
27 | + if (pageReq != null) | |
28 | + { | |
29 | + int total = 0; | |
30 | + result.Result = query.ToOffsetPage(pageReq.page, pageReq.limit, ref total); | |
31 | + result.Count = total; | |
32 | + } | |
33 | + else | |
34 | + { | |
35 | + result.Result = query.ToList(); | |
36 | + result.Count = result.Result.Count(); | |
37 | + } | |
38 | + return result; | |
39 | + }, catchRetrunValue: "list"); | |
40 | + } | |
41 | + | |
42 | + public dynamic Ins(base_sim entity) | |
43 | + { | |
44 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
45 | + { | |
46 | + var response = new Response(); | |
47 | + //entity.createBy = sysWebUser?.Account; | |
48 | + //entity.createTime = DateTime.Now; | |
49 | + response.Status = Add(entity); | |
50 | + if (!response.Status) response.Message = SystemVariable.dataActionError; | |
51 | + return response; | |
52 | + }); | |
53 | + } | |
54 | + | |
55 | + public dynamic Upd(base_sim entity) | |
56 | + { | |
57 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
58 | + { | |
59 | + var response = new Response(); | |
60 | + //entity.updateBy = sysWebUser?.Account; | |
61 | + //entity.updateTime = DateTime.Now; | |
62 | + response.Status = Update(entity); | |
63 | + if (!response.Status) response.Message = SystemVariable.dataActionError; | |
64 | + return response; | |
65 | + }); | |
66 | + } | |
67 | + | |
68 | + public dynamic DelByIds(int[] ids) | |
69 | + { | |
70 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
71 | + { | |
72 | + var response = new Response(); | |
73 | + Context.Deleteable<base_sim>(t => ids.Contains(t.id)).ExecuteCommand(); | |
74 | + return response; | |
75 | + }); | |
76 | + } | |
77 | + | |
78 | + public Response ExportData(base_sim entity) | |
79 | + { | |
80 | + return Load(null, entity); | |
81 | + } | |
82 | + | |
83 | + public Expression<Func<base_sim, bool>> LinqWhere(base_sim model) | |
84 | + { | |
85 | + try | |
86 | + { | |
87 | + var exp = Expressionable.Create<base_sim>(); | |
88 | + //数据过滤条件 | |
89 | + //if (!string.IsNullOrWhiteSpace(model.XXX)) exp.And(x => x.XXX.Contains(model.XXX)); | |
90 | + if (!string.IsNullOrWhiteSpace(model.simNumber)) | |
91 | + { | |
92 | + exp.And(x => x.simNumber.Contains(model.simNumber)); | |
93 | + } | |
94 | + if (!string.IsNullOrWhiteSpace(model.ip)) | |
95 | + { | |
96 | + exp.And(x => x.ip.Contains(model.ip)); | |
97 | + } | |
98 | + if (!string.IsNullOrWhiteSpace(model.suppliersInfo)) | |
99 | + { | |
100 | + exp.And(x => x.suppliersInfo.Contains(model.suppliersInfo)); | |
101 | + } | |
102 | + return exp.ToExpression();//拼接表达式 | |
103 | + } | |
104 | + catch (Exception ex) | |
105 | + { | |
106 | + throw new Exception($"{ex.Message}"); | |
107 | + } | |
108 | + } | |
109 | + | |
110 | + public dynamic BindEquipment(string simNumber, bool checkeds, string equipmentCode, string factoryCode) | |
111 | + { | |
112 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
113 | + { | |
114 | + var response = new Response(); | |
115 | + var projectKey = Context.Queryable<base_factory>().Where(x => x.factoryCode == factoryCode).Select(x => new { projectKey = x.projectKeys }).ToList(); | |
116 | + if (checkeds) | |
117 | + { | |
118 | + //添加 | |
119 | + var simBindCount = Context.Queryable<base_sim_equipment_rel>().Where(x => x.simNumber == simNumber).ToList().Count; | |
120 | + if (simBindCount > 250) | |
121 | + { | |
122 | + response.Message = "一张SIM卡只允许绑定250个设备,请选择其它SIM卡绑定"; | |
123 | + } | |
124 | + // base_sim_equipment_rel baseSimEquipmentRel = new base_sim_equipment_rel() {simNumber=simNumber,projectKey=projectKey, }; | |
125 | + } | |
126 | + else | |
127 | + { | |
128 | + | |
129 | + } | |
130 | + return response; | |
131 | + }); | |
132 | + } | |
133 | + } | |
134 | +} | |
0 | 135 | \ No newline at end of file |
... | ... |
sys/Hh.Mes.Service/WebService/Equipment/BaseEquipmentService.cs
... | ... | @@ -57,8 +57,8 @@ namespace Hh.Mes.Service.Equipment |
57 | 57 | return ExceptionsHelp.Instance.ExecuteT(() => |
58 | 58 | { |
59 | 59 | var response = new Response(); |
60 | - //entity.createBy = sysWebUser?.Account; | |
61 | - //entity.createTime = DateTime.Now; | |
60 | + entity.createBy = sysWebUser?.Account; | |
61 | + entity.createTime = DateTime.Now; | |
62 | 62 | response.Status = Add(entity); |
63 | 63 | if (!response.Status) response.Message = SystemVariable.dataActionError; |
64 | 64 | return response; |
... | ... | @@ -70,8 +70,8 @@ namespace Hh.Mes.Service.Equipment |
70 | 70 | return ExceptionsHelp.Instance.ExecuteT(() => |
71 | 71 | { |
72 | 72 | var response = new Response(); |
73 | - //entity.updateBy = sysWebUser?.Account; | |
74 | - //entity.updateTime = DateTime.Now; | |
73 | + entity.updateBy = sysWebUser?.Account; | |
74 | + entity.updateTime = DateTime.Now; | |
75 | 75 | response.Status = Update(entity); |
76 | 76 | if (!response.Status) response.Message = SystemVariable.dataActionError; |
77 | 77 | return response; |
... | ... |
sys/Hh.Mes.Service/WebService/Equipment/BaseEquipmentTypeService.cs
0 → 100644
1 | +using Hh.Mes.Common.Infrastructure; | |
2 | +using Hh.Mes.Common.log; | |
3 | +using Hh.Mes.Common.Request; | |
4 | +using Hh.Mes.POJO.Entity; | |
5 | +using Hh.Mes.POJO.Response; | |
6 | +using Hh.Mes.Service.Repository; | |
7 | +using SqlSugar; | |
8 | +using System; | |
9 | +using System.Collections.Generic; | |
10 | +using System.Linq; | |
11 | +using System.Linq.Expressions; | |
12 | +using Hh.Mes.Pojo.System; | |
13 | + | |
14 | +namespace Hh.Mes.Service.Equipment | |
15 | +{ | |
16 | + public class BaseEquipmentTypeService : RepositorySqlSugar<base_equipment_type> | |
17 | + { | |
18 | + public dynamic Load(PageReq pageReq, base_equipment_type entity) | |
19 | + { | |
20 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
21 | + { | |
22 | + var result = new Response<List<base_equipment_type>>(); | |
23 | + var expression = LinqWhere(entity); | |
24 | + //先组合查询表达式 | |
25 | + var query = Context.Queryable<base_equipment_type>().Where(expression); | |
26 | + //Exel为ture就不分页,因为导出的话是全部导出 | |
27 | + if (pageReq != null) | |
28 | + { | |
29 | + int total = 0; | |
30 | + result.Result = query.ToOffsetPage(pageReq.page, pageReq.limit, ref total); | |
31 | + result.Count = total; | |
32 | + } | |
33 | + else | |
34 | + { | |
35 | + result.Result = query.ToList(); | |
36 | + result.Count = result.Result.Count(); | |
37 | + } | |
38 | + return result; | |
39 | + }, catchRetrunValue: "list"); | |
40 | + } | |
41 | + | |
42 | + public dynamic Ins(base_equipment_type entity) | |
43 | + { | |
44 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
45 | + { | |
46 | + var response = new Response(); | |
47 | + entity.createBy = sysWebUser?.Account; | |
48 | + entity.createTime = DateTime.Now; | |
49 | + response.Status = Add(entity); | |
50 | + if (!response.Status)response.Message = SystemVariable.dataActionError; | |
51 | + return response; | |
52 | + }); | |
53 | + } | |
54 | + | |
55 | + public dynamic Upd(base_equipment_type entity) | |
56 | + { | |
57 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
58 | + { | |
59 | + var response = new Response(); | |
60 | + entity.updateBy = sysWebUser?.Account; | |
61 | + entity.updateTime = DateTime.Now; | |
62 | + response.Status = Update(entity); | |
63 | + if (!response.Status) response.Message = SystemVariable.dataActionError; | |
64 | + return response; | |
65 | + }); | |
66 | + } | |
67 | + | |
68 | + public dynamic DelByIds(int[] ids) | |
69 | + { | |
70 | + return ExceptionsHelp.Instance.ExecuteT(() => | |
71 | + { | |
72 | + var response = new Response(); | |
73 | + Context.Deleteable<base_equipment_type>(t => ids.Contains(t.id)).ExecuteCommand(); | |
74 | + return response; | |
75 | + }); | |
76 | + } | |
77 | + | |
78 | + public Response ExportData(base_equipment_type entity) | |
79 | + { | |
80 | + return Load(null, entity); | |
81 | + } | |
82 | + | |
83 | + public Expression<Func<base_equipment_type, bool>> LinqWhere(base_equipment_type model) | |
84 | + { | |
85 | + try | |
86 | + { | |
87 | + var exp = Expressionable.Create<base_equipment_type>(); | |
88 | + //数据过滤条件 | |
89 | + //if (!string.IsNullOrWhiteSpace(model.XXX)) exp.And(x => x.XXX.Contains(model.XXX)); | |
90 | + if (!string.IsNullOrWhiteSpace(model.code)) | |
91 | + { | |
92 | + exp.And(x => x.code.Contains(model.code)); | |
93 | + } | |
94 | + if (!string.IsNullOrWhiteSpace(model.name)) | |
95 | + { | |
96 | + exp.And(x => x.name.Contains(model.name)); | |
97 | + } | |
98 | + if (!string.IsNullOrWhiteSpace(model.description)) | |
99 | + { | |
100 | + exp.And(x => x.description.Contains(model.description)); | |
101 | + } | |
102 | + return exp.ToExpression();//拼接表达式 | |
103 | + } | |
104 | + catch (Exception ex) | |
105 | + { | |
106 | + throw new Exception($"{ex.Message}"); | |
107 | + } | |
108 | + } | |
109 | + } | |
110 | +} | |
0 | 111 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/base/Controllers/BaseSimController.cs
0 → 100644
1 | +using Hh.Mes.Common.Request; | |
2 | +using Hh.Mes.POJO.Entity; | |
3 | +using Hh.Mes.Service; | |
4 | +using Hh.Mes.Service.Base; | |
5 | +using Microsoft.AspNetCore.Hosting; | |
6 | +using Microsoft.AspNetCore.Mvc; | |
7 | +using Hh.Mes.Service.SystemAuth; | |
8 | +using WebMvc.Aop; | |
9 | + | |
10 | +namespace WebMvc.Areas.Base.Controllers | |
11 | +{ | |
12 | + [Area("Base")] | |
13 | + public class BaseSimController : BaseController | |
14 | + { | |
15 | + private readonly BaseSimService _service; | |
16 | + protected readonly IHostingEnvironment hostingEnvironment; | |
17 | + | |
18 | + public BaseSimController(IAuth authUtil, BaseSimService service) : base(authUtil) | |
19 | + { | |
20 | + _service = service; | |
21 | + _service.sysWebUser = authUtil.GetCurrentUser().User; | |
22 | + } | |
23 | + | |
24 | + #region 视图功能 | |
25 | + /// <summary> | |
26 | + /// 默认视图Action | |
27 | + /// </summary> | |
28 | + /// <returns></returns> | |
29 | + [Authenticate] | |
30 | + [ServiceFilter(typeof(OperLogFilter))] | |
31 | + public ActionResult Index() | |
32 | + { | |
33 | + return View(); | |
34 | + } | |
35 | + #endregion | |
36 | + | |
37 | + #region 数据操作 | |
38 | + | |
39 | + /// <summary> | |
40 | + /// 加载及分页查询 | |
41 | + /// </summary> | |
42 | + /// <param name="pageRequest">表单请求信息</param> | |
43 | + /// <param name="entity">请求条件实例</param> | |
44 | + /// <returns></returns> | |
45 | + [HttpPost] | |
46 | + public string Load(PageReq pageRequest, base_sim entity) | |
47 | + { | |
48 | + return Serialize(_service.Load(pageRequest, entity)); | |
49 | + } | |
50 | + | |
51 | + /// <summary> | |
52 | + /// 新增数据 | |
53 | + /// </summary> | |
54 | + /// <param name="entity">新增实例</param> | |
55 | + /// <returns></returns> | |
56 | + [HttpPost] | |
57 | + [ServiceFilter(typeof(OperLogFilter))] | |
58 | + public string Ins(base_sim entity) | |
59 | + { | |
60 | + return Serialize(_service.Ins(entity)); | |
61 | + } | |
62 | + | |
63 | + /// <summary> | |
64 | + /// 修改数据 | |
65 | + /// </summary> | |
66 | + /// <param name="entity">修改实例</param> | |
67 | + /// <returns></returns> | |
68 | + [HttpPost] | |
69 | + [ServiceFilter(typeof(OperLogFilter))] | |
70 | + public string Upd(base_sim entity) | |
71 | + { | |
72 | + return Serialize(_service.Upd(entity)); | |
73 | + } | |
74 | + | |
75 | + /// <summary> | |
76 | + /// 删除数据 | |
77 | + /// </summary> | |
78 | + /// <param name="ids"></param> | |
79 | + /// <returns></returns> | |
80 | + [HttpPost] | |
81 | + [ServiceFilter(typeof(OperLogFilter))] | |
82 | + public string DelByIds(int[] ids) | |
83 | + { | |
84 | + return Serialize(_service.DelByIds(ids)); | |
85 | + } | |
86 | + #endregion | |
87 | + | |
88 | + #region 导出数据 | |
89 | + /// <summary> | |
90 | + /// 导出数据 | |
91 | + /// </summary> | |
92 | + /// <param name="entity">请求条件实例</param> | |
93 | + /// <returns></returns> | |
94 | + [HttpPost] | |
95 | + public string Export(base_sim entity) | |
96 | + { | |
97 | + return Serialize(_service.ExportData(entity)); | |
98 | + } | |
99 | + #endregion | |
100 | + | |
101 | + #region 自定义方法 | |
102 | + public string BindEquipment(string simNumber,bool checkeds,string equipmentCode,string factoryCode) | |
103 | + { | |
104 | + return Serialize(_service.BindEquipment(simNumber,checkeds,equipmentCode,factoryCode)); | |
105 | + } | |
106 | + #endregion | |
107 | + } | |
108 | +} | |
0 | 109 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/base/Controllers/BaseSimEquipmentRelController.cs
0 → 100644
1 | +using Hh.Mes.Common.Request; | |
2 | +using Hh.Mes.POJO.Entity; | |
3 | +using Hh.Mes.Service; | |
4 | +using Hh.Mes.Service.Base; | |
5 | +using Microsoft.AspNetCore.Hosting; | |
6 | +using Microsoft.AspNetCore.Mvc; | |
7 | +using Hh.Mes.Service.SystemAuth; | |
8 | +using WebMvc.Aop; | |
9 | + | |
10 | +namespace WebMvc.Areas.Base.Controllers | |
11 | +{ | |
12 | + [Area("Base")] | |
13 | + public class BaseSimEquipmentRelController : BaseController | |
14 | + { | |
15 | + private readonly BaseSimEquipmentRelService _service; | |
16 | + protected readonly IHostingEnvironment hostingEnvironment; | |
17 | + | |
18 | + public BaseSimEquipmentRelController(IAuth authUtil, BaseSimEquipmentRelService service) : base(authUtil) | |
19 | + { | |
20 | + _service = service; | |
21 | + _service.sysWebUser = authUtil.GetCurrentUser().User; | |
22 | + } | |
23 | + | |
24 | + #region 视图功能 | |
25 | + /// <summary> | |
26 | + /// 默认视图Action | |
27 | + /// </summary> | |
28 | + /// <returns></returns> | |
29 | + [Authenticate] | |
30 | + [ServiceFilter(typeof(OperLogFilter))] | |
31 | + public ActionResult Index() | |
32 | + { | |
33 | + return View(); | |
34 | + } | |
35 | + #endregion | |
36 | + | |
37 | + #region 数据操作 | |
38 | + | |
39 | + /// <summary> | |
40 | + /// 加载及分页查询 | |
41 | + /// </summary> | |
42 | + /// <param name="pageRequest">表单请求信息</param> | |
43 | + /// <param name="entity">请求条件实例</param> | |
44 | + /// <returns></returns> | |
45 | + [HttpPost] | |
46 | + public string Load(PageReq pageRequest, base_sim_equipment_rel entity) | |
47 | + { | |
48 | + return Serialize(_service.Load(pageRequest, entity)); | |
49 | + } | |
50 | + | |
51 | + /// <summary> | |
52 | + /// 新增数据 | |
53 | + /// </summary> | |
54 | + /// <param name="entity">新增实例</param> | |
55 | + /// <returns></returns> | |
56 | + [HttpPost] | |
57 | + [ServiceFilter(typeof(OperLogFilter))] | |
58 | + public string Ins(base_sim_equipment_rel entity) | |
59 | + { | |
60 | + return Serialize(_service.Ins(entity)); | |
61 | + } | |
62 | + | |
63 | + /// <summary> | |
64 | + /// 修改数据 | |
65 | + /// </summary> | |
66 | + /// <param name="entity">修改实例</param> | |
67 | + /// <returns></returns> | |
68 | + [HttpPost] | |
69 | + [ServiceFilter(typeof(OperLogFilter))] | |
70 | + public string Upd(base_sim_equipment_rel entity) | |
71 | + { | |
72 | + return Serialize(_service.Upd(entity)); | |
73 | + } | |
74 | + | |
75 | + /// <summary> | |
76 | + /// 删除数据 | |
77 | + /// </summary> | |
78 | + /// <param name="ids"></param> | |
79 | + /// <returns></returns> | |
80 | + [HttpPost] | |
81 | + [ServiceFilter(typeof(OperLogFilter))] | |
82 | + public string DelByIds(int[] ids) | |
83 | + { | |
84 | + return Serialize(_service.DelByIds(ids)); | |
85 | + } | |
86 | + #endregion | |
87 | + | |
88 | + #region 导出数据 | |
89 | + /// <summary> | |
90 | + /// 导出数据 | |
91 | + /// </summary> | |
92 | + /// <param name="entity">请求条件实例</param> | |
93 | + /// <returns></returns> | |
94 | + [HttpPost] | |
95 | + public string Export(base_sim_equipment_rel entity) | |
96 | + { | |
97 | + return Serialize(_service.ExportData(entity)); | |
98 | + } | |
99 | + #endregion | |
100 | + | |
101 | + #region 自定义方法 | |
102 | + | |
103 | + #endregion | |
104 | + } | |
105 | +} | |
0 | 106 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/base/Views/BaseSim/Index.cshtml
0 → 100644
1 | +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | |
2 | +@{ | |
3 | + ViewData["title"] = "sim管理"; | |
4 | + Layout = "~/Views/Shared/_Layout.cshtml"; | |
5 | +} | |
6 | +@section header | |
7 | +{ | |
8 | +} | |
9 | + | |
10 | +<div id="listForm" class="layui-tab-item layui-show"> | |
11 | + <form class="layui-form layui-form-pane" action="" lay-filter="listForm"> | |
12 | + <div class="layui-form-item" id="panelSearch" hidden> | |
13 | + <fieldset class="layui-elem-field"> | |
14 | + | |
15 | + <div class="layui-field-box" id="qform"> | |
16 | + <div class="layui-form-item layui-col-sm12"> | |
17 | + <div class="layui-inline toolList"> | |
18 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius" data-type="btnQuery"><i class="layui-icon"></i>查询</a> | |
19 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-warm" data-type="btnReset"><i class="layui-icon"></i>重置</a> | |
20 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" data-type="btnClose"><i class="layui-icon"></i>关闭</a> | |
21 | + </div> | |
22 | + </div> | |
23 | + <div class="layui-row"> | |
24 | + <div class="layui-col-sm3"> | |
25 | + <label class="layui-form-label">SIM卡号</label> | |
26 | + <div class="layui-input-inline"> | |
27 | + <input name="simNumber" type="text" autocomplete="off" maxlength="35" class="layui-input"> | |
28 | + </div> | |
29 | + </div> | |
30 | + <div class="layui-col-sm3"> | |
31 | + <label class="layui-form-label">IP地址</label> | |
32 | + <div class="layui-input-inline"> | |
33 | + <input name="ip" type="text" autocomplete="off" maxlength="35" class="layui-input"> | |
34 | + </div> | |
35 | + </div> | |
36 | + <div class="layui-col-sm3"> | |
37 | + <label class="layui-form-label">供应商</label> | |
38 | + <div class="layui-input-inline"> | |
39 | + <input name="suppliersInfo" type="text" autocomplete="off" maxlength="35" class="layui-input"> | |
40 | + </div> | |
41 | + </div> | |
42 | + | |
43 | + </div> | |
44 | + </div> | |
45 | + </fieldset> | |
46 | + </div> | |
47 | + </form> | |
48 | + <table id="mainList" lay-filter="mainList"></table> | |
49 | +</div> | |
50 | + | |
51 | +<div id="modifyForm" class="layui-tab-item"> | |
52 | + <form class="layui-form layui-form-pane" action="" lay-filter="modifyForm" onsubmit="return false;"> | |
53 | + <div class="layui-row"> | |
54 | + <div class="layui-col-sm6"> | |
55 | + <label class="layui-form-label layui-col-sm3">卡号<span class="lable-required">*</span></label> | |
56 | + <div class="layui-input-inline layui-col-sm6"> | |
57 | + <input type="text" name="simNumber" lay-verify="required" autocomplete="off" maxlength="35" class="layui-input"> | |
58 | + </div> | |
59 | + </div> | |
60 | + <div class="layui-col-sm6"> | |
61 | + <label class="layui-form-label layui-col-sm3">ip<span class="lable-required">*</span></label> | |
62 | + <div class="layui-input-inline layui-col-sm6"> | |
63 | + <input type="text" name="ip" lay-verify="required" autocomplete="off" maxlength="35" class="layui-input"> | |
64 | + </div> | |
65 | + </div> | |
66 | + <div class="layui-col-sm6"> | |
67 | + <label class="layui-form-label layui-col-sm3">供应商<span class="lable-required">*</span></label> | |
68 | + <div class="layui-input-inline layui-col-sm6"> | |
69 | + <input type="text" name="suppliersInfo" value="长沙华恒机器人有限公司" lay-verify="required" autocomplete="off" maxlength="35" class="layui-input"> | |
70 | + </div> | |
71 | + </div> | |
72 | + <div class="layui-col-sm6"> | |
73 | + <label class="layui-form-label layui-col-sm3">出厂日期<span class="lable-required">*</span></label> | |
74 | + <div class="layui-input-inline layui-col-sm6"> | |
75 | + <input name="factoryDate" type="text" lay-verify="required" autocomplete="off" class="layui-input layui-date"> | |
76 | + </div> | |
77 | + </div> | |
78 | + <div class="layui-col-sm6"> | |
79 | + <label class="layui-form-label layui-col-sm3">备注</label> | |
80 | + <div class="layui-input-inline layui-col-sm6"> | |
81 | + <input type="text" name="remarks" autocomplete="off" maxlength="350" class="layui-input"> | |
82 | + </div> | |
83 | + </div> | |
84 | + <div class="layui-col-sm6"> | |
85 | + <label class="layui-form-label layui-col-sm3">状态<span class="lable-required">*</span></label> | |
86 | + <div class="layui-input-inline layui-col-sm6"> | |
87 | + <input name="isDelete" type="checkbox" lay-verify="required" lay-skin="switch" lay-text="启用|删除" checked="checked" value="1"> | |
88 | + </div> | |
89 | + </div> | |
90 | + | |
91 | + <div class="layui-form-item"> | |
92 | + <!--表单验证按钮--> | |
93 | + <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button> | |
94 | + <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button> | |
95 | + </div> | |
96 | + </div> | |
97 | + <div hidden> | |
98 | + <input name="id" type="text" class="layui-input"> | |
99 | + | |
100 | + <input name="createBy" type="text" class="layui-input"> | |
101 | + <input name="createTime" type="text" class="layui-input"> | |
102 | + <input name="updateTime" type="text" class="layui-input"> | |
103 | + <input name="updateBy" type="text" class="layui-input"> | |
104 | + </div> | |
105 | + </form> | |
106 | +</div> | |
107 | + | |
108 | +<script type="text/html" id="toolbarTable"> | |
109 | + <div class="layui-btn-container"> | |
110 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnSelect"><i class="layui-icon"></i>检索</a> | |
111 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnRefresh"><i class="layui-icon"></i>刷新</a> | |
112 | + {{ loadMenus("BaseSim", 1) }} | |
113 | + </div> | |
114 | +</script> | |
115 | + | |
116 | +@section Scripts | |
117 | +{ | |
118 | + <script type="text/javascript" src="/productjs/base/BaseSim.js" asp-append-version="true"></script> | |
119 | +} | |
0 | 120 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/base/Views/BaseSimEquipmentRel/Index.cshtml
0 → 100644
1 | +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | |
2 | +@{ | |
3 | + ViewData["title"] = "sim项目设备关系表"; | |
4 | + Layout = "~/Views/Shared/_Layout.cshtml"; | |
5 | +} | |
6 | +@section header | |
7 | +{ | |
8 | +} | |
9 | + | |
10 | +<div id="listForm" class="layui-tab-item layui-show"> | |
11 | + <form class="layui-form layui-form-pane" action="" lay-filter="listForm"> | |
12 | + <div class="layui-form-item" id="panelSearch" hidden> | |
13 | + <fieldset class="layui-elem-field"> | |
14 | + | |
15 | + <div class="layui-field-box" id="qform"> | |
16 | + <div class="layui-form-item layui-col-sm12"> | |
17 | + <div class="layui-inline toolList"> | |
18 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius" data-type="btnQuery"><i class="layui-icon"></i>查询</a> | |
19 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-warm" data-type="btnReset"><i class="layui-icon"></i>重置</a> | |
20 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" data-type="btnClose"><i class="layui-icon"></i>关闭</a> | |
21 | + </div> | |
22 | + </div> | |
23 | + <div class="layui-row"> | |
24 | + <div class="layui-col-sm3"> | |
25 | + <label class="layui-form-label">sim卡号</label> | |
26 | + <div class="layui-input-inline"> | |
27 | + <input name="simNumber" type="text" autocomplete="off" maxlength="35" class="layui-input"> | |
28 | + </div> | |
29 | + </div> | |
30 | + <div class="layui-col-sm3"> | |
31 | + <label class="layui-form-label">设备编码</label> | |
32 | + <div class="layui-input-inline"> | |
33 | + <input name="equipmentCode" type="text" autocomplete="off" maxlength="35" class="layui-input"> | |
34 | + </div> | |
35 | + </div> | |
36 | + | |
37 | + </div> | |
38 | + </div> | |
39 | + </fieldset> | |
40 | + </div> | |
41 | + </form> | |
42 | + <table id="mainList" lay-filter="mainList"></table> | |
43 | +</div> | |
44 | + | |
45 | +<div id="modifyForm" class="layui-tab-item"> | |
46 | + <form class="layui-form layui-form-pane" action="" lay-filter="modifyForm" onsubmit="return false;"> | |
47 | + <div class="layui-row"> | |
48 | + <div class="layui-col-sm6"> | |
49 | + <label class="layui-form-label layui-col-sm3">sim卡号<span class="lable-required">*</span></label> | |
50 | + <div class="layui-input-inline layui-col-sm6"> | |
51 | + <input type="text" name="simNumber" lay-verify="required" autocomplete="off" maxlength="35" class="layui-input"> | |
52 | + </div> | |
53 | + </div> | |
54 | + <div class="layui-col-sm6"> | |
55 | + <label class="layui-form-label layui-col-sm3">项目keys<span class="lable-required">*</span></label> | |
56 | + <div class="layui-input-inline layui-col-sm6"> | |
57 | + <input type="text" name="projectKey" lay-verify="required" autocomplete="off" maxlength="11" class="layui-input"> | |
58 | + </div> | |
59 | + </div> | |
60 | + <div class="layui-col-sm6"> | |
61 | + <label class="layui-form-label layui-col-sm3">设备编码<span class="lable-required">*</span></label> | |
62 | + <div class="layui-input-inline layui-col-sm6"> | |
63 | + <input type="text" name="equipmentCode" lay-verify="required" autocomplete="off" maxlength="35" class="layui-input"> | |
64 | + </div> | |
65 | + </div> | |
66 | + | |
67 | + <div class="layui-form-item"> | |
68 | + <!--表单验证按钮--> | |
69 | + <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button> | |
70 | + <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button> | |
71 | + </div> | |
72 | + </div> | |
73 | + <div hidden> | |
74 | + <input name="id" type="text" class="layui-input"> | |
75 | + | |
76 | + <input name="createBy" type="text" class="layui-input"> | |
77 | + <input name="createTime" type="text" class="layui-input"> | |
78 | + <input name="updateTime" type="text" class="layui-input"> | |
79 | + <input name="updateBy" type="text" class="layui-input"> | |
80 | + </div> | |
81 | + </form> | |
82 | +</div> | |
83 | + | |
84 | +<script type="text/html" id="toolbarTable"> | |
85 | + <div class="layui-btn-container"> | |
86 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnSelect"><i class="layui-icon"></i>检索</a> | |
87 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnRefresh"><i class="layui-icon"></i>刷新</a> | |
88 | + {{ loadMenus("BaseSimEquipmentRel", 1) }} | |
89 | + </div> | |
90 | +</script> | |
91 | + | |
92 | +@section Scripts | |
93 | +{ | |
94 | + <script type="text/javascript" src="/productjs/base/BaseSimEquipmentRel.js" asp-append-version="true"></script> | |
95 | +} | |
0 | 96 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/equipment/Controllers/BaseEquipmentTypeController.cs
0 → 100644
1 | +using Hh.Mes.Common.Request; | |
2 | +using Hh.Mes.POJO.Entity; | |
3 | +using Hh.Mes.Service; | |
4 | +using Hh.Mes.Service.Equipment; | |
5 | +using Microsoft.AspNetCore.Hosting; | |
6 | +using Microsoft.AspNetCore.Mvc; | |
7 | +using Hh.Mes.Service.SystemAuth; | |
8 | +using WebMvc.Aop; | |
9 | + | |
10 | +namespace WebMvc.Areas.Equipment.Controllers | |
11 | +{ | |
12 | + [Area("Equipment")] | |
13 | + public class BaseEquipmentTypeController : BaseController | |
14 | + { | |
15 | + private readonly BaseEquipmentTypeService _service; | |
16 | + protected readonly IHostingEnvironment hostingEnvironment; | |
17 | + | |
18 | + public BaseEquipmentTypeController(IAuth authUtil, BaseEquipmentTypeService service) : base(authUtil) | |
19 | + { | |
20 | + _service = service; | |
21 | + _service.sysWebUser = authUtil.GetCurrentUser().User; | |
22 | + } | |
23 | + | |
24 | + #region 视图功能 | |
25 | + /// <summary> | |
26 | + /// 默认视图Action | |
27 | + /// </summary> | |
28 | + /// <returns></returns> | |
29 | + [Authenticate] | |
30 | + [ServiceFilter(typeof(OperLogFilter))] | |
31 | + public ActionResult Index() | |
32 | + { | |
33 | + return View(); | |
34 | + } | |
35 | + #endregion | |
36 | + | |
37 | + #region 数据操作 | |
38 | + | |
39 | + /// <summary> | |
40 | + /// 加载及分页查询 | |
41 | + /// </summary> | |
42 | + /// <param name="pageRequest">表单请求信息</param> | |
43 | + /// <param name="entity">请求条件实例</param> | |
44 | + /// <returns></returns> | |
45 | + [HttpPost] | |
46 | + public string Load(PageReq pageRequest, base_equipment_type entity) | |
47 | + { | |
48 | + return Serialize(_service.Load(pageRequest, entity)); | |
49 | + } | |
50 | + | |
51 | + /// <summary> | |
52 | + /// 新增数据 | |
53 | + /// </summary> | |
54 | + /// <param name="entity">新增实例</param> | |
55 | + /// <returns></returns> | |
56 | + [HttpPost] | |
57 | + [ServiceFilter(typeof(OperLogFilter))] | |
58 | + public string Ins(base_equipment_type entity) | |
59 | + { | |
60 | + return Serialize(_service.Ins(entity)); | |
61 | + } | |
62 | + | |
63 | + /// <summary> | |
64 | + /// 修改数据 | |
65 | + /// </summary> | |
66 | + /// <param name="entity">修改实例</param> | |
67 | + /// <returns></returns> | |
68 | + [HttpPost] | |
69 | + [ServiceFilter(typeof(OperLogFilter))] | |
70 | + public string Upd(base_equipment_type entity) | |
71 | + { | |
72 | + return Serialize(_service.Upd(entity)); | |
73 | + } | |
74 | + | |
75 | + /// <summary> | |
76 | + /// 删除数据 | |
77 | + /// </summary> | |
78 | + /// <param name="ids"></param> | |
79 | + /// <returns></returns> | |
80 | + [HttpPost] | |
81 | + [ServiceFilter(typeof(OperLogFilter))] | |
82 | + public string DelByIds(int[] ids) | |
83 | + { | |
84 | + return Serialize(_service.DelByIds(ids)); | |
85 | + } | |
86 | + #endregion | |
87 | + | |
88 | + #region 导出数据 | |
89 | + /// <summary> | |
90 | + /// 导出数据 | |
91 | + /// </summary> | |
92 | + /// <param name="entity">请求条件实例</param> | |
93 | + /// <returns></returns> | |
94 | + [HttpPost] | |
95 | + public string Export(base_equipment_type entity) | |
96 | + { | |
97 | + return Serialize(_service.ExportData(entity)); | |
98 | + } | |
99 | + #endregion | |
100 | + | |
101 | + #region 自定义方法 | |
102 | + | |
103 | + #endregion | |
104 | + } | |
105 | +} | |
0 | 106 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/equipment/Views/BaseEquipment/Index.cshtml
1 | 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
2 | 2 | @{ |
3 | - ViewData["title"] = "设备"; | |
3 | + ViewData["title"] = "设备管理"; | |
4 | 4 | Layout = "~/Views/Shared/_Layout.cshtml"; |
5 | 5 | } |
6 | 6 | @section header |
7 | -{ | |
7 | + { | |
8 | 8 | } |
9 | 9 | |
10 | 10 | <div id="listForm" class="layui-tab-item layui-show"> |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | </div> |
23 | 23 | <div class="layui-row"> |
24 | 24 | <div class="layui-col-sm3"> |
25 | - <label class="layui-form-label">设备编码,唯一且有规律易识别</label> | |
25 | + <label class="layui-form-label">设备编码</label> | |
26 | 26 | <div class="layui-input-inline"> |
27 | 27 | <input name="equipmentCode" type="text" autocomplete="off" class="layui-input"> |
28 | 28 | </div> |
... | ... | @@ -34,12 +34,12 @@ |
34 | 34 | </div> |
35 | 35 | </div> |
36 | 36 | <div class="layui-col-sm3"> |
37 | - <label class="layui-form-label">此处写到这台设备对应的IP,一般为PLC的IP</label> | |
37 | + <label class="layui-form-label">IP</label> | |
38 | 38 | <div class="layui-input-inline"> |
39 | 39 | <input name="ip" type="text" autocomplete="off" class="layui-input"> |
40 | 40 | </div> |
41 | 41 | </div> |
42 | - | |
42 | + | |
43 | 43 | </div> |
44 | 44 | </div> |
45 | 45 | </fieldset> |
... | ... | @@ -50,92 +50,74 @@ |
50 | 50 | |
51 | 51 | <div id="modifyForm" class="layui-tab-item"> |
52 | 52 | <form class="layui-form layui-form-pane" action="" lay-filter="modifyForm" onsubmit="return false;"> |
53 | - <div class="layui-row"> | |
54 | - <div class="layui-col-sm6"> | |
55 | - <label class="layui-form-label layui-col-sm3">设备编码,唯一且有规律易识别<span class="lable-required">*</span></label> | |
56 | - <div class="layui-input-inline layui-col-sm6"> | |
57 | - <input type="text" name="equipmentCode" lay-verify="required" autocomplete="off" class="layui-input"> | |
58 | - </div> | |
59 | - </div> | |
60 | - <div class="layui-col-sm6"> | |
61 | - <label class="layui-form-label layui-col-sm3">设备名<span class="lable-required">*</span></label> | |
62 | - <div class="layui-input-inline layui-col-sm6"> | |
63 | - <input type="text" name="equipmentName" lay-verify="required" autocomplete="off" class="layui-input"> | |
64 | - </div> | |
65 | - </div> | |
66 | - <div class="layui-col-sm6"> | |
67 | - <label class="layui-form-label layui-col-sm3">关联到设备类型<span class="lable-required">*</span></label> | |
68 | - <div class="layui-input-inline layui-col-sm6"> | |
69 | - <input name="equipmentTypeCode" type="number" lay-verify="required" autocomplete="off" class="layui-input"> | |
53 | + <div class="layui-row"> | |
54 | + <div class="layui-col-sm6"> | |
55 | + <label class="layui-form-label layui-col-sm3">设备编码<span class="lable-required">*</span></label> | |
56 | + <div class="layui-input-inline layui-col-sm6"> | |
57 | + <input type="text" name="equipmentCode" lay-verify="required" autocomplete="off" class="layui-input"> | |
58 | + </div> | |
70 | 59 | </div> |
71 | - </div> | |
72 | - <div class="layui-col-sm6"> | |
73 | - <label class="layui-form-label layui-col-sm3">此处写到这台设备对应的IP,一般为PLC的IP<span class="lable-required">*</span></label> | |
74 | - <div class="layui-input-inline layui-col-sm6"> | |
75 | - <input type="text" name="ip" lay-verify="required" autocomplete="off" class="layui-input"> | |
60 | + <div class="layui-col-sm6"> | |
61 | + <label class="layui-form-label layui-col-sm3">厂房编码<span class="lable-required">*</span></label> | |
62 | + <div class="layui-input-inline layui-col-sm6"> | |
63 | + <input type="text" name="factoryCode" lay-verify="required" autocomplete="off" class="layui-input"> | |
64 | + </div> | |
76 | 65 | </div> |
77 | - </div> | |
78 | - <div class="layui-col-sm6"> | |
79 | - <label class="layui-form-label layui-col-sm3">所在区域,出于调度目的或其他划分,比如:为兼容转轨堆垛机设定,正常情况下与巷道相同,转轨情况下对应虚拟划分巷道<span class="lable-required">*</span></label> | |
80 | - <div class="layui-input-inline layui-col-sm6"> | |
81 | - <input type="text" name="destinationArea" lay-verify="required" autocomplete="off" class="layui-input"> | |
66 | + <div class="layui-col-sm6"> | |
67 | + <label class="layui-form-label layui-col-sm3">设备名<span class="lable-required">*</span></label> | |
68 | + <div class="layui-input-inline layui-col-sm6"> | |
69 | + <input type="text" name="equipmentName" lay-verify="required" autocomplete="off" class="layui-input"> | |
70 | + </div> | |
82 | 71 | </div> |
83 | - </div> | |
84 | - <div class="layui-col-sm6"> | |
85 | - <label class="layui-form-label layui-col-sm3">描述<span class="lable-required">*</span></label> | |
86 | - <div class="layui-input-inline layui-col-sm6"> | |
87 | - <input type="text" name="remark" lay-verify="required" autocomplete="off" class="layui-input"> | |
72 | + <div class="layui-col-sm6"> | |
73 | + <label class="layui-form-label layui-col-sm3">设备类型<span class="lable-required">*</span></label> | |
74 | + <div class="layui-input-inline layui-col-sm6"> | |
75 | + <select name="equipmentTypeCode" lay-verify="required" class="layui-select"></select> | |
76 | + </div> | |
88 | 77 | </div> |
89 | - </div> | |
90 | - <div class="layui-col-sm6"> | |
91 | - <label class="layui-form-label layui-col-sm3">维护规则Id<span class="lable-required">*</span></label> | |
92 | - <div class="layui-input-inline layui-col-sm6"> | |
93 | - <input name="equipmentMaintainRuleId" type="number" lay-verify="required" autocomplete="off" class="layui-input"> | |
78 | + <div class="layui-col-sm6"> | |
79 | + <label class="layui-form-label layui-col-sm3">PLC-IP</label> | |
80 | + <div class="layui-input-inline layui-col-sm6"> | |
81 | + <input type="text" name="ip" autocomplete="off" class="layui-input"> | |
82 | + </div> | |
94 | 83 | </div> |
95 | - </div> | |
96 | - <div class="layui-col-sm6"> | |
97 | - <label class="layui-form-label layui-col-sm3">创建时间<span class="lable-required">*</span></label> | |
98 | - <div class="layui-input-inline layui-col-sm6"> | |
99 | - <input name="createTime" type="text" lay-verify="required" autocomplete="off" class="layui-input layui-date"> | |
84 | + <div class="layui-col-sm6"> | |
85 | + <label class="layui-form-label layui-col-sm3">所在区域</label> | |
86 | + <div class="layui-input-inline layui-col-sm6"> | |
87 | + <input type="text" name="destinationArea" autocomplete="off" class="layui-input"> | |
88 | + </div> | |
100 | 89 | </div> |
101 | - </div> | |
102 | - <div class="layui-col-sm6"> | |
103 | - <label class="layui-form-label layui-col-sm3">createdBy<span class="lable-required">*</span></label> | |
104 | - <div class="layui-input-inline layui-col-sm6"> | |
105 | - <input type="text" name="createBy" lay-verify="required" autocomplete="off" class="layui-input"> | |
90 | + <div class="layui-col-sm6"> | |
91 | + <label class="layui-form-label layui-col-sm3">描述</label> | |
92 | + <div class="layui-input-inline layui-col-sm6"> | |
93 | + <input type="text" name="remark" autocomplete="off" class="layui-input"> | |
94 | + </div> | |
106 | 95 | </div> |
107 | - </div> | |
108 | - <div class="layui-col-sm6"> | |
109 | - <label class="layui-form-label layui-col-sm3">对于更新时间,不自动写入,允许为null<span class="lable-required">*</span></label> | |
110 | - <div class="layui-input-inline layui-col-sm6"> | |
111 | - <input name="updateTime" type="text" lay-verify="required" autocomplete="off" class="layui-input layui-date"> | |
96 | + <div class="layui-col-sm6"> | |
97 | + <label class="layui-form-label layui-col-sm3">维护规则Id</label> | |
98 | + <div class="layui-input-inline layui-col-sm6"> | |
99 | + <input name="equipmentMaintainRuleId" type="number" autocomplete="off" class="layui-input"> | |
100 | + </div> | |
112 | 101 | </div> |
113 | - </div> | |
114 | - <div class="layui-col-sm6"> | |
115 | - <label class="layui-form-label layui-col-sm3">updatedBy<span class="lable-required">*</span></label> | |
116 | - <div class="layui-input-inline layui-col-sm6"> | |
117 | - <input type="text" name="updateBy" lay-verify="required" autocomplete="off" class="layui-input"> | |
102 | + <div class="layui-col-sm6"> | |
103 | + <label class="layui-form-label layui-col-sm3">是否启用</label> | |
104 | + <div class="layui-input-inline layui-col-sm6"> | |
105 | + <input type="checkbox" name="isDelete" lay-skin="switch" lay-text="启用|禁用" checked="checked" value="1"> | |
106 | + </div> | |
118 | 107 | </div> |
119 | - </div> | |
120 | - <div class="layui-col-sm6"> | |
121 | - <label class="layui-form-label layui-col-sm3">是否启用<span class="lable-required">*</span></label> | |
122 | - <div class="layui-input-inline layui-col-sm6"> | |
123 | - <input type="text" name="isDelete" lay-verify="required" autocomplete="off" class="layui-input"> | |
108 | + <div class="layui-col-sm6"> | |
109 | + <label class="layui-form-label layui-col-sm3">图片文件名称</label> | |
110 | + <div class="layui-input-inline layui-col-sm6"> | |
111 | + <input type="text" name="imgSrc" autocomplete="off" class="layui-input"> | |
112 | + </div> | |
124 | 113 | </div> |
125 | - </div> | |
126 | - <div class="layui-col-sm6"> | |
127 | - <label class="layui-form-label layui-col-sm3">图片文件名称<span class="lable-required">*</span></label> | |
128 | - <div class="layui-input-inline layui-col-sm6"> | |
129 | - <input type="text" name="imgSrc" lay-verify="required" autocomplete="off" class="layui-input"> | |
114 | + | |
115 | + <div class="layui-form-item"> | |
116 | + <!--表单验证按钮--> | |
117 | + <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button> | |
118 | + <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button> | |
130 | 119 | </div> |
131 | 120 | </div> |
132 | - | |
133 | - <div class="layui-form-item"> | |
134 | - <!--表单验证按钮--> | |
135 | - <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button> | |
136 | - <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button> | |
137 | - </div> | |
138 | - </div> | |
139 | 121 | <div hidden> |
140 | 122 | <input name="id" type="text" class="layui-input"> |
141 | 123 | |
... | ... | @@ -156,6 +138,6 @@ |
156 | 138 | </script> |
157 | 139 | |
158 | 140 | @section Scripts |
159 | -{ | |
141 | + { | |
160 | 142 | <script type="text/javascript" src="/productjs/equipment/BaseEquipment.js" asp-append-version="true"></script> |
161 | 143 | } |
162 | 144 | \ No newline at end of file |
... | ... |
web/WebMvc/Areas/equipment/Views/BaseEquipmentType/Index.cshtml
0 → 100644
1 | +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | |
2 | +@{ | |
3 | + ViewData["title"] = "设备类型表"; | |
4 | + Layout = "~/Views/Shared/_Layout.cshtml"; | |
5 | +} | |
6 | +@section header | |
7 | + { | |
8 | +} | |
9 | + | |
10 | +<div id="listForm" class="layui-tab-item layui-show"> | |
11 | + <form class="layui-form layui-form-pane" action="" lay-filter="listForm"> | |
12 | + <div class="layui-form-item" id="panelSearch" hidden> | |
13 | + <fieldset class="layui-elem-field"> | |
14 | + | |
15 | + <div class="layui-field-box" id="qform"> | |
16 | + <div class="layui-form-item layui-col-sm12"> | |
17 | + <div class="layui-inline toolList"> | |
18 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius" data-type="btnQuery"><i class="layui-icon"></i>查询</a> | |
19 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-warm" data-type="btnReset"><i class="layui-icon"></i>重置</a> | |
20 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" data-type="btnClose"><i class="layui-icon"></i>关闭</a> | |
21 | + </div> | |
22 | + </div> | |
23 | + <div class="layui-row"> | |
24 | + <div class="layui-col-sm3"> | |
25 | + <label class="layui-form-label">设备类型代号</label> | |
26 | + <div class="layui-input-inline"> | |
27 | + <input name="code" type="text" autocomplete="off" maxlength="22" class="layui-input"> | |
28 | + </div> | |
29 | + </div> | |
30 | + <div class="layui-col-sm3"> | |
31 | + <label class="layui-form-label">类型名称</label> | |
32 | + <div class="layui-input-inline"> | |
33 | + <input name="name" type="text" autocomplete="off" maxlength="22" class="layui-input"> | |
34 | + </div> | |
35 | + </div> | |
36 | + <div class="layui-col-sm3"> | |
37 | + <label class="layui-form-label">描述</label> | |
38 | + <div class="layui-input-inline"> | |
39 | + <input name="description" type="text" autocomplete="off" maxlength="22" class="layui-input"> | |
40 | + </div> | |
41 | + </div> | |
42 | + | |
43 | + </div> | |
44 | + </div> | |
45 | + </fieldset> | |
46 | + </div> | |
47 | + </form> | |
48 | + <table id="mainList" lay-filter="mainList"></table> | |
49 | +</div> | |
50 | + | |
51 | +<div id="modifyForm" class="layui-tab-item"> | |
52 | + <form class="layui-form layui-form-pane" action="" lay-filter="modifyForm" onsubmit="return false;"> | |
53 | + <div class="layui-row"> | |
54 | + <div class="layui-col-sm12"> | |
55 | + <label class="layui-form-label layui-col-sm3">类型代号<span class="lable-required">*</span></label> | |
56 | + <div class="layui-input-inline layui-col-sm6"> | |
57 | + <input type="text" name="code" lay-verify="required" autocomplete="off" maxlength="22" class="layui-input"> | |
58 | + </div> | |
59 | + </div> | |
60 | + <div class="layui-col-sm12"> | |
61 | + <label class="layui-form-label layui-col-sm3">类型名称<span class="lable-required">*</span></label> | |
62 | + <div class="layui-input-inline layui-col-sm6"> | |
63 | + <input type="text" name="name" lay-verify="required" autocomplete="off" maxlength="22" class="layui-input"> | |
64 | + </div> | |
65 | + </div> | |
66 | + <div class="layui-col-sm12"> | |
67 | + <label class="layui-form-label layui-col-sm3">描述<span class="lable-required">*</span></label> | |
68 | + <div class="layui-input-inline layui-col-sm6"> | |
69 | + <input type="text" name="description" lay-verify="required" autocomplete="off" maxlength="22" class="layui-input"> | |
70 | + </div> | |
71 | + </div> | |
72 | + <div class="layui-col-sm6"> | |
73 | + <label class="layui-form-label layui-col-sm3">是否生效<span class="lable-required">*</span></label> | |
74 | + <div class="layui-input-inline layui-col-sm6"> | |
75 | + <input type="checkbox" name="enable" lay-verify="required" lay-skin="switch" lay-text="生效|失效" checked="checked" value="true"> | |
76 | + </div> | |
77 | + </div> | |
78 | + | |
79 | + <div class="layui-form-item"> | |
80 | + <!--表单验证按钮--> | |
81 | + <button class="layui-btn" style="display:none" name="fromAdd" lay-filter="fromAdd" lay-submit>fromAdd</button> | |
82 | + <button class="layui-btn" style="display:none" name="fromUpdate" lay-filter="fromUpdate" lay-submit>fromUpdate</button> | |
83 | + </div> | |
84 | + </div> | |
85 | + <div hidden> | |
86 | + <input name="id" type="text" class="layui-input"> | |
87 | + | |
88 | + <input name="createBy" type="text" class="layui-input"> | |
89 | + <input name="createTime" type="text" class="layui-input"> | |
90 | + <input name="updateTime" type="text" class="layui-input"> | |
91 | + <input name="updateBy" type="text" class="layui-input"> | |
92 | + </div> | |
93 | + </form> | |
94 | +</div> | |
95 | + | |
96 | +<script type="text/html" id="toolbarTable"> | |
97 | + <div class="layui-btn-container"> | |
98 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnSelect"><i class="layui-icon"></i>检索</a> | |
99 | + <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-mini" lay-event="btnRefresh"><i class="layui-icon"></i>刷新</a> | |
100 | + {{ loadMenus("BaseEquipmentType", 1) }} | |
101 | + </div> | |
102 | +</script> | |
103 | + | |
104 | +@section Scripts | |
105 | + { | |
106 | + <script type="text/javascript" src="/productjs/equipment/BaseEquipmentType.js" asp-append-version="true"></script> | |
107 | +} | |
0 | 108 | \ No newline at end of file |
... | ... |
web/WebMvc/WebMvc.csproj
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | </PropertyGroup> |
17 | 17 | |
18 | 18 | <ItemGroup> |
19 | + <Compile Remove="Areas\base\Views\BaseSimEquipmentRel\**" /> | |
19 | 20 | <Compile Remove="Areas\configure\Views\base_product_header\**" /> |
20 | 21 | <Compile Remove="logs\**" /> |
21 | 22 | <Compile Remove="wwwroot\css\新文件夹\**" /> |
... | ... | @@ -26,6 +27,7 @@ |
26 | 27 | <Compile Remove="wwwroot\productjs\distribution\**" /> |
27 | 28 | <Compile Remove="wwwroot\productjs\production\**" /> |
28 | 29 | <Compile Remove="wwwroot\productjs\quality\**" /> |
30 | + <Content Remove="Areas\base\Views\BaseSimEquipmentRel\**" /> | |
29 | 31 | <Content Remove="Areas\configure\Views\base_product_header\**" /> |
30 | 32 | <Content Remove="logs\**" /> |
31 | 33 | <Content Remove="wwwroot\css\新文件夹\**" /> |
... | ... | @@ -36,6 +38,7 @@ |
36 | 38 | <Content Remove="wwwroot\productjs\distribution\**" /> |
37 | 39 | <Content Remove="wwwroot\productjs\production\**" /> |
38 | 40 | <Content Remove="wwwroot\productjs\quality\**" /> |
41 | + <EmbeddedResource Remove="Areas\base\Views\BaseSimEquipmentRel\**" /> | |
39 | 42 | <EmbeddedResource Remove="Areas\configure\Views\base_product_header\**" /> |
40 | 43 | <EmbeddedResource Remove="logs\**" /> |
41 | 44 | <EmbeddedResource Remove="wwwroot\css\新文件夹\**" /> |
... | ... | @@ -46,6 +49,7 @@ |
46 | 49 | <EmbeddedResource Remove="wwwroot\productjs\distribution\**" /> |
47 | 50 | <EmbeddedResource Remove="wwwroot\productjs\production\**" /> |
48 | 51 | <EmbeddedResource Remove="wwwroot\productjs\quality\**" /> |
52 | + <None Remove="Areas\base\Views\BaseSimEquipmentRel\**" /> | |
49 | 53 | <None Remove="Areas\configure\Views\base_product_header\**" /> |
50 | 54 | <None Remove="logs\**" /> |
51 | 55 | <None Remove="wwwroot\css\新文件夹\**" /> |
... | ... | @@ -59,6 +63,7 @@ |
59 | 63 | </ItemGroup> |
60 | 64 | |
61 | 65 | <ItemGroup> |
66 | + <Compile Remove="Areas\base\Controllers\BaseSimEquipmentRelController.cs" /> | |
62 | 67 | <Compile Remove="Areas\Planned\Controllers\FactoryCalendarController.cs" /> |
63 | 68 | </ItemGroup> |
64 | 69 | |
... | ... |
web/WebMvc/wwwroot/baseJs/projectMap.js
web/WebMvc/wwwroot/productjs/base/BaseSim.js
0 → 100644
1 | +let action = null; | |
2 | +layui.config({ | |
3 | + base: "/js/", | |
4 | + version: 1 | |
5 | +}).use(['system'], function () { | |
6 | + var form = layui.form, | |
7 | + $ = layui.jquery, | |
8 | + element = layui.element, | |
9 | + table = layui.table, | |
10 | + system = layui.system, | |
11 | + sysU = new system.u(), | |
12 | + sendDataWhere = null, | |
13 | + sendDataDescWhere = null, | |
14 | + areaName = "base", | |
15 | + controllerName = "BaseSim", | |
16 | + app = null; | |
17 | + | |
18 | + action = { | |
19 | + addOptions: function () { | |
20 | + var options = { | |
21 | + fromId: "#modifyForm form", | |
22 | + url: `/${areaName}/${controllerName}/Ins`, | |
23 | + //sendDataWhere: null, | |
24 | + //isAddWhereExtend: "arbitrarily", | |
25 | + //mainTable: app.data.tableIns, | |
26 | + submit: "submit(fromAdd)" | |
27 | + } | |
28 | + return options; | |
29 | + }, | |
30 | + | |
31 | + editOptions: function () { | |
32 | + var options = { | |
33 | + fromId: "#modifyForm form", | |
34 | + url: `/${areaName}/${controllerName}/Upd`, | |
35 | + submit: "submit(fromUpdate)" | |
36 | + } | |
37 | + return options; | |
38 | + }, | |
39 | + | |
40 | + deleteOptions: function () { | |
41 | + var options = { | |
42 | + url: `/${areaName}/${controllerName}/DelByIds`, | |
43 | + keyId: "id" | |
44 | + } | |
45 | + return options; | |
46 | + }, | |
47 | + | |
48 | + exportOptions: function () { | |
49 | + var options = { | |
50 | + fromId: "listForm", | |
51 | + url: `/${areaName}/${controllerName}/Export`, | |
52 | + isDefault: false, | |
53 | + sendDataWhere: {}, | |
54 | + excelCols: { | |
55 | + head: app.data.cols, | |
56 | + body: app.data.colsDesc | |
57 | + } | |
58 | + } | |
59 | + return options; | |
60 | + }, | |
61 | + | |
62 | + queryOptions: function () { | |
63 | + var options = { | |
64 | + resetFrom: "form[lay-filter=listForm]", | |
65 | + fromId: "listForm", | |
66 | + urlExport: `/${areaName}/${controllerName}/Export`, | |
67 | + urlQuery: `/${areaName}/${controllerName}/Load`, | |
68 | + sendDataWhere: {}, | |
69 | + mainTable: app.data.tableIns | |
70 | + } | |
71 | + return options; | |
72 | + }, | |
73 | + /*rowClickOptions: function () { | |
74 | + var options = { | |
75 | + //是否主子表 | |
76 | + isDefault: true, | |
77 | + targetTableId: app.data.tableElem, | |
78 | + tabfilter: "tableTabBody", | |
79 | + tabId: 2, | |
80 | + customFn: app.methods.initTableDesc | |
81 | + } | |
82 | + return options; | |
83 | + },*/ | |
84 | + | |
85 | + uploadOptions: function () { | |
86 | + var options = { | |
87 | + url: `/${areaName}/${controllerName}/Import`, | |
88 | + fromFile: "#excelfile", | |
89 | + content: $("#ImportData") | |
90 | + } | |
91 | + return options; | |
92 | + }, | |
93 | + addBefore: function (callBack) { | |
94 | + //callBack是回调函数,如果editBefore有ajax 放在成功之后 | |
95 | + if (callBack != null) callBack(); | |
96 | + }, | |
97 | + | |
98 | + addSaveBefore: function (data, callBack) { | |
99 | + if (callBack != null) callBack(); | |
100 | + }, | |
101 | + editBefore: function (data, callBack) { | |
102 | + //data.enable = data.enable.toString(); | |
103 | + form.val("modifyForm", data); | |
104 | + if (callBack != null) callBack(); | |
105 | + }, | |
106 | + editSaveBefore: function (data, callBack) { | |
107 | + if (typeof data.field.isDelete == "undefined") data.field["isDelete"] = "0"; | |
108 | + if (callBack != null) callBack(); | |
109 | + }, | |
110 | + | |
111 | + btnBindEquipment: function () { | |
112 | + var checkStatus = table.checkStatus('mainList'), | |
113 | + data = checkStatus.data; | |
114 | + var edit = false; | |
115 | + if (data.length != 1) { | |
116 | + toplayer.msg("请选择要设备的Sim卡!"); | |
117 | + return; | |
118 | + } | |
119 | + | |
120 | + var url = `/equipment/BaseEquipment/Index?menuFlag=-2&selectColKeyCustom=keys&page=BaseSim&simNumber=${data[0].simNumber}`;//menuFlag=-2 菜单隐藏 | |
121 | + var index = layer.open({ | |
122 | + title: "为SIM卡【" + data[0].Name + "】绑定设备<span style='color:red;'>(一张sim卡可绑定最多250台设备,逐一勾选,禁止全选)</span>", | |
123 | + area: ["1000px", "600px"], | |
124 | + type: 2, | |
125 | + content: url, | |
126 | + | |
127 | + }); | |
128 | + }, | |
129 | + | |
130 | + checkboxMethod: function (obj) { | |
131 | + var page = "".GetUrlParam("page"), | |
132 | + xxx = "".GetUrlParam("xxx"); | |
133 | + if (page == "xxx") { | |
134 | + var sendData = { | |
135 | + | |
136 | + }; | |
137 | + var ajaxConfig = { | |
138 | + data: sendData, | |
139 | + url: `${areaName}/${controllerName}/xxx`, | |
140 | + success: function (result) { | |
141 | + if (sysU.successBefore(result)) return false; | |
142 | + layer.msg(result.Message); | |
143 | + } | |
144 | + }; | |
145 | + sysU.ajax(ajaxConfig); | |
146 | + } | |
147 | + }, | |
148 | + //所有动作成功之后 | |
149 | + actionSuccess: (flag) => { | |
150 | + sysU.refreshTable(app, sysU, null, flag); | |
151 | + }, | |
152 | + closeAfter: function (callBack) { | |
153 | + if (callBack != null) callBack(); | |
154 | + } | |
155 | + } | |
156 | + | |
157 | + app = { | |
158 | + data: { | |
159 | + cols: [[ | |
160 | + { checkbox: true, fixed: true }, | |
161 | + { field: "id", width: 80, hide: true, title: "Id" }, | |
162 | + { field: "simNumber", width: 150, title: "SIM卡号" }, | |
163 | + { field: "ip", width: 150, title: "IP地址" }, | |
164 | + { field: "suppliersInfo", width: 150, title: "供应商" }, | |
165 | + { field: "factoryDate", width: 150, title: "出厂日期" }, | |
166 | + { field: "remarks", width: 150, title: "备注" }, | |
167 | + { field: "isDelete", width: 150, title: "状态" }, | |
168 | + { field: "createTime", width: 150, title: "创建时间" }, | |
169 | + { field: "createBy", width: 150, title: "创建人" }, | |
170 | + { field: "updateTime", width: 150, title: "修改时间" }, | |
171 | + { field: "updateBy", width: 150, title: "修改人" }, | |
172 | + ]], | |
173 | + colsDesc: null, | |
174 | + tableIns: null, | |
175 | + tableElem: "mainList", | |
176 | + tableInsDesc: null, | |
177 | + tableElemDesc: "mainListDesc", | |
178 | + | |
179 | + //下拉框配置 | |
180 | + selectOption: { | |
181 | + //station: { | |
182 | + // SelType: "FromUrl", | |
183 | + // SelFrom: `/${areaName}/${controllerName}/StationLineSelect`, | |
184 | + // SelLabel: "workStationName", | |
185 | + // SelValue: "workStationCode", | |
186 | + // OptGroup: true, | |
187 | + // Dom: [$("[name='stationCode']")] | |
188 | + //}, | |
189 | + //返回的数据 用于后续操作 | |
190 | + selectData: { | |
191 | + | |
192 | + } | |
193 | + }, | |
194 | + //下拉框配置枚举 | |
195 | + selectOptionEnum: { | |
196 | + type: { | |
197 | + SelValue: "value", //key or value | |
198 | + SelFrom: "dataSource", //固定 | |
199 | + Dom: [$("select[name='xxx']")], | |
200 | + dataSource: window.top.Enumxxx, | |
201 | + }, | |
202 | + //返回的数据 用于后续操作 | |
203 | + selectData: { | |
204 | + | |
205 | + } | |
206 | + }, | |
207 | + }, | |
208 | + methods: { | |
209 | + initTable: function (opt) { | |
210 | + var config = {}; | |
211 | + if (opt != undefined) $.extend(config, opt); | |
212 | + let options = { | |
213 | + elem: "#" + app.data.tableElem, | |
214 | + url: `/${areaName}/${controllerName}/Load`, | |
215 | + cols: sysU.columnRecord(app.data.tableElem, app.data.cols), | |
216 | + toolbar: '#toolbarTable', | |
217 | + where: config, | |
218 | + //height: "full-56",//如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示 | |
219 | + doneExtend: function (res, obj) { | |
220 | + | |
221 | + } | |
222 | + } | |
223 | + app.data.tableIns = sysU.initTable(options); | |
224 | + }, | |
225 | + | |
226 | + initSelectTable: function () { | |
227 | + var opt1 = { | |
228 | + elem: ".productCode", | |
229 | + checkedKey: "productCode", | |
230 | + doneKey: { | |
231 | + key: "productCode", | |
232 | + lableValue: "productName" | |
233 | + }, | |
234 | + searchKey: "productCode", | |
235 | + searchName: "产品编码" | |
236 | + }; | |
237 | + sysU.initSelectProduct(opt1); | |
238 | + }, | |
239 | + | |
240 | + initFrom() { | |
241 | + //sysU.initSelect(app.data.selectOption); | |
242 | + | |
243 | + //sysU.initSelecteByEnum(app.data.selectOptionEnum); | |
244 | + } | |
245 | + }, | |
246 | + registerEvent: function () { | |
247 | + | |
248 | + }, | |
249 | + init: function () { | |
250 | + //var sendDataWhere = form.val("listForm") | |
251 | + app.methods.initTable(); | |
252 | + app.methods.initFrom(); | |
253 | + app.registerEvent(); | |
254 | + } | |
255 | + }; | |
256 | + app.init(); | |
257 | +}); | |
0 | 258 | \ No newline at end of file |
... | ... |
web/WebMvc/wwwroot/productjs/base/BaseSimEquipmentRel.js
0 → 100644
1 | +let action = null; | |
2 | +layui.config({ | |
3 | + base: "/js/", | |
4 | + version: 1 | |
5 | +}).use(['system'], function () { | |
6 | + var form = layui.form, | |
7 | + $ = layui.jquery, | |
8 | + element = layui.element, | |
9 | + table = layui.table, | |
10 | + system = layui.system, | |
11 | + sysU = new system.u(), | |
12 | + sendDataWhere = null, | |
13 | + sendDataDescWhere = null, | |
14 | + areaName = "base", | |
15 | + controllerName = "BaseSimEquipmentRel", | |
16 | + app = null; | |
17 | + | |
18 | + action = { | |
19 | + addOptions: function () { | |
20 | + var options = { | |
21 | + fromId: "#modifyForm form", | |
22 | + url: `/${areaName}/${controllerName}/Ins`, | |
23 | + //sendDataWhere: null, | |
24 | + //isAddWhereExtend: "arbitrarily", | |
25 | + //mainTable: app.data.tableIns, | |
26 | + submit: "submit(fromAdd)" | |
27 | + } | |
28 | + return options; | |
29 | + }, | |
30 | + | |
31 | + editOptions: function () { | |
32 | + var options = { | |
33 | + fromId: "#modifyForm form", | |
34 | + url: `/${areaName}/${controllerName}/Upd`, | |
35 | + submit: "submit(fromUpdate)" | |
36 | + } | |
37 | + return options; | |
38 | + }, | |
39 | + | |
40 | + deleteOptions: function () { | |
41 | + var options = { | |
42 | + url: `/${areaName}/${controllerName}/DelByIds`, | |
43 | + keyId: "id" | |
44 | + } | |
45 | + return options; | |
46 | + }, | |
47 | + | |
48 | + exportOptions: function () { | |
49 | + var options = { | |
50 | + fromId: "listForm", | |
51 | + url: `/${areaName}/${controllerName}/Export`, | |
52 | + isDefault: false, | |
53 | + sendDataWhere:{}, | |
54 | + excelCols: { | |
55 | + head: app.data.cols, | |
56 | + body: app.data.colsDesc | |
57 | + } | |
58 | + } | |
59 | + return options; | |
60 | + }, | |
61 | + | |
62 | + queryOptions: function () { | |
63 | + var options = { | |
64 | + resetFrom: "form[lay-filter=listForm]", | |
65 | + fromId: "listForm", | |
66 | + urlExport: `/${areaName}/${controllerName}/Export`, | |
67 | + urlQuery: `/${areaName}/${controllerName}/Load`, | |
68 | + sendDataWhere:{}, | |
69 | + mainTable: app.data.tableIns | |
70 | + } | |
71 | + return options; | |
72 | + }, | |
73 | + /*rowClickOptions: function () { | |
74 | + var options = { | |
75 | + //是否主子表 | |
76 | + isDefault: true, | |
77 | + targetTableId: app.data.tableElem, | |
78 | + tabfilter: "tableTabBody", | |
79 | + tabId: 2, | |
80 | + customFn: app.methods.initTableDesc | |
81 | + } | |
82 | + return options; | |
83 | + },*/ | |
84 | + | |
85 | + uploadOptions: function () { | |
86 | + var options = { | |
87 | + url: `/${areaName}/${controllerName}/Import`, | |
88 | + fromFile: "#excelfile", | |
89 | + content: $("#ImportData") | |
90 | + } | |
91 | + return options; | |
92 | + }, | |
93 | + addBefore: function (callBack) { | |
94 | + //callBack是回调函数,如果editBefore有ajax 放在成功之后 | |
95 | + if (callBack != null) callBack(); | |
96 | + }, | |
97 | + | |
98 | + addSaveBefore: function (data, callBack) { | |
99 | + if (callBack != null) callBack(); | |
100 | + }, | |
101 | + editBefore: function (data, callBack) { | |
102 | + //data.enable = data.enable.toString(); | |
103 | + form.val("modifyForm", data); | |
104 | + if (callBack != null) callBack(); | |
105 | + }, | |
106 | + editSaveBefore: function (data, callBack) { | |
107 | + if (callBack != null) callBack(); | |
108 | + }, | |
109 | + | |
110 | + checkboxMethod: function (obj) { | |
111 | + var page = "".GetUrlParam("page"), | |
112 | + xxx = "".GetUrlParam("xxx"); | |
113 | + if (page == "xxx") { | |
114 | + var sendData = { | |
115 | + | |
116 | + }; | |
117 | + var ajaxConfig = { | |
118 | + data: sendData, | |
119 | + url: `${areaName}/${controllerName}/xxx`, | |
120 | + success: function (result) { | |
121 | + if (sysU.successBefore(result)) return false; | |
122 | + layer.msg(result.Message); | |
123 | + } | |
124 | + }; | |
125 | + sysU.ajax(ajaxConfig); | |
126 | + } | |
127 | + }, | |
128 | + //所有动作成功之后 | |
129 | + actionSuccess: (flag) => { | |
130 | + sysU.refreshTable(app, sysU, null, flag); | |
131 | + }, | |
132 | + closeAfter: function (callBack) { | |
133 | + if (callBack != null) callBack(); | |
134 | + } | |
135 | + } | |
136 | + | |
137 | + app = { | |
138 | + data: { | |
139 | + cols: [[ | |
140 | + { checkbox: true, fixed: true }, | |
141 | + { field: "id", width: 80, hide: true, title: "Id" }, | |
142 | + { field: "simNumber", width: 150, title: "sim卡号" }, | |
143 | + { field: "projectKey", width: 150, title: "项目keys" }, | |
144 | + { field: "equipmentCode", width: 150, title: "设备编码" }, | |
145 | + ]], | |
146 | + colsDesc:null, | |
147 | + tableIns: null, | |
148 | + tableElem: "mainList", | |
149 | + tableInsDesc: null, | |
150 | + tableElemDesc: "mainListDesc", | |
151 | + | |
152 | + //下拉框配置 | |
153 | + selectOption: { | |
154 | + //station: { | |
155 | + // SelType: "FromUrl", | |
156 | + // SelFrom: `/${areaName}/${controllerName}/StationLineSelect`, | |
157 | + // SelLabel: "workStationName", | |
158 | + // SelValue: "workStationCode", | |
159 | + // OptGroup: true, | |
160 | + // Dom: [$("[name='stationCode']")] | |
161 | + //}, | |
162 | + //返回的数据 用于后续操作 | |
163 | + selectData: { | |
164 | + | |
165 | + } | |
166 | + }, | |
167 | + //下拉框配置枚举 | |
168 | + selectOptionEnum: { | |
169 | + type: { | |
170 | + SelValue: "value", //key or value | |
171 | + SelFrom: "dataSource", //固定 | |
172 | + Dom: [$("select[name='xxx']")], | |
173 | + dataSource: window.top.Enumxxx, | |
174 | + }, | |
175 | + //返回的数据 用于后续操作 | |
176 | + selectData: { | |
177 | + | |
178 | + } | |
179 | + }, | |
180 | + }, | |
181 | + methods: { | |
182 | + initTable: function (opt) { | |
183 | + var config = {}; | |
184 | + if (opt != undefined) $.extend(config, opt); | |
185 | + let options = { | |
186 | + elem: "#" + app.data.tableElem, | |
187 | + url: `/${areaName}/${controllerName}/Load`, | |
188 | + cols: sysU.columnRecord(app.data.tableElem, app.data.cols), | |
189 | + toolbar: '#toolbarTable', | |
190 | + where: config, | |
191 | + //height: "full-56",//如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示 | |
192 | + doneExtend: function (res, obj) { | |
193 | + | |
194 | + } | |
195 | + } | |
196 | + app.data.tableIns = sysU.initTable(options); | |
197 | + }, | |
198 | + | |
199 | + initSelectTable: function () { | |
200 | + var opt1 = { | |
201 | + elem: ".productCode", | |
202 | + checkedKey: "productCode", | |
203 | + doneKey: { | |
204 | + key: "productCode", | |
205 | + lableValue: "productName" | |
206 | + }, | |
207 | + searchKey: "productCode", | |
208 | + searchName: "产品编码" | |
209 | + }; | |
210 | + sysU.initSelectProduct(opt1); | |
211 | + }, | |
212 | + | |
213 | + initFrom() { | |
214 | + //sysU.initSelect(app.data.selectOption); | |
215 | + | |
216 | + //sysU.initSelecteByEnum(app.data.selectOptionEnum); | |
217 | + } | |
218 | + }, | |
219 | + registerEvent: function () { | |
220 | + | |
221 | + }, | |
222 | + init: function () { | |
223 | + //var sendDataWhere = form.val("listForm") | |
224 | + app.methods.initTable(); | |
225 | + app.methods.initFrom(); | |
226 | + app.registerEvent(); | |
227 | + } | |
228 | + }; | |
229 | + app.init(); | |
230 | +}); | |
0 | 231 | \ No newline at end of file |
... | ... |
web/WebMvc/wwwroot/productjs/equipment/BaseEquipment.js
... | ... | @@ -16,7 +16,35 @@ layui.config({ |
16 | 16 | app = null; |
17 | 17 | |
18 | 18 | action = { |
19 | - | |
19 | + addOptions: function () { | |
20 | + var options = { | |
21 | + fromId: "#modifyForm form", | |
22 | + url: `/${areaName}/${controllerName}/Ins`, | |
23 | + //sendDataWhere: null, | |
24 | + //isAddWhereExtend: "arbitrarily", | |
25 | + //mainTable: app.data.tableIns, | |
26 | + submit: "submit(fromAdd)" | |
27 | + } | |
28 | + return options; | |
29 | + }, | |
30 | + | |
31 | + editOptions: function () { | |
32 | + var options = { | |
33 | + fromId: "#modifyForm form", | |
34 | + url: `/${areaName}/${controllerName}/Upd`, | |
35 | + submit: "submit(fromUpdate)" | |
36 | + } | |
37 | + return options; | |
38 | + }, | |
39 | + | |
40 | + deleteOptions: function () { | |
41 | + var options = { | |
42 | + url: `/${areaName}/${controllerName}/DelByIds`, | |
43 | + keyId: "id" | |
44 | + } | |
45 | + return options; | |
46 | + }, | |
47 | + | |
20 | 48 | exportOptions: function () { |
21 | 49 | var options = { |
22 | 50 | fromId: "listForm", |
... | ... | @@ -62,26 +90,47 @@ layui.config({ |
62 | 90 | } |
63 | 91 | return options; |
64 | 92 | }, |
65 | - | |
93 | + addBefore: function (callBack) { | |
94 | + //callBack是回调函数,如果editBefore有ajax 放在成功之后 | |
95 | + if (callBack != null) callBack(); | |
96 | + }, | |
97 | + | |
98 | + addSaveBefore: function (data, callBack) { | |
99 | + if (callBack != null) callBack(); | |
100 | + }, | |
101 | + editBefore: function (data, callBack) { | |
102 | + //data.enable = data.enable.toString(); | |
103 | + form.val("modifyForm", data); | |
104 | + if (callBack != null) callBack(); | |
105 | + }, | |
106 | + editSaveBefore: function (data, callBack) { | |
107 | + if (typeof data.field.isDelete == "undefined") data.field["isDelete"] = 0; | |
108 | + if (callBack != null) callBack(); | |
109 | + }, | |
66 | 110 | |
67 | 111 | checkboxMethod: function (obj) { |
68 | 112 | var page = "".GetUrlParam("page"), |
69 | - xxx = "".GetUrlParam("xxx"); | |
70 | - if (page == "xxx") { | |
113 | + simNumber = "".GetUrlParam("simNumber"); | |
114 | + if (page == "BaseSim") { | |
71 | 115 | var sendData = { |
72 | - | |
116 | + simNumber: simNumber, | |
117 | + checkeds: obj.checked, | |
118 | + equipmentCode: obj.data.equipmentCode, | |
119 | + factoryCode: obj.data.factoryCode | |
73 | 120 | }; |
74 | 121 | var ajaxConfig = { |
75 | 122 | data: sendData, |
76 | - url: `${areaName}/${controllerName}/xxx`, | |
123 | + url: "/base/BaseSim/BindEquipment", | |
77 | 124 | success: function (result) { |
78 | 125 | if (sysU.successBefore(result)) return false; |
79 | 126 | layer.msg(result.Message); |
127 | + sysU.refreshTable(app, sysU, null, "main"); | |
80 | 128 | } |
81 | 129 | }; |
82 | 130 | sysU.ajax(ajaxConfig); |
83 | 131 | } |
84 | 132 | }, |
133 | + | |
85 | 134 | //所有动作成功之后 |
86 | 135 | actionSuccess: (flag) => { |
87 | 136 | sysU.refreshTable(app, sysU, null, flag); |
... | ... | @@ -100,20 +149,16 @@ layui.config({ |
100 | 149 | { field: "factoryCode", width: 150, title: "厂房编码", hide: true }, |
101 | 150 | { field: "equipmentName", width: 150, title: "设备名" }, |
102 | 151 | |
103 | - { field: "equipmentTypeCode", width: 150, title: "关联到设备类型编码", hide: true }, | |
104 | - { field: "equipmentTypeName", width: 150, title: "关联到设备类型" }, | |
152 | + { field: "equipmentTypeCode", width: 150, title: "设备类型编码", hide: true }, | |
153 | + /*{ field: "equipmentTypeName", width: 150, title: "设备类型",},*/ | |
105 | 154 | { field: "ip", width: 150, title: "PLC-IP", hide: true }, |
106 | 155 | { field: "destinationArea", width: 150, title: "所在区域" }, |
107 | 156 | |
108 | 157 | { field: "remark", width: 150, title: "描述" }, |
109 | 158 | { field: "equipmentMaintainRuleId", width: 150, title: "维护规则Id", hide: true }, |
110 | - { field: "isDelete", width: 150, title: "是否启用" }, | |
159 | + { field: "isDelete", width: 150, title: "是否启用", }, | |
111 | 160 | { field: "imgSrc", width: 150, title: "图片文件路径" }, |
112 | 161 | |
113 | - { field: "createTime", width: 150, title: "创建时间" }, | |
114 | - { field: "createBy", width: 150, title: "创建人" }, | |
115 | - { field: "updateTime", width: 150, title: "更新时间" }, | |
116 | - { field: "updateBy", width: 150, title: "更新人" }, | |
117 | 162 | ]], |
118 | 163 | colsDesc: null, |
119 | 164 | tableIns: null, |
... | ... | @@ -123,14 +168,15 @@ layui.config({ |
123 | 168 | |
124 | 169 | //下拉框配置 |
125 | 170 | selectOption: { |
126 | - //station: { | |
127 | - // SelType: "FromUrl", | |
128 | - // SelFrom: `/${areaName}/${controllerName}/StationLineSelect`, | |
129 | - // SelLabel: "workStationName", | |
130 | - // SelValue: "workStationCode", | |
131 | - // OptGroup: true, | |
132 | - // Dom: [$("[name='stationCode']")] | |
133 | - //}, | |
171 | + selectEquipmentTypeCode: { | |
172 | + SelType: "FromUrl", | |
173 | + SelFrom: `/${areaName}/BaseEquipmentType/Load`, | |
174 | + //SelModel:"EquipmentTypeName", | |
175 | + SelLabel: "name", | |
176 | + SelValue: "code", | |
177 | + Where: {}, | |
178 | + Dom: [$("[name='equipmentTypeCode']")] | |
179 | + }, | |
134 | 180 | //返回的数据 用于后续操作 |
135 | 181 | selectData: { |
136 | 182 | |
... | ... | @@ -183,7 +229,7 @@ layui.config({ |
183 | 229 | }, |
184 | 230 | |
185 | 231 | initFrom() { |
186 | - //sysU.initSelect(app.data.selectOption); | |
232 | + sysU.initSelect(app.data.selectOption); | |
187 | 233 | |
188 | 234 | //sysU.initSelecteByEnum(app.data.selectOptionEnum); |
189 | 235 | } |
... | ... |
web/WebMvc/wwwroot/productjs/equipment/BaseEquipmentType.js
0 → 100644
1 | +let action = null; | |
2 | +layui.config({ | |
3 | + base: "/js/", | |
4 | + version: 1 | |
5 | +}).use(['system'], function () { | |
6 | + var form = layui.form, | |
7 | + $ = layui.jquery, | |
8 | + element = layui.element, | |
9 | + table = layui.table, | |
10 | + system = layui.system, | |
11 | + sysU = new system.u(), | |
12 | + sendDataWhere = null, | |
13 | + sendDataDescWhere = null, | |
14 | + areaName = "equipment", | |
15 | + controllerName = "BaseEquipmentType", | |
16 | + app = null; | |
17 | + | |
18 | + action = { | |
19 | + addOptions: function () { | |
20 | + var options = { | |
21 | + fromId: "#modifyForm form", | |
22 | + url: `/${areaName}/${controllerName}/Ins`, | |
23 | + //sendDataWhere: null, | |
24 | + //isAddWhereExtend: "arbitrarily", | |
25 | + //mainTable: app.data.tableIns, | |
26 | + submit: "submit(fromAdd)", | |
27 | + area: ['500px', '300px'] | |
28 | + } | |
29 | + return options; | |
30 | + }, | |
31 | + | |
32 | + editOptions: function () { | |
33 | + var options = { | |
34 | + fromId: "#modifyForm form", | |
35 | + url: `/${areaName}/${controllerName}/Upd`, | |
36 | + submit: "submit(fromUpdate)", | |
37 | + area:['500px','300px'] | |
38 | + } | |
39 | + return options; | |
40 | + }, | |
41 | + | |
42 | + deleteOptions: function () { | |
43 | + var options = { | |
44 | + url: `/${areaName}/${controllerName}/DelByIds`, | |
45 | + keyId: "id" | |
46 | + } | |
47 | + return options; | |
48 | + }, | |
49 | + | |
50 | + exportOptions: function () { | |
51 | + var options = { | |
52 | + fromId: "listForm", | |
53 | + url: `/${areaName}/${controllerName}/Export`, | |
54 | + isDefault: false, | |
55 | + sendDataWhere:{}, | |
56 | + excelCols: { | |
57 | + head: app.data.cols, | |
58 | + body: app.data.colsDesc | |
59 | + } | |
60 | + } | |
61 | + return options; | |
62 | + }, | |
63 | + | |
64 | + queryOptions: function () { | |
65 | + var options = { | |
66 | + resetFrom: "form[lay-filter=listForm]", | |
67 | + fromId: "listForm", | |
68 | + urlExport: `/${areaName}/${controllerName}/Export`, | |
69 | + urlQuery: `/${areaName}/${controllerName}/Load`, | |
70 | + sendDataWhere:{}, | |
71 | + mainTable: app.data.tableIns | |
72 | + } | |
73 | + return options; | |
74 | + }, | |
75 | + /*rowClickOptions: function () { | |
76 | + var options = { | |
77 | + //是否主子表 | |
78 | + isDefault: true, | |
79 | + targetTableId: app.data.tableElem, | |
80 | + tabfilter: "tableTabBody", | |
81 | + tabId: 2, | |
82 | + customFn: app.methods.initTableDesc | |
83 | + } | |
84 | + return options; | |
85 | + },*/ | |
86 | + | |
87 | + uploadOptions: function () { | |
88 | + var options = { | |
89 | + url: `/${areaName}/${controllerName}/Import`, | |
90 | + fromFile: "#excelfile", | |
91 | + content: $("#ImportData") | |
92 | + } | |
93 | + return options; | |
94 | + }, | |
95 | + addBefore: function (callBack) { | |
96 | + //callBack是回调函数,如果editBefore有ajax 放在成功之后 | |
97 | + if (callBack != null) callBack(); | |
98 | + }, | |
99 | + | |
100 | + addSaveBefore: function (data, callBack) { | |
101 | + if (callBack != null) callBack(); | |
102 | + }, | |
103 | + editBefore: function (data, callBack) { | |
104 | + //data.enable = data.enable.toString(); | |
105 | + form.val("modifyForm", data); | |
106 | + if (callBack != null) callBack(); | |
107 | + }, | |
108 | + editSaveBefore: function (data, callBack) { | |
109 | + if (typeof data.field.enable == "undefined") data.field["enable"] = 'false'; | |
110 | + if (callBack != null) callBack(); | |
111 | + }, | |
112 | + | |
113 | + checkboxMethod: function (obj) { | |
114 | + var page = "".GetUrlParam("page"), | |
115 | + xxx = "".GetUrlParam("xxx"); | |
116 | + if (page == "xxx") { | |
117 | + var sendData = { | |
118 | + | |
119 | + }; | |
120 | + var ajaxConfig = { | |
121 | + data: sendData, | |
122 | + url: `${areaName}/${controllerName}/xxx`, | |
123 | + success: function (result) { | |
124 | + if (sysU.successBefore(result)) return false; | |
125 | + layer.msg(result.Message); | |
126 | + } | |
127 | + }; | |
128 | + sysU.ajax(ajaxConfig); | |
129 | + } | |
130 | + }, | |
131 | + //所有动作成功之后 | |
132 | + actionSuccess: (flag) => { | |
133 | + sysU.refreshTable(app, sysU, null, flag); | |
134 | + }, | |
135 | + closeAfter: function (callBack) { | |
136 | + if (callBack != null) callBack(); | |
137 | + } | |
138 | + } | |
139 | + | |
140 | + app = { | |
141 | + data: { | |
142 | + cols: [[ | |
143 | + { checkbox: true, fixed: true }, | |
144 | + { field: "id", width: 80, hide: true, title: "Id" }, | |
145 | + { field: "code", width: 150, title: "设备类型代号" }, | |
146 | + { field: "name", width: 150, title: "类型名称" }, | |
147 | + { field: "description", width: 150, title: "描述" }, | |
148 | + { field: "enable", width: 150, title: "是否生效" }, | |
149 | + { field: "createTime", width: 150, title: "建立时间" }, | |
150 | + { field: "createBy", width: 150, title: "建立者" }, | |
151 | + { field: "updateTime", width: 150, title: "更新时间" }, | |
152 | + { field: "updateBy", width: 150, title: "更新者" }, | |
153 | + ]], | |
154 | + colsDesc:null, | |
155 | + tableIns: null, | |
156 | + tableElem: "mainList", | |
157 | + tableInsDesc: null, | |
158 | + tableElemDesc: "mainListDesc", | |
159 | + | |
160 | + //下拉框配置 | |
161 | + selectOption: { | |
162 | + //station: { | |
163 | + // SelType: "FromUrl", | |
164 | + // SelFrom: `/${areaName}/${controllerName}/StationLineSelect`, | |
165 | + // SelLabel: "workStationName", | |
166 | + // SelValue: "workStationCode", | |
167 | + // OptGroup: true, | |
168 | + // Dom: [$("[name='stationCode']")] | |
169 | + //}, | |
170 | + //返回的数据 用于后续操作 | |
171 | + selectData: { | |
172 | + | |
173 | + } | |
174 | + }, | |
175 | + //下拉框配置枚举 | |
176 | + selectOptionEnum: { | |
177 | + type: { | |
178 | + SelValue: "value", //key or value | |
179 | + SelFrom: "dataSource", //固定 | |
180 | + Dom: [$("select[name='xxx']")], | |
181 | + dataSource: window.top.Enumxxx, | |
182 | + }, | |
183 | + //返回的数据 用于后续操作 | |
184 | + selectData: { | |
185 | + | |
186 | + } | |
187 | + }, | |
188 | + }, | |
189 | + methods: { | |
190 | + initTable: function (opt) { | |
191 | + var config = {}; | |
192 | + if (opt != undefined) $.extend(config, opt); | |
193 | + let options = { | |
194 | + elem: "#" + app.data.tableElem, | |
195 | + url: `/${areaName}/${controllerName}/Load`, | |
196 | + cols: sysU.columnRecord(app.data.tableElem, app.data.cols), | |
197 | + toolbar: '#toolbarTable', | |
198 | + where: config, | |
199 | + //height: "full-56",//如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示 | |
200 | + doneExtend: function (res, obj) { | |
201 | + | |
202 | + } | |
203 | + } | |
204 | + app.data.tableIns = sysU.initTable(options); | |
205 | + }, | |
206 | + | |
207 | + initSelectTable: function () { | |
208 | + var opt1 = { | |
209 | + elem: ".productCode", | |
210 | + checkedKey: "productCode", | |
211 | + doneKey: { | |
212 | + key: "productCode", | |
213 | + lableValue: "productName" | |
214 | + }, | |
215 | + searchKey: "productCode", | |
216 | + searchName: "产品编码" | |
217 | + }; | |
218 | + sysU.initSelectProduct(opt1); | |
219 | + }, | |
220 | + | |
221 | + initFrom() { | |
222 | + //sysU.initSelect(app.data.selectOption); | |
223 | + | |
224 | + //sysU.initSelecteByEnum(app.data.selectOptionEnum); | |
225 | + } | |
226 | + }, | |
227 | + registerEvent: function () { | |
228 | + | |
229 | + }, | |
230 | + init: function () { | |
231 | + //var sendDataWhere = form.val("listForm") | |
232 | + app.methods.initTable(); | |
233 | + app.methods.initFrom(); | |
234 | + app.registerEvent(); | |
235 | + } | |
236 | + }; | |
237 | + app.init(); | |
238 | +}); | |
0 | 239 | \ No newline at end of file |
... | ... |