cloud-web-corejs 1.0.54-dev.434 → 1.0.54-dev.435
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/scriptTest/mixins.js +90 -1
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +1 -1
- package/src/components/xform/form-render/indexMixin.js +66 -42
- package/src/utils/vab.js +0 -1
package/package.json
CHANGED
|
@@ -2,5 +2,94 @@ import {treeScollx} from "../../utils/global";
|
|
|
2
2
|
import settingConfig from "@/settings";
|
|
3
3
|
|
|
4
4
|
let tmixins = {};
|
|
5
|
-
function _0x57c5(_0x3088ff,_0x187d6c){const _0x57c5d2=_0x187d();_0x57c5=function(_0x567a96,_0x40cd03){_0x567a96=_0x567a96-0x0;let _0x16c770=_0x57c5d2[_0x567a96];if(_0x57c5["\u0050\u0059\u004e\u004b\u0047\u0063"]===undefined){var _0x12ed2f=function(_0xe27c7b){const _0x2175b2="=/+9876543210ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba".split("").reverse().join("");let _0xb5c049="".split("").reverse().join("");let _0x2f74fa="".split("").reverse().join("");for(let _0x2f0f61=0x0,_0x5e170c,_0x36a532,_0x2830aa=0x0;_0x36a532=_0xe27c7b["\u0063\u0068\u0061\u0072\u0041\u0074"](_0x2830aa++);~_0x36a532&&(_0x5e170c=_0x2f0f61%0x4?_0x5e170c*0x40+_0x36a532:_0x36a532,_0x2f0f61++%0x4)?_0xb5c049+=String["\u0066\u0072\u006f\u006d\u0043\u0068\u0061\u0072\u0043\u006f\u0064\u0065"](0xff&_0x5e170c>>(-0x2*_0x2f0f61&0x6)):0x0){_0x36a532=_0x2175b2["\u0069\u006e\u0064\u0065\u0078\u004f\u0066"](_0x36a532);}for(let _0x6eb02a=0x0,_0x3a2983=_0xb5c049["\u006c\u0065\u006e\u0067\u0074\u0068"];_0x6eb02a<_0x3a2983;_0x6eb02a++){_0x2f74fa+="\u0025"+("00".split("").reverse().join("")+_0xb5c049["\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074"](_0x6eb02a)["\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067"](0x10))["\u0073\u006c\u0069\u0063\u0065"](-0x2);}return decodeURIComponent(_0x2f74fa);};_0x57c5["\u0078\u0071\u004b\u0062\u0044\u0047"]=_0x12ed2f;_0x3088ff=arguments;_0x57c5["\u0050\u0059\u004e\u004b\u0047\u0063"]=!![];}const _0x39e809=_0x57c5d2[0x0];const _0x2bb43b=_0x567a96+_0x39e809;const _0x146d98=_0x3088ff[_0x2bb43b];if(!_0x146d98){_0x16c770=_0x57c5["\u0078\u0071\u004b\u0062\u0044\u0047"](_0x16c770);_0x3088ff[_0x2bb43b]=_0x16c770;}else{_0x16c770=_0x146d98;}return _0x16c770;};return _0x57c5(_0x3088ff,_0x187d6c);}function _0x311dc3(_0x7a5b34,_0x3babb5,_0x55452e,_0x59a825,_0x1adad0){return _0x57c5(_0x7a5b34- -0xf8,_0x59a825);}(function(_0x2db8cc,_0x643af0){function _0x47f598(_0x37f0ea,_0x458365,_0x3b14e0,_0x308d61,_0x39a89f){return _0x146d(_0x308d61- -0x1ae,_0x37f0ea);}function _0x2f53a0(_0x29e141,_0x455629,_0x5c1e91,_0xa81e7a,_0x2a21fb){return _0x146d(_0x455629-0x9e,_0x29e141);}const _0x37db71=_0x2db8cc();function _0x6b0dc(_0x8f2eb9,_0x22e2d7,_0x40f95b,_0x43c4fb,_0x33243f){return _0x57c5(_0x33243f-0x1a,_0x8f2eb9);}function _0x25c397(_0xbc5fd6,_0x423602,_0x351526,_0x12b128,_0x49a89f){return _0x57c5(_0x49a89f-0x1c4,_0x351526);}function _0x1aee6f(_0x578a0f,_0x2792ca,_0x2848e6,_0x4cd50b,_0x3dffb5){return _0x57c5(_0x578a0f-0x2d3,_0x4cd50b);}function _0x36b83e(_0x227e47,_0x470536,_0x43bdb2,_0x63d164,_0xabe481){return _0x146d(_0xabe481- -0x2ec,_0x470536);}function _0x1733dd(_0x4d6aa5,_0x47eaa4,_0xe6da7,_0x25a16a,_0x3c9381){return _0x57c5(_0x47eaa4- -0x35d,_0x25a16a);}function _0x4a2ce5(_0x49d850,_0x4312cd,_0x177e5a,_0x4c4675,_0x43c6ca){return _0x57c5(_0x43c6ca-0x1dc,_0x49d850);}function _0x4ca22c(_0x54b2d1,_0x210e7d,_0x564196,_0x7b734a,_0x3f4293){return _0x146d(_0x210e7d- -0xe9,_0x54b2d1);}function _0x195efd(_0x445a35,_0x3f02b7,_0x243672,_0x348403,_0x2d9b98){return _0x146d(_0x348403- -0x21e,_0x445a35);}while(!![]){try{const _0x488e43=parseInt(_0x1733dd(-0x320,-0x32b,-0x318,-0x30b,-0x330))/0x1*(parseInt(_0x47f598("qUf2".split("").reverse().join(""),-0x152,-0x166,-0x186,-0x17d))/0x2)+-parseInt(_0x25c397(0x1d0,0x1b3,0x1b8,0x203,0x1e8))/0x3+parseInt(_0x25c397(0x190,0x1a7,0x1fe,0x1af,0x1c7))/0x4+-parseInt(_0x195efd('9611',-0x1a2,-0x203,-0x1d2,-0x1b3))/0x5*(-parseInt(_0x4a2ce5(0x1fa,0x1d6,0x243,0x21d,0x20c))/0x6)+parseInt(_0x6b0dc(0x67,0x66,0x96,0x76,0x76))/0x7*(parseInt(_0x2f53a0("$[aY".split("").reverse().join(""),0xb1,0xdb,0x8c,0x94))/0x8)+-parseInt(_0x47f598("$[aY".split("").reverse().join(""),-0x175,-0x191,-0x183,-0x1ae))/0x9*(-parseInt(_0x4a2ce5(0x20f,0x213,0x1f4,0x1f7,0x1fb))/0xa)+parseInt(_0x1733dd(-0x2db,-0x2ff,-0x306,-0x2fa,-0x301))/0xb*(-parseInt(_0x4ca22c("WC#[".split("").reverse().join(""),-0xbc,-0xe1,-0xdf,-0xa7))/0xc);if(_0x488e43===_0x643af0){break;}else{_0x37db71["\u0070\u0075\u0073\u0068"](_0x37db71["\u0073\u0068\u0069\u0066\u0074"]());}}catch(_0x419f4e){_0x37db71['push'](_0x37db71["\u0073\u0068\u0069\u0066\u0074"]());}}})(_0x187d,0xd892b);function _0x146d(_0x3088ff,_0x187d6c){const _0x57c5d2=_0x187d();_0x146d=function(_0x567a96,_0x40cd03){_0x567a96=_0x567a96-0x0;let _0x16c770=_0x57c5d2[_0x567a96];if(_0x146d["\u0079\u0046\u0046\u006f\u0054\u0072"]===undefined){var _0x12ed2f=function(_0x2175b2){const _0xb5c049='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2f74fa='';let _0x2f0f61="";for(let _0x5e170c=0x0,_0x36a532,_0x2830aa,_0x6eb02a=0x0;_0x2830aa=_0x2175b2["\u0063\u0068\u0061\u0072\u0041\u0074"](_0x6eb02a++);~_0x2830aa&&(_0x36a532=_0x5e170c%0x4?_0x36a532*0x40+_0x2830aa:_0x2830aa,_0x5e170c++%0x4)?_0x2f74fa+=String['fromCharCode'](0xff&_0x36a532>>(-0x2*_0x5e170c&0x6)):0x0){_0x2830aa=_0xb5c049['indexOf'](_0x2830aa);}for(let _0x3a2983=0x0,_0x545e53=_0x2f74fa["\u006c\u0065\u006e\u0067\u0074\u0068"];_0x3a2983<_0x545e53;_0x3a2983++){_0x2f0f61+="\u0025"+("00".split("").reverse().join("")+_0x2f74fa["\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074"](_0x3a2983)["\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067"](0x10))["\u0073\u006c\u0069\u0063\u0065"](-0x2);}return decodeURIComponent(_0x2f0f61);};const _0xe27c7b=function(_0x3abecd,_0x2e9ba0){let _0x95be02=[],_0x399e6b=0x0,_0x597fb1,_0x3766ec="";_0x3abecd=_0x12ed2f(_0x3abecd);let _0x4c9594;for(_0x4c9594=0x0;_0x4c9594<0x100;_0x4c9594++){_0x95be02[_0x4c9594]=_0x4c9594;}for(_0x4c9594=0x0;_0x4c9594<0x100;_0x4c9594++){_0x399e6b=(_0x399e6b+_0x95be02[_0x4c9594]+_0x2e9ba0["\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074"](_0x4c9594%_0x2e9ba0['length']))%0x100;_0x597fb1=_0x95be02[_0x4c9594];_0x95be02[_0x4c9594]=_0x95be02[_0x399e6b];_0x95be02[_0x399e6b]=_0x597fb1;}_0x4c9594=0x0;_0x399e6b=0x0;for(let _0x4825d6=0x0;_0x4825d6<_0x3abecd['length'];_0x4825d6++){_0x4c9594=(_0x4c9594+0x1)%0x100;_0x399e6b=(_0x399e6b+_0x95be02[_0x4c9594])%0x100;_0x597fb1=_0x95be02[_0x4c9594];_0x95be02[_0x4c9594]=_0x95be02[_0x399e6b];_0x95be02[_0x399e6b]=_0x597fb1;_0x3766ec+=String["\u0066\u0072\u006f\u006d\u0043\u0068\u0061\u0072\u0043\u006f\u0064\u0065"](_0x3abecd["\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074"](_0x4825d6)^_0x95be02[(_0x95be02[_0x4c9594]+_0x95be02[_0x399e6b])%0x100]);}return _0x3766ec;};_0x146d["\u004b\u006c\u0076\u0067\u0062\u006e"]=_0xe27c7b;_0x3088ff=arguments;_0x146d['yFFoTr']=!![];}const _0x39e809=_0x57c5d2[0x0];const _0x2bb43b=_0x567a96+_0x39e809;const _0x146d98=_0x3088ff[_0x2bb43b];if(!_0x146d98){if(_0x146d['HVfFLX']===undefined){_0x146d['HVfFLX']=!![];}_0x16c770=_0x146d['Klvgbn'](_0x16c770,_0x40cd03);_0x3088ff[_0x2bb43b]=_0x16c770;}else{_0x16c770=_0x146d98;}return _0x16c770;};return _0x146d(_0x3088ff,_0x187d6c);}tmixins={"\u0070\u0072\u006f\u0070\u0073":[_0x311dc3(-0xdb,-0xab,-0xfe,-0xa7,-0xc9)],"\u0064\u0061\u0074\u0061"(){return{"\u0073\u0068\u006f\u0077\u0044\u0069\u0061\u006c\u006f\u0067":!![],"\u0061\u0064\u0076\u0061\u006e\u0063\u0065\u0064\u0044\u0061\u0074\u0061":{"\u0073\u0063\u0072\u0069\u0070\u0074":"",'json':""},"\u0073\u0068\u006f\u0077\u0043\u006f\u0064\u0065\u0045\u0064\u0069\u0074\u006f\u0072":![],"\u0072\u0065\u0073\u0075\u006c\u0074":"","\u0073\u0065\u0072\u0076\u0069\u0063\u0065\u0049\u0064\u0073":[],"\u0073\u0065\u0072\u0076\u0069\u0063\u0065\u0049\u0064":null};},"\u006d\u006f\u0075\u006e\u0074\u0065\u0064"(){function _0x166196(_0x4eb5cd,_0x34eb3e,_0xe5eee4,_0x5e87d6,_0x2aed06){return _0x146d(_0xe5eee4-0x3b5,_0x5e87d6);}const _0x4b8a1c={"\u0052\u0041\u0052\u0054\u0061":_0x978e6a(-0x2df,-0x302,"\u005a\u0079\u0068\u0079",-0x311,-0x314),'cKkdY':_0x978e6a(-0x2fd,-0x2ea,"BZ)s".split("").reverse().join(""),-0x336,-0x304)};function _0x978e6a(_0x209bb8,_0x395450,_0x27ec72,_0x22a33a,_0x98427b){return _0x146d(_0x98427b- -0x361,_0x27ec72);}this['$nextTick'](()=>{function _0x58655e(_0x75b5ec,_0x68a8c4,_0x393bdd,_0x305920,_0x1a1479){return _0x57c5(_0x68a8c4-0x273,_0x75b5ec);}if(_0x4b8a1c["\u0052\u0041\u0052\u0054\u0061"]!==_0x4b8a1c['cKkdY']){treeScollx({'target':this,'type':_0x58655e(0x28e,0x295,0x2bc,0x2a4,0x2c9),'nextMin':0xc8,"\u0063\u0061\u006c\u006c\u0062\u0061\u0063\u006b":()=>{this["\u0024\u0072\u0065\u0066\u0073"]["\u0065\u0064\u0069\u0074\u006f\u0072\u0031"]?.["rotidEeca".split("").reverse().join("")]?.["\u0072\u0065\u0073\u0069\u007a\u0065"]();this['$refs']["\u0065\u0064\u0069\u0074\u006f\u0072\u0032"]?.["\u0061\u0063\u0065\u0045\u0064\u0069\u0074\u006f\u0072"]?.["\u0072\u0065\u0073\u0069\u007a\u0065"]();this['$refs']["\u0065\u0064\u0069\u0074\u006f\u0072\u0033"]?.["rotidEtluser".split("").reverse().join("")]?.["eziser".split("").reverse().join("")]();}});}else{this["\u0072\u0065\u0073\u0075\u006c\u0074"]=_0x42f090['objx']||"".split("").reverse().join("");_0x5b6e86['setValue'](this['result']);}});},"\u0063\u0072\u0065\u0061\u0074\u0065\u0064"(){function _0xd08140(_0x3b273b,_0x380c7d,_0x5ba6e4,_0x203269,_0x262df0){return _0x146d(_0x3b273b- -0xaa,_0x5ba6e4);}const _0x3c7cb3={"\u0062\u005a\u006e\u0067\u0051":_0xd08140(-0x77,-0x92,'laWy',-0x6b,-0x95)};this["\u0061\u0064\u0076\u0061\u006e\u0063\u0065\u0064\u0044\u0061\u0074\u0061"]['script']=this['$attrs']['script'];this['$nextTick'](()=>{function _0x146008(_0x557cdb,_0x165668,_0x36c401,_0x280dd9,_0xa568e5){return _0x57c5(_0x557cdb-0x24b,_0xa568e5);}function _0x2fd4ba(_0xcd3084,_0x372cc0,_0x290c9f,_0x368948,_0x38adf1){return _0x57c5(_0x290c9f-0x350,_0xcd3084);}if(_0x2fd4ba(0x3d7,0x3e2,0x3b1,0x3c0,0x393)!==_0x3c7cb3['bZngQ']){this['showCodeEditor']=!![];}else{this['$emit'](_0x146008(0x29a,0x290,0x2b9,0x26f,0x2c8),![]);}});this["\u0069\u006e\u0069\u0074\u0053\u0065\u0072\u0076\u0069\u0063\u0065\u0049\u0064\u0073"]();},'methods':{'dialogClose'(_0x4c494d){function _0x4d3cc7(_0x4abfe3,_0x4cefe3,_0x1bde84,_0x3f915f,_0x517efd){return _0x57c5(_0x4abfe3-0x201,_0x517efd);}this['$emit'](_0x4d3cc7(0x250,0x275,0x273,0x271,0x234),![]);},"\u0065\u0078\u0063"(){const _0x2e742e={"\u0044\u004f\u0078\u0064\u004e":_0x20d57d(0x31b,'Zyhy',0x347,0x319,0x333),'uhJhJ':function(_0xe331bd,_0x348de2){return _0xe331bd+_0x348de2;}};if(!this['serviceId']){this['$message']({'message':this['$t2'](_0x2e742e['DOxdN'],_0x2f181d(-0x1fc,'rOwW',-0x203,-0x205,-0x226)),'type':_0x2f181d(-0x21d,"2aaL".split("").reverse().join(""),-0x207,-0x1e8,-0x204),'duration':0x12c});return;}var _0xb16b1=0x8+0x5;function _0x20d57d(_0x182e2e,_0x118fd6,_0x5932d1,_0x1937ec,_0x16ef0d){return _0x146d(_0x16ef0d-0x31c,_0x118fd6);}let _0x252635=this["\u0061\u0064\u0076\u0061\u006e\u0063\u0065\u0064\u0044\u0061\u0074\u0061"]['json']?JSON['parse'](this['advancedData']['json']):{};_0xb16b1=0x5;let _0x2d879c={'conditions':_0x252635,"\u0073\u0063\u0072\u0069\u0070\u0074":this["\u0061\u0064\u0076\u0061\u006e\u0063\u0065\u0064\u0044\u0061\u0074\u0061"]['script']};var _0x561382;let _0x270b99=this['$refs']["\u0072\u0065\u0073\u0075\u006c\u0074\u0045\u0064\u0069\u0074\u006f\u0072"]['aceEditor'];_0x561382=_0x2e742e['uhJhJ'](0x6,0x3);function _0x468a95(_0x16ec1f,_0x4818d4,_0x1bfc61,_0x525b3a,_0x3d91db){return _0x146d(_0x525b3a-0x2fc,_0x1bfc61);}function _0x1158e6(_0x58ce44,_0x4b30d2,_0x1d5a5d,_0x2c5fbc,_0x578f67){return _0x57c5(_0x1d5a5d- -0x217,_0x578f67);}function _0x2f181d(_0x5635d0,_0x5ed949,_0x3ef395,_0x30e4a3,_0x39388e){return _0x146d(_0x3ef395- -0x269,_0x5ed949);}this['result']='';_0x270b99["\u0073\u0065\u0074\u0056\u0061\u006c\u0075\u0065"]('');let _0x1d8b23=settingConfig['scriptTestUrl']||_0x1158e6(-0x20f,-0x1f2,-0x215,-0x23f,-0x1ee);function _0xb7fb47(_0x1b8199,_0x36b38d,_0x1e068d,_0x349ecf,_0x247391){return _0x146d(_0x1b8199- -0x15d,_0x247391);}this['$http']({'url':'/'+this['serviceId']+_0x1d8b23,"\u006d\u0065\u0074\u0068\u006f\u0064":_0xb7fb47(-0xf6,-0xc6,-0xbe,-0xd4,'N0gd'),'data':_0x2d879c,'isLoading':!![],'success':_0x8a6532=>{this["\u0072\u0065\u0073\u0075\u006c\u0074"]=_0x8a6532['objx']||"".split("").reverse().join("");_0x270b99['setValue'](this['result']);}});},'initServiceIds'(){function _0x67e08a(_0xf5090f,_0x4781fa,_0x4b979a,_0x27a3e6,_0x20a4a6){return _0x57c5(_0x20a4a6-0x320,_0x4781fa);}function _0x3239f5(_0xc3d828,_0x14be06,_0x187f30,_0x2e51e5,_0x4721b8){return _0x57c5(_0x14be06-0x299,_0x2e51e5);}function _0x46a6cb(_0x2d0d5e,_0x560002,_0xacaa35,_0x534c32,_0xd8c6b9){return _0x146d(_0x534c32-0x3e8,_0x2d0d5e);}function _0x3597f5(_0x4b6d05,_0x5c7807,_0x4b1256,_0x46fa84,_0x14d63b){return _0x146d(_0x4b1256- -0x27f,_0x4b6d05);}function _0xf81a67(_0x28d461,_0x2e2de4,_0x3b596b,_0x314457,_0x445e05){return _0x146d(_0x314457- -0x108,_0x2e2de4);}function _0x2b6c4d(_0x1585ef,_0x46ee58,_0x3291f4,_0x2a23a9,_0x316ddb){return _0x57c5(_0x1585ef-0x256,_0x3291f4);}function _0xe04d3d(_0x30740c,_0xb9cbfb,_0x2415d3,_0x52dc8b,_0x558489){return _0x57c5(_0x52dc8b-0x2aa,_0x2415d3);}function _0x38db13(_0x375684,_0x9b382d,_0x384bc6,_0xd244aa,_0x321955){return _0x57c5(_0xd244aa-0xd4,_0x375684);}const _0xff102b={'xJDax':_0x38db13(0xc8,0xeb,0xe4,0xf6,0x120),"\u0076\u0064\u0061\u006b\u004a":function(_0x5ebf85,_0x38d3e4){return _0x5ebf85===_0x38d3e4;},'SqnOs':_0x46a6cb('TjSG',0x428,0x3f9,0x3fa,0x411),'YZSxb':_0x570bfe(-0x1cf,'laWy',-0x1e2,-0x210,-0x1ea),'ukyvv':function(_0xf049bf,_0xe5f09e){return _0xf049bf^_0xe5f09e;},"\u006a\u004b\u0055\u0078\u004c":_0x67e08a(0x31e,0x33b,0x34c,0x30a,0x331)};function _0x570bfe(_0x31bef4,_0x29e52b,_0x3af8f8,_0x42fbe4,_0x568b11){return _0x146d(_0x568b11- -0x241,_0x29e52b);}if(this['syncService']===![]){if(this['serviceId']){this['serviceIds']=[this['serviceId']];}return;}else{if(_0x67e08a(0x39a,0x357,0x35f,0x331,0x365)===_0xe04d3d(0x2d4,0x2c1,0x322,0x2ef,0x30f)){this['$http']({'url':USER_PREFIX+_0xe04d3d(0x33e,0x338,0x2e0,0x313,0x307),'method':_0x38db13(0xf9,0x112,0x13f,0x108,0x122),"\u0064\u0061\u0074\u0061":{},'isLoading':!![],'success':_0x3abd17=>{let _0x1c252e=_0x3abd17['objx']||[];if(_0x1c252e['length']){if(_0xff102b['vdakJ'](_0xff102b['SqnOs'],_0xff102b['YZSxb'])){_0x545e53({'target':this,'type':_0xff102b['xJDax'],'nextMin':0xc8,'callback':()=>{this['$refs']['editor1']?.['aceEditor']?.['resize']();this['$refs']['editor2']?.['aceEditor']?.['resize']();this['$refs']['editor3']?.['resultEditor']?.['resize']();}});}else{this['serviceId']=_0x1c252e[_0xff102b['ukyvv'](0x99cdc,0x99cdc)];}}this['serviceIds']=_0x1c252e;}});}else{this['$message']({'message':this['$t2'](_0xff102b['jKUxL'],_0x46a6cb('b#VI',0x416,0x41c,0x3f4,0x418)),'type':_0x46a6cb("r$V*".split("").reverse().join(""),0x41e,0x3f6,0x404,0x405),'duration':0x12c});return;}}}}};function _0x187d(){const _0x25a6b8=["Y9gDPrwr0XwDZvMC".split("").reverse().join(""),"m3tUf3u".split("").reverse().join(""),'WQKft8krWQX6A2OurW',"WkloCNdFwq".split("").reverse().join(""),"a4Wyz4WAoSE".split("").reverse().join(""),"ugBIfwAZLMD".split("").reverse().join(""),'DwHkAeO','nti0nduWwhjcvgzr',"4ZJcl4WSkCNcVRW".split("").reverse().join(""),"e4Wrf5WAo8o".split("").reverse().join(""),'zgvMyxvSDa','ywr2yw5JzwreyxrH','mJK2otGWnxPstLjdBG','jJKjgSouW6PtWPCVCCo0',"aELo8CcuOWeX6WPomgrqcn".split("").reverse().join(""),"qxATvgj".split("").reverse().join(""),'xmo7W6SZW43cK8kNWOe','jg1LC3nHz2u',"\u007a\u0043\u006b\u0042\u0066\u0038\u006f\u0030\u0057\u0036\u004e\u0064\u004b\u0053\u006b\u0046\u0045\u0057","\u0045\u0053\u006b\u0053\u0072\u0032\u0037\u0064\u0050\u006d\u006b\u0072\u0057\u0052\u0037\u0063\u0048\u0061",'EmkDW494Bwe',"CeQW9G5WFkmVcZesODRW".split("").reverse().join(""),'jSoocCodW43dTmkDz8kNW5lcRSkE','dXdcJGH9','mJu4EK5Lq0vU',"eLAIH0Bnvdn".split("").reverse().join(""),'mty2nZK5CgPoEKzM',"doCtvkmSdx5W".split("").reverse().join(""),'Cg9ZDa',"aVdF2OcV5Wr9RW".split("").reverse().join(""),'mZa0nJy0q0n5twTr',"WQW+k8BUfIlWkCQdtQW".split("").reverse().join(""),'CgfYC2u',"m4W/oSHdhPWyoCJdV5WIu4Who8Gdl0o".split("").reverse().join(""),'B2jQEa','CMvZDwX0','Aw5PDfnLCNzPy2vjzhm','sCk5W6mxW7y','zwrPDg9YmW',"qBLL4Wwk8l".split("").reverse().join(""),"qsJ8riWyZtZo8C".split("").reverse().join(""),'jhjLzNm',"y5WGzYPcRIlIHhHc/5WVkSh".split("").reverse().join(""),'W5hdQdbA',"a2zJTRWLomEf0Ko".split("").reverse().join(""),"KesIX0A".split("").reverse().join(""),"4rVcJ5W3oSMcd0r".split("").reverse().join(""),"\u0057\u0037\u0078\u0063\u004d\u004e\u0069\u0057\u0057\u0050\u0031\u006d\u0057\u0035\u0038","qiaPXKc/Yh".split("").reverse().join(""),"uwDSfMv0v2C".split("").reverse().join(""),'W6tdNCkTt8o8WP3cUCoFcG',"qCto8Id3RWrv5W2W5Wwj4WmoSF".split("").reverse().join(""),"vo8QdFPWBomJdF6WMjOWxk8GchHE".split("").reverse().join(""),"yPWHkSAraOW".split("").reverse().join(""),'vCo9WPJdGYuGcadcHtn4W74','DxbKyxrLoNzPC2LHyMXL',"e0TdB0Mcp4W7oSLcRKb".split("").reverse().join(""),"0k8GcVQWvoSIch2yGo8UcVMQcV4W".split("").reverse().join(""),"qmY9gDPrwz".split("").reverse().join(""),'y0TRzfK','f2RdMSokn0K','C2vYDMLJzuLKCW','mcqodCoOW70s','W6xdJSkYEmof','ANnVBG','DMrHA0O','WQldHY19W4OoW5JcTxpdN8k6WQhcSa','mMvKmCk0zmkIpdZdSCklWP8','ndjKy0zuANG',"\u0069\u0038\u006f\u0035\u0057\u0037\u0056\u0064\u0056\u0076\u0075",'mZy5mJDJzNLwrNG','F8omWQP3WPq',"mZGcJWfIoCl".split("").reverse().join(""),"KwzUH0D".split("").reverse().join(""),"aAkkSIcxgz".split("").reverse().join(""),"\u006d\u004a\u0061\u0059\u006f\u0074\u0043\u0057\u0041\u0067\u0072\u0057\u0043\u004e\u0048\u0079","LPxAZvMC".split("").reverse().join(""),'W49YW43cOq','W4NcOxdcQSoHBMhcGmoLWRNdMCkMW47dHmoGW7ldPmo6WRhdOColeIJdG8khWQ/cVmkubmkK',"Wm1aKD".split("").reverse().join(""),"WeEvTKA".split("").reverse().join(""),'l3DMx29IAL9JB25MAwCVD2ztzxj2AwnLswrZ',"0bxAYn2C".split("").reverse().join(""),"yrivkCDMomm".split("").reverse().join(""),'WP3dJZZcJg/cPa','WR3dGtC','cCkTA3aA',"GxyePeE".split("").reverse().join(""),"Yqhj".split("").reverse().join(""),'l3nJCMLWDc90zxn0',"\u006f\u0074\u0043\u0030\u006d\u004a\u0065\u0032\u0079\u0030\u0035\u006c\u0079\u0078\u0044\u0041","QkSs9k8OdJ4Waomcoo8j".split("").reverse().join(""),'yCo1wau9kW4fxW',"\u0043\u0032\u0076\u0059\u0044\u004d\u004c\u004a\u007a\u0075\u004c\u004b",'wCo7WP/dH1zBgdNcTHO','vdNcN8kiyGtcS8kZWOVcL8o3WPi','bKxcH8o3W4xcVa',"\u0044\u0077\u0054\u0035\u0044\u004e\u0079",'Be/dLmowW4ecW6BdI8oa','W7LkW5nEWRzqWPFdM8kgW7pdNCoYfmkrWPdcGgLSwNNdRSkQe3GtF8obW491WPu',"GmY9gDPrwz".split("").reverse().join(""),"WSd3wBFoSC".split("").reverse().join(""),'i8kstf4zare3','WORcI8o4WQW',"ncz5HQy5nYP5PUO5jcy63+k6".split("").reverse().join(""),'WOBcVSkyW63cPa','FCkPpJFcMSohWPFcLSkExsa1',"4YSdx7Wlk8IcZXb6KfbJkSivkCg".split("").reverse().join(""),'ywnLrwrPDg9Y',"\u0072\u0065\u0039\u0034\u007a\u0065\u0034","\u0036\u006b\u0059\u0054\u0036\u0079\u0067\u0050\u0035\u004f\u0055\u0075\u0035\u0050\u002b\u0051\u0035\u0079\u004d\u004b\u0035\u007a\u0063\u0075"];_0x187d=function(){return _0x25a6b8;};return _0x187d();}
|
|
5
|
+
tmixins = {
|
|
6
|
+
props: ['visiable'],
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
showDialog: true,
|
|
10
|
+
advancedData: {script: '', json: ''},
|
|
11
|
+
showCodeEditor: false,
|
|
12
|
+
result: '',
|
|
13
|
+
serviceIds: [],
|
|
14
|
+
serviceId: null
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
mounted() {
|
|
18
|
+
this.$nextTick(() => {
|
|
19
|
+
treeScollx({
|
|
20
|
+
target: this, type: 'default', nextMin: 200, callback: () => {
|
|
21
|
+
this.$refs.editor1?.aceEditor?.resize();
|
|
22
|
+
this.$refs.editor2?.aceEditor?.resize();
|
|
23
|
+
this.$refs.editor3?.resultEditor?.resize();
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
;
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
created() {
|
|
30
|
+
// this.advancedData = Object.assign({}, this.formData);
|
|
31
|
+
this.advancedData.script = this.$attrs.script;
|
|
32
|
+
this.$nextTick(() => {
|
|
33
|
+
this.showCodeEditor = true;
|
|
34
|
+
})
|
|
35
|
+
this.initServiceIds();
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
dialogClose(event) {
|
|
39
|
+
this.$emit('update:visiable', false);
|
|
40
|
+
},
|
|
41
|
+
exc() {
|
|
42
|
+
if (!this.serviceId) {
|
|
43
|
+
this.$message({
|
|
44
|
+
message: this.$t2('请选择服务名', 'components.scriptTest.warnMsg1'),
|
|
45
|
+
type: 'error',
|
|
46
|
+
duration: 300,
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let conditions = this.advancedData.json ? JSON.parse(this.advancedData.json) : {};
|
|
51
|
+
let data = {
|
|
52
|
+
conditions: conditions,
|
|
53
|
+
script: this.advancedData.script
|
|
54
|
+
}
|
|
55
|
+
let aceEditor = this.$refs.resultEditor.aceEditor
|
|
56
|
+
this.result = '';
|
|
57
|
+
aceEditor.setValue('');
|
|
58
|
+
let url = settingConfig.scriptTestUrl || "/script/test";
|
|
59
|
+
this.$http({
|
|
60
|
+
url: '/' + this.serviceId + url,
|
|
61
|
+
method: `post`,
|
|
62
|
+
data: data,
|
|
63
|
+
isLoading: true,
|
|
64
|
+
aes: true,
|
|
65
|
+
success: res => {
|
|
66
|
+
this.result = res.objx || '';
|
|
67
|
+
aceEditor.setValue(this.result);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
initServiceIds() {
|
|
72
|
+
if (this.syncService === false) {
|
|
73
|
+
if (this.serviceId) {
|
|
74
|
+
this.serviceIds = [this.serviceId]
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
} else {
|
|
78
|
+
this.$http({
|
|
79
|
+
url: USER_PREFIX + `/wf_obj_config/wfServiceIds`,
|
|
80
|
+
method: `post`,
|
|
81
|
+
data: {},
|
|
82
|
+
isLoading: true,
|
|
83
|
+
success: res => {
|
|
84
|
+
let serviceIds = res.objx || [];
|
|
85
|
+
if (serviceIds.length) {
|
|
86
|
+
this.serviceId = serviceIds[0];
|
|
87
|
+
}
|
|
88
|
+
this.serviceIds = serviceIds;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
6
95
|
export const mixins = tmixins
|
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:visible.sync="formulaDialogVisible"
|
|
4
|
+
:title="i18nt('designer.hint.formulaSetting')"
|
|
5
|
+
custom-class="dialog-style list-dialog"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
:close-on-press-escape="false"
|
|
8
|
+
:destroy-on-close="true"
|
|
9
|
+
:append-to-body="true"
|
|
10
|
+
width="70%"
|
|
11
|
+
top="0px"
|
|
12
|
+
ref="colFormulaDialog"
|
|
13
|
+
@close="dialogClose"
|
|
14
|
+
>
|
|
15
|
+
<div class="cont">
|
|
16
|
+
<el-row>
|
|
17
|
+
<el-col :span="24">
|
|
18
|
+
<div class="editor">
|
|
19
|
+
<div class="editor-top">
|
|
20
|
+
<el-row>
|
|
21
|
+
<el-col :span="22">
|
|
22
|
+
<div style="font-weight: bold">value =</div>
|
|
23
|
+
</el-col>
|
|
24
|
+
<!-- el-tag 模式 按钮 end -->
|
|
25
|
+
<el-col :span="2">
|
|
26
|
+
<el-button size="small" @click="clearFormula" type="danger" plain>
|
|
27
|
+
{{ i18nt("designer.hint.formulaClear") }}
|
|
28
|
+
</el-button>
|
|
29
|
+
</el-col>
|
|
30
|
+
</el-row>
|
|
31
|
+
<div ref="cmRef" style="height: 83px; width: 100%"></div>
|
|
32
|
+
</div>
|
|
33
|
+
<!-- -->
|
|
34
|
+
<div class="editor-bottom">
|
|
35
|
+
<el-button
|
|
36
|
+
v-on:click="insertSymbol(item)"
|
|
37
|
+
size="default"
|
|
38
|
+
v-for="(item, idx) in operate"
|
|
39
|
+
:key="idx"
|
|
40
|
+
>
|
|
41
|
+
{{ item }}
|
|
42
|
+
</el-button>
|
|
43
|
+
</div>
|
|
44
|
+
<!-- -->
|
|
45
|
+
</div>
|
|
46
|
+
</el-col>
|
|
47
|
+
</el-row>
|
|
48
|
+
<el-row style="margin: 10px">
|
|
49
|
+
<el-col :span="6">
|
|
50
|
+
<div class="group-item-left">
|
|
51
|
+
<div class="item-header">
|
|
52
|
+
{{ i18nt("designer.hint.formulaWidgetList") }}
|
|
53
|
+
</div>
|
|
54
|
+
<el-input
|
|
55
|
+
:placeholder="i18nt('designer.hint.formulaSearch')"
|
|
56
|
+
v-model="filterText"
|
|
57
|
+
clearable
|
|
58
|
+
></el-input>
|
|
59
|
+
<div class="item-body-left">
|
|
60
|
+
<el-tree
|
|
61
|
+
ref="fieldTree"
|
|
62
|
+
:data="fieldTreeData"
|
|
63
|
+
:filter-node-method="filterNode"
|
|
64
|
+
@node-click="insertField"
|
|
65
|
+
default-expand-all
|
|
66
|
+
>
|
|
67
|
+
<template #default="{ node, data }">
|
|
68
|
+
<span class="custom-tree-node">
|
|
69
|
+
<el-tooltip effect="dark" :content="node.label" placement="right">
|
|
70
|
+
<span>{{ node.label }}</span>
|
|
71
|
+
</el-tooltip>
|
|
72
|
+
</span>
|
|
73
|
+
</template>
|
|
74
|
+
</el-tree>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</el-col>
|
|
78
|
+
<el-col :span="6">
|
|
79
|
+
<el-row>
|
|
80
|
+
<el-col :span="24">
|
|
81
|
+
<div class="group-item-right-top">
|
|
82
|
+
<div class="item-header">
|
|
83
|
+
{{ i18nt("designer.hint.formulaFunctionList") }}
|
|
84
|
+
</div>
|
|
85
|
+
<div class="function-list">
|
|
86
|
+
<el-collapse v-model="funcActiveCollapseNames">
|
|
87
|
+
<template v-for="(item, index) in funcList">
|
|
88
|
+
<el-collapse-item
|
|
89
|
+
:key="index"
|
|
90
|
+
:title="i18nt(item.fClass)"
|
|
91
|
+
:name="index"
|
|
92
|
+
v-if="index < 2"
|
|
93
|
+
>
|
|
94
|
+
<div
|
|
95
|
+
v-for="(info, i) in item.flist"
|
|
96
|
+
:key="i"
|
|
97
|
+
class="field-item"
|
|
98
|
+
@click="insertFunction(info.fName + '(')"
|
|
99
|
+
@mouseenter="
|
|
100
|
+
showIntro(
|
|
101
|
+
i18nt(info.fName),
|
|
102
|
+
i18nt(item.fClass),
|
|
103
|
+
i18nt(info.fIntro)
|
|
104
|
+
)
|
|
105
|
+
"
|
|
106
|
+
v-on:mouseleave="resetIntro"
|
|
107
|
+
>
|
|
108
|
+
<span>{{ info.fName }}</span>
|
|
109
|
+
<el-tag :type="getClass(info.fType)"
|
|
110
|
+
>{{ i18nt(info.fType) }}
|
|
111
|
+
</el-tag>
|
|
112
|
+
</div>
|
|
113
|
+
</el-collapse-item>
|
|
114
|
+
</template>
|
|
115
|
+
</el-collapse>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</el-col>
|
|
119
|
+
</el-row>
|
|
120
|
+
</el-col>
|
|
121
|
+
<el-col :span="12">
|
|
122
|
+
<div class="group-item-right-bottom">
|
|
123
|
+
<div class="item-header">{{ introTitle }}</div>
|
|
124
|
+
<div class="item-body-right-bottom">
|
|
125
|
+
<ul>
|
|
126
|
+
<li
|
|
127
|
+
v-if="introduction.title !== ''"
|
|
128
|
+
style="font-size: 16px; color: #0a5d7c"
|
|
129
|
+
>
|
|
130
|
+
{{ introduction.title }}
|
|
131
|
+
</li>
|
|
132
|
+
<li>
|
|
133
|
+
<div class="intro-content" v-html="introduction.content"></div>
|
|
134
|
+
</li>
|
|
135
|
+
</ul>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</el-col>
|
|
139
|
+
</el-row>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="dialog-footer" slot="footer">
|
|
142
|
+
<el-button
|
|
143
|
+
@click="formulaDialogVisible = false"
|
|
144
|
+
class="button-sty"
|
|
145
|
+
icon="el-icon-close"
|
|
146
|
+
>
|
|
147
|
+
{{ i18nt("designer.hint.cancel") }}
|
|
148
|
+
</el-button>
|
|
149
|
+
<el-button
|
|
150
|
+
type="primary"
|
|
151
|
+
@click="saveFormula"
|
|
152
|
+
class="button-sty"
|
|
153
|
+
icon="el-icon-check"
|
|
154
|
+
>
|
|
155
|
+
{{ i18nt("designer.hint.confirm") }}
|
|
156
|
+
</el-button>
|
|
157
|
+
</div>
|
|
158
|
+
</el-dialog>
|
|
159
|
+
</template>
|
|
160
|
+
|
|
161
|
+
<script>
|
|
162
|
+
import { basicSetup, EditorView } from "codemirror";
|
|
163
|
+
import { javascript } from "@codemirror/lang-javascript";
|
|
164
|
+
import { EditorState } from "@codemirror/state";
|
|
165
|
+
import i18n from "@base/components/xform/utils/i18n";
|
|
166
|
+
import {
|
|
167
|
+
deepClone,
|
|
168
|
+
getAllContainerWidgets,
|
|
169
|
+
getAllFieldWidgets,
|
|
170
|
+
getFieldWidgetById,
|
|
171
|
+
traverseFieldWidgetsOfContainer,
|
|
172
|
+
loopHandleWidget,
|
|
173
|
+
traverseAllWidgetsNew,
|
|
174
|
+
} from "@base/components/xform/utils/util";
|
|
175
|
+
import {
|
|
176
|
+
placeholders,
|
|
177
|
+
baseTheme,
|
|
178
|
+
formulas,
|
|
179
|
+
FORMULA_REG_EXP,
|
|
180
|
+
} from "@base/components/xform/utils/formula-util";
|
|
181
|
+
|
|
182
|
+
export default {
|
|
183
|
+
name: "formula-editor2",
|
|
184
|
+
mixins: [i18n],
|
|
185
|
+
components: {},
|
|
186
|
+
props: {
|
|
187
|
+
option: Object,
|
|
188
|
+
},
|
|
189
|
+
computed: {
|
|
190
|
+
formulaForView() {
|
|
191
|
+
const matchResult = this.formula.match(FORMULA_REG_EXP);
|
|
192
|
+
if (!matchResult) {
|
|
193
|
+
return this.formula;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let resultFormula = this.formula;
|
|
197
|
+
matchResult.forEach((mi) => {
|
|
198
|
+
const secondPart = mi.split(".")[1];
|
|
199
|
+
resultFormula = resultFormula.replaceAll(mi, secondPart);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
return resultFormula;
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
watch: {
|
|
206
|
+
filterText(val) {
|
|
207
|
+
this.$refs.fieldTree.filter(val);
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
data() {
|
|
211
|
+
return {
|
|
212
|
+
codeMirror: null,
|
|
213
|
+
formula: "",
|
|
214
|
+
tags: [], // 公式页签集合
|
|
215
|
+
fieldTreeData: [], // 设计器字段树
|
|
216
|
+
filterText: "",
|
|
217
|
+
formulaDialogVisible: true,
|
|
218
|
+
operate: ["+", "-", "*", "/", "!=", "==", "<", ">", "<=", ">=", "(", ")", ","],
|
|
219
|
+
insertNum: 0,
|
|
220
|
+
insertStr: "",
|
|
221
|
+
activeNames: ["1"],
|
|
222
|
+
widgetSizes: [
|
|
223
|
+
{
|
|
224
|
+
label: this.i18nt("designer.hint.formulaSizeLarge"),
|
|
225
|
+
value: "large",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
label: this.i18nt("designer.hint.formulaSizeMedium"),
|
|
229
|
+
value: "default",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: this.i18nt("designer.hint.formulaSizeSmall"),
|
|
233
|
+
value: "small",
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
label: this.i18nt("designer.hint.formulaSizeMini"),
|
|
237
|
+
value: "small",
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
introTitle: this.i18nt("designer.hint.formulaFunctionExplain"),
|
|
241
|
+
introduction: {
|
|
242
|
+
title: this.i18nt("designer.hint.formulaPleaseSelect"),
|
|
243
|
+
content:
|
|
244
|
+
'<span class="cg">' +
|
|
245
|
+
this.i18nt("designer.hint.formulaSample") +
|
|
246
|
+
':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">' +
|
|
247
|
+
this.i18nt("designer.hint.formulaPara") +
|
|
248
|
+
'1</span><span class="cg">,</span><span class="cs">' +
|
|
249
|
+
this.i18nt("designer.hint.formulaPara") +
|
|
250
|
+
'2</span><span class="cg">)</span>',
|
|
251
|
+
},
|
|
252
|
+
funcList: formulas,
|
|
253
|
+
funcActiveCollapseNames: [0],
|
|
254
|
+
|
|
255
|
+
targetFormTemplate: null,
|
|
256
|
+
targetFormJson: null,
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
created() {
|
|
260
|
+
this.editFormula();
|
|
261
|
+
},
|
|
262
|
+
mounted() {},
|
|
263
|
+
methods: {
|
|
264
|
+
dialogClose() {
|
|
265
|
+
this.formulaDialogVisible = false;
|
|
266
|
+
this.$emit("update:visiable", false);
|
|
267
|
+
},
|
|
268
|
+
clearFormula(event) {
|
|
269
|
+
this.formula = ""; //CodeMirror 模式
|
|
270
|
+
this.tags = []; //el-tag模式
|
|
271
|
+
this.codeMirror.dispatch({
|
|
272
|
+
changes: { from: 0, to: this.codeMirror.state.doc.length, insert: "" },
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
/** 删除字符串str中的第n个subStr
|
|
277
|
+
* @param {Object} str
|
|
278
|
+
* @param {Object} subStr
|
|
279
|
+
* @param {Object} n
|
|
280
|
+
*/
|
|
281
|
+
deleteChar(str, subStr, n) {
|
|
282
|
+
let num = -1;
|
|
283
|
+
return str.replace(/a/g, (item) => {
|
|
284
|
+
num++;
|
|
285
|
+
return num === n ? "" : item;
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
filterNode(value, data) {
|
|
290
|
+
if (!value) return true;
|
|
291
|
+
return data.label.indexOf(value) !== -1;
|
|
292
|
+
},
|
|
293
|
+
handleTableConfigData(widget, callback) {
|
|
294
|
+
callback(widget);
|
|
295
|
+
},
|
|
296
|
+
initHandleFields() {
|
|
297
|
+
let option = this.option;
|
|
298
|
+
let formWidgetNames = option.formWidgetNames || [];
|
|
299
|
+
let itemWidgets = option.itemWidgets || [];
|
|
300
|
+
let tableWidgetNames = itemWidgets.map((item) => item.widgetName);
|
|
301
|
+
|
|
302
|
+
let tableWidgetMap0 = itemWidgets.map((item) => {
|
|
303
|
+
return {
|
|
304
|
+
[item.widgetName]: item.columnWidgetNames,
|
|
305
|
+
};
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
let formWidgetMap = {};
|
|
309
|
+
let tableWidgetMap = itemWidgets.map((item) => {
|
|
310
|
+
let columnWidgetMap = {};
|
|
311
|
+
item.columnWidgetNames.forEach((columnWidgetName) => {
|
|
312
|
+
return (columnWidgetMap[columnWidgetName] = null);
|
|
313
|
+
});
|
|
314
|
+
return {
|
|
315
|
+
[item.widgetName]: {
|
|
316
|
+
tableWidget: null,
|
|
317
|
+
columnWidgetMap,
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
traverseAllWidgetsNew(this.targetFormJson.widgetList, (widget, pWidget) => {
|
|
323
|
+
if (pWidget && pWidget.type === "data-table") {
|
|
324
|
+
if (tableWidgetNames.includes(pWidget.options.name)) {
|
|
325
|
+
let tableItems = tableWidgetMap0[pWidget.options.name];
|
|
326
|
+
if (
|
|
327
|
+
widget.formItemFlag &&
|
|
328
|
+
widget.options.label &&
|
|
329
|
+
tableItems.includes(widget.options.label)
|
|
330
|
+
) {
|
|
331
|
+
tableWidgetMap[pWidget.options.name].columnWidgetMap[
|
|
332
|
+
widget.options.label
|
|
333
|
+
] = widget;
|
|
334
|
+
}
|
|
335
|
+
tableWidgetMap[pWidget.options.name].tableWidget = widget;
|
|
336
|
+
}
|
|
337
|
+
formWidgetNames.push(widget.widgetName);
|
|
338
|
+
itemWidgets.push(widget);
|
|
339
|
+
} else if (
|
|
340
|
+
widget.formItemFlag &&
|
|
341
|
+
widget.options.label &&
|
|
342
|
+
formWidgetNames.includes(widget.options.label)
|
|
343
|
+
) {
|
|
344
|
+
formWidgetMap[widget.options.label] = widget;
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
getReportTemplate(formCode, callback) {
|
|
349
|
+
let url, data;
|
|
350
|
+
url = USER_PREFIX + `/formTemplate/getByFormCode`;
|
|
351
|
+
data = { stringOne: formCode };
|
|
352
|
+
return this.$http({
|
|
353
|
+
// aes: true,
|
|
354
|
+
url: url,
|
|
355
|
+
method: `post`,
|
|
356
|
+
data: data,
|
|
357
|
+
isLoading: true,
|
|
358
|
+
// loadingTarget: document.body,
|
|
359
|
+
// modalStrictly: true,
|
|
360
|
+
success: (res) => {
|
|
361
|
+
let formTemplate = res.objx || {};
|
|
362
|
+
this.targetFormTemplate = formTemplate;
|
|
363
|
+
this.targetFormJson = formTemplate.formViewContent
|
|
364
|
+
? JSON.parse(formTemplate.formViewContent)
|
|
365
|
+
: {};
|
|
366
|
+
callback && callback();
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
getTargetWidgetList() {
|
|
371
|
+
let widgetList = this.targetFormJson.widgetList;
|
|
372
|
+
return widgetList;
|
|
373
|
+
},
|
|
374
|
+
loadFieldListToTree() {
|
|
375
|
+
let option = this.option;
|
|
376
|
+
let formWidgetNames = option.formWidgetNames || [];
|
|
377
|
+
let itemWidgets = option.itemWidgets || [];
|
|
378
|
+
let tableWidgetNames = itemWidgets.map((item) => item.widgetName);
|
|
379
|
+
let tableWidgetMap = {};
|
|
380
|
+
itemWidgets.forEach((item) => {
|
|
381
|
+
tableWidgetMap[item.widgetName] = item.columnWidgetNames;
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
this.fieldTreeData.length = 0; //先清空
|
|
385
|
+
|
|
386
|
+
let widgetList = this.getTargetWidgetList();
|
|
387
|
+
|
|
388
|
+
const allFields = getAllFieldWidgets(widgetList);
|
|
389
|
+
const allContainers = getAllContainerWidgets(widgetList);
|
|
390
|
+
|
|
391
|
+
const subFormArray = [];
|
|
392
|
+
let sfFieldArray = [];
|
|
393
|
+
const subFormFieldMap = {};
|
|
394
|
+
|
|
395
|
+
//获取子表单容器内部的字段
|
|
396
|
+
allContainers.forEach((con) => {
|
|
397
|
+
if (con.type === "data-table") {
|
|
398
|
+
if (tableWidgetNames.includes(con.container.options.name)) {
|
|
399
|
+
subFormArray.push(con.container);
|
|
400
|
+
const tmpFieldArray = [];
|
|
401
|
+
const fwHandler = (fw) => {
|
|
402
|
+
/* if (!!fw.formItemFlag && fw.type === "number") {
|
|
403
|
+
tmpFieldArray.push(fw);
|
|
404
|
+
} */
|
|
405
|
+
if (tableWidgetMap[con.container.options.name]?.includes(fw.options.name)) {
|
|
406
|
+
tmpFieldArray.push(fw);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
// this.traverseFieldWidgetsOfTableDataWidget(con.container, fwHandler);
|
|
411
|
+
traverseFieldWidgetsOfContainer(con.container, fwHandler);
|
|
412
|
+
subFormFieldMap[con.container.options.name] = tmpFieldArray;
|
|
413
|
+
sfFieldArray = sfFieldArray.concat(tmpFieldArray);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
//加载到树形组件数据对象
|
|
419
|
+
allFields.forEach((fld) => {
|
|
420
|
+
let flag1 = !sfFieldArray.find((item) => item.id === fld.field.id);
|
|
421
|
+
let flag2 =
|
|
422
|
+
fld.field.options.label && formWidgetNames.includes(fld.field.options.name);
|
|
423
|
+
let flag = flag2;
|
|
424
|
+
if (flag) {
|
|
425
|
+
//排除子表单字段
|
|
426
|
+
const fieldNode = {
|
|
427
|
+
id: fld.field.id,
|
|
428
|
+
name: fld.field.options.name,
|
|
429
|
+
label: fld.field.options.label,
|
|
430
|
+
type: fld.field.type,
|
|
431
|
+
formItemFlag: true,
|
|
432
|
+
};
|
|
433
|
+
this.fieldTreeData.push(fieldNode);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
subFormArray.forEach((sf) => {
|
|
438
|
+
const subFormNode = {
|
|
439
|
+
id: sf.id,
|
|
440
|
+
name: sf.options.name,
|
|
441
|
+
label: sf.options.label || sf.options.name,
|
|
442
|
+
type: sf.type,
|
|
443
|
+
formItemFlag: false,
|
|
444
|
+
children: [],
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
subFormFieldMap[sf.options.name].forEach((fld) => {
|
|
448
|
+
const fieldNode = {
|
|
449
|
+
id: fld.id,
|
|
450
|
+
name: fld.options.name,
|
|
451
|
+
label: fld.options.label,
|
|
452
|
+
type: fld.type,
|
|
453
|
+
formItemFlag: true,
|
|
454
|
+
};
|
|
455
|
+
subFormNode.children.push(fieldNode);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
this.fieldTreeData.push(subFormNode);
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
|
|
462
|
+
// 插入字段
|
|
463
|
+
insertField(obj, node, self) {
|
|
464
|
+
if (!!obj.formItemFlag) {
|
|
465
|
+
let fieldId = obj.id + "";
|
|
466
|
+
let fieldLabel = "[" + obj.label + "]";
|
|
467
|
+
this.updateCodeMirror(fieldId, fieldLabel, "field");
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
|
|
471
|
+
// 插入符号
|
|
472
|
+
insertSymbol(opt) {
|
|
473
|
+
this.updateCodeMirror(opt, opt, null);
|
|
474
|
+
},
|
|
475
|
+
|
|
476
|
+
// 插入函数
|
|
477
|
+
insertFunction(opt) {
|
|
478
|
+
const val = opt.substring(0, opt.length - 1);
|
|
479
|
+
this.updateCodeMirror(val, val, "func");
|
|
480
|
+
},
|
|
481
|
+
getFunStr(funcName) {
|
|
482
|
+
let map = {
|
|
483
|
+
SUMIF: `([],"",[])`,
|
|
484
|
+
SUMIFS: `([],[],"")`,
|
|
485
|
+
};
|
|
486
|
+
return map[funcName] || "()";
|
|
487
|
+
},
|
|
488
|
+
updateCodeMirror(field, text, type = null) {
|
|
489
|
+
if (type) {
|
|
490
|
+
let obj = {
|
|
491
|
+
field: field,
|
|
492
|
+
text: text,
|
|
493
|
+
type: type,
|
|
494
|
+
};
|
|
495
|
+
let selectionLet = obj.field.length + obj.text.length + obj.type.length; //光标位置;
|
|
496
|
+
let code = `{{${obj.field}.${obj.text}.${obj.type}}}`;
|
|
497
|
+
if (type === "func") {
|
|
498
|
+
// code += "()";
|
|
499
|
+
// selectionLet = selectionLet + 7;
|
|
500
|
+
let funStr = this.getFunStr(text);
|
|
501
|
+
code += funStr;
|
|
502
|
+
let num = "()" === funStr ? 7 : 7 - 1 + funStr.length;
|
|
503
|
+
selectionLet = selectionLet + num;
|
|
504
|
+
} else {
|
|
505
|
+
selectionLet = selectionLet + 6;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (code) {
|
|
509
|
+
this.codeMirror.dispatch({
|
|
510
|
+
changes: {
|
|
511
|
+
from: this.codeMirror.state.selection.main.head,
|
|
512
|
+
to: this.codeMirror.state.selection.main.head,
|
|
513
|
+
insert: code,
|
|
514
|
+
},
|
|
515
|
+
selection: {
|
|
516
|
+
anchor: this.codeMirror.state.selection.main.head + selectionLet,
|
|
517
|
+
},
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
} else {
|
|
521
|
+
this.codeMirror.dispatch({
|
|
522
|
+
changes: {
|
|
523
|
+
from: this.codeMirror.state.selection.main.head,
|
|
524
|
+
to: this.codeMirror.state.selection.main.head,
|
|
525
|
+
insert: text,
|
|
526
|
+
},
|
|
527
|
+
selection: {
|
|
528
|
+
anchor: this.codeMirror.state.selection.main.head + text.length,
|
|
529
|
+
},
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
|
|
534
|
+
// 在字符串中查找[开始]结尾的字符串,并删除
|
|
535
|
+
removeStr(str) {
|
|
536
|
+
let a = str.indexOf("[");
|
|
537
|
+
if (a === -1) {
|
|
538
|
+
return str;
|
|
539
|
+
}
|
|
540
|
+
let b = str.indexOf("]", a) + 1;
|
|
541
|
+
let c = str.substring(a, b);
|
|
542
|
+
let strArr = str.split(c);
|
|
543
|
+
let newStr = "";
|
|
544
|
+
for (let i = 0; i < strArr.length; i++) {
|
|
545
|
+
newStr += strArr[i];
|
|
546
|
+
}
|
|
547
|
+
return this.removeStr(newStr);
|
|
548
|
+
},
|
|
549
|
+
extractFieldNames(formula) {
|
|
550
|
+
if (!formula) return [];
|
|
551
|
+
const fieldArray = [];
|
|
552
|
+
let tempFormula = formula;
|
|
553
|
+
|
|
554
|
+
// 循环查找所有 [字段名] 格式的引用
|
|
555
|
+
while (true) {
|
|
556
|
+
const startIndex = tempFormula.indexOf("[");
|
|
557
|
+
if (startIndex === -1) {
|
|
558
|
+
break; // 没有更多字段引用了
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const endIndex = tempFormula.indexOf("]", startIndex);
|
|
562
|
+
if (endIndex === -1) {
|
|
563
|
+
break; // 格式不正确,没有匹配的右括号
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// 提取字段名(不包含方括号)
|
|
567
|
+
const fieldName = tempFormula.substring(startIndex + 1, endIndex);
|
|
568
|
+
|
|
569
|
+
// 避免重复添加相同的字段名
|
|
570
|
+
if (!fieldArray.includes(fieldName)) {
|
|
571
|
+
fieldArray.push(fieldName);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// 从剩余部分继续查找
|
|
575
|
+
tempFormula = tempFormula.substring(endIndex + 1);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return fieldArray;
|
|
579
|
+
},
|
|
580
|
+
/**
|
|
581
|
+
* 字段label可能在公式保存后再次被修改,当编辑公式时需要再次刷新公式中的字段label(不刷新也不会影响公式计算结果)
|
|
582
|
+
*/
|
|
583
|
+
refreshFormula() {
|
|
584
|
+
const matchResult = this.option.formula?.match(FORMULA_REG_EXP);
|
|
585
|
+
if (!matchResult) {
|
|
586
|
+
return this.option.formula;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
matchResult.forEach((mi) => {
|
|
590
|
+
const firstPart = mi.split(".")[0];
|
|
591
|
+
const secondPart = mi.split(".")[1];
|
|
592
|
+
const thirdPart = mi.split(".")[2];
|
|
593
|
+
const nodeType = thirdPart.substring(0, thirdPart.length - 2);
|
|
594
|
+
if (nodeType === "func") {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
const fieldId = firstPart.substring(2, firstPart.length);
|
|
599
|
+
const fieldSchema = getFieldWidgetById(
|
|
600
|
+
// this.designer.widgetList,
|
|
601
|
+
this.getTargetWidgetList(),
|
|
602
|
+
fieldId,
|
|
603
|
+
false
|
|
604
|
+
);
|
|
605
|
+
if (!!fieldSchema) {
|
|
606
|
+
const newLabel = fieldSchema.options.label || fieldSchema.options.name;
|
|
607
|
+
this.option.formula = this.option.formula.replace(
|
|
608
|
+
mi,
|
|
609
|
+
firstPart + ".[" + newLabel + "]." + thirdPart
|
|
610
|
+
);
|
|
611
|
+
} else {
|
|
612
|
+
this.$message.error(
|
|
613
|
+
this.i18nt("designer.hint.deletedFieldInFormula") + secondPart
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
|
|
619
|
+
// 打开编辑公式弹窗
|
|
620
|
+
editFormula() {
|
|
621
|
+
this.formula = this.option.formula ?? null;
|
|
622
|
+
this.fieldTreeData.length = 0;
|
|
623
|
+
// 初始化字段树
|
|
624
|
+
|
|
625
|
+
// this.loadFieldListToTree();
|
|
626
|
+
|
|
627
|
+
let option = this.option;
|
|
628
|
+
let formCode = option.formCode;
|
|
629
|
+
if (formCode) {
|
|
630
|
+
this.getReportTemplate(formCode, () => {
|
|
631
|
+
this.loadFieldListToTree();
|
|
632
|
+
console.log("设计器字段===>", this.fieldTreeData);
|
|
633
|
+
|
|
634
|
+
// 加载当前字段计算公式tags
|
|
635
|
+
this.refreshFormula();
|
|
636
|
+
const code = this.formula;
|
|
637
|
+
this.formulaDialogVisible = true;
|
|
638
|
+
|
|
639
|
+
//==== codeMirror 挂载视图 ====
|
|
640
|
+
this.$nextTick(() => {
|
|
641
|
+
this.codeMirror = new EditorView({
|
|
642
|
+
state: EditorState.create({
|
|
643
|
+
doc: code,
|
|
644
|
+
extensions: [basicSetup, javascript(), [baseTheme, [], placeholders]],
|
|
645
|
+
}),
|
|
646
|
+
parent: this.$refs.cmRef,
|
|
647
|
+
});
|
|
648
|
+
console.log("编辑器实例==>", this.codeMirror);
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
|
|
654
|
+
// 保存计算公式
|
|
655
|
+
getFormulaForView(formula) {
|
|
656
|
+
const matchResult = formula?.match(FORMULA_REG_EXP);
|
|
657
|
+
if (!matchResult) {
|
|
658
|
+
return {
|
|
659
|
+
formula: formula,
|
|
660
|
+
showFormula: formula,
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
return {
|
|
665
|
+
showFormula: this.formulaForView,
|
|
666
|
+
formula: formula,
|
|
667
|
+
};
|
|
668
|
+
},
|
|
669
|
+
saveFormula() {
|
|
670
|
+
this.formula = this.codeMirror.state.doc.text.join("");
|
|
671
|
+
let resultObj = this.getFormulaForView(this.formula);
|
|
672
|
+
this.option.confirm && this.option.confirm(resultObj);
|
|
673
|
+
this.dialogClose();
|
|
674
|
+
},
|
|
675
|
+
getClass(type) {
|
|
676
|
+
if (type === this.i18nt("designer.hint.formulaNumber")) {
|
|
677
|
+
return "warning";
|
|
678
|
+
}
|
|
679
|
+
if (type === this.i18nt("designer.hint.formulaChar")) {
|
|
680
|
+
return "";
|
|
681
|
+
}
|
|
682
|
+
if (type === this.i18nt("designer.hint.formulaObject")) {
|
|
683
|
+
return "danger";
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
|
|
687
|
+
resetIntro() {
|
|
688
|
+
this.introTitle = this.i18nt("designer.hint.formulaFunctionExplain");
|
|
689
|
+
this.introduction = {
|
|
690
|
+
title: this.i18nt("designer.hint.formulaPleaseSelect"),
|
|
691
|
+
content:
|
|
692
|
+
'<span class="cg">' +
|
|
693
|
+
this.i18nt("designer.hint.formulaSample") +
|
|
694
|
+
':</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">参数1</span><span class="cg">,</span><span class="cs">参数2</span><span class="cg">)</span>',
|
|
695
|
+
};
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
showIntro(name, title, content) {
|
|
699
|
+
content = '<span class="cg">' + content + "</span>";
|
|
700
|
+
this.introduction = {
|
|
701
|
+
title: title,
|
|
702
|
+
content: content,
|
|
703
|
+
};
|
|
704
|
+
this.introTitle = name;
|
|
705
|
+
},
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* 校验计算公式是否正确
|
|
709
|
+
* @param s
|
|
710
|
+
* @returns {boolean}
|
|
711
|
+
*/
|
|
712
|
+
isValid(s) {
|
|
713
|
+
let a = []; //存储左括号出现的地方
|
|
714
|
+
let l = s.length;
|
|
715
|
+
let k = 0;
|
|
716
|
+
let flag = 1;
|
|
717
|
+
let j;
|
|
718
|
+
for (let i = 0; i < l && flag; i++) {
|
|
719
|
+
switch (s[i]) {
|
|
720
|
+
case "(":
|
|
721
|
+
a[k] = i;
|
|
722
|
+
k++;
|
|
723
|
+
break;
|
|
724
|
+
case ")":
|
|
725
|
+
j = a[k - 1];
|
|
726
|
+
if (s[j] === "(") {
|
|
727
|
+
a[k] = 0;
|
|
728
|
+
k--;
|
|
729
|
+
} else {
|
|
730
|
+
flag = 0;
|
|
731
|
+
}
|
|
732
|
+
break;
|
|
733
|
+
case "{":
|
|
734
|
+
a[k] = i;
|
|
735
|
+
k++;
|
|
736
|
+
break;
|
|
737
|
+
case "}":
|
|
738
|
+
j = a[k - 1];
|
|
739
|
+
if (s[j] === "{") {
|
|
740
|
+
a[k] = 0;
|
|
741
|
+
k--;
|
|
742
|
+
} else {
|
|
743
|
+
flag = 0;
|
|
744
|
+
}
|
|
745
|
+
break;
|
|
746
|
+
case "[":
|
|
747
|
+
a[k] = i;
|
|
748
|
+
k++;
|
|
749
|
+
break;
|
|
750
|
+
case "]":
|
|
751
|
+
j = a[k - 1];
|
|
752
|
+
if (s[j] === "[") {
|
|
753
|
+
a[k] = 0;
|
|
754
|
+
k--;
|
|
755
|
+
} else {
|
|
756
|
+
flag = 0;
|
|
757
|
+
}
|
|
758
|
+
break;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (k !== 0) {
|
|
762
|
+
flag = 0;
|
|
763
|
+
}
|
|
764
|
+
return flag !== 0;
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
};
|
|
768
|
+
</script>
|
|
769
|
+
|
|
770
|
+
<style lang="scss" scoped>
|
|
771
|
+
:deep(.cm-editor) {
|
|
772
|
+
height: 100%;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
li {
|
|
776
|
+
list-style: none;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/*去掉li前面的点*/
|
|
780
|
+
.el-input-group {
|
|
781
|
+
cursor: pointer;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.header {
|
|
785
|
+
width: 97%;
|
|
786
|
+
border: 1px solid #ccc;
|
|
787
|
+
border-top-left-radius: 10px;
|
|
788
|
+
border-top-right-radius: 10px;
|
|
789
|
+
height: 31px;
|
|
790
|
+
line-height: 31px;
|
|
791
|
+
padding-left: 15px;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
.editor {
|
|
795
|
+
margin-left: 10px;
|
|
796
|
+
margin-right: 10px;
|
|
797
|
+
height: 200px;
|
|
798
|
+
border: 1px solid #ccc;
|
|
799
|
+
border-radius: 6px;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.editor-top {
|
|
803
|
+
//margin-left: 10px;
|
|
804
|
+
height: 130px;
|
|
805
|
+
width: 100%;
|
|
806
|
+
padding: 8px;
|
|
807
|
+
position: relative;
|
|
808
|
+
overflow-x: hidden;
|
|
809
|
+
overflow-y: scroll;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.editor-bottom {
|
|
813
|
+
border-left: 1px solid #ccc;
|
|
814
|
+
display: flex;
|
|
815
|
+
flex-wrap: wrap;
|
|
816
|
+
padding: 5px;
|
|
817
|
+
align-content: flex-start;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
.body-right-button {
|
|
821
|
+
width: 60px;
|
|
822
|
+
height: 40px;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.group-form {
|
|
826
|
+
margin-top: 15px;
|
|
827
|
+
display: flex;
|
|
828
|
+
justify-content: space-between;
|
|
829
|
+
height: 350px;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.group-item-left {
|
|
833
|
+
height: 350px;
|
|
834
|
+
border: 1px solid #ccc;
|
|
835
|
+
border-top-left-radius: 6px;
|
|
836
|
+
border-bottom-left-radius: 6px;
|
|
837
|
+
margin-bottom: 5px;
|
|
838
|
+
padding: 0;
|
|
839
|
+
width: 100%;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.group-item-right-top {
|
|
843
|
+
height: 350px;
|
|
844
|
+
border: 1px solid #ccc;
|
|
845
|
+
border-radius: 0;
|
|
846
|
+
margin-bottom: 5px;
|
|
847
|
+
width: 100%;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.group-item-right-bottom {
|
|
851
|
+
height: 350px;
|
|
852
|
+
border: 1px solid #ccc;
|
|
853
|
+
border-top-right-radius: 6px;
|
|
854
|
+
border-bottom-right-radius: 6px;
|
|
855
|
+
margin-bottom: 5px;
|
|
856
|
+
width: 100%;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.item-header {
|
|
860
|
+
border-bottom: 1px solid #ccc;
|
|
861
|
+
height: 29px;
|
|
862
|
+
line-height: 29px;
|
|
863
|
+
padding-left: 15px;
|
|
864
|
+
font-weight: bold;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.item-body-left {
|
|
868
|
+
height: 320px;
|
|
869
|
+
overflow-y: auto;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.function-list {
|
|
873
|
+
height: 320px;
|
|
874
|
+
overflow-y: auto;
|
|
875
|
+
|
|
876
|
+
:deep(.el-collapse-item__header) {
|
|
877
|
+
font-weight: normal !important;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.item-body-right-bottom {
|
|
882
|
+
height: 152px;
|
|
883
|
+
overflow-y: auto;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.el-collapse {
|
|
887
|
+
border: none;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
:deep(.el-dialog) {
|
|
891
|
+
margin-top: 10px !important;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
:deep(.el-collapse-item__header) {
|
|
895
|
+
padding-left: 10px;
|
|
896
|
+
border: none;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
:deep(.el-collapse-item__wrap) {
|
|
900
|
+
border: none;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
:deep(.el-collapse-item__arrow) {
|
|
904
|
+
margin-left: 8px;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.field-item {
|
|
908
|
+
display: flex;
|
|
909
|
+
justify-content: space-between;
|
|
910
|
+
align-items: center;
|
|
911
|
+
height: 32px;
|
|
912
|
+
padding-left: 30px;
|
|
913
|
+
padding-right: 15px;
|
|
914
|
+
cursor: pointer;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.field-item:hover {
|
|
918
|
+
background-color: #f8f8f8;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
p::before {
|
|
922
|
+
content: "● ";
|
|
923
|
+
color: #0a5d7c;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
p {
|
|
927
|
+
height: 24px;
|
|
928
|
+
line-height: 24px;
|
|
929
|
+
padding: 0 15px;
|
|
930
|
+
font-size: 16px;
|
|
931
|
+
color: #0a5d7c;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.intro-content {
|
|
935
|
+
padding-left: 30px;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.cg {
|
|
939
|
+
color: #0a5d7c;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.fname {
|
|
943
|
+
display: inline-block;
|
|
944
|
+
border-radius: 2px;
|
|
945
|
+
padding: 0 5px;
|
|
946
|
+
margin: 1px;
|
|
947
|
+
font-size: 12px;
|
|
948
|
+
line-height: 20px;
|
|
949
|
+
color: #708;
|
|
950
|
+
background: #fff;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.cs {
|
|
954
|
+
display: inline-block;
|
|
955
|
+
border-radius: 2px;
|
|
956
|
+
padding: 0 5px;
|
|
957
|
+
margin: 1px;
|
|
958
|
+
color: #fff;
|
|
959
|
+
font-size: 12px;
|
|
960
|
+
line-height: 20px;
|
|
961
|
+
background: #178cdf;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
:deep(.el-dialog__body) {
|
|
965
|
+
padding: 0;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.small-padding-dialog {
|
|
969
|
+
/* margin-top: 0px; */
|
|
970
|
+
}
|
|
971
|
+
</style>
|
|
@@ -1117,6 +1117,50 @@ modules = {
|
|
|
1117
1117
|
|
|
1118
1118
|
return hasModifyItem;
|
|
1119
1119
|
},
|
|
1120
|
+
loadFormData(options) {
|
|
1121
|
+
let config = options.config || {}
|
|
1122
|
+
let that = this;
|
|
1123
|
+
let formConfig = this.formConfig;
|
|
1124
|
+
let entity = formConfig.entity;
|
|
1125
|
+
let dataId = this.dataId;
|
|
1126
|
+
let reportTemplate = this.reportTemplate;
|
|
1127
|
+
let scriptCode = formConfig.formScriptCode || "getOne";
|
|
1128
|
+
|
|
1129
|
+
let formData = {};
|
|
1130
|
+
if (scriptCode) {
|
|
1131
|
+
let formCode = reportTemplate.formCode;
|
|
1132
|
+
|
|
1133
|
+
let formScriptParam = this.handleCustomEvent(
|
|
1134
|
+
this.formConfig.formScriptParam
|
|
1135
|
+
);
|
|
1136
|
+
|
|
1137
|
+
let defaultOption = {
|
|
1138
|
+
addCreateInfo: true,
|
|
1139
|
+
queryCreateInfo:
|
|
1140
|
+
window.$vueRoot.$store.getters.queryCreateInfo || "0",
|
|
1141
|
+
};
|
|
1142
|
+
return this.formHttp({
|
|
1143
|
+
// url: "/" + reportTemplate.serviceName + "/form_ins/getOne",
|
|
1144
|
+
scriptCode: scriptCode,
|
|
1145
|
+
data: {
|
|
1146
|
+
formCode: formCode,
|
|
1147
|
+
formVersion: reportTemplate.formVersion,
|
|
1148
|
+
taBm: entity,
|
|
1149
|
+
data: {
|
|
1150
|
+
id: dataId,
|
|
1151
|
+
...formScriptParam,
|
|
1152
|
+
},
|
|
1153
|
+
},
|
|
1154
|
+
...defaultOption,
|
|
1155
|
+
success: (res) => {
|
|
1156
|
+
formData = res.objx || {};
|
|
1157
|
+
this.setFormData(formData);
|
|
1158
|
+
options.callback && options.callback(formData);
|
|
1159
|
+
},
|
|
1160
|
+
...config,
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1120
1164
|
loadDefaultEntityData(callback) {
|
|
1121
1165
|
let that = this;
|
|
1122
1166
|
let formConfig = this.formConfig;
|
|
@@ -1132,8 +1176,8 @@ modules = {
|
|
|
1132
1176
|
if (entity && dataId && scriptCode) {
|
|
1133
1177
|
let formCode = reportTemplate.formCode;
|
|
1134
1178
|
let otherParam = {};
|
|
1135
|
-
let wfCode = reportTemplate.objTypeCode;
|
|
1136
1179
|
if (wfEnabled) {
|
|
1180
|
+
let wfCode = reportTemplate.objTypeCode;
|
|
1137
1181
|
wfConfig = (res) => {
|
|
1138
1182
|
let wfConfig1 = null;
|
|
1139
1183
|
let callback1 = null;
|
|
@@ -1243,44 +1287,24 @@ modules = {
|
|
|
1243
1287
|
return resOption;
|
|
1244
1288
|
};
|
|
1245
1289
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
taBm: entity,
|
|
1263
|
-
data: {
|
|
1264
|
-
id: dataId,
|
|
1265
|
-
...formScriptParam,
|
|
1266
|
-
},
|
|
1267
|
-
},
|
|
1268
|
-
...defaultOption,
|
|
1269
|
-
sync: false,
|
|
1270
|
-
wfConfig,
|
|
1271
|
-
success: (res) => {
|
|
1272
|
-
formData = res.objx || {};
|
|
1273
|
-
// this.currentFormData = res.objx || {};
|
|
1274
|
-
if (!wfConfig) {
|
|
1275
|
-
this.hanldeCommonWidget2(); //处理组件显隐,可编辑
|
|
1276
|
-
this.setFormData(formData);
|
|
1277
|
-
this.showFormContent = true;
|
|
1278
|
-
this.$nextTick(() => {
|
|
1279
|
-
this.handleShowHideRule();
|
|
1280
|
-
callback && callback();
|
|
1281
|
-
});
|
|
1290
|
+
return this.loadFormData({
|
|
1291
|
+
config:{
|
|
1292
|
+
sync: false,
|
|
1293
|
+
wfConfig,
|
|
1294
|
+
success: (res) => {
|
|
1295
|
+
formData = res.objx || {};
|
|
1296
|
+
// this.currentFormData = res.objx || {};
|
|
1297
|
+
if (!wfConfig) {
|
|
1298
|
+
this.hanldeCommonWidget2(); //处理组件显隐,可编辑
|
|
1299
|
+
this.setFormData(formData);
|
|
1300
|
+
this.showFormContent = true;
|
|
1301
|
+
this.$nextTick(() => {
|
|
1302
|
+
this.handleShowHideRule();
|
|
1303
|
+
callback && callback();
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1282
1306
|
}
|
|
1283
|
-
}
|
|
1307
|
+
}
|
|
1284
1308
|
});
|
|
1285
1309
|
} else {
|
|
1286
1310
|
this.hanldeCommonWidget2(); //处理组件显隐,可编辑
|
|
@@ -1816,9 +1840,9 @@ modules = {
|
|
|
1816
1840
|
foundW.widget.type === "grid-sub-form"
|
|
1817
1841
|
) {
|
|
1818
1842
|
foundW.disableGridSubForm();
|
|
1819
|
-
}else if (!!foundW.widget && foundW.widget.type === "data-table") {
|
|
1843
|
+
} else if (!!foundW.widget && foundW.widget.type === "data-table") {
|
|
1820
1844
|
foundW.disableGridForm();
|
|
1821
|
-
}
|
|
1845
|
+
} else {
|
|
1822
1846
|
!!foundW.setDisabled && foundW.setDisabled(true);
|
|
1823
1847
|
}
|
|
1824
1848
|
}
|
|
@@ -1840,7 +1864,7 @@ modules = {
|
|
|
1840
1864
|
foundW.widget.type === "grid-sub-form"
|
|
1841
1865
|
) {
|
|
1842
1866
|
foundW.enableGridSubForm();
|
|
1843
|
-
}else if (!!foundW.widget && foundW.widget.type === "data-table") {
|
|
1867
|
+
} else if (!!foundW.widget && foundW.widget.type === "data-table") {
|
|
1844
1868
|
foundW.enableGridForm();
|
|
1845
1869
|
} else {
|
|
1846
1870
|
!!foundW.setDisabled && foundW.setDisabled(false);
|
|
@@ -2772,7 +2796,7 @@ modules = {
|
|
|
2772
2796
|
this.showFormDialog = true;
|
|
2773
2797
|
},
|
|
2774
2798
|
closeFormDialog() {
|
|
2775
|
-
if(this.showFormDialog){
|
|
2799
|
+
if (this.showFormDialog) {
|
|
2776
2800
|
this.$refs.formDialog.close();
|
|
2777
2801
|
}
|
|
2778
2802
|
},
|