cloud-web-corejs 1.0.54-dev.734 → 1.0.54-dev.736
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/baseTabs/mixins.js +12 -1
- package/src/components/excelExport/exportFieldDialog.vue +40 -18
- package/src/components/excelExport/index.js +17 -3
- package/src/components/excelExport/index.vue +2 -1
- package/src/components/excelExport/mixins.js +113 -32
- package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +7 -22
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +38 -40
- package/src/components/table/vxeFilter/index.js +153 -2
- package/src/components/table/vxeFilter/mixin.js +305 -3
- package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +57 -0
- package/src/components/xform/docs/2026-07 /346/216/222/346/237/245/344/277/256/345/244/215/350/256/260/345/275/225.md" +73 -0
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +108 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +288 -6
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -1
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +0 -1
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +3 -12
- package/src/components/xform/form-designer/form-widget/indexMixin.js +184 -2
- package/src/components/xform/form-designer/indexMixin.js +0 -1
- package/src/components/xform/form-designer/refMixinDesign.js +27 -1
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +357 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/showViewButton-editor.vue +29 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +639 -15
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +282 -1115
- package/src/components/xform/form-render/container-item/data-table-mixin.js +29 -7
- package/src/components/xform/form-render/dynamicDialogRender.js +238 -3
- package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
- package/src/components/xform/form-render/indexMixin.js +21 -431
- package/src/components/xform/form-render/refMixin.js +32 -1
- package/src/components/xform/mixins/defaultHandle.js +2 -2
- package/src/components/xform/utils/dynamicSchemaUtil.js +46 -0
- package/src/components/xform/utils/validators.js +186 -2
- package/src/utils/componentDialog.js +322 -0
- package/src/views/user/form/vform/render.vue +4 -21
- package/src/views/user/form/view/list.vue +13 -9
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +0 -971
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +0 -408
- package/src/components/xform/utils/formHttp.js +0 -162
|
@@ -1,2 +1,186 @@
|
|
|
1
|
-
import {evalFn, isNull} from "./util";
|
|
2
|
-
(function(_0x43fce3,_0xea853e){function _0x12997f(_0x14a5bb,_0x5f3c36,_0x45dcce,_0x232b90,_0x40c97e){return _0x328c(_0x40c97e- -0x36c,_0x45dcce);}function _0x280656(_0x2a8b13,_0x1efe6b,_0x274a22,_0x2854ed,_0x293333){return _0x3b11(_0x293333- -0x33b,_0x1efe6b);}function _0x56a208(_0x87bf78,_0x56c0c8,_0x6612be,_0x3451aa,_0x1d2bce){return _0x3b11(_0x6612be-0x32c,_0x3451aa);}function _0x25f7c2(_0x2a7c9c,_0x23f30c,_0x35d7ca,_0x91b189,_0x70a9c9){return _0x3b11(_0x91b189- -0x1e3,_0x2a7c9c);}function _0x248c01(_0x1be48f,_0x4afa25,_0x189cf5,_0x4c17ec,_0x933e6b){return _0x328c(_0x933e6b- -0x2cb,_0x1be48f);}function _0x57db4f(_0x2de6c5,_0x21fa5f,_0x4bab96,_0xfd826c,_0x2aa195){return _0x3b11(_0xfd826c- -0x26,_0x2aa195);}function _0x5a5086(_0x4c0971,_0x3e94ff,_0x1b3ce8,_0x57c2c6,_0x18c039){return _0x3b11(_0x4c0971- -0x8e,_0x18c039);}function _0x1a245d(_0x19d572,_0x2e83a0,_0xe85bb7,_0x103e0e,_0x515c15){return _0x328c(_0x19d572-0x203,_0x103e0e);}function _0x1a76cd(_0x330bf6,_0x464b06,_0x37f44f,_0x7d53f2,_0x5b6544){return _0x328c(_0x464b06- -0x11a,_0x330bf6);}const _0x5e1b30=_0x43fce3();function _0x5d67bc(_0x4ee59e,_0x17dc00,_0x300edb,_0x2482de,_0x488e90){return _0x328c(_0x488e90-0xf9,_0x300edb);}do{try{const _0x14c7b6=parseInt(_0x280656(-0x2f6,-0x307,-0x312,-0x342,-0x31f))/0x1*(parseInt(_0x57db4f(0x3c,0x22,0x36,0x26,0x45))/0x2)+-parseInt(_0x248c01("\u0051\u0058\u0031\u0058",-0x296,-0x2b3,-0x2e7,-0x2c0))/0x3*(-parseInt(_0x56a208(0x316,0x362,0x339,0x318,0x353))/0x4)+parseInt(_0x248c01("ksxo".split("").reverse().join(""),-0x2a3,-0x281,-0x2ad,-0x2a2))/0x5+parseInt(_0x248c01("KyJa".split("").reverse().join(""),-0x2ac,-0x29a,-0x2cd,-0x2b6))/0x6+parseInt(_0x1a76cd("2IX3".split("").reverse().join(""),-0x111,-0x128,-0xe8,-0x12d))/0x7*(parseInt(_0x56a208(0x370,0x387,0x36c,0x396,0x36b))/0x8)+parseInt(_0x280656(-0x326,-0x325,-0x30d,-0x2ff,-0x310))/0x9+-parseInt(_0x12997f(-0x357,-0x373,"\u0056\u004e\u004d\u006e",-0x350,-0x353))/0xa;if(_0x14c7b6===_0xea853e){break;}else{_0x5e1b30['push'](_0x5e1b30["\u0073\u0068\u0069\u0066\u0074"]());}}catch(_0x124bdc){_0x5e1b30["\u0070\u0075\u0073\u0068"](_0x5e1b30["\u0073\u0068\u0069\u0066\u0074"]());}}while(!![]);})(_0xe3fb,0x32f89);export const getRegExp=function(_0x547f86){const _0x279736={'QImRP':_0x3e6aa4(-0x62,-0x48,-0x81,-0x7a,-0x69),"\u0058\u0074\u004b\u006b\u0079":_0x459adb(-0x15,-0x3f,-0xc,-0x11,-0x24),"\u0054\u0079\u0074\u0077\u0059":_0x33b152(0x372,0x37d,0x385,0x359,0x36a)};function _0x1c4918(_0x510384,_0x10d3ac,_0x342c38,_0x54c1ed,_0x373a86){return _0x3b11(_0x10d3ac-0x3a3,_0x373a86);}function _0x33b152(_0x5465bc,_0x525f25,_0x2f86d4,_0x5f1885,_0x38fbde){return _0x3b11(_0x5465bc-0x350,_0x38fbde);}function _0x3e6aa4(_0x51c3a3,_0x5d019b,_0x396c50,_0x2bc4b1,_0x9a5b86){return _0x3b11(_0x9a5b86- -0x8c,_0x51c3a3);}function _0x459adb(_0xefd82,_0x5eda09,_0xce344,_0x541421,_0x27b502){return _0x3b11(_0xefd82- -0x68,_0x27b502);}const _0x1287ee={'number':_0x279736["\u0051\u0049\u006d\u0052\u0050"],"\u006c\u0065\u0074\u0074\u0065\u0072":_0x3e6aa4(-0x77,-0x90,-0x56,-0x7f,-0x7a),"\u006c\u0065\u0074\u0074\u0065\u0072\u0041\u006e\u0064\u004e\u0075\u006d\u0062\u0065\u0072":_0x279736['XtKky'],"\u006d\u006f\u0062\u0069\u006c\u0065\u0050\u0068\u006f\u006e\u0065":_0x1c4918(0x408,0x3f1,0x3e5,0x3e0,0x41a),"\u006c\u0065\u0074\u0074\u0065\u0072\u0053\u0074\u0061\u0072\u0074\u004e\u0075\u006d\u0062\u0065\u0072\u0049\u006e\u0063\u006c\u0075\u0064\u0065\u0064":_0x3e6aa4(-0x72,-0x9f,-0x79,-0x6c,-0x84),'noChinese':_0x279736["\u0054\u0079\u0074\u0077\u0059"],'chinese':_0x2311dd("A^ja".split("").reverse().join(""),0x362,0x373,0x33a,0x348),"\u0065\u006d\u0061\u0069\u006c":_0x33b152(0x39a,0x389,0x3bc,0x3a8,0x39c),'url':_0x3e6aa4(-0x60,-0x6c,-0x71,-0x53,-0x57)};function _0x2311dd(_0x247818,_0x43de93,_0x604586,_0x25e2e5,_0x1d04a3){return _0x328c(_0x43de93-0x311,_0x247818);}function _0x5e8418(_0x4bb579,_0x5444b6,_0x4a18b8,_0x5962a2,_0x42d335){return _0x3b11(_0x4a18b8- -0x385,_0x5962a2);}return _0x1287ee[_0x547f86];};function _0x3b11(_0x47abdb,_0xe3fb96){const _0x3b1161=_0xe3fb();_0x3b11=function(_0x51181e,_0x3a5423){_0x51181e=_0x51181e-0x0;let _0x31eef4=_0x3b1161[_0x51181e];if(_0x3b11['DjFwil']===undefined){var _0x4ec82b=function(_0x1093a6){const _0x25aac0="\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068\u0069\u006a\u006b\u006c\u006d\u006e\u006f\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077\u0078\u0079\u007a\u0041\u0042\u0043\u0044\u0045\u0046\u0047\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057\u0058\u0059\u005a\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037\u0038\u0039\u002b\u002f\u003d";let _0x57ae65='';let _0x34fe48='';for(let _0x1c4e13=0x0,_0x29c8eb,_0x5ce9a2,_0x1c61fe=0x0;_0x5ce9a2=_0x1093a6["\u0063\u0068\u0061\u0072\u0041\u0074"](_0x1c61fe++);~_0x5ce9a2&&(_0x29c8eb=_0x1c4e13%0x4?_0x29c8eb*0x40+_0x5ce9a2:_0x5ce9a2,_0x1c4e13++%0x4)?_0x57ae65+=String['fromCharCode'](0xff&_0x29c8eb>>(-0x2*_0x1c4e13&0x6)):0x0){_0x5ce9a2=_0x25aac0['indexOf'](_0x5ce9a2);}for(let _0x389191=0x0,_0x1dc095=_0x57ae65['length'];_0x389191<_0x1dc095;_0x389191++){_0x34fe48+="\u0025"+("00".split("").reverse().join("")+_0x57ae65['charCodeAt'](_0x389191)["\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067"](0x10))['slice'](-0x2);}return decodeURIComponent(_0x34fe48);};_0x3b11['UvMiUa']=_0x4ec82b;_0x47abdb=arguments;_0x3b11["\u0044\u006a\u0046\u0077\u0069\u006c"]=!![];}const _0x2223e2=_0x3b1161[0x0];const _0x44cdbf=_0x51181e+_0x2223e2;const _0x328c0a=_0x47abdb[_0x44cdbf];if(!_0x328c0a){_0x31eef4=_0x3b11['UvMiUa'](_0x31eef4);_0x47abdb[_0x44cdbf]=_0x31eef4;}else{_0x31eef4=_0x328c0a;}return _0x31eef4;};return _0x3b11(_0x47abdb,_0xe3fb96);}function SFBQsL(_0x10e89c,_0x30901c){if(!![]!=![])return;SFBQsL=function(_0xb169c,_0x101902){_0xb169c=_0xb169c-(0x973c9^0x973c9);var _0x57b37a=_0x5e50e6[_0xb169c];return _0x57b37a;};return SFBQsL(_0x10e89c,_0x30901c);}SFBQsL();function _0x328c(_0x47abdb,_0xe3fb96){const _0x3b1161=_0xe3fb();_0x328c=function(_0x51181e,_0x3a5423){_0x51181e=_0x51181e-0x0;let _0x31eef4=_0x3b1161[_0x51181e];if(_0x328c["\u0061\u004a\u0055\u0075\u004d\u0068"]===undefined){var _0x4ec82b=function(_0x25aac0){const _0x57ae65="=/+9876543210ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba".split("").reverse().join("");let _0x34fe48='';let _0x1c4e13='';for(let _0x29c8eb=0x0,_0x5ce9a2,_0x1c61fe,_0x389191=0x0;_0x1c61fe=_0x25aac0["\u0063\u0068\u0061\u0072\u0041\u0074"](_0x389191++);~_0x1c61fe&&(_0x5ce9a2=_0x29c8eb%0x4?_0x5ce9a2*0x40+_0x1c61fe:_0x1c61fe,_0x29c8eb++%0x4)?_0x34fe48+=String["\u0066\u0072\u006f\u006d\u0043\u0068\u0061\u0072\u0043\u006f\u0064\u0065"](0xff&_0x5ce9a2>>(-0x2*_0x29c8eb&0x6)):0x0){_0x1c61fe=_0x57ae65["\u0069\u006e\u0064\u0065\u0078\u004f\u0066"](_0x1c61fe);}for(let _0x1dc095=0x0,_0x10e89c=_0x34fe48['length'];_0x1dc095<_0x10e89c;_0x1dc095++){_0x1c4e13+="\u0025"+("\u0030\u0030"+_0x34fe48['charCodeAt'](_0x1dc095)['toString'](0x10))["\u0073\u006c\u0069\u0063\u0065"](-0x2);}return decodeURIComponent(_0x1c4e13);};const _0x1093a6=function(_0x30901c,_0xb169c){let _0x101902=[],_0x57b37a=0x0,_0x4d8f2a,_0x3eb286='';_0x30901c=_0x4ec82b(_0x30901c);let _0x163c9f;for(_0x163c9f=0x0;_0x163c9f<0x100;_0x163c9f++){_0x101902[_0x163c9f]=_0x163c9f;}for(_0x163c9f=0x0;_0x163c9f<0x100;_0x163c9f++){_0x57b37a=(_0x57b37a+_0x101902[_0x163c9f]+_0xb169c["\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074"](_0x163c9f%_0xb169c["\u006c\u0065\u006e\u0067\u0074\u0068"]))%0x100;_0x4d8f2a=_0x101902[_0x163c9f];_0x101902[_0x163c9f]=_0x101902[_0x57b37a];_0x101902[_0x57b37a]=_0x4d8f2a;}_0x163c9f=0x0;_0x57b37a=0x0;for(let _0x500ff4=0x0;_0x500ff4<_0x30901c["\u006c\u0065\u006e\u0067\u0074\u0068"];_0x500ff4++){_0x163c9f=(_0x163c9f+0x1)%0x100;_0x57b37a=(_0x57b37a+_0x101902[_0x163c9f])%0x100;_0x4d8f2a=_0x101902[_0x163c9f];_0x101902[_0x163c9f]=_0x101902[_0x57b37a];_0x101902[_0x57b37a]=_0x4d8f2a;_0x3eb286+=String["\u0066\u0072\u006f\u006d\u0043\u0068\u0061\u0072\u0043\u006f\u0064\u0065"](_0x30901c['charCodeAt'](_0x500ff4)^_0x101902[(_0x101902[_0x163c9f]+_0x101902[_0x57b37a])%0x100]);}return _0x3eb286;};_0x328c['XNQPpm']=_0x1093a6;_0x47abdb=arguments;_0x328c["\u0061\u004a\u0055\u0075\u004d\u0068"]=!![];}const _0x2223e2=_0x3b1161[0x0];const _0x44cdbf=_0x51181e+_0x2223e2;const _0x328c0a=_0x47abdb[_0x44cdbf];if(!_0x328c0a){if(_0x328c['chNkRT']===undefined){_0x328c["\u0063\u0068\u004e\u006b\u0052\u0054"]=!![];}_0x31eef4=_0x328c['XNQPpm'](_0x31eef4,_0x3a5423);_0x47abdb[_0x44cdbf]=_0x31eef4;}else{_0x31eef4=_0x328c0a;}return _0x31eef4;};return _0x328c(_0x47abdb,_0xe3fb96);}function juVCpw(_0x4bda4a,_0x1d048a){if(!![]!=![])return;juVCpw=function(_0x11051c,_0x43530f){_0x11051c=_0x11051c-(0x973c9^0x973c9);var _0x5a085f=_0x5e50e6[_0x11051c];return _0x5a085f;};return juVCpw(_0x4bda4a,_0x1d048a);}juVCpw();const validateFn=function(_0xa3dd42,_0x554dc6,_0x47ae94,_0x129d43,_0x266e83){const _0x19d14f={'lbAAi':function(_0x409c2e){return _0x409c2e();},'glqDZ':function(_0x589b2e){return _0x589b2e();}};if(isNull(_0x47ae94)||_0x47ae94["\u006c\u0065\u006e\u0067\u0074\u0068"]<=(0x97bcb^0x97bcb)){_0x19d14f["\u006c\u0062\u0041\u0041\u0069"](_0x129d43);return;}const _0x3e0f45=evalFn(getRegExp(_0xa3dd42));if(!_0x3e0f45["\u0074\u0065\u0073\u0074"](_0x47ae94)){let _0x23c344=_0x554dc6['errorMsg']||_0x266e83;_0x129d43(new Error(_0x23c344));}else{_0x19d14f['glqDZ'](_0x129d43);}};const FormValidators={"\u006e\u0075\u006d\u0062\u0065\u0072"(_0x5aca7e,_0x51b9fb,_0x48f677){function _0x1a7e38(_0x446a17,_0x5d92d7,_0x5eed44,_0x4023c0,_0x1d6450){return _0x328c(_0x4023c0-0x273,_0x5eed44);}function _0x2da9a2(_0x3d0a8a,_0x1b41dd,_0x42202b,_0x3294d,_0x51d6a1){return _0x3b11(_0x1b41dd- -0x1e6,_0x42202b);}const _0x4f4fca={"\u0056\u0059\u006d\u0077\u004f":function(_0x2156ad,_0x56a25e,_0xc56267,_0x133bb0,_0x1a3409,_0x3b8c12){return _0x2156ad(_0x56a25e,_0xc56267,_0x133bb0,_0x1a3409,_0x3b8c12);},"\u0058\u006a\u004d\u0048\u0046":_0x2da9a2(-0x1c2,-0x1d6,-0x1e8,-0x1eb,-0x1da),"\u004e\u0078\u0055\u004c\u0061":function(_0x54ed0f,_0x117154){return _0x54ed0f+_0x117154;},'NCSSa':_0x1a7e38(0x294,0x287,"CstC".split("").reverse().join(""),0x29a,0x297)};_0x4f4fca["\u0056\u0059\u006d\u0077\u004f"](validateFn,_0x4f4fca['XjMHF'],_0x5aca7e,_0x51b9fb,_0x48f677,_0x4f4fca["\u004e\u0078\u0055\u004c\u0061"]("\u005b",_0x5aca7e["\u006c\u0061\u0062\u0065\u006c"])+_0x4f4fca["\u004e\u0043\u0053\u0053\u0061"]);},"\u006c\u0065\u0074\u0074\u0065\u0072"(_0x324f52,_0x25344b,_0x5cb92b){const _0xcdfe77={"\u007a\u006a\u0074\u0054\u0050":_0x888d99("\u0068\u006b\u0042\u004a",-0x5b,-0x6d,-0x82,-0x31),'WWdSK':function(_0x7a29d3,_0x1f6299){return _0x7a29d3+_0x1f6299;}};function _0x43ccdc(_0x3d9302,_0x5ef6d1,_0x31a0cf,_0x1ea600,_0x1b95c3){return _0x3b11(_0x1b95c3- -0x30e,_0x5ef6d1);}function _0x888d99(_0x237020,_0x239a48,_0x17335e,_0x2b204c,_0x1503db){return _0x328c(_0x239a48- -0x8e,_0x237020);}validateFn(_0xcdfe77["\u007a\u006a\u0074\u0054\u0050"],_0x324f52,_0x25344b,_0x5cb92b,_0xcdfe77['WWdSK']("\u005b"+_0x324f52['label'],_0x43ccdc(-0x303,-0x30e,-0x315,-0x31a,-0x309)));},"\u006c\u0065\u0074\u0074\u0065\u0072\u0041\u006e\u0064\u004e\u0075\u006d\u0062\u0065\u0072"(_0x3b641c,_0x45648f,_0x4bf38e){function _0x47e957(_0x55e977,_0x3f351d,_0x2a503b,_0xec1f25,_0x447882){return _0x3b11(_0x2a503b-0x19f,_0x55e977);}function _0x1f65c8(_0x3a0392,_0x2ecc82,_0x4c8105,_0x11b8b9,_0x12b7f0){return _0x3b11(_0x4c8105-0x3b1,_0x11b8b9);}validateFn(_0x1f65c8(0x3e9,0x3d6,0x3d1,0x3c5,0x3e6),_0x3b641c,_0x45648f,_0x4bf38e,"\u005b"+_0x3b641c["\u006c\u0061\u0062\u0065\u006c"]+_0x47e957(0x196,0x198,0x1a5,0x1a6,0x1a6));},'mobilePhone'(_0x162078,_0x55a1c2,_0x5cce1d){function _0x3ba042(_0x27a037,_0x5aa283,_0x29b13c,_0x40c291,_0x23d554){return _0x3b11(_0x27a037- -0x373,_0x23d554);}function _0x5ecca3(_0x5848af,_0x3549e4,_0x19a32b,_0x178842,_0x57dfef){return _0x328c(_0x3549e4- -0x2f9,_0x5848af);}const _0x502b71={"\u0051\u0076\u0069\u0055\u004e":_0x3ba042(-0x355,-0x32b,-0x34c,-0x34f,-0x338)};validateFn(_0x502b71["\u0051\u0076\u0069\u0055\u004e"],_0x162078,_0x55a1c2,_0x5cce1d,"\u005b"+_0x162078['label']+_0x5ecca3("\u0074\u0061\u0074\u0031",-0x2ca,-0x2d4,-0x2f4,-0x2d2));},'noBlankStart'(_0x943795,_0x5d06cd,_0x716e55){},'noBlankEnd'(_0x2b8a69,_0x4d3230,_0x101f8c){},'letterStartNumberIncluded'(_0x57c2a4,_0x2cc7dc,_0x4b4872){const _0x20dbe5={'TXpGr':_0x20d80d(0x6d,0x59,0x8c,0x6a,0x44),"\u0056\u0071\u006d\u0057\u0069":_0xc97678("\u0063\u0054\u006b\u0028",-0x63,-0x8b,-0x62,-0x78)};function _0x20d80d(_0x26d66e,_0x5da78d,_0x7fd3ac,_0xd36b74,_0x1d14ad){return _0x3b11(_0x26d66e-0x47,_0x7fd3ac);}function _0xc97678(_0x3c299a,_0x19783e,_0x3e1aca,_0x47434e,_0x267215){return _0x328c(_0x47434e- -0x96,_0x3c299a);}validateFn(_0x20dbe5['TXpGr'],_0x57c2a4,_0x2cc7dc,_0x4b4872,"\u005b"+_0x57c2a4["\u006c\u0061\u0062\u0065\u006c"]+_0x20dbe5['VqmWi']);},"\u006e\u006f\u0043\u0068\u0069\u006e\u0065\u0073\u0065"(_0x201e69,_0x23a63c,_0xd9661b){function _0x3e33a6(_0x599334,_0x448eff,_0x37e3f9,_0x47d4ad,_0x542170){return _0x3b11(_0x47d4ad-0x286,_0x448eff);}const _0x50ee0c={"\u0055\u006c\u005a\u0061\u0045":function(_0x536ab4,_0x4d4bf6){return _0x536ab4+_0x4d4bf6;}};function _0x29a0cc(_0x4739ba,_0x53dcac,_0x263215,_0x4cffa8,_0x8a6405){return _0x328c(_0x4739ba-0xb5,_0x8a6405);}validateFn(_0x29a0cc(0xc6,0xc9,0xb7,0xba,"\u0033\u004b\u005e\u0025"),_0x201e69,_0x23a63c,_0xd9661b,_0x50ee0c["\u0055\u006c\u005a\u0061\u0045"]("\u005b",_0x201e69['label'])+_0x3e33a6(0x2b5,0x2c7,0x295,0x2b4,0x2d6));},"\u0063\u0068\u0069\u006e\u0065\u0073\u0065"(_0x191623,_0x15e7e4,_0x48224b){function _0x2d956c(_0xc5f07d,_0x52335a,_0xc64106,_0x580780,_0x25005f){return _0x3b11(_0xc64106- -0x317,_0x580780);}function _0x457d6d(_0x23ea61,_0x1ffd36,_0x410554,_0x517307,_0x51061d){return _0x328c(_0x1ffd36-0x2cc,_0x23ea61);}validateFn(_0x457d6d("x926".split("").reverse().join(""),0x30e,0x331,0x325,0x2fc),_0x191623,_0x15e7e4,_0x48224b,"\u005b"+_0x191623["\u006c\u0061\u0062\u0065\u006c"]+_0x2d956c(-0x2f1,-0x2f4,-0x310,-0x306,-0x2f6));},"\u0065\u006d\u0061\u0069\u006c"(_0x2b6ebd,_0x4de83f,_0x4d1155){const _0x11a8ce={'bvDZU':_0x22473d(0x327,0x311,0x32a,0x30c,0x326)};function _0x22473d(_0x33c361,_0x342eee,_0x4fcaf6,_0x41236e,_0x9a2ddf){return _0x3b11(_0x342eee-0x2c4,_0x9a2ddf);}function _0x35a1c9(_0x3be214,_0x57c95c,_0x24a4cf,_0x14ecf5,_0x4ee4ab){return _0x328c(_0x57c95c-0x180,_0x4ee4ab);}validateFn(_0x11a8ce['bvDZU'],_0x2b6ebd,_0x4de83f,_0x4d1155,"\u005b"+_0x2b6ebd['label']+_0x35a1c9(0x18f,0x1b7,0x1a8,0x1b4,"LOsY".split("").reverse().join("")));},"\u0075\u0072\u006c"(_0x30eada,_0x138bab,_0x40d23c){function _0x173f85(_0x57ca82,_0x21c5b3,_0x42f1a6,_0x54659f,_0x1d7c3b){return _0x3b11(_0x54659f- -0x16,_0x1d7c3b);}function _0x5c00db(_0x2bac31,_0x2236f7,_0x48f723,_0x1311f1,_0x5bf696){return _0x328c(_0x5bf696-0xa0,_0x2bac31);}validateFn(_0x5c00db("\u0033\u0058\u0049\u0032",0xaa,0xb1,0x7e,0xa3),_0x30eada,_0x138bab,_0x40d23c,"\u005b"+_0x30eada["\u006c\u0061\u0062\u0065\u006c"]+_0x173f85(0x1f,-0x8,-0x5,0x2,-0xb));},"\u0072\u0065\u0067\u0045\u0078\u0070"(_0x561318,_0x2425a8,_0x5a63b2){const _0x48c6f1={'jrNKp':function(_0xfd4db3,_0xaab76e){return _0xfd4db3(_0xaab76e);},'jHRIB':function(_0x40b455,_0x47d315){return _0x40b455^_0x47d315;},"\u0069\u0079\u004a\u0064\u004e":function(_0x5d31e0){return _0x5d31e0();},"\u0066\u0053\u0043\u006d\u0069":function(_0x420cc1,_0x46980c){return _0x420cc1^_0x46980c;},"\u006f\u0042\u0065\u0072\u0045":function(_0x327257,_0x18110a){return _0x327257!==_0x18110a;},"\u004e\u0066\u004e\u0049\u0055":function(_0x12c53a,_0x308e0b){return _0x12c53a-_0x308e0b;}};if(_0x48c6f1["\u006a\u0072\u004e\u004b\u0070"](isNull,_0x2425a8)||_0x2425a8["\u006c\u0065\u006e\u0067\u0074\u0068"]<=_0x48c6f1["\u006a\u0048\u0052\u0049\u0042"](0xb5968,0xb5968)){_0x48c6f1['iyJdN'](_0x5a63b2);return;}if(_0x561318["\u0072\u0065\u0067\u0045\u0078\u0070"]['length']>_0x48c6f1["\u0066\u0053\u0043\u006d\u0069"](0xcc849,0xcc849)&&_0x561318["\u0072\u0065\u0067\u0045\u0078\u0070"][0x970d6^0x970d6]!=="\u002f"){_0x561318['regExp']="\u002f"+_0x561318["\u0072\u0065\u0067\u0045\u0078\u0070"];}function _0x391b9a(_0x3a435c,_0xbb990f,_0x1993bd,_0x322235,_0x3ae0fd){return _0x3b11(_0x3a435c-0x74,_0x3ae0fd);}if(_0x561318['regExp']["\u006c\u0065\u006e\u0067\u0074\u0068"]>(0x9f79e^0x9f79e)&&_0x48c6f1['oBerE'](_0x561318['regExp'][_0x48c6f1["\u004e\u0066\u004e\u0049\u0055"](_0x561318['regExp']["\u006c\u0065\u006e\u0067\u0074\u0068"],0x6559e^0x6559f)],"\u002f")){_0x561318["\u0072\u0065\u0067\u0045\u0078\u0070"]=_0x561318['regExp']+"\u002f";}const _0x298a66=evalFn(_0x561318["\u0072\u0065\u0067\u0045\u0078\u0070"]);if(!_0x298a66['test'](_0x2425a8)){let _0x12f2a7=_0x561318["\u0065\u0072\u0072\u006f\u0072\u004d\u0073\u0067"]||"\u005b"+_0x561318['label']+_0x391b9a(0xb3,0xc6,0xc7,0xdd,0xd1);_0x5a63b2(new Error(_0x12f2a7));}else{_0x48c6f1['iyJdN'](_0x5a63b2);}}};export default FormValidators;function _0xe3fb(){const _0x4ea4f6=["\u006d\u004a\u0062\u0079\u0044\u0030\u007a\u0033\u007a\u004b\u0034","s5PWpkCMdZRW".split("").reverse().join(""),"\u0042\u0077\u0039\u0049\u0041\u0077\u0058\u004c\u0075\u0067\u0048\u0056\u0042\u004d\u0075","\u0057\u0051\u0053\u0079\u006e\u0038\u006b\u0058\u0057\u0036\u0078\u0063\u0056\u0047","\u0042\u0067\u0076\u0030\u0044\u0067\u0076\u0059\u0071\u0077\u0035\u004b\u0074\u004e\u0076\u0054\u0079\u004d\u0076\u0059","\u0042\u0067\u006a\u0062\u0071\u0077\u004b","VqYkDvQVP3cG4sUxB51l".split("").reverse().join(""),"\u006c\u0031\u0035\u0042\u006c\u0076\u0030\u002f\u0078\u0067\u0071\u0052\u006b\u0066\u0057\u0055\u0078\u0067\u0071\u0052\u006b\u0074\u0038\u004b\u006c\u0057","\u0076\u0066\u0048\u0057\u0072\u0033\u0069","\u0076\u004c\u004c\u0054\u0044\u0030\u0038","azLrwDSnMBjjxzI1wDorNCHr3uYvgD0vgB".split("").reverse().join(""),"aMTE+VVwEJUwENuAEGEMoLtw+How+B".split("").reverse().join(""),"bkCygk8dzP5W".split("").reverse().join(""),"\u007a\u0053\u006f\u002b\u006c\u006d\u006f\u004b\u0057\u0051\u0079\u0061\u0057\u0035\u0047\u0065\u0061\u0072\u0078\u0063\u0053\u0053\u006b\u006f","GBUoSPchOWrG7WQkCSdtRWjomLdpQW".split("").reverse().join(""),"\u006d\u004a\u0071\u0058\u006e\u004a\u006d\u0059\u0045\u0068\u0050\u0035\u0079\u0031\u006e\u0030","ywgJkmiO87W".split("").reverse().join(""),"\u007a\u0078\u006a\u0059\u0042\u0033\u006a\u006e\u0043\u0032\u0043","\u0078\u0045\u0073\u0034\u004a\u0045\u0077\u0070\u0052\u002b\u0049\u002b\u004b\u002b\u0077\u0066\u0050\u0045\u0073\u0034\u0052\u0045\u0041\u0077\u0048\u002b\u0077\u0054\u004c\u002b\u0045\u0053\u0050\u0047","WOUIUUEAUM9w+UJAULHE+IowUOFA+UiAUb".split("").reverse().join(""),"qBmGOW8m5W".split("").reverse().join(""),"\u0042\u0067\u0076\u0055\u007a\u0033\u0072\u004f","\u0057\u0036\u0069\u0077\u0057\u0036\u0070\u0064\u0050\u0030\u004a\u0064\u004a\u0038\u006b\u005a\u0057\u0050\u007a\u0050\u0057\u0050\u0047\u006f","\u0057\u0037\u0074\u0063\u004e\u006d\u006b\u0053\u0062\u0053\u006b\u0031\u0057\u0036\u0075","\u0057\u0034\u0037\u004c\u0056\u006c\u0068\u0050\u004f\u0035\u0033\u004b\u0055\u0036\u0042\u004c\u0052\u0037\u0070\u004d\u0052\u0051\u0078\u004c\u0056\u0042\u0042\u004c\u0050\u0052\u005a\u0056\u0056\u006a\u0056\u004c\u004a\u0051\u0064\u004c\u004a\u006a\u0070\u004c\u004b\u0042\u0052\u004d\u004c\u0052\u0070\u004c\u0052\u0079\u0065","VqYkP01lC5xl50cm61syA1sqBHYkP4cxPSsx+1soTaJETeMwTe0wOGskVW1lCPtxtn3wDbfCB1Nm71fv0TvxiH2w89cxVWLoDbfCB1Nm71fv0TvxiH2wO41l".split("").reverse().join(""),"\u0061\u0053\u006b\u0057\u0057\u0037\u0056\u0063\u004c\u0030\u004b","\u0057\u004f\u0042\u0050\u0047\u004f\u0068\u004e\u0052\u0041\u0056\u004d\u004f\u0036\u006c\u004c\u0056\u0042\u0074\u004d\u004e\u0052\u0068\u004f\u0052\u006c\u0065","\u0076\u0068\u004c\u0030\u0044\u0031\u004b","a3sojNA".split("").reverse().join(""),"qF0vhfmome".split("").reverse().join(""),"\u0078\u0053\u006f\u004a\u0057\u0050\u0033\u0063\u0055\u0047\u0065","uLwezNy".split("").reverse().join(""),"\u007a\u004c\u006e\u0064\u0042\u0077\u004b","\u0074\u004d\u007a\u006f\u0073\u0076\u0075","uwDSfMDGqwASfMDULwx".split("").reverse().join(""),"\u006d\u004a\u0043\u0030\u006f\u0074\u0043\u005a\u006e\u004d\u0054\u0049\u0042\u004d\u004c\u0053\u0045\u0061","\u0057\u0051\u005a\u0063\u0049\u0053\u006b\u0054\u0057\u004f\u005a\u0064\u004a\u0077\u0052\u0063\u0051\u0068\u0071\u0053\u0066\u0077\u0052\u0064\u0050\u0047","\u0057\u0037\u006c\u0063\u0049\u006d\u006b\u0072\u0057\u0036\u005a\u0063\u0050\u0038\u006f\u0052\u0057\u0036\u0075","\u0043\u004d\u0076\u004e\u0072\u0078\u0048\u0057","KnOWd8Jk".split("").reverse().join(""),"qg0kCgJkCE".split("").reverse().join(""),"WHdx7Ww00q".split("").reverse().join(""),"aLuTLuu".split("").reverse().join(""),"\u006e\u0033\u0072\u0062\u0077\u0077\u006e\u0079\u0042\u0071","\u0077\u0038\u006b\u002b\u0069\u0053\u006b\u0046\u0064\u006d\u006b\u0048","\u006c\u0031\u0034\u004f\u0077\u0059\u0031\u0046\u0071\u0073\u0031\u0041\u0079\u0073\u0031\u0036\u006d\u0063\u0030\u0035\u006c\u004c\u0030\u0052\u006b\u0075\u0061\u004f\u0077\u0031\u0039\u0062\u006c\u0076\u0050\u0048\u006c\u0078\u004f\u0057\u006c\u0074\u004c\u0044\u006b\u0031\u0057\u0055\u006b\u0073\u0054\u0042\u0071\u0073\u0031\u0041\u0079\u0073\u0031\u0036\u006d\u0063\u0030\u0035\u0078\u0078\u0053\u0059\u006c\u0064\u006e\u0039\u006a\u0063\u0038","\u0042\u0067\u0066\u0049\u007a\u0077\u0057","\u006d\u004a\u0079\u0059\u006f\u0064\u006a\u0065\u0074\u0076\u0050\u0067\u0042\u0066\u0061","\u007a\u0077\u0031\u0048\u0041\u0077\u0057","\u006c\u0031\u0035\u0042\u006d\u0076\u0031\u0042\u006d\u0059\u0030\u0035\u0078\u0076\u0053\u0057\u006c\u0074\u004c\u0044\u0045\u005a\u004c\u0039\u006a\u0063\u0038","\u006e\u004a\u004b\u0035\u006d\u005a\u0065\u0030\u006d\u0065\u0031\u004b\u0041\u0031\u0050\u004d\u0071\u0047","\u0057\u0035\u002f\u0063\u0055\u0064\u0071\u0074\u0057\u0052\u0039\u0074","\u0067\u006d\u006b\u0066\u0066\u002b\u0073\u0037\u0055\u0066\u0078\u0050\u0056\u0041\u005a\u0064\u004c\u0043\u006f\u0042\u0057\u0036\u0074\u0063\u0051\u0061","XkCilkSUcB5W".split("").reverse().join(""),"WlKSsx50cm61syA1sqB51l".split("").reverse().join(""),"zkCBKkSbzr4W".split("").reverse().join(""),"\u0076\u004e\u0066\u0054\u0076\u0032\u004b","qSd36WyH6W".split("").reverse().join(""),"/o8Ndl7W".split("").reverse().join(""),"\u0057\u0050\u005a\u0064\u0051\u004d\u0076\u0056\u0057\u0037\u006d\u0077\u0057\u0034\u0071\u004a\u0057\u004f\u0037\u0063\u0049\u0031\u0069\u0064","\u0078\u0045\u0077\u006d\u0048\u0045\u0077\u0071\u0051\u002b\u004d\u0044\u004e\u0055\u0077\u0054\u004c\u002b\u0041\u0056\u004a\u0045\u0077\u0054\u004c\u002b\u0045\u0053\u0050\u0047","\u0078\u0045\u0077\u0070\u0051\u0055\u0049\u0064\u0056\u0045\u0049\u002b\u004b\u002b\u0077\u0066\u0050\u0045\u0077\u0054\u004c\u002b\u0041\u0056\u004a\u0045\u0041\u0069\u004c\u0055\u0041\u0076\u0053\u006f\u0077\u0054\u004c\u0057","\u0078\u0045\u0077\u0070\u0051\u0055\u0049\u0064\u0056\u0045\u0049\u002b\u004b\u002b\u0077\u0066\u0050\u0045\u0073\u0034\u0052\u0045\u0041\u0077\u0048\u002b\u0077\u0054\u004c\u002b\u0045\u0053\u0050\u0047","VqIkDrgx61syA1sqBTsx61syA1sqB51l".split("").reverse().join(""),"OrUdVwrsoCMddRW".split("").reverse().join(""),"0o8vsoSNcN6W".split("").reverse().join(""),"\u0057\u0051\u0075\u0065\u0057\u0051\u0046\u0063\u0056\u006d\u006f\u0041\u0057\u0036\u0068\u0064\u0050\u006d\u006b\u0047\u0066\u0053\u006b\u0031\u0057\u0052\u0079","PmWEuCfte4Mtvk8D".split("").reverse().join(""),"\u006d\u004a\u0072\u0054\u0076\u0032\u0058\u0055\u007a\u004d\u0034","DoSzPz6WVa2SchOW".split("").reverse().join(""),"\u0076\u0043\u006f\u0055\u0057\u004f\u0037\u0063\u004d\u005a\u0043","YvMyTvNB".split("").reverse().join(""),"\u0046\u006d\u006b\u0038\u0046\u0043\u006b\u0044\u0075\u0043\u006f\u0058\u0045\u0065\u006a\u0045","\u006c\u0031\u0035\u0042\u0071\u0073\u0031\u0041\u0079\u0073\u0031\u0036\u0078\u0073\u0053\u004b\u006c\u0057","4ezkLxA".split("").reverse().join(""),"\u0063\u005a\u0079\u0051\u0057\u0050\u0079","qD5KOWsKwyuKKpHidy".split("").reverse().join(""),"yesnPgw".split("").reverse().join(""),"\u0075\u0078\u007a\u0050\u0076\u0075\u0034","WRVIEICA+J8woVGAotsvvx".split("").reverse().join(""),"\u0057\u0036\u0039\u0065\u0041\u0043\u006f\u0068\u0057\u0051\u005a\u0064\u0055\u004c\u0074\u0063\u0053\u004d\u0035\u0065\u0057\u0034\u006c\u0064\u004b\u0068\u0075","K3Alrhw".split("").reverse().join(""),"\u0057\u0052\u0030\u0076\u0061\u0038\u006f\u0069\u0057\u0036\u0071"];_0xe3fb=function(){return _0x4ea4f6;};return _0xe3fb();}
|
|
1
|
+
import { evalFn, isNull } from "./util";
|
|
2
|
+
|
|
3
|
+
export const getRegExp = function (validatorName) {
|
|
4
|
+
const commonRegExp = {
|
|
5
|
+
number: "/^[-]?\\d+(\\.\\d+)?$/",
|
|
6
|
+
letter: "/^[A-Za-z]+$/",
|
|
7
|
+
letterAndNumber: "/^[A-Za-z0-9]+$/",
|
|
8
|
+
mobilePhone: "/^[1][3-9][0-9]{9}$/",
|
|
9
|
+
letterStartNumberIncluded: "/^[A-Za-z]+[A-Za-z\\d]*$/",
|
|
10
|
+
noChinese: "/^[^\u4e00-\u9fa5]+$/",
|
|
11
|
+
chinese: "/^[\u4e00-\u9fa5]+$/",
|
|
12
|
+
email: "/^([-_A-Za-z0-9.]+)@([_A-Za-z0-9]+\\.)+[A-Za-z0-9]{2,3}$/",
|
|
13
|
+
url: "/^([hH][tT]{2}[pP]:\\/\\/|[hH][tT]{2}[pP][sS]:\\/\\/)(([A-Za-z0-9-~]+)\\.)+([A-Za-z0-9-~\\/])+$/",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return commonRegExp[validatorName];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const validateFn = function (
|
|
20
|
+
validatorName,
|
|
21
|
+
rule,
|
|
22
|
+
value,
|
|
23
|
+
callback,
|
|
24
|
+
defaultErrorMsg
|
|
25
|
+
) {
|
|
26
|
+
//空值不校验
|
|
27
|
+
if (isNull(value) || value.length <= 0) {
|
|
28
|
+
callback();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const reg = evalFn(getRegExp(validatorName));
|
|
33
|
+
|
|
34
|
+
if (!reg.test(value)) {
|
|
35
|
+
let errTxt = rule.errorMsg || defaultErrorMsg;
|
|
36
|
+
callback(new Error(errTxt));
|
|
37
|
+
} else {
|
|
38
|
+
callback();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const FormValidators = {
|
|
43
|
+
/* 数字 */
|
|
44
|
+
number(rule, value, callback) {
|
|
45
|
+
validateFn(
|
|
46
|
+
"number",
|
|
47
|
+
rule,
|
|
48
|
+
value,
|
|
49
|
+
callback,
|
|
50
|
+
"[" + rule.label + "]包含非数字字符"
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
/* 字母 */
|
|
55
|
+
letter(rule, value, callback) {
|
|
56
|
+
validateFn(
|
|
57
|
+
"letter",
|
|
58
|
+
rule,
|
|
59
|
+
value,
|
|
60
|
+
callback,
|
|
61
|
+
"[" + rule.label + "]包含非字母字符"
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/* 字母和数字 */
|
|
66
|
+
letterAndNumber(rule, value, callback) {
|
|
67
|
+
validateFn(
|
|
68
|
+
"letterAndNumber",
|
|
69
|
+
rule,
|
|
70
|
+
value,
|
|
71
|
+
callback,
|
|
72
|
+
"[" + rule.label + "]只能输入字母或数字"
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/* 手机号码 */
|
|
77
|
+
mobilePhone(rule, value, callback) {
|
|
78
|
+
validateFn(
|
|
79
|
+
"mobilePhone",
|
|
80
|
+
rule,
|
|
81
|
+
value,
|
|
82
|
+
callback,
|
|
83
|
+
"[" + rule.label + "]手机号码格式有误"
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/* 禁止空白字符开头 */
|
|
88
|
+
noBlankStart(rule, value, callback) {
|
|
89
|
+
//暂未实现
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
/* 禁止空白字符结尾 */
|
|
93
|
+
noBlankEnd(rule, value, callback) {
|
|
94
|
+
//暂未实现
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
/* 字母开头,仅可包含数字 */
|
|
98
|
+
letterStartNumberIncluded(rule, value, callback) {
|
|
99
|
+
validateFn(
|
|
100
|
+
"letterStartNumberIncluded",
|
|
101
|
+
rule,
|
|
102
|
+
value,
|
|
103
|
+
callback,
|
|
104
|
+
"[" + rule.label + "]必须以字母开头,可包含数字"
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
/* 禁止中文输入 */
|
|
109
|
+
noChinese(rule, value, callback) {
|
|
110
|
+
validateFn(
|
|
111
|
+
"noChinese",
|
|
112
|
+
rule,
|
|
113
|
+
value,
|
|
114
|
+
callback,
|
|
115
|
+
"[" + rule.label + "]不可输入中文字符"
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
/* 必须中文输入 */
|
|
120
|
+
chinese(rule, value, callback) {
|
|
121
|
+
validateFn(
|
|
122
|
+
"chinese",
|
|
123
|
+
rule,
|
|
124
|
+
value,
|
|
125
|
+
callback,
|
|
126
|
+
"[" + rule.label + "]只能输入中文字符"
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
/* 电子邮箱 */
|
|
131
|
+
email(rule, value, callback) {
|
|
132
|
+
validateFn(
|
|
133
|
+
"email",
|
|
134
|
+
rule,
|
|
135
|
+
value,
|
|
136
|
+
callback,
|
|
137
|
+
"[" + rule.label + "]邮箱格式有误"
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/* URL网址 */
|
|
142
|
+
url(rule, value, callback) {
|
|
143
|
+
validateFn("url", rule, value, callback, "[" + rule.label + "]URL格式有误");
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/*测试
|
|
147
|
+
test(rule, value, callback, errorMsg) {
|
|
148
|
+
//空值不校验
|
|
149
|
+
if (isNull(value) || (value.length <= 0)) {
|
|
150
|
+
callback()
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (value < 100) {
|
|
155
|
+
callback(new Error('[' + rule.label + ']不能小于100'))
|
|
156
|
+
} else {
|
|
157
|
+
callback()
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
regExp(rule, value, callback) {
|
|
163
|
+
//空值不校验
|
|
164
|
+
if (isNull(value) || value.length <= 0) {
|
|
165
|
+
callback();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (rule.regExp.length > 0 && rule.regExp[0] !== "/") {
|
|
170
|
+
rule.regExp = "/" + rule.regExp;
|
|
171
|
+
}
|
|
172
|
+
if (rule.regExp.length > 0 && rule.regExp[rule.regExp.length - 1] !== "/") {
|
|
173
|
+
rule.regExp = rule.regExp + "/";
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const pattern = evalFn(rule.regExp);
|
|
177
|
+
if (!pattern.test(value)) {
|
|
178
|
+
let errTxt = rule.errorMsg || "[" + rule.label + "]invalid value";
|
|
179
|
+
callback(new Error(errTxt));
|
|
180
|
+
} else {
|
|
181
|
+
callback();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export default FormValidators;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
|
|
3
|
+
// webpack 只允许加载构建时已收集的模块。这里限定为 components 和 views,
|
|
4
|
+
// 并使用 lazy 模式,避免把所有 Vue 文件直接打进主包。
|
|
5
|
+
const componentContext = require.context(
|
|
6
|
+
"../components",
|
|
7
|
+
true,
|
|
8
|
+
/\.vue$/,
|
|
9
|
+
"lazy"
|
|
10
|
+
);
|
|
11
|
+
const viewContext = require.context("../views", true, /\.vue$/, "lazy");
|
|
12
|
+
|
|
13
|
+
const componentKeys = new Set(componentContext.keys());
|
|
14
|
+
const viewKeys = new Set(viewContext.keys());
|
|
15
|
+
|
|
16
|
+
function normalizePath(path) {
|
|
17
|
+
return String(path || "")
|
|
18
|
+
.trim()
|
|
19
|
+
.replace(/\\/g, "/")
|
|
20
|
+
.replace(/[?#].*$/, "")
|
|
21
|
+
.replace(/^\.\//, "")
|
|
22
|
+
.replace(/^src\//, "")
|
|
23
|
+
.replace(/^@base\//, "")
|
|
24
|
+
.replace(/^@\//, "")
|
|
25
|
+
.replace(/^\/+/, "")
|
|
26
|
+
.replace(/\/+$/, "");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function getComponentLoader(path) {
|
|
30
|
+
const normalizedPath = normalizePath(path);
|
|
31
|
+
|
|
32
|
+
if (!normalizedPath) {
|
|
33
|
+
throw new Error("[componentDialog] componentPath 不能为空");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (normalizedPath.split("/").includes("..")) {
|
|
37
|
+
throw new Error("[componentDialog] componentPath 不允许包含 ..");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let context;
|
|
41
|
+
let contextKeys;
|
|
42
|
+
let relativePath;
|
|
43
|
+
|
|
44
|
+
if (normalizedPath.startsWith("components/")) {
|
|
45
|
+
context = componentContext;
|
|
46
|
+
contextKeys = componentKeys;
|
|
47
|
+
relativePath = normalizedPath.slice("components/".length);
|
|
48
|
+
} else if (normalizedPath.startsWith("views/")) {
|
|
49
|
+
context = viewContext;
|
|
50
|
+
contextKeys = viewKeys;
|
|
51
|
+
relativePath = normalizedPath.slice("views/".length);
|
|
52
|
+
} else {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"[componentDialog] 只允许加载 src/components 或 src/views 下的组件"
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const candidates = /\.vue$/i.test(relativePath)
|
|
59
|
+
? [`./${relativePath}`]
|
|
60
|
+
: [`./${relativePath}.vue`, `./${relativePath}/index.vue`];
|
|
61
|
+
const componentKey = candidates.find((key) => contextKeys.has(key));
|
|
62
|
+
|
|
63
|
+
if (!componentKey) {
|
|
64
|
+
throw new Error(`[componentDialog] 找不到组件:${normalizedPath}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return () => Promise.resolve(context(componentKey));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function loadComponent(path) {
|
|
71
|
+
const loader = getComponentLoader(path);
|
|
72
|
+
const componentModule = await loader();
|
|
73
|
+
return componentModule.default || componentModule;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function callEvent(events, eventName, args) {
|
|
77
|
+
const handler = events[eventName];
|
|
78
|
+
|
|
79
|
+
if (typeof handler === "function") {
|
|
80
|
+
handler(...args);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function mountComponentDialog(component, options, parentVm) {
|
|
85
|
+
const {
|
|
86
|
+
wrapper = true,
|
|
87
|
+
dialog = {},
|
|
88
|
+
props = {},
|
|
89
|
+
attrs = {},
|
|
90
|
+
provide: provideValues = {},
|
|
91
|
+
events = {},
|
|
92
|
+
onClose,
|
|
93
|
+
} = options;
|
|
94
|
+
|
|
95
|
+
let hostInstance = null;
|
|
96
|
+
let destroyTimer = null;
|
|
97
|
+
let closeStarted = false;
|
|
98
|
+
let closeNotified = false;
|
|
99
|
+
let resizeHandler = null;
|
|
100
|
+
const centerTimers = [];
|
|
101
|
+
|
|
102
|
+
const centerDialog = () => {
|
|
103
|
+
if (!hostInstance || options.verticalCenter === false) return;
|
|
104
|
+
|
|
105
|
+
hostInstance.$nextTick(() => {
|
|
106
|
+
if (!hostInstance || !hostInstance.$el) return;
|
|
107
|
+
|
|
108
|
+
const hostElement = hostInstance.$el;
|
|
109
|
+
const dialogElement = hostElement.matches(".el-dialog")
|
|
110
|
+
? hostElement
|
|
111
|
+
: hostElement.querySelector(".el-dialog");
|
|
112
|
+
|
|
113
|
+
if (!dialogElement || !dialogElement.offsetHeight) return;
|
|
114
|
+
|
|
115
|
+
const viewportHeight
|
|
116
|
+
= window.innerHeight || document.documentElement.clientHeight;
|
|
117
|
+
const marginTop = Math.max(
|
|
118
|
+
(viewportHeight - dialogElement.offsetHeight) / 2,
|
|
119
|
+
0
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
dialogElement.style.marginTop = `${marginTop}px`;
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const notifyClose = () => {
|
|
127
|
+
if (closeNotified) return;
|
|
128
|
+
|
|
129
|
+
closeNotified = true;
|
|
130
|
+
if (typeof onClose === "function") {
|
|
131
|
+
onClose();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const removeHost = () => {
|
|
136
|
+
if (!hostInstance) return;
|
|
137
|
+
|
|
138
|
+
centerTimers.forEach((timer) => clearTimeout(timer));
|
|
139
|
+
if (resizeHandler) {
|
|
140
|
+
window.removeEventListener("resize", resizeHandler);
|
|
141
|
+
resizeHandler = null;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const element = hostInstance.$el;
|
|
145
|
+
hostInstance.$destroy();
|
|
146
|
+
|
|
147
|
+
if (element && element.parentNode) {
|
|
148
|
+
element.parentNode.removeChild(element);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
hostInstance = null;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const destroy = () => {
|
|
155
|
+
if (closeStarted) return;
|
|
156
|
+
|
|
157
|
+
closeStarted = true;
|
|
158
|
+
notifyClose();
|
|
159
|
+
destroyTimer = setTimeout(removeHost, 300);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const forceDestroy = () => {
|
|
163
|
+
if (destroyTimer) {
|
|
164
|
+
clearTimeout(destroyTimer);
|
|
165
|
+
destroyTimer = null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
closeStarted = true;
|
|
169
|
+
notifyClose();
|
|
170
|
+
removeHost();
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const DialogHost = Vue.extend({
|
|
174
|
+
name: "DynamicComponentDialogHost",
|
|
175
|
+
|
|
176
|
+
provide() {
|
|
177
|
+
return provideValues;
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
data() {
|
|
181
|
+
return {
|
|
182
|
+
visible: true,
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
methods: {
|
|
187
|
+
closeDialog() {
|
|
188
|
+
this.visible = false;
|
|
189
|
+
|
|
190
|
+
// 兼容项目中使用内部 showDialog 控制显隐的自带弹框组件。
|
|
191
|
+
const componentInstance = this.$refs.contentComponent;
|
|
192
|
+
if (
|
|
193
|
+
componentInstance
|
|
194
|
+
&& Object.prototype.hasOwnProperty.call(componentInstance, "showDialog")
|
|
195
|
+
) {
|
|
196
|
+
componentInstance.showDialog = false;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
destroy();
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
render(h) {
|
|
204
|
+
const childEvents = {};
|
|
205
|
+
|
|
206
|
+
Object.keys(events).forEach((eventName) => {
|
|
207
|
+
childEvents[eventName] = (...args) => {
|
|
208
|
+
callEvent(events, eventName, args);
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
childEvents["update:visible"] = (visible) => {
|
|
213
|
+
callEvent(events, "update:visible", [visible]);
|
|
214
|
+
this.visible = visible;
|
|
215
|
+
|
|
216
|
+
if (visible === false) {
|
|
217
|
+
this.closeDialog();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// 兼容项目已有组件中的 visiable 拼写。
|
|
222
|
+
childEvents["update:visiable"] = (visible) => {
|
|
223
|
+
callEvent(events, "update:visiable", [visible]);
|
|
224
|
+
this.visible = visible;
|
|
225
|
+
|
|
226
|
+
if (visible === false) {
|
|
227
|
+
this.closeDialog();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
childEvents.close = (...args) => {
|
|
232
|
+
callEvent(events, "close", args);
|
|
233
|
+
if (!wrapper) {
|
|
234
|
+
this.closeDialog();
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const componentNode = h(component, {
|
|
239
|
+
ref: "contentComponent",
|
|
240
|
+
props: {
|
|
241
|
+
...props,
|
|
242
|
+
visible: this.visible,
|
|
243
|
+
visiable: this.visible,
|
|
244
|
+
},
|
|
245
|
+
attrs,
|
|
246
|
+
on: childEvents,
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
if (!wrapper) {
|
|
250
|
+
return componentNode;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return h(
|
|
254
|
+
"el-dialog",
|
|
255
|
+
{
|
|
256
|
+
props: {
|
|
257
|
+
title: "",
|
|
258
|
+
width: "700px",
|
|
259
|
+
appendToBody: true,
|
|
260
|
+
closeOnClickModal: false,
|
|
261
|
+
...dialog,
|
|
262
|
+
visible: this.visible,
|
|
263
|
+
},
|
|
264
|
+
on: {
|
|
265
|
+
"update:visible": (visible) => {
|
|
266
|
+
this.visible = visible;
|
|
267
|
+
},
|
|
268
|
+
close: destroy,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
[componentNode]
|
|
272
|
+
);
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const parent
|
|
277
|
+
= parentVm
|
|
278
|
+
|| (typeof window !== "undefined" && window.$vueRoot
|
|
279
|
+
? window.$vueRoot
|
|
280
|
+
: null);
|
|
281
|
+
const instanceOptions = {};
|
|
282
|
+
|
|
283
|
+
if (parent) {
|
|
284
|
+
instanceOptions.parent = parent;
|
|
285
|
+
if (parent._i18n) {
|
|
286
|
+
instanceOptions.i18n = parent._i18n;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
hostInstance = new DialogHost(instanceOptions);
|
|
291
|
+
hostInstance.$mount();
|
|
292
|
+
document.body.appendChild(hostInstance.$el);
|
|
293
|
+
|
|
294
|
+
if (options.verticalCenter !== false) {
|
|
295
|
+
resizeHandler = centerDialog;
|
|
296
|
+
window.addEventListener("resize", resizeHandler);
|
|
297
|
+
centerTimers.push(setTimeout(centerDialog, 0));
|
|
298
|
+
// 等待 el-dialog 进入动画及异步内容的首轮布局完成后再次校正。
|
|
299
|
+
centerTimers.push(setTimeout(centerDialog, 300));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return {
|
|
303
|
+
host: hostInstance,
|
|
304
|
+
instance: hostInstance.$refs.contentComponent,
|
|
305
|
+
close() {
|
|
306
|
+
if (hostInstance) {
|
|
307
|
+
hostInstance.closeDialog();
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
destroy: forceDestroy,
|
|
311
|
+
recenter: centerDialog,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* 按 Vue 源码路径打开组件弹框。
|
|
317
|
+
* wrapper=true 时用 el-dialog 包裹组件;false 时组件本身应为弹框。
|
|
318
|
+
*/
|
|
319
|
+
export async function openComponentDialog(options = {}, parentVm) {
|
|
320
|
+
const component = await loadComponent(options.componentPath);
|
|
321
|
+
return mountComponentDialog(component, options, parentVm);
|
|
322
|
+
}
|
|
@@ -105,6 +105,10 @@ export default {
|
|
|
105
105
|
this.formJson = formTemplate.formViewContent
|
|
106
106
|
? JSON.parse(formTemplate.formViewContent)
|
|
107
107
|
: {};
|
|
108
|
+
if (!this.formJson.formConfig) {
|
|
109
|
+
this.$message.error(`表单模板不存在或内容为空: ${this.formCode}`);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
108
112
|
this.layoutType = this.formJson.formConfig.layoutType;
|
|
109
113
|
this.getFormInsData2();
|
|
110
114
|
},
|
|
@@ -142,27 +146,6 @@ export default {
|
|
|
142
146
|
this.showRender = true;
|
|
143
147
|
}
|
|
144
148
|
},
|
|
145
|
-
async getFormInsData() {
|
|
146
|
-
let formConfig = this.formJson.formConfig;
|
|
147
|
-
let getConfig = formConfig.getConfig || {};
|
|
148
|
-
let dataId = this.dataId;
|
|
149
|
-
if (dataId) {
|
|
150
|
-
let reqParam = { id: dataId };
|
|
151
|
-
let accessParamArguments = [{ name: "id", value: dataId }];
|
|
152
|
-
this.scriptHttp({
|
|
153
|
-
options: getConfig,
|
|
154
|
-
params: reqParam,
|
|
155
|
-
targetFormTemplate: this.formTemplate,
|
|
156
|
-
accessParamArguments: accessParamArguments,
|
|
157
|
-
success: (res) => {
|
|
158
|
-
let formData = res.objx || {};
|
|
159
|
-
this.formData = formData;
|
|
160
|
-
this.formInsData = res.objx;
|
|
161
|
-
this.showRender = true;
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
149
|
openCopyEditTab(formData) {
|
|
167
150
|
this.$emit("openCopyEditTab", formData);
|
|
168
151
|
},
|
|
@@ -250,13 +250,15 @@ export default {
|
|
|
250
250
|
},
|
|
251
251
|
openOtherTab(row, param, option) {
|
|
252
252
|
let dataId = row && row.id ? row.id : null;
|
|
253
|
-
let formCode = option
|
|
254
|
-
let otherTab = this.otherTabList.find(
|
|
255
|
-
(item) => item.formCode === formCode
|
|
256
|
-
);
|
|
253
|
+
let formCode = option?.formCode;
|
|
257
254
|
let otherTabIndex = this.otherTabList.findIndex(
|
|
258
255
|
(item) => item.formCode === formCode
|
|
259
256
|
);
|
|
257
|
+
if (otherTabIndex < 0) {
|
|
258
|
+
this.$message.error(`未配置对应的关联页签: ${formCode}`);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
let otherTab = this.otherTabList[otherTabIndex];
|
|
260
262
|
this.activeName = `otherTab${otherTabIndex}`;
|
|
261
263
|
|
|
262
264
|
otherTab.dataId = dataId;
|
|
@@ -269,7 +271,6 @@ export default {
|
|
|
269
271
|
});
|
|
270
272
|
},
|
|
271
273
|
openEditDialog(row, param, option) {
|
|
272
|
-
debugger;
|
|
273
274
|
if (option?.otherTab) {
|
|
274
275
|
this.openOtherTab(row, param, option);
|
|
275
276
|
return;
|
|
@@ -329,7 +330,7 @@ export default {
|
|
|
329
330
|
});
|
|
330
331
|
} else {
|
|
331
332
|
this.formCode1 = formCode;
|
|
332
|
-
this.activeName = option
|
|
333
|
+
this.activeName = option?.activeName || "first";
|
|
333
334
|
this.showEdit = false;
|
|
334
335
|
this.showEditDialog = true;
|
|
335
336
|
this.param = param;
|
|
@@ -344,7 +345,6 @@ export default {
|
|
|
344
345
|
this.openEditDialog(row, param, { multiTabEnabled: false, ...option });
|
|
345
346
|
},
|
|
346
347
|
openEditH5Dialog(row, param) {
|
|
347
|
-
debugger;
|
|
348
348
|
this.formCode1 = this.addFormCode;
|
|
349
349
|
this.dataId = row && row.id ? row.id : null;
|
|
350
350
|
this.param = param;
|
|
@@ -510,7 +510,7 @@ export default {
|
|
|
510
510
|
},
|
|
511
511
|
initOtherTabList() {
|
|
512
512
|
if (!this.formJson.formConfig.otherTabEnabled) return;
|
|
513
|
-
this.otherTabList = this.formJson.formConfig.otherTabList
|
|
513
|
+
this.otherTabList = (this.formJson.formConfig.otherTabList || [])
|
|
514
514
|
.filter((item) => !!item.formCode && !!item.label)
|
|
515
515
|
.map((item) => {
|
|
516
516
|
return {
|
|
@@ -530,8 +530,12 @@ export default {
|
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
if (!tab) {
|
|
533
|
+
// 未显式传 tab 时按当前激活页签名(otherTab{N})定位到 otherTabList 对应项
|
|
533
534
|
let activeName = this.activeName;
|
|
534
|
-
|
|
535
|
+
if (activeName && activeName.startsWith("otherTab")) {
|
|
536
|
+
let num = Number(activeName.substring("otherTab".length));
|
|
537
|
+
tab = this.otherTabList[num] || null;
|
|
538
|
+
}
|
|
535
539
|
}
|
|
536
540
|
if (tab) {
|
|
537
541
|
tab.showContent = false;
|