UNPKG

2.84 kBJavaScriptView Raw
1module.exports = function (row) {
2 /**
3 *
4 */
5 const codes = [
6 '025', // -移门(木门)
7 '083' // 移门(铝框门)
8 ]
9
10 // 构造表单
11
12 var forms = [{
13 key: this.utils.getKey('门洞宽'),
14 label: '门洞宽',
15 type:'txt',
16 tip: `范围应在${row[this.utils.getKey('门洞宽最小值')]}~${row[this.utils.getKey('门洞宽极限值')]}之间`,
17 value: ""
18 },
19 {
20 key: this.utils.getKey('门洞高'),
21 label: '门洞高',
22 type:'txt',
23 tip: `范围应在${row[this.utils.getKey('门洞高最小值')]}~${row[this.utils.getKey('门洞高极限值')]}之间`,
24 value: ""
25 },
26 {
27 key: this.utils.getKey('门洞深'),
28 label: '门洞深',
29 type:'txt',
30 tip: `范围应在${row[this.utils.getKey('门洞深最小值')]}~${row[this.utils.getKey('门洞深极限值')]}之间`,
31 value: ""
32 }
33 ]
34
35 var validateMap = {
36 [`${this.utils.getKey('门洞宽')}_valid`]: (value, fd, fo) => {
37 let errorMsg = '';
38 errorMsg = this.utils.staValidFun('门洞宽', value);
39 errorMsg = this.utils.runAction([
40 {condition: () => {return errorMsg}, msg: errorMsg},
41 {condition: () => {return (value * 1 < row[this.utils.getKey('门洞宽最小值')] || value * 1 > row[this.utils.getKey('门洞宽极限值')])}, msg: `门洞宽${fo.tip}`}
42 ]);
43 return errorMsg;
44 },
45 [`${this.utils.getKey('门洞高')}_valid`]: (value, fd, fo) => {
46 let errorMsg = '';
47 errorMsg = this.utils.staValidFun('门洞高', value);
48 errorMsg = this.utils.runAction([
49 {condition: () => {return errorMsg}, msg: errorMsg},
50 {condition: () => {return (value * 1 < row[this.utils.getKey('门洞高最小值')] || value * 1 > row[this.utils.getKey('门洞高极限值')])}, msg: `门洞高${fo.tip}`}
51 ]);
52 return errorMsg;
53 },
54 [`${this.utils.getKey('门洞深')}_valid`]: (value, fd, fo) => {
55 let errorMsg = '';
56 errorMsg = this.utils.staValidFun('门洞深', value);
57 errorMsg = this.utils.runAction([
58 {condition: () => {return errorMsg}, msg: errorMsg},
59 {condition: () => {return (value * 1 < row[this.utils.getKey('门洞深最小值')] || value * 1 > row[this.utils.getKey('门洞深极限值')])}, msg: `门洞深${fo.tip}`}
60 ]);
61 return errorMsg;
62 }
63 }
64
65 return {
66 validateMap: validateMap,
67 codes: codes,
68 forms: forms
69 }
70}
\No newline at end of file