赖素文
authored
about a year ago
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// ------------------------------------------------------------------------------
// < auto - generated >
// 此代码由工具生成。
// 运行时版本 : 17.0 . 0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
// </ auto - generated >
// ------------------------------------------------------------------------------
namespace Hh.Mes.T4
{
using System.Linq ;
using System ;
/// < summary >
/// Class to produce the template output
/// </ summary >
19
# line 1 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[ global :: System . CodeDom . Compiler . GeneratedCodeAttribute ( "Microsoft.VisualStudio.TextTemplating" , "17.0.0.0" )]
public partial class JavaScriptTemplate : JavaScriptTemplateBase
{
# line hidden
/// < summary >
/// Create the template output
/// </ summary >
public virtual string TransformText ()
{
this . Write ( @" let action = null ;
layui . config ({
base : "" / js / "" ,
version : 1
}). use ([ ' system ' ], function () {
var form = layui . form ,
$ = layui . jquery ,
element = layui . element ,
table = layui . table ,
system = layui . system ,
sysU = new system . u (),
sendDataWhere = null ,
sendDataDescWhere = null ,
赖素文
authored
5 months ago
42
fatherParam = null ,
赖素文
authored
about a year ago
43
44
areaName = "" " );
45
# line 16 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
46
47
48
49
50
51
this . Write ( this . ToStringHelper . ToStringWithCulture ( AreaName ));
# line default
# line hidden
this . Write ( "\",\r\n controllerName = \"" );
52
# line 17 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
53
54
55
56
this . Write ( this . ToStringHelper . ToStringWithCulture ( ControllerName ));
# line default
# line hidden
唐召明
authored
about a year ago
57
58
this . Write ( "\",\r\n app = null;\r\n\r\n action = {\r\n addOptions" );
59
# line 21 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
60
61
62
63
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
64
65
this . Write ( ": function (flagKey, toolbarId, obj, $event) {\r\n var options = {\r\n " +
" fromId: \"#modifyForm" );
唐召明
authored
about a year ago
66
67
# line 23 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
68
69
70
71
72
73
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( " form\",\r\n url: `/${areaName}/${controllerName}/Ins" );
74
# line 24 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
75
76
77
78
79
80
81
82
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "`,\r\n //sendDataWhere: null,\r\n //isAddWhereExtend: \"" +
"arbitrarily\",\r\n //mainTable: app.data.tableIns,\r\n " +
"submit: \"submit(fromAdd" );
83
# line 28 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
84
85
86
87
88
89
90
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ")\"\r\n }\r\n return options;\r\n },\r\n\r\n editOptions" +
"" );
91
# line 33 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
92
93
94
95
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
96
97
this . Write ( ": function (data, sysU, toolbarId, obj, $event) {\r\n var options = {\r\n " +
" fromId: \"#modifyForm" );
唐召明
authored
about a year ago
98
99
# line 35 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
100
101
102
103
104
105
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( " form\",\r\n url: `/${areaName}/${controllerName}/Upd" );
106
# line 36 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
107
108
109
110
111
112
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "`,\r\n submit: \"submit(fromUpdate" );
113
# line 37 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
114
115
116
117
118
119
120
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ")\"\r\n }\r\n return options;\r\n },\r\n\r\n deleteOptio" +
"ns" );
121
# line 42 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
122
123
124
125
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
126
127
this . Write ( ": function (sysU, toolbarId, obj, $event) {\r\n var options = {\r\n " +
" url: `/${areaName}/${controllerName}/DelByIds" );
唐召明
authored
about a year ago
128
129
# line 44 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
130
131
132
133
134
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "`,\r\n keyId: \"id\"\r\n }\r\n return options;\r\n " +
135
136
" },\r\n\r\n //导出方法\r\n exportOptions: function () {\r\n var " +
"options = {\r\n fromId: \"listForm" );
唐召明
authored
about a year ago
137
138
# line 53 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
139
140
141
142
143
144
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( @"" " ,
url : ` / $ { areaName }/ $ { controllerName }/ Export ` ,
145
isDefault : false ,// false 导出单表, true 导出主明细表
146
147
sendDataWhere : sendDataDescWhere ,
// fileName : "" xxxx "" ,
148
// 后台接口返回数据也要保持一致 response . Result = new { head = x , body = x 、 footer = x }
149
// 如果只要导出明细 就写 excelCols : { body : app . data . colsDesc }
唐召明
authored
about a year ago
150
151
152
153
154
155
156
157
158
159
excelCols : {
head : app . data . cols ,
body : app . data . colsDesc
}
}
return options ;
},
queryOptions " );
160
# line 68 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
161
162
163
164
165
166
167
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": function () {\r\n var options = {\r\n resetFrom: \"form[la" +
"y-filter=listForm" );
168
# line 70 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
169
170
171
172
173
174
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "]\",\r\n fromId: \"listForm" );
175
# line 71 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
176
177
178
179
180
181
182
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "\",\r\n urlExport: `/${areaName}/${controllerName}/Export`,\r\n " +
" urlQuery: `/${areaName}/${controllerName}/Load" );
183
# line 73 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
184
185
186
187
188
189
190
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "`,\r\n sendDataWhere:{},\r\n mainTable: app.data.tableI" +
"ns" );
191
# line 75 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( @"
}
return options ;
},
/* rowClickOptions : function () {
var options = {
// 是否主子表
isDefault : true ,
targetTableId : app . data . tableElem ,
tabfilter : "" tableTabBody "" ,
tabId : 2 ,
customFn : app . methods . initTableDesc
}
return options ;
},*/
uploadOptions : function () {
var options = {
url : ` / $ { areaName }/ $ { controllerName }/ Import ` ,
fromFile : "" # excelfile "" ,
content : $ ( "" # ImportData "" )
}
return options ;
},
addBefore " );
222
# line 99 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
223
224
225
226
227
228
229
230
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": function (callBack) {\r\n //callBack是回调函数,如果editBefore有ajax 放在成功之后\r\n " +
" if (callBack != null) callBack();\r\n },\r\n\r\n addSaveBefore" +
"" );
231
# line 104 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
232
233
234
235
236
237
238
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": function (data, callBack) {\r\n if (callBack != null) callBack();\r\n " +
" },\r\n editBefore" );
239
# line 107 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
240
241
242
243
244
245
246
247
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": function (data, callBack) {\r\n //data.enable = data.enable.toString()" +
";\r\n form.val(\"modifyForm\", data);\r\n if (callBack != null) " +
"callBack();\r\n },\r\n editSaveBefore" );
248
# line 112 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
249
250
251
252
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
赖素文
authored
8 months ago
253
this . Write ( ": function (data, callBack) {\r\n if (callBack != null) callBack();\r\n " +
254
" },\r\n\r\n checkboxMethod: function (obj) {\r\n //if (!sysU.Set" +
赖素文
authored
5 months ago
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
"TableRadioCheckBefore()) return;\r\n if (fatherParam.page == \"xxx\") {\r\n" +
" var sendData = {\r\n \r\n };\r\n " +
" var ajaxConfig = {\r\n data: sendData,\r\n " +
" url: `${areaName}/${controllerName}/xxx`,\r\n success:" +
" function (result) {\r\n if (sysU.successBefore(result)) re" +
"turn false;\r\n layer.msg(result.Message);\r\n " +
" }\r\n };\r\n sysU.ajax(ajaxConfig);\r\n " +
"}\r\n },\r\n radioMethod: function (obj) {\r\n if (!sysU.SetT" +
"ableRadioCheckBefore()) return;\r\n\r\n if (false) {\r\n var" +
" sendData = {\r\n xyz: \"xx\",\r\n checkeds: obj" +
".checked,\r\n keys: obj.data.keys,\r\n };\r\n " +
" if (sendData.keys == null || sendData.keys == \"\") {\r\n " +
" layer.alert(\"tableRowOneClick:项目角色标识【keys】为空,请重新关闭后再操作,反复出现请联系管理员\", { icon: 2," +
" shadeClose: true, title: \"提示\" });\r\n return false;\r\n " +
" }\r\n var ajaxConfig = {\r\n data: sendData" +
",\r\n url: \"/base/xxx/xxx\",\r\n success: funct" +
"ion (result) {\r\n if (sysU.successBefore(result)) return f" +
"alse;\r\n layer.msg(result.Message);\r\n " +
" sysU.refreshTable(app, sysU, null, \"main\");\r\n }\r\n " +
" };\r\n sysU.ajax(ajaxConfig);\r\n }\r\n },\r\n\r\n" +
" //所有动作成功之后\r\n actionSuccess: (flag) => {\r\n var data = n" +
"ull;\r\n if (flag.includes(\"Desc\")) {\r\n data = sendDataDes" +
"cWhere;\r\n }\r\n sysU.refreshTable(app, sysU, data, flag);\r\n " +
" },\r\n closeAfter: function (callBack) {\r\n if (callBack != " +
"null) callBack();\r\n }\r\n }\r\n\r\n app = {\r\n data: {\r\n " +
" cols" );
282
# line 174 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
283
284
285
286
287
288
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": [[\r\n { checkbox: true, fixed: true },\r\n" );
289
# line 176 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
290
291
292
293
294
if ( Data . Any ( x => x . Key . Equals ( "id" , StringComparison . OrdinalIgnoreCase )))
# line default
# line hidden
295
# line 177 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
296
297
298
299
300
301
{
# line default
# line hidden
this . Write ( " { field: \"id\", width: 80, hide: true, title: \"Id\" },\r\n" );
302
# line 179 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
303
304
305
306
307
}
# line default
# line hidden
308
# line 180 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
309
310
311
312
313
if ( Data . Any ( x => x . Key . Equals ( "keys" , StringComparison . OrdinalIgnoreCase )))
# line default
# line hidden
314
# line 181 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
315
316
317
318
319
320
{
# line default
# line hidden
this . Write ( " { field: \"keys\", width: 80, hide: true, title: \"Keys\" },\r\n" );
321
# line 183 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
322
323
324
325
326
}
# line default
# line hidden
327
# line 184 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
328
329
330
331
332
foreach ( var item in Data )
# line default
# line hidden
333
# line 185 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
334
335
336
337
338
{
# line default
# line hidden
339
# line 186 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
340
341
342
343
344
if ( item . Key . Equals ( "Id" , StringComparison . OrdinalIgnoreCase ) || item . Key . Equals ( "Keys" , StringComparison . OrdinalIgnoreCase ))
# line default
# line hidden
345
# line 187 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
346
347
348
349
350
{ continue ; }
# line default
# line hidden
351
# line 188 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
352
353
354
355
356
if (! string . IsNullOrWhiteSpace ( item . Value ))
# line default
# line hidden
357
# line 189 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
358
359
360
361
362
363
{
# line default
# line hidden
this . Write ( " { field: \"" );
364
# line 190 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
365
366
367
368
369
370
this . Write ( this . ToStringHelper . ToStringWithCulture ( item . Key ));
# line default
# line hidden
this . Write ( "\", width: 150, title: \"" );
371
# line 190 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
372
373
374
375
376
377
this . Write ( this . ToStringHelper . ToStringWithCulture ( item . Value ));
# line default
# line hidden
this . Write ( "\" },\r\n" );
378
# line 191 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
379
380
381
382
383
384
} else {
# line default
# line hidden
this . Write ( " { field: \"" );
385
# line 192 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
386
387
388
389
390
391
this . Write ( this . ToStringHelper . ToStringWithCulture ( item . Key ));
# line default
# line hidden
this . Write ( "\", width: 150, title: \"" );
392
# line 192 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
393
394
395
396
397
398
this . Write ( this . ToStringHelper . ToStringWithCulture ( item . Key ));
# line default
# line hidden
this . Write ( "\" },\r\n" );
399
# line 193 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
400
401
402
403
404
}
# line default
# line hidden
405
# line 194 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
赖素文
authored
about a year ago
406
407
408
409
}
# line default
# line hidden
唐召明
authored
about a year ago
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
this . Write ( @" ]],
colsDesc : null ,
tableIns : null ,
tableElem : "" mainList "" ,
tableInsDesc : null ,
tableElemDesc : "" mainListDesc "" ,
// 下拉框配置
selectOption : {
// station : {
// SelType : "" FromUrl "" ,
// SelFrom : ` / $ { areaName }/ $ { controllerName }/ StationLineSelect ` ,
// SelLabel : "" workStationName "" ,
// SelValue : "" workStationCode "" ,
// OptGroup : true ,
// Dom : [ $ ( "" [ name = ' stationCode ' ] "" )]
//},
// 返回的数据 用于后续操作
selectData : {
}
},
// 下拉框配置枚举
selectOptionEnum : {
type : {
SelValue : "" value "" , // key or value
SelFrom : "" dataSource "" , // 固定
Dom : [ $ ( "" select [ name = ' xxx ' ] "" )],
dataSource : window . top . Enumxxx ,
},
// 返回的数据 用于后续操作
selectData : {
}
},
},
methods : {
initTable " );
449
# line 232 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
450
451
452
453
454
455
456
457
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ": function (opt) {\r\n var config = {};\r\n if (opt != " +
"undefined) $.extend(config, opt);\r\n let options = {\r\n " +
" elem: \"#\" + app.data.tableElem" );
458
# line 236 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
459
460
461
462
463
464
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ",\r\n url: `/${areaName}/${controllerName}/Load" );
465
# line 237 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
466
467
468
469
470
471
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( "`,\r\n cols: sysU.columnRecord(app.data.tableElem" );
472
# line 238 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
473
474
475
476
477
478
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( ", app.data.cols" );
479
# line 238 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
this . Write ( @" ),
toolbar : '# toolbarTable ' ,
where : config ,
// height : "" full - 50 "" ,// 如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示
doneExtend : function ( res , obj ) {
}
}
app . data . tableIns = sysU . initTable ( options );
},
initSelectTable : function () {
var opt1 = {
elem : "" . productCode "" ,
checkedKey : "" productCode "" ,
赖素文
authored
5 months ago
499
doneKey : {
唐召明
authored
about a year ago
500
501
502
503
504
505
506
507
508
509
510
511
key : "" productCode "" ,
lableValue : "" productName ""
},
searchKey : "" productCode "" ,
searchName : "" 产品编码 ""
};
sysU . initSelectProduct ( opt1 );
},
initFrom () {
// sysU . initSelect ( app . data . selectOption );
赖素文
authored
about a year ago
512
// sysU . tabClick ( "" tableTabBody "" );
唐召明
authored
about a year ago
513
514
515
516
517
518
519
// sysU . initSelecteByEnum ( app . data . selectOptionEnum );
}
},
registerEvent : function () {
},
init : function () {
赖素文
authored
10 months ago
520
app . methods . initFrom ();
唐召明
authored
about a year ago
521
522
// var sendDataWhere = form . val ( "" listForm " );
523
# line 275 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
524
525
526
527
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
赖素文
authored
5 months ago
528
529
this . Write ( "\")\r\n //fatherParam = \"\".getAllUrlParameters();\r\n app.method" +
"s.initTable" );
唐召明
authored
about a year ago
530
531
# line 277 "D:\CSHHProjects\IOT\Hh.Mes.T4\JavaScriptTemplate.tt"
唐召明
authored
about a year ago
532
533
534
535
this . Write ( this . ToStringHelper . ToStringWithCulture ( IsDetail ? "Desc" : "" ));
# line default
# line hidden
赖素文
authored
10 months ago
536
this . Write ( "();\r\n app.registerEvent();\r\n }\r\n };\r\n app.init();\r\n});" );
赖素文
authored
about a year ago
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
return this . GenerationEnvironment . ToString ();
}
}
# line default
# line hidden
# region Base class
/// < summary >
/// Base class for this transformation
/// </ summary >
[ global :: System . CodeDom . Compiler . GeneratedCodeAttribute ( "Microsoft.VisualStudio.TextTemplating" , "17.0.0.0" )]
public class JavaScriptTemplateBase
{
# region Fields
private global :: System . Text . StringBuilder generationEnvironmentField ;
private global :: System . CodeDom . Compiler . CompilerErrorCollection errorsField ;
private global :: System . Collections . Generic . List < int > indentLengthsField ;
private string currentIndentField = "" ;
private bool endsWithNewline ;
private global :: System . Collections . Generic . IDictionary < string , object > sessionField ;
# endregion
# region Properties
/// < summary >
/// The string builder that generation - time code is using to assemble generated output
/// </ summary >
赖素文
authored
about a year ago
562
protected System . Text . StringBuilder GenerationEnvironment
赖素文
authored
about a year ago
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
{
get
{
if (( this . generationEnvironmentField == null ))
{
this . generationEnvironmentField = new global :: System . Text . StringBuilder ();
}
return this . generationEnvironmentField ;
}
set
{
this . generationEnvironmentField = value ;
}
}
/// < summary >
/// The error collection for the generation process
/// </ summary >
public System . CodeDom . Compiler . CompilerErrorCollection Errors
{
get
{
if (( this . errorsField == null ))
{
this . errorsField = new global :: System . CodeDom . Compiler . CompilerErrorCollection ();
}
return this . errorsField ;
}
}
/// < summary >
/// A list of the lengths of each indent that was added with PushIndent
/// </ summary >
private System . Collections . Generic . List < int > indentLengths
{
get
{
if (( this . indentLengthsField == null ))
{
this . indentLengthsField = new global :: System . Collections . Generic . List < int >();
}
return this . indentLengthsField ;
}
}
/// < summary >
/// Gets the current indent we use when adding lines to the output
/// </ summary >
public string CurrentIndent
{
get
{
return this . currentIndentField ;
}
}
/// < summary >
/// Current transformation session
/// </ summary >
public virtual global :: System . Collections . Generic . IDictionary < string , object > Session
{
get
{
return this . sessionField ;
}
set
{
this . sessionField = value ;
}
}
# endregion
# region Transform - time helpers
/// < summary >
/// Write text directly into the generated output
/// </ summary >
public void Write ( string textToAppend )
{
if ( string . IsNullOrEmpty ( textToAppend ))
{
return ;
}
// If we ' re starting off , or if the previous text ended with a newline ,
// we have to append the current indent first .
if ((( this . GenerationEnvironment . Length == 0 )
|| this . endsWithNewline ))
{
this . GenerationEnvironment . Append ( this . currentIndentField );
this . endsWithNewline = false ;
}
// Check if the current text ends with a newline
if ( textToAppend . EndsWith ( global :: System . Environment . NewLine , global :: System . StringComparison . CurrentCulture ))
{
this . endsWithNewline = true ;
}
// This is an optimization . If the current indent is "" , then we don ' t have to do any
// of the more complex stuff further down .
if (( this . currentIndentField . Length == 0 ))
{
this . GenerationEnvironment . Append ( textToAppend );
return ;
}
// Everywhere there is a newline in the text , add an indent after it
textToAppend = textToAppend . Replace ( global :: System . Environment . NewLine , ( global :: System . Environment . NewLine + this . currentIndentField ));
// If the text ends with a newline , then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write () is called
if ( this . endsWithNewline )
{
this . GenerationEnvironment . Append ( textToAppend , 0 , ( textToAppend . Length - this . currentIndentField . Length ));
}
else
{
this . GenerationEnvironment . Append ( textToAppend );
}
}
/// < summary >
/// Write text directly into the generated output
/// </ summary >
public void WriteLine ( string textToAppend )
{
this . Write ( textToAppend );
this . GenerationEnvironment . AppendLine ();
this . endsWithNewline = true ;
}
/// < summary >
/// Write formatted text directly into the generated output
/// </ summary >
public void Write ( string format , params object [] args )
{
this . Write ( string . Format ( global :: System . Globalization . CultureInfo . CurrentCulture , format , args ));
}
/// < summary >
/// Write formatted text directly into the generated output
/// </ summary >
public void WriteLine ( string format , params object [] args )
{
this . WriteLine ( string . Format ( global :: System . Globalization . CultureInfo . CurrentCulture , format , args ));
}
/// < summary >
/// Raise an error
/// </ summary >
public void Error ( string message )
{
System . CodeDom . Compiler . CompilerError error = new global :: System . CodeDom . Compiler . CompilerError ();
error . ErrorText = message ;
this . Errors . Add ( error );
}
/// < summary >
/// Raise a warning
/// </ summary >
public void Warning ( string message )
{
System . CodeDom . Compiler . CompilerError error = new global :: System . CodeDom . Compiler . CompilerError ();
error . ErrorText = message ;
error . IsWarning = true ;
this . Errors . Add ( error );
}
/// < summary >
/// Increase the indent
/// </ summary >
public void PushIndent ( string indent )
{
if (( indent == null ))
{
throw new global :: System . ArgumentNullException ( "indent" );
}
this . currentIndentField = ( this . currentIndentField + indent );
this . indentLengths . Add ( indent . Length );
}
/// < summary >
/// Remove the last indent that was added with PushIndent
/// </ summary >
public string PopIndent ()
{
string returnValue = "" ;
if (( this . indentLengths . Count > 0 ))
{
int indentLength = this . indentLengths [( this . indentLengths . Count - 1 )];
this . indentLengths . RemoveAt (( this . indentLengths . Count - 1 ));
if (( indentLength > 0 ))
{
returnValue = this . currentIndentField . Substring (( this . currentIndentField . Length - indentLength ));
this . currentIndentField = this . currentIndentField . Remove (( this . currentIndentField . Length - indentLength ));
}
}
return returnValue ;
}
/// < summary >
/// Remove any indentation
/// </ summary >
public void ClearIndent ()
{
this . indentLengths . Clear ();
this . currentIndentField = "" ;
}
# endregion
# region ToString Helpers
/// < summary >
/// Utility class to produce culture - oriented representation of an object as a string .
/// </ summary >
public class ToStringInstanceHelper
{
private System . IFormatProvider formatProviderField = global :: System . Globalization . CultureInfo . InvariantCulture ;
/// < summary >
/// Gets or sets format provider to be used by ToStringWithCulture method .
/// </ summary >
public System . IFormatProvider FormatProvider
{
get
{
return this . formatProviderField ;
}
set
{
if (( value != null ))
{
this . formatProviderField = value ;
}
}
}
/// < summary >
/// This is called from the compile / run appdomain to convert objects within an expression block to a string
/// </ summary >
public string ToStringWithCulture ( object objectToConvert )
{
if (( objectToConvert == null ))
{
throw new global :: System . ArgumentNullException ( "objectToConvert" );
}
System . Type t = objectToConvert . GetType ();
System . Reflection . MethodInfo method = t . GetMethod ( "ToString" , new System . Type [] {
typeof ( System . IFormatProvider )});
if (( method == null ))
{
return objectToConvert . ToString ();
}
else
{
return (( string )( method . Invoke ( objectToConvert , new object [] {
this . formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper ();
/// < summary >
/// Helper to produce culture - oriented representation of an object as a string
/// </ summary >
public ToStringInstanceHelper ToStringHelper
{
get
{
return this . toStringHelperField ;
}
}
# endregion
}
# endregion
}