eztech-core-components 1.0.0
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/assets/css/index.css +405 -0
- package/ckeditor/CHANGES.md +2339 -0
- package/ckeditor/LICENSE.md +1444 -0
- package/ckeditor/MongolianScript.ttf +0 -0
- package/ckeditor/README.md +39 -0
- package/ckeditor/SECURITY.md +10 -0
- package/ckeditor/adapters/jquery.js +10 -0
- package/ckeditor/bender-runner.config.json +16 -0
- package/ckeditor/build-config.js +193 -0
- package/ckeditor/ckcontent.css +71 -0
- package/ckeditor/ckeditor.js +1446 -0
- package/ckeditor/cmdashitseden.ttf +0 -0
- package/ckeditor/config.js +21 -0
- package/ckeditor/contents.css +220 -0
- package/ckeditor/lang/af.js +5 -0
- package/ckeditor/lang/ar.js +5 -0
- package/ckeditor/lang/az.js +5 -0
- package/ckeditor/lang/bg.js +5 -0
- package/ckeditor/lang/bn.js +5 -0
- package/ckeditor/lang/bs.js +5 -0
- package/ckeditor/lang/ca.js +5 -0
- package/ckeditor/lang/cs.js +5 -0
- package/ckeditor/lang/cy.js +5 -0
- package/ckeditor/lang/da.js +5 -0
- package/ckeditor/lang/de-ch.js +5 -0
- package/ckeditor/lang/de.js +5 -0
- package/ckeditor/lang/el.js +5 -0
- package/ckeditor/lang/en-au.js +5 -0
- package/ckeditor/lang/en-ca.js +5 -0
- package/ckeditor/lang/en-gb.js +5 -0
- package/ckeditor/lang/en.js +5 -0
- package/ckeditor/lang/eo.js +5 -0
- package/ckeditor/lang/es-mx.js +5 -0
- package/ckeditor/lang/es.js +5 -0
- package/ckeditor/lang/et.js +5 -0
- package/ckeditor/lang/eu.js +5 -0
- package/ckeditor/lang/fa.js +5 -0
- package/ckeditor/lang/fi.js +5 -0
- package/ckeditor/lang/fo.js +5 -0
- package/ckeditor/lang/fr-ca.js +5 -0
- package/ckeditor/lang/fr.js +5 -0
- package/ckeditor/lang/gl.js +5 -0
- package/ckeditor/lang/gu.js +5 -0
- package/ckeditor/lang/he.js +5 -0
- package/ckeditor/lang/hi.js +5 -0
- package/ckeditor/lang/hr.js +5 -0
- package/ckeditor/lang/hu.js +5 -0
- package/ckeditor/lang/id.js +5 -0
- package/ckeditor/lang/is.js +5 -0
- package/ckeditor/lang/it.js +5 -0
- package/ckeditor/lang/ja.js +5 -0
- package/ckeditor/lang/ka.js +5 -0
- package/ckeditor/lang/km.js +5 -0
- package/ckeditor/lang/ko.js +5 -0
- package/ckeditor/lang/ku.js +5 -0
- package/ckeditor/lang/lt.js +5 -0
- package/ckeditor/lang/lv.js +5 -0
- package/ckeditor/lang/mk.js +5 -0
- package/ckeditor/lang/mn.js +5 -0
- package/ckeditor/lang/ms.js +5 -0
- package/ckeditor/lang/nb.js +5 -0
- package/ckeditor/lang/nl.js +5 -0
- package/ckeditor/lang/no.js +5 -0
- package/ckeditor/lang/oc.js +5 -0
- package/ckeditor/lang/pl.js +5 -0
- package/ckeditor/lang/pt-br.js +5 -0
- package/ckeditor/lang/pt.js +5 -0
- package/ckeditor/lang/ro.js +5 -0
- package/ckeditor/lang/ru.js +5 -0
- package/ckeditor/lang/si.js +5 -0
- package/ckeditor/lang/sk.js +5 -0
- package/ckeditor/lang/sl.js +5 -0
- package/ckeditor/lang/sq.js +5 -0
- package/ckeditor/lang/sr-latn.js +5 -0
- package/ckeditor/lang/sr.js +5 -0
- package/ckeditor/lang/sv.js +5 -0
- package/ckeditor/lang/th.js +5 -0
- package/ckeditor/lang/tr.js +5 -0
- package/ckeditor/lang/tt.js +5 -0
- package/ckeditor/lang/ug.js +5 -0
- package/ckeditor/lang/uk.js +5 -0
- package/ckeditor/lang/vi.js +5 -0
- package/ckeditor/lang/zh-cn.js +5 -0
- package/ckeditor/lang/zh.js +5 -0
- package/ckeditor/monbaiti.ttf +0 -0
- package/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/af.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/az.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/de-ch.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/en-au.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/es-mx.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/eu.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/fo.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +10 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/oc.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +10 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +13 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +12 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +11 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +9 -0
- package/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +9 -0
- package/ckeditor/plugins/about/dialogs/about.js +8 -0
- package/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- package/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- package/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- package/ckeditor/plugins/colordialog/dialogs/colordialog.css +20 -0
- package/ckeditor/plugins/colordialog/dialogs/colordialog.js +14 -0
- package/ckeditor/plugins/copyformatting/cursors/cursor-disabled.svg +25 -0
- package/ckeditor/plugins/copyformatting/cursors/cursor.svg +14 -0
- package/ckeditor/plugins/copyformatting/styles/copyformatting.css +45 -0
- package/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- package/ckeditor/plugins/dialog/styles/dialog.css +18 -0
- package/ckeditor/plugins/div/dialogs/div.js +10 -0
- package/ckeditor/plugins/find/dialogs/find.js +26 -0
- package/ckeditor/plugins/forms/dialogs/button.js +8 -0
- package/ckeditor/plugins/forms/dialogs/checkbox.js +9 -0
- package/ckeditor/plugins/forms/dialogs/form.js +8 -0
- package/ckeditor/plugins/forms/dialogs/hiddenfield.js +7 -0
- package/ckeditor/plugins/forms/dialogs/radio.js +9 -0
- package/ckeditor/plugins/forms/dialogs/select.js +21 -0
- package/ckeditor/plugins/forms/dialogs/textarea.js +9 -0
- package/ckeditor/plugins/forms/dialogs/textfield.js +11 -0
- package/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- package/ckeditor/plugins/icons.png +0 -0
- package/ckeditor/plugins/icons_hidpi.png +0 -0
- package/ckeditor/plugins/iframe/dialogs/iframe.js +11 -0
- package/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- package/ckeditor/plugins/image/dialogs/image.js +44 -0
- package/ckeditor/plugins/image/images/noimage.png +0 -0
- package/ckeditor/plugins/indent/dev/indent.html +285 -0
- package/ckeditor/plugins/indent/icons/hidpi/indent-rtl.png +0 -0
- package/ckeditor/plugins/indent/icons/hidpi/indent.png +0 -0
- package/ckeditor/plugins/indent/icons/hidpi/outdent-rtl.png +0 -0
- package/ckeditor/plugins/indent/icons/hidpi/outdent.png +0 -0
- package/ckeditor/plugins/indent/icons/indent-rtl.png +0 -0
- package/ckeditor/plugins/indent/icons/indent.png +0 -0
- package/ckeditor/plugins/indent/icons/outdent-rtl.png +0 -0
- package/ckeditor/plugins/indent/icons/outdent.png +0 -0
- package/ckeditor/plugins/indent/lang/af.js +8 -0
- package/ckeditor/plugins/indent/lang/ar.js +8 -0
- package/ckeditor/plugins/indent/lang/az.js +8 -0
- package/ckeditor/plugins/indent/lang/bg.js +8 -0
- package/ckeditor/plugins/indent/lang/bn.js +8 -0
- package/ckeditor/plugins/indent/lang/bs.js +8 -0
- package/ckeditor/plugins/indent/lang/ca.js +8 -0
- package/ckeditor/plugins/indent/lang/cs.js +8 -0
- package/ckeditor/plugins/indent/lang/cy.js +8 -0
- package/ckeditor/plugins/indent/lang/da.js +8 -0
- package/ckeditor/plugins/indent/lang/de-ch.js +8 -0
- package/ckeditor/plugins/indent/lang/de.js +8 -0
- package/ckeditor/plugins/indent/lang/el.js +8 -0
- package/ckeditor/plugins/indent/lang/en-au.js +8 -0
- package/ckeditor/plugins/indent/lang/en-ca.js +8 -0
- package/ckeditor/plugins/indent/lang/en-gb.js +8 -0
- package/ckeditor/plugins/indent/lang/en.js +8 -0
- package/ckeditor/plugins/indent/lang/eo.js +8 -0
- package/ckeditor/plugins/indent/lang/es-mx.js +8 -0
- package/ckeditor/plugins/indent/lang/es.js +8 -0
- package/ckeditor/plugins/indent/lang/et.js +8 -0
- package/ckeditor/plugins/indent/lang/eu.js +8 -0
- package/ckeditor/plugins/indent/lang/fa.js +8 -0
- package/ckeditor/plugins/indent/lang/fi.js +8 -0
- package/ckeditor/plugins/indent/lang/fo.js +8 -0
- package/ckeditor/plugins/indent/lang/fr-ca.js +8 -0
- package/ckeditor/plugins/indent/lang/fr.js +8 -0
- package/ckeditor/plugins/indent/lang/gl.js +8 -0
- package/ckeditor/plugins/indent/lang/gu.js +8 -0
- package/ckeditor/plugins/indent/lang/he.js +8 -0
- package/ckeditor/plugins/indent/lang/hi.js +8 -0
- package/ckeditor/plugins/indent/lang/hr.js +8 -0
- package/ckeditor/plugins/indent/lang/hu.js +8 -0
- package/ckeditor/plugins/indent/lang/id.js +8 -0
- package/ckeditor/plugins/indent/lang/is.js +8 -0
- package/ckeditor/plugins/indent/lang/it.js +8 -0
- package/ckeditor/plugins/indent/lang/ja.js +8 -0
- package/ckeditor/plugins/indent/lang/ka.js +8 -0
- package/ckeditor/plugins/indent/lang/km.js +8 -0
- package/ckeditor/plugins/indent/lang/ko.js +8 -0
- package/ckeditor/plugins/indent/lang/ku.js +8 -0
- package/ckeditor/plugins/indent/lang/lt.js +8 -0
- package/ckeditor/plugins/indent/lang/lv.js +8 -0
- package/ckeditor/plugins/indent/lang/mk.js +8 -0
- package/ckeditor/plugins/indent/lang/mn.js +8 -0
- package/ckeditor/plugins/indent/lang/ms.js +8 -0
- package/ckeditor/plugins/indent/lang/nb.js +8 -0
- package/ckeditor/plugins/indent/lang/nl.js +8 -0
- package/ckeditor/plugins/indent/lang/no.js +8 -0
- package/ckeditor/plugins/indent/lang/oc.js +8 -0
- package/ckeditor/plugins/indent/lang/pl.js +8 -0
- package/ckeditor/plugins/indent/lang/pt-br.js +8 -0
- package/ckeditor/plugins/indent/lang/pt.js +8 -0
- package/ckeditor/plugins/indent/lang/ro.js +8 -0
- package/ckeditor/plugins/indent/lang/ru.js +8 -0
- package/ckeditor/plugins/indent/lang/si.js +8 -0
- package/ckeditor/plugins/indent/lang/sk.js +8 -0
- package/ckeditor/plugins/indent/lang/sl.js +8 -0
- package/ckeditor/plugins/indent/lang/sq.js +8 -0
- package/ckeditor/plugins/indent/lang/sr-latn.js +8 -0
- package/ckeditor/plugins/indent/lang/sr.js +8 -0
- package/ckeditor/plugins/indent/lang/sv.js +8 -0
- package/ckeditor/plugins/indent/lang/th.js +8 -0
- package/ckeditor/plugins/indent/lang/tr.js +8 -0
- package/ckeditor/plugins/indent/lang/tt.js +8 -0
- package/ckeditor/plugins/indent/lang/ug.js +8 -0
- package/ckeditor/plugins/indent/lang/uk.js +8 -0
- package/ckeditor/plugins/indent/lang/vi.js +8 -0
- package/ckeditor/plugins/indent/lang/zh-cn.js +8 -0
- package/ckeditor/plugins/indent/lang/zh.js +8 -0
- package/ckeditor/plugins/indent/plugin.js +461 -0
- package/ckeditor/plugins/justify/icons/hidpi/justifyblock.png +0 -0
- package/ckeditor/plugins/justify/icons/hidpi/justifycenter.png +0 -0
- package/ckeditor/plugins/justify/icons/hidpi/justifyleft.png +0 -0
- package/ckeditor/plugins/justify/icons/hidpi/justifyright.png +0 -0
- package/ckeditor/plugins/justify/icons/justifyblock.png +0 -0
- package/ckeditor/plugins/justify/icons/justifycenter.png +0 -0
- package/ckeditor/plugins/justify/icons/justifyleft.png +0 -0
- package/ckeditor/plugins/justify/icons/justifyright.png +0 -0
- package/ckeditor/plugins/justify/plugin.js +269 -0
- package/ckeditor/plugins/lineheight/LICENSE +22 -0
- package/ckeditor/plugins/lineheight/README.md +2 -0
- package/ckeditor/plugins/lineheight/lang/LANG.js +3 -0
- package/ckeditor/plugins/lineheight/lang/ar.js +3 -0
- package/ckeditor/plugins/lineheight/lang/de.js +3 -0
- package/ckeditor/plugins/lineheight/lang/en.js +3 -0
- package/ckeditor/plugins/lineheight/lang/es.js +3 -0
- package/ckeditor/plugins/lineheight/lang/fr.js +3 -0
- package/ckeditor/plugins/lineheight/lang/ko.js +3 -0
- package/ckeditor/plugins/lineheight/lang/pt.js +3 -0
- package/ckeditor/plugins/lineheight/plugin.js +81 -0
- package/ckeditor/plugins/lineheight/readme.txt +30 -0
- package/ckeditor/plugins/link/dialogs/anchor.js +9 -0
- package/ckeditor/plugins/link/dialogs/link.js +30 -0
- package/ckeditor/plugins/link/images/anchor.png +0 -0
- package/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- package/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
- package/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
- package/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
- package/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
- package/ckeditor/plugins/magicline/images/icon.png +0 -0
- package/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- package/ckeditor/plugins/pastefromgdocs/filter/default.js +8 -0
- package/ckeditor/plugins/pastefromlibreoffice/filter/default.js +11 -0
- package/ckeditor/plugins/pastefromword/filter/default.js +43 -0
- package/ckeditor/plugins/pastetools/filter/common.js +24 -0
- package/ckeditor/plugins/pastetools/filter/image.js +12 -0
- package/ckeditor/plugins/preview/images/pagebreak.gif +0 -0
- package/ckeditor/plugins/preview/preview.html +13 -0
- package/ckeditor/plugins/preview/styles/screen.css +10 -0
- package/ckeditor/plugins/scayt/CHANGELOG.md +4 -0
- package/ckeditor/plugins/scayt/LICENSE.md +28 -0
- package/ckeditor/plugins/scayt/README.md +81 -0
- package/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
- package/ckeditor/plugins/scayt/dialogs/options.js +32 -0
- package/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- package/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +25 -0
- package/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- package/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- package/ckeditor/plugins/simage/LICENSE +674 -0
- package/ckeditor/plugins/simage/README.md +73 -0
- package/ckeditor/plugins/simage/icons/simage.png +0 -0
- package/ckeditor/plugins/simage/plugin.js +154 -0
- package/ckeditor/plugins/smiley/dialogs/smiley.js +11 -0
- package/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/angel_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/angry_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- package/ckeditor/plugins/smiley/images/broken_heart.png +0 -0
- package/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/confused_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/cry_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/devil_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/embarrassed_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- package/ckeditor/plugins/smiley/images/envelope.png +0 -0
- package/ckeditor/plugins/smiley/images/heart.gif +0 -0
- package/ckeditor/plugins/smiley/images/heart.png +0 -0
- package/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- package/ckeditor/plugins/smiley/images/kiss.png +0 -0
- package/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- package/ckeditor/plugins/smiley/images/lightbulb.png +0 -0
- package/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/omg_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/regular_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/sad_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/shades_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/teeth_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- package/ckeditor/plugins/smiley/images/thumbs_down.png +0 -0
- package/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- package/ckeditor/plugins/smiley/images/thumbs_up.png +0 -0
- package/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/tongue_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png +0 -0
- package/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- package/ckeditor/plugins/smiley/images/wink_smile.png +0 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/af.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ar.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/az.js +10 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/bg.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ca.js +14 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/da.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/de-ch.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/en-au.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/en-ca.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/en-gb.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/es-mx.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/es.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/et.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/eu.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js +10 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/fr.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/gl.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/he.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/hu.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/id.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ja.js +9 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/km.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ko.js +10 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/lt.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/oc.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/pt.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ro.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ru.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/si.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sl.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sq.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sr-latn.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sr.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/tt.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/uk.js +12 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/vi.js +14 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- package/ckeditor/plugins/specialchar/dialogs/lang/zh.js +9 -0
- package/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
- package/ckeditor/plugins/table/dialogs/table.js +22 -0
- package/ckeditor/plugins/tableselection/styles/tableselection.css +36 -0
- package/ckeditor/plugins/tabletools/dialogs/tableCell.js +18 -0
- package/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- package/ckeditor/plugins/templates/dialogs/templates.js +11 -0
- package/ckeditor/plugins/templates/templatedefinition.js +4 -0
- package/ckeditor/plugins/templates/templates/default.js +7 -0
- package/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- package/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- package/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- package/ckeditor/plugins/textindent/icons/hidpi/textindent.png +0 -0
- package/ckeditor/plugins/textindent/icons/textindent.png +0 -0
- package/ckeditor/plugins/textindent/lang/en.js +3 -0
- package/ckeditor/plugins/textindent/lang/pt-br.js +3 -0
- package/ckeditor/plugins/textindent/plugin.js +99 -0
- package/ckeditor/plugins/widget/images/handle.png +0 -0
- package/ckeditor/samples/css/samples.css +1637 -0
- package/ckeditor/samples/img/github-top.png +0 -0
- package/ckeditor/samples/img/header-bg.png +0 -0
- package/ckeditor/samples/img/header-separator.png +0 -0
- package/ckeditor/samples/img/logo.png +0 -0
- package/ckeditor/samples/img/logo.svg +13 -0
- package/ckeditor/samples/img/navigation-tip.png +0 -0
- package/ckeditor/samples/index.html +130 -0
- package/ckeditor/samples/js/sample.js +53 -0
- package/ckeditor/samples/js/sf.js +17 -0
- package/ckeditor/samples/old/ajax.html +85 -0
- package/ckeditor/samples/old/api.html +210 -0
- package/ckeditor/samples/old/appendto.html +59 -0
- package/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- package/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- package/ckeditor/samples/old/assets/posteddata.php +60 -0
- package/ckeditor/samples/old/assets/sample.jpg +0 -0
- package/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- package/ckeditor/samples/old/datafiltering.html +508 -0
- package/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- package/ckeditor/samples/old/dialog/dialog.html +190 -0
- package/ckeditor/samples/old/divreplace.html +144 -0
- package/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- package/ckeditor/samples/old/htmlwriter/outputhtml.html +224 -0
- package/ckeditor/samples/old/index.html +129 -0
- package/ckeditor/samples/old/inlineall.html +314 -0
- package/ckeditor/samples/old/inlinebycode.html +124 -0
- package/ckeditor/samples/old/inlinetextarea.html +113 -0
- package/ckeditor/samples/old/jquery.html +103 -0
- package/ckeditor/samples/old/magicline/magicline.html +209 -0
- package/ckeditor/samples/old/readonly.html +76 -0
- package/ckeditor/samples/old/replacebyclass.html +60 -0
- package/ckeditor/samples/old/replacebycode.html +59 -0
- package/ckeditor/samples/old/sample.css +357 -0
- package/ckeditor/samples/old/sample.js +50 -0
- package/ckeditor/samples/old/sample_posteddata.php +16 -0
- package/ckeditor/samples/old/tabindex.html +78 -0
- package/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- package/ckeditor/samples/old/uicolor.html +72 -0
- package/ckeditor/samples/old/uilanguages.html +122 -0
- package/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- package/ckeditor/samples/old/xhtmlstyle.html +234 -0
- package/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- package/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- package/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- package/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- package/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- package/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- package/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- package/ckeditor/samples/toolbarconfigurator/index.html +447 -0
- package/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- package/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- package/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- package/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +19 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +325 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +38 -0
- package/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- package/ckeditor/skins/moono-lisa/dialog.css +5 -0
- package/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
- package/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
- package/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
- package/ckeditor/skins/moono-lisa/editor.css +5 -0
- package/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
- package/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
- package/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
- package/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
- package/ckeditor/skins/moono-lisa/icons.png +0 -0
- package/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
- package/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
- package/ckeditor/skins/moono-lisa/images/close.png +0 -0
- package/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
- package/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
- package/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
- package/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
- package/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
- package/ckeditor/skins/moono-lisa/images/lock.png +0 -0
- package/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
- package/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
- package/ckeditor/skins/moono-lisa/readme.md +46 -0
- package/ckeditor/styles.js +137 -0
- package/ckeditor/vendor/promise.js +13 -0
- package/comps/Animation/Checkbox.vue +37 -0
- package/comps/Animation/Radio.vue +30 -0
- package/comps/BooleanLabel.vue +40 -0
- package/comps/CardButton.vue +18 -0
- package/comps/CardImage.vue +40 -0
- package/comps/CardItem.vue +63 -0
- package/comps/CardList.vue +57 -0
- package/comps/CardNumber.vue +27 -0
- package/comps/Config/SelectColumns.vue +137 -0
- package/comps/CoreAgeMonth.vue +44 -0
- package/comps/CoreAppPassword.vue +31 -0
- package/comps/CoreAutocomplete.vue +93 -0
- package/comps/CoreCascader.vue +129 -0
- package/comps/CoreCascaderChildOrg.vue +165 -0
- package/comps/CoreCascaderChildPosition.vue +186 -0
- package/comps/CoreCkeditor.vue +324 -0
- package/comps/CoreColorPicker.vue +35 -0
- package/comps/CoreContextMenu.vue +81 -0
- package/comps/CoreDate.vue +56 -0
- package/comps/CoreDateRange.vue +34 -0
- package/comps/CoreDatetime.vue +34 -0
- package/comps/CoreDeepLink.vue +53 -0
- package/comps/CoreDurationJustified.vue +23 -0
- package/comps/CoreFiles.vue +497 -0
- package/comps/CoreFooter.vue +100 -0
- package/comps/CoreForm.vue +499 -0
- package/comps/CoreFormDialog.vue +140 -0
- package/comps/CoreFormFields.vue +306 -0
- package/comps/CoreFormItem.vue +114 -0
- package/comps/CoreFormItemCopy.vue +155 -0
- package/comps/CoreFormSub.vue +118 -0
- package/comps/CoreFormTable.vue +197 -0
- package/comps/CoreFormTableInline.vue +300 -0
- package/comps/CoreFormTableList.vue +268 -0
- package/comps/CoreIcon.vue +5 -0
- package/comps/CoreImage.vue +37 -0
- package/comps/CoreInlineNumber.vue +54 -0
- package/comps/CoreInputNumber.vue +49 -0
- package/comps/CoreInputSearch.vue +44 -0
- package/comps/CoreJson.vue +10 -0
- package/comps/CoreLoader.vue +153 -0
- package/comps/CoreLocked.vue +151 -0
- package/comps/CoreMergeConfirm.vue +59 -0
- package/comps/CoreMultipleInput.vue +51 -0
- package/comps/CorePanel.vue +33 -0
- package/comps/CorePdfDialog.vue +84 -0
- package/comps/CorePdfView.vue +52 -0
- package/comps/CoreRegexp.vue +41 -0
- package/comps/CoreSelect.vue +249 -0
- package/comps/CoreSelectEnum.vue +103 -0
- package/comps/CoreSelectGroup.vue +237 -0
- package/comps/CoreSelectGroupItem.vue +168 -0
- package/comps/CoreSelectGroupList.vue +386 -0
- package/comps/CoreSelectOrgEmp.vue +319 -0
- package/comps/CoreSelectTable.vue +277 -0
- package/comps/CoreSelectTree.vue +183 -0
- package/comps/CoreSelectTreeItem.vue +129 -0
- package/comps/CoreSelectTreeList.vue +149 -0
- package/comps/CoreSelectYear.vue +42 -0
- package/comps/CoreSignCertificate.vue +129 -0
- package/comps/CoreSpan.vue +31 -0
- package/comps/CoreStatus.vue +29 -0
- package/comps/CoreSwitch.vue +28 -0
- package/comps/CoreTable.vue +852 -0
- package/comps/CoreTableColumn.vue +78 -0
- package/comps/CoreTableColumnHeader.vue +25 -0
- package/comps/CoreTableColumnRow.vue +234 -0
- package/comps/CoreTableConfig.vue +248 -0
- package/comps/CoreTableImage.vue +89 -0
- package/comps/CoreTableSearch.vue +267 -0
- package/comps/CoreTableSearchDetail.vue +89 -0
- package/comps/CoreTableStatus.vue +71 -0
- package/comps/CoreUploadImage.vue +542 -0
- package/comps/CoreVideo.vue +44 -0
- package/comps/CoreVimeo.vue +135 -0
- package/comps/CoreVimeoLabel.vue +32 -0
- package/comps/CoreVueEditor.vue +106 -0
- package/comps/CoreXypService.vue +233 -0
- package/comps/CoreZoomImage.vue +99 -0
- package/comps/Custom/CrimeDescription.vue +195 -0
- package/comps/Custom/CrimeNum.vue +41 -0
- package/comps/Custom/EmployeeSelect.vue +243 -0
- package/comps/Custom/EmployeeText.vue +7 -0
- package/comps/Custom/EmployeeWorkFamilies.vue +36 -0
- package/comps/Custom/NationalLangSkills.vue +137 -0
- package/comps/Custom/TableLogs.vue +86 -0
- package/comps/Custom/UserClotheRow.vue +105 -0
- package/comps/Custom/UserClothes.vue +470 -0
- package/comps/Custom/UserRoles.vue +169 -0
- package/comps/Custom/UserSelect.vue +423 -0
- package/comps/Custom/UserSkills.vue +98 -0
- package/comps/MomentAddCode.vue +91 -0
- package/comps/SclHandbook.vue +135 -0
- package/comps/Sign/Dialog.vue +321 -0
- package/comps/Sign/Info.vue +43 -0
- package/comps/Sign/InfoDialog.vue +78 -0
- package/directives/el-dragDialog/drag.js +34 -0
- package/index.js +7 -0
- package/middleware/auth.js +28 -0
- package/middleware/confirm-leave.js +15 -0
- package/middleware/login.js +6 -0
- package/middleware/router.js +5 -0
- package/package.json +48 -0
- package/plugins/axios.js +51 -0
- package/plugins/chart.js +134 -0
- package/plugins/ckeditor.js +3 -0
- package/plugins/idle-logout.js +33 -0
- package/store/settings.js +236 -0
- package/store/user.js +215 -0
- package/utils/component-helper.js +336 -0
- package/utils/data-helper.js +236 -0
- package/utils/default-nuxt-config.js +116 -0
- package/utils/eslint-rules.js +12 -0
- package/utils/helpers.js +67 -0
- package/utils/message-helper.js +19 -0
- package/utils/number-helper.js +166 -0
- package/utils/number-texts.js +217 -0
- package/utils/regexps.js +86 -0
- package/utils/role-helper.js +52 -0
- package/utils/social-helper.js +58 -0
- package/utils/table-helper.js +1612 -0
|
@@ -0,0 +1,1612 @@
|
|
|
1
|
+
import { get, set, has, isEqual, cloneDeep, isEmpty } from 'lodash'
|
|
2
|
+
import { mapActions, mapGetters } from 'vuex'
|
|
3
|
+
import { getRegexp } from './regexps'
|
|
4
|
+
import { getFormComponent, getFormWidth, getFormColSpan, getFormRowSpan, getColWidth, getColAlign, isHidden } from './component-helper'
|
|
5
|
+
import { extractRegisterNum, getFormBoolean, addBusinessDays, getTriggerFields, getTriggerEquals, isValidJSON, getIdcardAddress, getAgeFromDate, getGenderFromName } from './data-helper'
|
|
6
|
+
import { groupFieldLog } from './role-helper'
|
|
7
|
+
import { uuidv4, base64ToBlob } from './helpers'
|
|
8
|
+
export const tableWatch = {
|
|
9
|
+
id () {
|
|
10
|
+
if (this.isCustom) {
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
this.$nextTick(() => {
|
|
14
|
+
this.resetTemp()
|
|
15
|
+
})
|
|
16
|
+
},
|
|
17
|
+
url () {
|
|
18
|
+
this.$nextTick(() => {
|
|
19
|
+
if (this.isCustom) {
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
this.resetDefaultTemp()
|
|
23
|
+
this.handleRefresh()
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
refreshListUrl () {
|
|
27
|
+
if (this.isCustom) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
this.handleRefreshList()
|
|
31
|
+
},
|
|
32
|
+
locale () {
|
|
33
|
+
this.handleRefreshList()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const tableComputed = {
|
|
37
|
+
...mapGetters('settings', ['unsavedChanges', 'loadingWindow', 'env']),
|
|
38
|
+
...mapGetters(['user_position_id', 'refs']),
|
|
39
|
+
...mapGetters('user', ['token']),
|
|
40
|
+
localeId () {
|
|
41
|
+
return this.tempLocaleId || this.locale?._id || (this.locales?.length ? this.locales[0]._id : null)
|
|
42
|
+
},
|
|
43
|
+
pk_field_name () {
|
|
44
|
+
return this.project ? this.project.pk_field_name : '_id'
|
|
45
|
+
},
|
|
46
|
+
url () {
|
|
47
|
+
return this.customUrl || `${this.projectId}/${this.tableName}`
|
|
48
|
+
},
|
|
49
|
+
urlOne () {
|
|
50
|
+
return this.customUrl || `${this.projectId}/${this.tableName}`
|
|
51
|
+
},
|
|
52
|
+
urlTable () {
|
|
53
|
+
return `${this.projectId}/${this.table?.name}`
|
|
54
|
+
},
|
|
55
|
+
urlExcel () {
|
|
56
|
+
return this.customExcelUrl || `excel/${this.url}`
|
|
57
|
+
},
|
|
58
|
+
urlProfileDownload () {
|
|
59
|
+
return `profileDownload/${this.url}/${this.id}`
|
|
60
|
+
},
|
|
61
|
+
statusCount: {
|
|
62
|
+
get () {
|
|
63
|
+
return this.data?.statusCount || null
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
qstatus: {
|
|
67
|
+
get () {
|
|
68
|
+
return this.queryStatus || this.$route.query.qstatus || 'count'
|
|
69
|
+
},
|
|
70
|
+
set (val) {
|
|
71
|
+
this.$router.push({ query: { ...this.$route.query, qstatus: val, page: 1 } })
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
totalDurationMs () {
|
|
75
|
+
return this.data?.totalDurationMs || null
|
|
76
|
+
},
|
|
77
|
+
list: {
|
|
78
|
+
get () {
|
|
79
|
+
if (this.data.length === 2 && Array.isArray(this.data[0])) {
|
|
80
|
+
return this.data[0]
|
|
81
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data) && this.data.rows) {
|
|
82
|
+
return this.data.rows
|
|
83
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data) && this.data.list) {
|
|
84
|
+
return this.data.list
|
|
85
|
+
} else {
|
|
86
|
+
return this.data
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
set (val) {
|
|
90
|
+
if (this.data.length === 2 && Array.isArray(this.data[0])) {
|
|
91
|
+
this.data[0] = val || []
|
|
92
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data) && this.data.rows) {
|
|
93
|
+
this.data.rows = val || []
|
|
94
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data) && this.data.list) {
|
|
95
|
+
this.data.list = val || []
|
|
96
|
+
} else {
|
|
97
|
+
this.data = val
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
count: {
|
|
102
|
+
get () {
|
|
103
|
+
if (this.qstatus && has(this.statusCount, this.qstatus)) {
|
|
104
|
+
return Number(this.statusCount[this.qstatus])
|
|
105
|
+
}
|
|
106
|
+
if (this.data.length === 2 && Array.isArray(this.data[0])) {
|
|
107
|
+
return this.data[1] || 0
|
|
108
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data)) {
|
|
109
|
+
return this.data.count || 0
|
|
110
|
+
} else {
|
|
111
|
+
return this.data.length
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
set (val) {
|
|
115
|
+
if (this.data.length === 2 && Array.isArray(this.data[0])) {
|
|
116
|
+
this.data[1] = val
|
|
117
|
+
} else if (typeof this.data === 'object' && !Array.isArray(this.data)) {
|
|
118
|
+
this.data.count = val
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
refreshListUrl () {
|
|
123
|
+
return this.currentPage + '-' + this.pageSize + '-' + this.qstatus
|
|
124
|
+
},
|
|
125
|
+
localKeySort () {
|
|
126
|
+
if (this.noCache) {
|
|
127
|
+
return ''
|
|
128
|
+
}
|
|
129
|
+
if (!this.tableName?.includes('service_')) {
|
|
130
|
+
return ''
|
|
131
|
+
}
|
|
132
|
+
return `sort_${this.tableName}${this.id || ''}`
|
|
133
|
+
},
|
|
134
|
+
localKeySearch () {
|
|
135
|
+
if (this.noCache) {
|
|
136
|
+
return ''
|
|
137
|
+
}
|
|
138
|
+
if (!['service_', 'config_'].some(c => this.tableName?.includes(c))) {
|
|
139
|
+
return ''
|
|
140
|
+
}
|
|
141
|
+
return `search_${this.tableName}`
|
|
142
|
+
},
|
|
143
|
+
localKeyPageSize () {
|
|
144
|
+
if (this.noCache) {
|
|
145
|
+
return ''
|
|
146
|
+
}
|
|
147
|
+
if (!this.tableName?.includes('service_')) {
|
|
148
|
+
return ''
|
|
149
|
+
}
|
|
150
|
+
return `page_size_${this.tableName}`
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export const tableData = {
|
|
154
|
+
data: [],
|
|
155
|
+
loading: false,
|
|
156
|
+
confirming: false,
|
|
157
|
+
loadingForm: false,
|
|
158
|
+
loadingExcel: false,
|
|
159
|
+
restoringPassword: false,
|
|
160
|
+
downloadingProfile: false,
|
|
161
|
+
saving: false,
|
|
162
|
+
search: null,
|
|
163
|
+
visible: false,
|
|
164
|
+
defaultTemp: null,
|
|
165
|
+
temp: null,
|
|
166
|
+
rules: null,
|
|
167
|
+
selectedList: [],
|
|
168
|
+
onlyList: false,
|
|
169
|
+
listPage: 1,
|
|
170
|
+
pageSize: 0,
|
|
171
|
+
formSearching: false,
|
|
172
|
+
cancel: null,
|
|
173
|
+
updateGroupName: null,
|
|
174
|
+
currentRow: null,
|
|
175
|
+
currentRows: null,
|
|
176
|
+
locale: null,
|
|
177
|
+
isConfirmedDescription: false,
|
|
178
|
+
noCache: false,
|
|
179
|
+
clientDurationMs: null
|
|
180
|
+
}
|
|
181
|
+
export const tableAsyncData = {
|
|
182
|
+
currentPage: 1,
|
|
183
|
+
configProjectId: null,
|
|
184
|
+
project: null,
|
|
185
|
+
table: null,
|
|
186
|
+
formWidth: null,
|
|
187
|
+
columns: null,
|
|
188
|
+
configTableName: null,
|
|
189
|
+
configColFields: null,
|
|
190
|
+
hasPassword: null,
|
|
191
|
+
refColumns: null,
|
|
192
|
+
subColumn: null,
|
|
193
|
+
parentRow: null,
|
|
194
|
+
readOnly: null,
|
|
195
|
+
config_group_fields: null,
|
|
196
|
+
config_form_menus: null,
|
|
197
|
+
loadingVisible: false,
|
|
198
|
+
initted: false,
|
|
199
|
+
hideLog: true,
|
|
200
|
+
isCustom: true,
|
|
201
|
+
forensics: []
|
|
202
|
+
}
|
|
203
|
+
export const tableMethods = {
|
|
204
|
+
...mapActions('settings', ['set_unsaved_changes', 'set_merge', 'set_loading_window', 'set_handbook_id']),
|
|
205
|
+
async handleFormSearch ({ col_field }) {
|
|
206
|
+
if (this[`handleFormSearch_${col_field}`]) {
|
|
207
|
+
return this[`handleFormSearch_${col_field}`]()
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
// if (this.beforeFormSearch) {
|
|
211
|
+
// this.beforeFormSearch(col_field)
|
|
212
|
+
// }
|
|
213
|
+
if (!this.temp[col_field]?.trim()) {
|
|
214
|
+
return
|
|
215
|
+
}
|
|
216
|
+
if (this.formSearching) {
|
|
217
|
+
return
|
|
218
|
+
}
|
|
219
|
+
this.formSearching = true
|
|
220
|
+
if (col_field === 'register_num') {
|
|
221
|
+
const isEmployee = this.table?.name === 'hrm_employees'
|
|
222
|
+
if (isEmployee && !this.temp?._id) {
|
|
223
|
+
const { data } = await this.$axios.get(`one/${this.urlTable}`, {
|
|
224
|
+
params: {
|
|
225
|
+
search: JSON.stringify({ [col_field]: { val: this.temp[col_field], t: 'string', op: 'eq' } }),
|
|
226
|
+
locale_id: this.localeId,
|
|
227
|
+
fields: ['_id']
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
if (data) {
|
|
231
|
+
try {
|
|
232
|
+
await this.$showConfirm('Регистрийн дугаараар бүртгэл олдлоо. Хуудас руу шилжих үү?')
|
|
233
|
+
this.set_unsaved_changes(false)
|
|
234
|
+
this.tid = data.tid
|
|
235
|
+
this.id = data._id
|
|
236
|
+
} catch (_) {}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const isLegal = this.columns.some(c => c.col_field === 'is_legal') && !!this.temp?.is_legal
|
|
240
|
+
if (isLegal) {
|
|
241
|
+
const { data } = await this.$axios.get('xypservice/legal/info', {
|
|
242
|
+
params: {
|
|
243
|
+
[col_field]: this.temp[col_field]
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
const general = data.response.general
|
|
247
|
+
let induty = data.response.induty?.find(c => c.main?.trim()?.toLowerCase() === 'үндсэн')
|
|
248
|
+
if (induty) {
|
|
249
|
+
induty = get(data.response.induty, '[0]')
|
|
250
|
+
}
|
|
251
|
+
const addr = data.response.address
|
|
252
|
+
const addressSegments = [
|
|
253
|
+
addr?.stateCity?.name,
|
|
254
|
+
addr?.soumDistrict?.name,
|
|
255
|
+
addr?.bagKhoroo?.name
|
|
256
|
+
]
|
|
257
|
+
if (addr?.region?.name) {
|
|
258
|
+
addressSegments.push(addr?.region?.name)
|
|
259
|
+
}
|
|
260
|
+
if (addr?.town?.name) {
|
|
261
|
+
addressSegments.push(addr?.town?.name)
|
|
262
|
+
}
|
|
263
|
+
if (addr?.street?.name) {
|
|
264
|
+
addressSegments.push(addr?.street?.name + (addr?.street?.name?.toLowerCase().includes('гудамж') ? '' : ' гудамж'))
|
|
265
|
+
}
|
|
266
|
+
if (addr?.apartment?.name) {
|
|
267
|
+
addressSegments.push(addr?.apartment?.name + (addr?.apartment?.name?.toLowerCase().includes('байр') ? '' : ' байр'))
|
|
268
|
+
}
|
|
269
|
+
if (addr?.door) {
|
|
270
|
+
addressSegments.push(addr?.door)
|
|
271
|
+
}
|
|
272
|
+
const updateData = {
|
|
273
|
+
xyp_log_id: data._id,
|
|
274
|
+
passport_address: addressSegments.join(', '),
|
|
275
|
+
legal_entity_activity: induty?.industryName || '',
|
|
276
|
+
legal_entity_name: general.companyName,
|
|
277
|
+
legal_entity_register: general?.stateRegnum || ''
|
|
278
|
+
}
|
|
279
|
+
this.temp = {
|
|
280
|
+
...this.temp,
|
|
281
|
+
...updateData
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
let idDownload = false
|
|
285
|
+
try {
|
|
286
|
+
const { data } = await this.$axios.get('xypservice/idcard/info', {
|
|
287
|
+
params: {
|
|
288
|
+
[col_field]: this.temp[col_field]
|
|
289
|
+
}
|
|
290
|
+
})
|
|
291
|
+
const response = data.response
|
|
292
|
+
if (response) {
|
|
293
|
+
idDownload = true
|
|
294
|
+
const updateData = {
|
|
295
|
+
surname: response.lastname,
|
|
296
|
+
given_name: response.firstname
|
|
297
|
+
}
|
|
298
|
+
if (this.columns.some(c => c.col_field === 'image') && !this.temp?.image) {
|
|
299
|
+
updateData.image = await this.uploadImageBase64Id(response.image)
|
|
300
|
+
}
|
|
301
|
+
if (this.isXypLog) {
|
|
302
|
+
updateData.xyp_log_id = data._id
|
|
303
|
+
}
|
|
304
|
+
if (this.columns.some(c => c.col_field === 'forename')) {
|
|
305
|
+
updateData.forename = response.surname
|
|
306
|
+
}
|
|
307
|
+
if (this.columns.some(c => c.col_field === 'passport_address')) {
|
|
308
|
+
const passport_address = getIdcardAddress(response)
|
|
309
|
+
updateData.passport_address = passport_address
|
|
310
|
+
}
|
|
311
|
+
if (response.birthDateAsText && this.columns.some(c => c.col_field === 'birth_date')) {
|
|
312
|
+
updateData.birth_date = this.$moment(response.birthDateAsText, 'YYYY-MM-DD HH:mm').toDate()
|
|
313
|
+
if (this.columns.some(c => c.col_field === 'age')) {
|
|
314
|
+
updateData.age = getAgeFromDate(updateData.birth_date)
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (response.gender && this.columns.some(c => c.col_field === 'gender_id')) {
|
|
318
|
+
if (has(response, 'gender_id')) {
|
|
319
|
+
updateData.gender_id = response.gender_id
|
|
320
|
+
} else {
|
|
321
|
+
updateData.gender_id = getGenderFromName(response.gender, this.refs)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (response.birthDateAsText && this.columns.some(c => c.col_field === 'is_adult')) {
|
|
325
|
+
updateData.is_adult = getAgeFromDate(this.$moment(response.birthDateAsText, 'YYYY-MM-DD HH:mm').toDate()) >= 18
|
|
326
|
+
}
|
|
327
|
+
this.temp = {
|
|
328
|
+
...this.temp,
|
|
329
|
+
...updateData
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
} catch (err) {
|
|
333
|
+
this.$log(err)
|
|
334
|
+
}
|
|
335
|
+
if (!idDownload) {
|
|
336
|
+
const { data } = await this.$axios.get('xypservice/birth/info', {
|
|
337
|
+
params: {
|
|
338
|
+
[col_field]: this.temp[col_field]
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
const response = data.response
|
|
342
|
+
if (response) {
|
|
343
|
+
idDownload = true
|
|
344
|
+
const updateData = {
|
|
345
|
+
surname: response.lastname,
|
|
346
|
+
given_name: response.firstname
|
|
347
|
+
}
|
|
348
|
+
if (this.isXypLog) {
|
|
349
|
+
updateData.xyp_log_id = data._id
|
|
350
|
+
}
|
|
351
|
+
if (this.columns.some(c => c.col_field === 'forename')) {
|
|
352
|
+
updateData.forename = response.surname
|
|
353
|
+
}
|
|
354
|
+
if (response.birthDateAsText && this.columns.some(c => c.col_field === 'birth_date')) {
|
|
355
|
+
updateData.birth_date = this.$moment(response.birthDateAsText, 'YYYY-MM-DD HH:mm').toDate()
|
|
356
|
+
if (this.columns.some(c => c.col_field === 'age')) {
|
|
357
|
+
updateData.age = getAgeFromDate(updateData.birth_date)
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (response.gender && this.columns.some(c => c.col_field === 'gender_id')) {
|
|
361
|
+
if (has(response, 'gender_id')) {
|
|
362
|
+
updateData.gender_id = response.gender_id
|
|
363
|
+
} else {
|
|
364
|
+
updateData.gender_id = getGenderFromName(response.gender, this.refs)
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (response.birthDateAsText && this.columns.some(c => c.col_field === 'is_adult')) {
|
|
368
|
+
updateData.is_adult = getAgeFromDate(this.$moment(response.birthDateAsText, 'YYYY-MM-DD HH:mm').toDate()) >= 18
|
|
369
|
+
}
|
|
370
|
+
this.temp = { ...this.temp, ...updateData }
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (idDownload) {
|
|
374
|
+
this.$showSuccess('ХУР системээс амжилттай дуудлаа.')
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} else {
|
|
378
|
+
const { data } = await this.$axios.get(`one/${this.url}`, {
|
|
379
|
+
params: {
|
|
380
|
+
search: JSON.stringify({ [col_field]: { val: this.temp[col_field], t: 'string', op: 'eq' } }),
|
|
381
|
+
locale_id: this.localeId
|
|
382
|
+
}
|
|
383
|
+
})
|
|
384
|
+
if (data) {
|
|
385
|
+
this.id = data[this.pk_field_name]
|
|
386
|
+
this.tid = data.tid
|
|
387
|
+
this.$message({ message: 'Бүртгэл олдлоо.', type: 'success', showClose: true })
|
|
388
|
+
} else {
|
|
389
|
+
this.$customError('Бүртгэл олдсонгүй.')
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
} catch (err) {
|
|
393
|
+
this.$showError(err)
|
|
394
|
+
} finally {
|
|
395
|
+
this.formSearching = false
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
handleSelectionClear () {
|
|
399
|
+
this.selectedList = []
|
|
400
|
+
},
|
|
401
|
+
handleSelectionChange (row) {
|
|
402
|
+
const index = this.selectedList.findIndex(c => c[this.pk_field_name] === row[this.pk_field_name])
|
|
403
|
+
if (index > -1) {
|
|
404
|
+
this.selectedList.splice(index, 1)
|
|
405
|
+
} else {
|
|
406
|
+
this.selectedList.push(row)
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
handleTempChangeAll ($event) {
|
|
410
|
+
this.temp = { ...this.temp, ...$event }
|
|
411
|
+
},
|
|
412
|
+
handleTempChange ({ col_field }, val) {
|
|
413
|
+
let newVal = val
|
|
414
|
+
const oldVal = cloneDeep(get(this.temp, col_field))
|
|
415
|
+
// // hrm/service_clothe_tamachis?id=create tur
|
|
416
|
+
if (this.table.name === 'hrm_employee_vacations') {
|
|
417
|
+
set(this.temp, col_field, newVal)
|
|
418
|
+
if (!isNaN(this.temp.vacation_days) && !isNaN(this.temp.add_days)) {
|
|
419
|
+
set(this.temp, 'total_days', Number(this.temp.vacation_days) + Number(this.temp.add_days))
|
|
420
|
+
} else {
|
|
421
|
+
set(this.temp, 'total_days', 0)
|
|
422
|
+
}
|
|
423
|
+
if (this.temp.start_date && !isNaN(this.temp.total_days)) {
|
|
424
|
+
set(this.temp, 'end_date', addBusinessDays(this.temp.start_date, this.temp.total_days, this.holidays))
|
|
425
|
+
} else {
|
|
426
|
+
set(this.temp, 'end_date', null)
|
|
427
|
+
}
|
|
428
|
+
} else if (this.table.name === 'clothe_tamachis') {
|
|
429
|
+
if (col_field === 'clothe_reg_id') {
|
|
430
|
+
const obj = { ...val }
|
|
431
|
+
if (val) {
|
|
432
|
+
newVal = obj
|
|
433
|
+
set(this.temp, 'lifetime_year', obj.lifetime_year)
|
|
434
|
+
} else {
|
|
435
|
+
set(this.temp, 'lifetime_year', 0)
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
set(this.temp, col_field, newVal)
|
|
439
|
+
if (this.temp.received_date && !isNaN(this.temp.lifetime_year)) {
|
|
440
|
+
set(this.temp, 'next_receive_date', this.$moment(this.temp.received_date, 'YYYY-MM-DD').add(this.temp.lifetime_year, 'years').format('YYYY-MM-DD'))
|
|
441
|
+
} else {
|
|
442
|
+
set(this.temp, 'next_receive_date', null)
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
set(this.temp, col_field, newVal)
|
|
446
|
+
if (col_field === 'register_num') {
|
|
447
|
+
const updateData = {}
|
|
448
|
+
const extractedData = extractRegisterNum(this.temp[col_field], this.refs)
|
|
449
|
+
if (extractedData.birth_date && this.columns.some(c => c.col_field === 'birth_date')) {
|
|
450
|
+
updateData.birth_date = extractedData.birth_date
|
|
451
|
+
}
|
|
452
|
+
if (extractedData.age && this.columns.some(c => c.col_field === 'age')) {
|
|
453
|
+
updateData.age = extractedData.age
|
|
454
|
+
}
|
|
455
|
+
if (extractedData.gender_id && this.columns.some(c => c.col_field === 'gender_id')) {
|
|
456
|
+
updateData.gender_id = extractedData.gender_id
|
|
457
|
+
}
|
|
458
|
+
if (extractedData.age && this.columns.some(c => c.col_field === 'is_adult')) {
|
|
459
|
+
updateData.is_adult = extractedData.age >= 18
|
|
460
|
+
}
|
|
461
|
+
if (!isEmpty(updateData)) {
|
|
462
|
+
this.temp = { ...this.temp, ...updateData }
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (col_field === 'birth_date' && has(this.temp, 'age')) {
|
|
466
|
+
this.temp.age = getAgeFromDate(this.temp[col_field])
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (!isEqual(oldVal, newVal)) {
|
|
470
|
+
this.set_unsaved_changes(true)
|
|
471
|
+
}
|
|
472
|
+
if (this.afterTempChange) {
|
|
473
|
+
this.afterTempChange()
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
handleClose () {
|
|
477
|
+
this.tid = null
|
|
478
|
+
setTimeout(() => {
|
|
479
|
+
this.id = null
|
|
480
|
+
if (this.handleClosed) {
|
|
481
|
+
this.handleClosed()
|
|
482
|
+
}
|
|
483
|
+
}, 100)
|
|
484
|
+
},
|
|
485
|
+
resetDefaultTemp (options) {
|
|
486
|
+
const defaultTemp = {}
|
|
487
|
+
const rules = {}
|
|
488
|
+
if (!this.columns) {
|
|
489
|
+
return
|
|
490
|
+
}
|
|
491
|
+
if (this.config_group_fields) {
|
|
492
|
+
const inlineTables = this.config_group_fields.filter(c => c.group_type === 'INLINE_TABLE').map((c) => { return { name: c.name, table_name: c.col_fields } })
|
|
493
|
+
for (const inlineTable of inlineTables) {
|
|
494
|
+
defaultTemp[inlineTable.name] = []
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
for (const col of this.columns.filter(c => c.col_field && c.form)) {
|
|
498
|
+
const trigger_requireds = getTriggerFields(col.trigger_fields, 'required')
|
|
499
|
+
const trigger_required = get(trigger_requireds, '[0]')
|
|
500
|
+
let ruleType = 'string'
|
|
501
|
+
if (col.form.col_default === 'increment') {
|
|
502
|
+
set(defaultTemp, col.col_field, null)
|
|
503
|
+
continue
|
|
504
|
+
}
|
|
505
|
+
if (col.form.col_default === 'now') {
|
|
506
|
+
set(defaultTemp, col.col_field, this.$moment().format('YYYY-MM-DD'))
|
|
507
|
+
} else if (['decimal', 'number'].includes(col.col_type)) {
|
|
508
|
+
ruleType = 'number'
|
|
509
|
+
let valNumber = 0
|
|
510
|
+
if (!isNaN(col.form.col_default)) {
|
|
511
|
+
valNumber = Number(col.form.col_default)
|
|
512
|
+
}
|
|
513
|
+
set(defaultTemp, col.col_field, valNumber)
|
|
514
|
+
} else if (col.col_type === 'boolean') {
|
|
515
|
+
ruleType = 'boolean'
|
|
516
|
+
set(defaultTemp, col.col_field, getFormBoolean(col.form.col_default))
|
|
517
|
+
} else if (col.col_type === 'manyToOne' && col.col_default && typeof col.col_default === 'object') {
|
|
518
|
+
set(defaultTemp, col.col_field, col.col_default)
|
|
519
|
+
} else {
|
|
520
|
+
set(defaultTemp, col.col_field, col.form.col_default)
|
|
521
|
+
}
|
|
522
|
+
// if (col.form.isHide && col.form.isHide[1].includes(get(this.temp, col.form.isHide[0]))) {
|
|
523
|
+
// continue
|
|
524
|
+
// }
|
|
525
|
+
if (!rules[col.col_field]) {
|
|
526
|
+
rules[col.col_field] = []
|
|
527
|
+
}
|
|
528
|
+
if (getFormBoolean(col.col_multiple)) {
|
|
529
|
+
ruleType = 'array'
|
|
530
|
+
} else if (['manyToOne', 'image', 'file', 'profileImage', 'icon'].includes(col.col_type)) {
|
|
531
|
+
// if (['hrm_employees', 'hrm_users'].includes(col.ref_table)) {
|
|
532
|
+
// ruleType = 'string'
|
|
533
|
+
// } else {
|
|
534
|
+
// ruleType = 'object'
|
|
535
|
+
// }
|
|
536
|
+
ruleType = 'object'
|
|
537
|
+
}
|
|
538
|
+
if (col.form.required && !col.form.col_readonly) {
|
|
539
|
+
let trigger = 'change'
|
|
540
|
+
if (['decimal', 'number'].includes(col.col_type)) {
|
|
541
|
+
trigger = 'blur'
|
|
542
|
+
}
|
|
543
|
+
rules[col.col_field].push({ type: ruleType, required: true, trigger, message: options?.noMessage ? ' ' : `"${col.form.label || (col.props && col.props.label) || 'no label'}" утга шаардана.` })
|
|
544
|
+
} else if (trigger_required) {
|
|
545
|
+
let trigger = 'change'
|
|
546
|
+
if (['decimal', 'number'].includes(col.col_type)) {
|
|
547
|
+
trigger = 'blur'
|
|
548
|
+
}
|
|
549
|
+
rules[col.col_field].push({
|
|
550
|
+
type: ruleType,
|
|
551
|
+
required: (r) => {
|
|
552
|
+
return getTriggerEquals(trigger_required, r, false)
|
|
553
|
+
},
|
|
554
|
+
trigger,
|
|
555
|
+
message: options?.noMessage ? ' ' : `"${col.form.label || (col.props && col.props.label) || 'no label'}" утга шаардана.`
|
|
556
|
+
})
|
|
557
|
+
}
|
|
558
|
+
if (col.col_field && col.col_field.toLowerCase().endsWith('mail')) {
|
|
559
|
+
rules[col.col_field].push({ type: 'email', trigger: 'change', message: options?.noMessage ? ' ' : `"${col.form.label || (col.props && col.props.label) || 'no label'}" буруу байна.` })
|
|
560
|
+
} else {
|
|
561
|
+
const { pattern, patternMessage } = getRegexp(col.col_field, col.form.pattern)
|
|
562
|
+
if (pattern) {
|
|
563
|
+
rules[col.col_field].push({ type: 'regexp', pattern, trigger: 'change', message: options?.noMessage ? ' ' : `${patternMessage || 'Утга буруу байна.'}` })
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (col.form.min) {
|
|
567
|
+
rules[col.col_field].push({
|
|
568
|
+
type: ruleType,
|
|
569
|
+
min: col.form.min,
|
|
570
|
+
trigger: 'change',
|
|
571
|
+
message: options?.noMessage ? ' ' : `Хамгийн багадаа [${col.form.min}] урттай байна.`
|
|
572
|
+
})
|
|
573
|
+
}
|
|
574
|
+
if (col.form.max) {
|
|
575
|
+
rules[col.col_field].push({
|
|
576
|
+
type: ruleType,
|
|
577
|
+
max: col.form.max,
|
|
578
|
+
trigger: 'change',
|
|
579
|
+
message: `Хамгийн ихдээ [${col.form.max}] урттай байна.`
|
|
580
|
+
})
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
for (const extraField of (this.customExtraFields?.split(',') || [])) {
|
|
584
|
+
if (!has(defaultTemp, extraField)) {
|
|
585
|
+
set(defaultTemp, extraField, null)
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
this.setParentVal(defaultTemp)
|
|
589
|
+
this.defaultTemp = Object.assign({}, defaultTemp)
|
|
590
|
+
this.rules = Object.assign({}, rules)
|
|
591
|
+
this.clearValidateForm()
|
|
592
|
+
if (this.afterResetDefaultTemp) {
|
|
593
|
+
this.afterResetDefaultTemp()
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
setParentVal (obj) {
|
|
597
|
+
if (this.subColumn && obj) {
|
|
598
|
+
if (this.inlineParentTemp) {
|
|
599
|
+
obj[this.subColumn.col_field] = cloneDeep(this.inlineParentTemp) // ? this.parentRow[this.pk_field_name] : null
|
|
600
|
+
} else {
|
|
601
|
+
obj[this.subColumn.col_field] = cloneDeep(this.parentRow)
|
|
602
|
+
}
|
|
603
|
+
const trigger_fields = getTriggerFields(this.subColumn.trigger_fields)
|
|
604
|
+
for (const { localKey, localVal } of trigger_fields) {
|
|
605
|
+
if (localVal.includes('#')) {
|
|
606
|
+
const tempKey = localVal.substring(1)
|
|
607
|
+
if (this.parentRow && this.parentRow[tempKey]) {
|
|
608
|
+
const parentVal = this.parentRow[tempKey]
|
|
609
|
+
const parentType = typeof this.parentRow[tempKey]
|
|
610
|
+
if (parentType === 'object' && Array.isArray(parentVal)) {
|
|
611
|
+
obj[localKey] = [...parentVal]
|
|
612
|
+
} else if (parentType === 'object') {
|
|
613
|
+
obj[localKey] = { ...parentVal }
|
|
614
|
+
} else {
|
|
615
|
+
obj[localKey] = parentVal
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
obj[localKey] = null
|
|
619
|
+
}
|
|
620
|
+
} else {
|
|
621
|
+
obj[localKey] = localVal
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
async clearValidateForm () {
|
|
627
|
+
await this.$nextTick()
|
|
628
|
+
await this.$nextTick()
|
|
629
|
+
const form = get(this.$refs, 'coreForm')
|
|
630
|
+
if (form) {
|
|
631
|
+
form.clearValidate()
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
async handleLocaleChange (locale) {
|
|
635
|
+
this.temp.locale_id = locale._id
|
|
636
|
+
if (this.temp?.locale_uuid) {
|
|
637
|
+
await this.resetTemp(this.temp._id, this.temp.tid, locale._id)
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
async resetTemp (id = this.id, tid = this.tid, locale_id) {
|
|
641
|
+
try {
|
|
642
|
+
if (!locale_id) {
|
|
643
|
+
this.temp = null
|
|
644
|
+
}
|
|
645
|
+
if (id === 'create') {
|
|
646
|
+
let localTemp = null
|
|
647
|
+
if (this.tableName === 'service_reg_resolutions' && isValidJSON(localStorage.getItem('reg_type_id'))) {
|
|
648
|
+
const regTypeCode = JSON.parse(localStorage.getItem('reg_type_id'))?.code
|
|
649
|
+
if (['07', '06'].includes(regTypeCode)) {
|
|
650
|
+
const { data } = await this.$axios.get(`forensic/default/question/${regTypeCode}`)
|
|
651
|
+
localTemp = data
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
const temp = Object.assign({
|
|
655
|
+
...this.defaultTemp,
|
|
656
|
+
locale_uuid: null,
|
|
657
|
+
locale_id: this.locale,
|
|
658
|
+
...localTemp
|
|
659
|
+
})
|
|
660
|
+
if (this.isXypLog) {
|
|
661
|
+
temp.xyp_log_id = null
|
|
662
|
+
}
|
|
663
|
+
this.temp = temp
|
|
664
|
+
this.clearValidateForm()
|
|
665
|
+
if (this.resetedTemp) {
|
|
666
|
+
this.resetedTemp()
|
|
667
|
+
}
|
|
668
|
+
} else if (id) {
|
|
669
|
+
if (this.loadingForm) {
|
|
670
|
+
return
|
|
671
|
+
}
|
|
672
|
+
// const select = this.columns.filter(c => c.col_field).map((c) => { return c.col_field })
|
|
673
|
+
this.loadingForm = true
|
|
674
|
+
this.clearValidateForm()
|
|
675
|
+
const extraFields = []
|
|
676
|
+
if (this.extraFields) {
|
|
677
|
+
extraFields.push(...this.extraFields?.split(','))
|
|
678
|
+
}
|
|
679
|
+
if (this.customExtraFields) {
|
|
680
|
+
extraFields.push(...this.customExtraFields?.split(','))
|
|
681
|
+
}
|
|
682
|
+
const { data } = await this.$axios.get(`${this.urlOne}/${id}`, {
|
|
683
|
+
params: {
|
|
684
|
+
locale_id,
|
|
685
|
+
extraFields: extraFields.join(','),
|
|
686
|
+
tid
|
|
687
|
+
}
|
|
688
|
+
})
|
|
689
|
+
if (!data) {
|
|
690
|
+
this.$nuxt.error({ statusCode: 402 })
|
|
691
|
+
}
|
|
692
|
+
const temp = {
|
|
693
|
+
[this.pk_field_name]: data[this.pk_field_name],
|
|
694
|
+
work_families: data.work_families,
|
|
695
|
+
employee_history_text: data.employee_history_text,
|
|
696
|
+
employee_degree_text: data.employee_degree_text,
|
|
697
|
+
all_history_text: data.all_history_text,
|
|
698
|
+
tid: data.tid
|
|
699
|
+
}
|
|
700
|
+
for (const key in this.defaultTemp) {
|
|
701
|
+
const col = this.columns.find(c => c.col_field === key)
|
|
702
|
+
if (col && col.col_type === 'boolean') {
|
|
703
|
+
temp[key] = getFormBoolean(data[key])
|
|
704
|
+
} else {
|
|
705
|
+
temp[key] = data[key]
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
if (this.locales?.length) {
|
|
709
|
+
temp.locale_id = data.locale_id
|
|
710
|
+
temp.locale_uuid = data.locale_uuid
|
|
711
|
+
}
|
|
712
|
+
if (this.isXypLog) {
|
|
713
|
+
temp.xyp_log_id = data.xyp_log_id ?? null
|
|
714
|
+
}
|
|
715
|
+
for (const extraField of (this.customExtraFields?.split(',') || [])) {
|
|
716
|
+
if (!has(temp, extraField)) {
|
|
717
|
+
set(temp, extraField, get(data, extraField))
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
this.temp = Object.assign({}, this.defaultTemp, temp)
|
|
721
|
+
if (this.resetedTemp) {
|
|
722
|
+
this.resetedTemp()
|
|
723
|
+
}
|
|
724
|
+
} else if (this.isFormSub) {
|
|
725
|
+
this.search[this.subColumn.col_field] = { val: this.parentRow ? this.parentRow[this.pk_field_name] : 'null', t: 'number', op: 'eq' }
|
|
726
|
+
const trigger_fields = getTriggerFields(this.subColumn.trigger_fields)
|
|
727
|
+
for (const { localKey, localVal, type, operation } of trigger_fields) {
|
|
728
|
+
if (localVal.includes('#')) {
|
|
729
|
+
const tempKey = localVal.substring(1)
|
|
730
|
+
this.search[localKey] = { val: this.parentRow[tempKey], t: type, op: operation }
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
// const select = this.columns.filter(c => c.col_field).map((c) => { return c.col_field })
|
|
734
|
+
const { data } = await this.$axios.get(`one/${this.urlOne}`, {
|
|
735
|
+
params: {
|
|
736
|
+
// reApi: this.reApi,
|
|
737
|
+
// select,
|
|
738
|
+
search: JSON.stringify(this.search),
|
|
739
|
+
locale_id: this.localeId,
|
|
740
|
+
tid
|
|
741
|
+
}
|
|
742
|
+
})
|
|
743
|
+
if (!data) {
|
|
744
|
+
this.$nuxt.error({ statusCode: 402 })
|
|
745
|
+
}
|
|
746
|
+
const temp = {
|
|
747
|
+
[this.pk_field_name]: data[this.pk_field_name],
|
|
748
|
+
work_families: data.work_families,
|
|
749
|
+
employee_history_text: data.employee_history_text,
|
|
750
|
+
employee_degree_text: data.employee_degree_text
|
|
751
|
+
}
|
|
752
|
+
for (const key in this.defaultTemp) {
|
|
753
|
+
const col = this.columns.find(c => c.col_field === key)
|
|
754
|
+
if (col && col.col_type === 'boolean') {
|
|
755
|
+
temp[key] = getFormBoolean(data[key])
|
|
756
|
+
} else {
|
|
757
|
+
temp[key] = data[key]
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (this.locales?.length) {
|
|
761
|
+
temp.locale_id = data.locale_id
|
|
762
|
+
temp.locale_uuid = data.locale_uuid
|
|
763
|
+
}
|
|
764
|
+
if (this.isXypLog) {
|
|
765
|
+
temp.xyp_log_id = data.xyp_log_id ?? null
|
|
766
|
+
}
|
|
767
|
+
if (this.parentRow && has(this.parentRow, this.pk_field_name)) {
|
|
768
|
+
temp[this.subColumn.col_field] = this.parentRow[this.pk_field_name]
|
|
769
|
+
}
|
|
770
|
+
this.temp = Object.assign({}, this.defaultTemp)
|
|
771
|
+
if (this.resetedTemp) {
|
|
772
|
+
this.resetedTemp()
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
} catch (err) {
|
|
776
|
+
// console.error(err)
|
|
777
|
+
// this.id = null
|
|
778
|
+
this.$showError(err)
|
|
779
|
+
} finally {
|
|
780
|
+
this.loadingForm = false
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
handleCreate () {
|
|
784
|
+
if (this.handleBeforeCreate) {
|
|
785
|
+
this.handleBeforeCreate()
|
|
786
|
+
}
|
|
787
|
+
this.updateGroupName = null
|
|
788
|
+
if (this.isCheckDetail && this.isCheckDetail()) {
|
|
789
|
+
this.handleDetail({ _id: 'create' })
|
|
790
|
+
} else if (this.handleDetail && this.isDetail) {
|
|
791
|
+
this.handleDetail({ _id: 'create' })
|
|
792
|
+
} else {
|
|
793
|
+
this.id = 'create'
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
async handleUpdate (row, updateGroupName = null) {
|
|
797
|
+
this.updateGroupName = updateGroupName
|
|
798
|
+
this.tid = row.tid
|
|
799
|
+
setTimeout(() => {
|
|
800
|
+
this.id = row[this.pk_field_name]
|
|
801
|
+
}, 100)
|
|
802
|
+
},
|
|
803
|
+
handleCurrentRowChange (row) {
|
|
804
|
+
if (Array.isArray(row)) {
|
|
805
|
+
this.currentRows = row
|
|
806
|
+
} else {
|
|
807
|
+
this.currentRowId = row[this.pk_field_name]
|
|
808
|
+
this.currentRow = row
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
resetSearch () {
|
|
812
|
+
const search = {}
|
|
813
|
+
const setSearch = (columns, parentKeys = [], currentIndex = 0) => {
|
|
814
|
+
for (const col of (columns || [])) {
|
|
815
|
+
if (['custom_duration'].includes(col.col_field)) {
|
|
816
|
+
search[col.col_field] = { t: 'date', val: ['', ''], op: 'between' }
|
|
817
|
+
} else if (col.col_type === 'manyToOne' && col.columns) { // !col.col_multiple &&
|
|
818
|
+
const col_key = parentKeys.concat(col.col_field).join('.')
|
|
819
|
+
if (col_key === 'position_id.name') {
|
|
820
|
+
search[col_key] = { t: col.col_type, val: null, op: 'eq' }
|
|
821
|
+
} else {
|
|
822
|
+
search[col_key] = { t: col.col_type, val: null, op: 'eq' }
|
|
823
|
+
setSearch(col.columns, parentKeys.concat(col.col_field), currentIndex + 1)
|
|
824
|
+
}
|
|
825
|
+
} else {
|
|
826
|
+
const col_key = col.child_key || col.col_key // parentKeys.concat(col.col_field).join('.')
|
|
827
|
+
if (col.col_type === 'boolean') {
|
|
828
|
+
search[col_key] = { t: col.col_type, val: null, op: 'eq' }
|
|
829
|
+
} else if (col.col_type === 'manyToOne') {
|
|
830
|
+
// search[col_key] = { t: col.col_type, val: null, op: 'eq' }
|
|
831
|
+
search[col_key] = { t: 'string', val: '', op: 'eq' }
|
|
832
|
+
} else {
|
|
833
|
+
let val = ''
|
|
834
|
+
if (col.searchOp === 'between') {
|
|
835
|
+
val = ['', '']
|
|
836
|
+
}
|
|
837
|
+
search[col_key] = { t: col.col_type, val, op: col.searchOp }
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
setSearch(this.columns)
|
|
843
|
+
this.search = { ...search }
|
|
844
|
+
if (this.handleDefaultSearch) {
|
|
845
|
+
this.handleDefaultSearch()
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
async handleProfileDownload () {
|
|
849
|
+
try {
|
|
850
|
+
if (this.downloadingProfile) {
|
|
851
|
+
return
|
|
852
|
+
}
|
|
853
|
+
await this.$showConfirm('Та албан хаагчийн анкет татах уу?')
|
|
854
|
+
this.downloadingProfile = true
|
|
855
|
+
const response = (await this.$axios.get(this.urlProfileDownload, {
|
|
856
|
+
params: {
|
|
857
|
+
search: JSON.stringify(this.search),
|
|
858
|
+
sorts: JSON.stringify(this.sorts),
|
|
859
|
+
fields: this.configColFields,
|
|
860
|
+
locale_id: this.localeId
|
|
861
|
+
},
|
|
862
|
+
responseType: 'blob'
|
|
863
|
+
}))
|
|
864
|
+
const href = URL.createObjectURL(response.data)
|
|
865
|
+
const link = document.createElement('a')
|
|
866
|
+
link.href = href
|
|
867
|
+
// link.target = '_blank'
|
|
868
|
+
link.setAttribute('download', `profile_${this.$moment().format('YYYYMMDD_HHmmss')}.pdf`)
|
|
869
|
+
document.body.appendChild(link)
|
|
870
|
+
link.click()
|
|
871
|
+
document.body.removeChild(link)
|
|
872
|
+
URL.revokeObjectURL(href)
|
|
873
|
+
} catch (err) {
|
|
874
|
+
this.$showError(err)
|
|
875
|
+
} finally {
|
|
876
|
+
this.downloadingProfile = false
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
async handleRestorePassword () {
|
|
880
|
+
try {
|
|
881
|
+
if (this.restoringPassword) {
|
|
882
|
+
return
|
|
883
|
+
}
|
|
884
|
+
if (!this.temp.email) {
|
|
885
|
+
this.$customError('И-Мэйл бүртгэлгүй байна.')
|
|
886
|
+
}
|
|
887
|
+
await this.$showConfirm(`Та хэрэглэгчийн нууц үг <strong>${this.temp.email}</strong> email хаягаар сэргээх үү?`)
|
|
888
|
+
this.restoringPassword = true
|
|
889
|
+
const { data } = await this.$axios.post('password/' + this.url, this.temp)
|
|
890
|
+
this.$showSuccess(data.message)
|
|
891
|
+
} catch (err) {
|
|
892
|
+
this.$showError(err)
|
|
893
|
+
} finally {
|
|
894
|
+
this.restoringPassword = false
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
async handleConfirm () {
|
|
898
|
+
try {
|
|
899
|
+
if (this.unsavedChanges) {
|
|
900
|
+
this.$customError('Та эхлээд өөрчлөлтийг хадгална уу')
|
|
901
|
+
}
|
|
902
|
+
let description = ''
|
|
903
|
+
if (this.isConfirmedDescription) {
|
|
904
|
+
const result = await this.$prompt('Баталгаажуулах', 'Тайлбар оруулна уу.', {
|
|
905
|
+
inputPattern: /^.{0,140}$/,
|
|
906
|
+
inputErrorMessage: '140 тэмдэгтээс хэтрэхгүй тэмдэгт бичнэ үү.'
|
|
907
|
+
})
|
|
908
|
+
description = result.value
|
|
909
|
+
} else {
|
|
910
|
+
await this.$showConfirm('Та тухайн бүртгэлийг баталгаажуулахдаа итгэлтэй байна уу?')
|
|
911
|
+
}
|
|
912
|
+
this.confirming = true
|
|
913
|
+
const extraFields = []
|
|
914
|
+
if (this.extraFields) {
|
|
915
|
+
extraFields.push(...this.extraFields?.split(','))
|
|
916
|
+
}
|
|
917
|
+
if (this.customExtraFields) {
|
|
918
|
+
extraFields.push(...this.customExtraFields?.split(','))
|
|
919
|
+
}
|
|
920
|
+
const updateData = {
|
|
921
|
+
_id: this.temp._id,
|
|
922
|
+
is_confirmed: true,
|
|
923
|
+
confirmed_date: new Date(),
|
|
924
|
+
confirmed_user_id: this.user_position_id
|
|
925
|
+
}
|
|
926
|
+
if (description) {
|
|
927
|
+
updateData.confirmed_description = description
|
|
928
|
+
}
|
|
929
|
+
const { data } = await this.$axios.post(this.urlConfirm || `confirm/${this.url}`, updateData, {
|
|
930
|
+
params: { extraFields: extraFields.join(',') }
|
|
931
|
+
})
|
|
932
|
+
this.set_unsaved_changes(false)
|
|
933
|
+
this.$showSuccess('Амжилттай баталгаажууллаа.')
|
|
934
|
+
if (this.handleAfterConfirm) {
|
|
935
|
+
this.handleAfterConfirm(data)
|
|
936
|
+
} else {
|
|
937
|
+
await this.resetTemp()
|
|
938
|
+
}
|
|
939
|
+
} catch (err) {
|
|
940
|
+
this.$showError(err)
|
|
941
|
+
} finally {
|
|
942
|
+
this.confirming = false
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
async handleSave () {
|
|
946
|
+
try {
|
|
947
|
+
const form = get(this.$refs, 'coreForm') // || get(this.$refs, 'form')
|
|
948
|
+
if (form) {
|
|
949
|
+
const validated = await form.isValidate()
|
|
950
|
+
if (!validated) {
|
|
951
|
+
return
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
if (this.handleBeforeSave) {
|
|
955
|
+
await this.handleBeforeSave()
|
|
956
|
+
}
|
|
957
|
+
this.saving = true
|
|
958
|
+
const extraFields = []
|
|
959
|
+
if (this.extraFields) {
|
|
960
|
+
extraFields.push(...this.extraFields?.split(','))
|
|
961
|
+
}
|
|
962
|
+
if (this.customExtraFields) {
|
|
963
|
+
extraFields.push(...this.customExtraFields?.split(','))
|
|
964
|
+
}
|
|
965
|
+
const { data } = await this.$axios.post(this.urlSave || this.url, this.temp, {
|
|
966
|
+
params: { extraFields: extraFields.join(',') }
|
|
967
|
+
})
|
|
968
|
+
if (this.locales?.length && data.locale_id !== this.localeId) {
|
|
969
|
+
// console.log('Хэлний сонголтын тоог нэмнэ.')
|
|
970
|
+
} else if (has(this.data, 'list')) {
|
|
971
|
+
const index = this.data.list.findIndex(c => c[this.pk_field_name] === data[this.pk_field_name])
|
|
972
|
+
if (index > -1) {
|
|
973
|
+
this.list.splice(index, 1, data)
|
|
974
|
+
} else {
|
|
975
|
+
this.count++
|
|
976
|
+
this.data.list.unshift(data)
|
|
977
|
+
}
|
|
978
|
+
this.data.list.sort(this.handleListSort)
|
|
979
|
+
}
|
|
980
|
+
this.set_unsaved_changes(false)
|
|
981
|
+
// this.currentRowId = data[this.pk_field_name]
|
|
982
|
+
if (this.handleSaved) {
|
|
983
|
+
this.handleSaved(data)
|
|
984
|
+
} else {
|
|
985
|
+
this.tid = null
|
|
986
|
+
this.id = null
|
|
987
|
+
this.$showSuccess('Амжилттай хадгаллаа.')
|
|
988
|
+
}
|
|
989
|
+
if (this.handleAfterSave) {
|
|
990
|
+
this.handleAfterSave(data)
|
|
991
|
+
}
|
|
992
|
+
} catch (err) {
|
|
993
|
+
this.$showError(err)
|
|
994
|
+
} finally {
|
|
995
|
+
this.saving = false
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
handleListSort (a, b) {
|
|
999
|
+
const getOrder = (ind = 0) => {
|
|
1000
|
+
if ((this.sorts?.length || 0) <= ind) {
|
|
1001
|
+
return Number(get(a, this.pk_field_name)) - Number(get(b, this.pk_field_name))
|
|
1002
|
+
}
|
|
1003
|
+
const sort = this.sorts[ind]
|
|
1004
|
+
let aVal = get(a, sort.prop)
|
|
1005
|
+
let bVal = get(b, sort.prop)
|
|
1006
|
+
if (['index_name', 'custom_index_num', 'index_num'].includes(sort.prop)) {
|
|
1007
|
+
aVal = aVal?.split('\n')[0]
|
|
1008
|
+
bVal = bVal?.split('\n')[0]
|
|
1009
|
+
const aVals = [aVal?.split('/')[0], aVal?.split('/')[1], aVal?.split('/')[2], aVal?.split('/')[3]]
|
|
1010
|
+
aVal = aVals.map(c => String(c || 0).padStart(5, '0')).join('-')
|
|
1011
|
+
const bVals = [bVal?.split('/')[0], bVal?.split('/')[1], bVal?.split('/')[2], bVal?.split('/')[3]]
|
|
1012
|
+
bVal = bVals.map(c => String(c || 0).padStart(5, '0')).join('-')
|
|
1013
|
+
}
|
|
1014
|
+
const order = ['desc', 'descending'].includes(sort.order?.toLowerCase()) ? -1 : 1
|
|
1015
|
+
if (aVal > bVal) {
|
|
1016
|
+
return order
|
|
1017
|
+
}
|
|
1018
|
+
if (aVal < bVal) {
|
|
1019
|
+
return order * -1
|
|
1020
|
+
}
|
|
1021
|
+
return getOrder(ind + 1)
|
|
1022
|
+
}
|
|
1023
|
+
const order = getOrder()
|
|
1024
|
+
return order
|
|
1025
|
+
},
|
|
1026
|
+
async handleDelete (row) {
|
|
1027
|
+
try {
|
|
1028
|
+
if (this.configTableName.startsWith('ref_')) {
|
|
1029
|
+
const data = await this.set_merge({
|
|
1030
|
+
table_name: this.configTableName,
|
|
1031
|
+
project_id: this.projectId,
|
|
1032
|
+
ref_column: 'name'
|
|
1033
|
+
})
|
|
1034
|
+
this.loading = true
|
|
1035
|
+
await this.$axios.delete(`${this.urlDelete || this.url}/${row[this.pk_field_name]}`, {
|
|
1036
|
+
data: { ...data, tid: row.tid }
|
|
1037
|
+
})
|
|
1038
|
+
} else {
|
|
1039
|
+
const result = await this.$prompt('Тайлбар оруулна уу.', 'Та энэ мөрийг устгахдаа итгэлтэй байна уу?', {
|
|
1040
|
+
inputPattern: /^.{0,300}$/,
|
|
1041
|
+
inputErrorMessage: '300 тэмдэгтээс хэтрэхгүй тэмдэгт бичнэ үү.'
|
|
1042
|
+
})
|
|
1043
|
+
this.loading = true
|
|
1044
|
+
await this.$axios.delete(`${this.urlDelete || this.url}/${row[this.pk_field_name]}`, {
|
|
1045
|
+
data: { description: result.value, tid: row.tid }
|
|
1046
|
+
})
|
|
1047
|
+
}
|
|
1048
|
+
const index = this.list.findIndex(c => c[this.pk_field_name] === row[this.pk_field_name])
|
|
1049
|
+
if (index > -1) {
|
|
1050
|
+
this.count--
|
|
1051
|
+
this.list.splice(index, 1)
|
|
1052
|
+
}
|
|
1053
|
+
this.$showSuccess('Амжилттай устгалаа.')
|
|
1054
|
+
if (this.handleDeleted) {
|
|
1055
|
+
this.handleDeleted()
|
|
1056
|
+
}
|
|
1057
|
+
} catch (err) {
|
|
1058
|
+
this.$showError(err)
|
|
1059
|
+
} finally {
|
|
1060
|
+
this.loading = false
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
async handleExcel () {
|
|
1064
|
+
try {
|
|
1065
|
+
if (this.loadingExcel) {
|
|
1066
|
+
return
|
|
1067
|
+
}
|
|
1068
|
+
this.loadingExcel = true
|
|
1069
|
+
if (this.beforeGetList) {
|
|
1070
|
+
await this.beforeGetList()
|
|
1071
|
+
}
|
|
1072
|
+
if (this.subColumn) {
|
|
1073
|
+
this.search[this.subColumn.col_field] = { val: this.parentRow[this.pk_field_name], t: 'number', op: 'eq' }
|
|
1074
|
+
const trigger_fields = getTriggerFields(this.subColumn.trigger_fields)
|
|
1075
|
+
for (const { localKey, localVal, type, operation } of trigger_fields) {
|
|
1076
|
+
if (localVal.includes('#')) {
|
|
1077
|
+
const tempKey = localVal.substring(1)
|
|
1078
|
+
this.search[localKey] = { val: this.parentRow[tempKey], t: type, op: operation }
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
const search = {}
|
|
1083
|
+
for (const searchKey in this.search) {
|
|
1084
|
+
if (searchKey === '$and') {
|
|
1085
|
+
search[searchKey] = this.search[searchKey]
|
|
1086
|
+
} else {
|
|
1087
|
+
const { op, val, t } = this.search[searchKey]
|
|
1088
|
+
if (op === 'between') {
|
|
1089
|
+
if (val && (val[0] || val[1])) {
|
|
1090
|
+
search[searchKey] = { ...this.search[searchKey] }
|
|
1091
|
+
}
|
|
1092
|
+
} else if (val) {
|
|
1093
|
+
search[searchKey] = { op, val, t }
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
const response = (await this.$axios.get(this.urlExcel, {
|
|
1098
|
+
params: {
|
|
1099
|
+
search: JSON.stringify(search),
|
|
1100
|
+
sorts: JSON.stringify(this.sorts),
|
|
1101
|
+
fields: this.configColFields,
|
|
1102
|
+
locale_id: this.localeId
|
|
1103
|
+
},
|
|
1104
|
+
responseType: 'blob'
|
|
1105
|
+
}))
|
|
1106
|
+
const href = URL.createObjectURL(response.data)
|
|
1107
|
+
const link = document.createElement('a')
|
|
1108
|
+
link.href = href
|
|
1109
|
+
link.setAttribute('download', `report_${this.$moment().format('YYYYMMDD_HHmmss')}.xlsx`)
|
|
1110
|
+
document.body.appendChild(link)
|
|
1111
|
+
link.click()
|
|
1112
|
+
document.body.removeChild(link)
|
|
1113
|
+
URL.revokeObjectURL(href)
|
|
1114
|
+
} catch (err) {
|
|
1115
|
+
this.$showError(err)
|
|
1116
|
+
} finally {
|
|
1117
|
+
this.loadingExcel = false
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
async getList () {
|
|
1121
|
+
if (this.isFormSub) {
|
|
1122
|
+
return
|
|
1123
|
+
}
|
|
1124
|
+
if (this.beforeGetList) {
|
|
1125
|
+
await this.beforeGetList()
|
|
1126
|
+
}
|
|
1127
|
+
if (this.subColumn) {
|
|
1128
|
+
if (!this.parentRow) {
|
|
1129
|
+
this.list = []
|
|
1130
|
+
this.count = 0
|
|
1131
|
+
return
|
|
1132
|
+
}
|
|
1133
|
+
this.search[this.subColumn.col_field] = { val: this.parentRow ? this.parentRow[this.pk_field_name] : 'null', t: 'number', op: 'eq' }
|
|
1134
|
+
const trigger_fields = getTriggerFields(this.subColumn.trigger_fields)
|
|
1135
|
+
for (const { localKey, localVal, type, operation } of trigger_fields) {
|
|
1136
|
+
if (localVal.includes('#')) {
|
|
1137
|
+
const tempKey = localVal.substring(1)
|
|
1138
|
+
this.search[localKey] = { val: this.parentRow[tempKey], t: type, op: operation }
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
const that = this
|
|
1143
|
+
const CancelToken = this.$axios.CancelToken
|
|
1144
|
+
if (that.cancel) {
|
|
1145
|
+
that.cancel()
|
|
1146
|
+
}
|
|
1147
|
+
const search = {}
|
|
1148
|
+
for (const searchKey in this.search) {
|
|
1149
|
+
if (searchKey === '$and') {
|
|
1150
|
+
search[searchKey] = this.search[searchKey]
|
|
1151
|
+
} else {
|
|
1152
|
+
const { op, val, t } = this.search[searchKey]
|
|
1153
|
+
if (t === 'boolean') {
|
|
1154
|
+
if ([true, false].includes(val)) {
|
|
1155
|
+
search[searchKey] = { op, val, t }
|
|
1156
|
+
}
|
|
1157
|
+
} else if (op === 'between') {
|
|
1158
|
+
if (val && (val[0] || val[1])) {
|
|
1159
|
+
search[searchKey] = { ...this.search[searchKey] }
|
|
1160
|
+
}
|
|
1161
|
+
} else if (val) {
|
|
1162
|
+
if (t === 'manyToOne') {
|
|
1163
|
+
search[searchKey] = { op, val: val._id, t }
|
|
1164
|
+
} else {
|
|
1165
|
+
search[searchKey] = { op, val, t }
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (this.textWhere) {
|
|
1171
|
+
const trigger_fields = getTriggerFields(this.textWhere)
|
|
1172
|
+
for (const { localKey, localVal, operation, type } of trigger_fields) {
|
|
1173
|
+
search[localKey] = { val: localVal, t: type, op: operation }
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
const extraFields = []
|
|
1177
|
+
if (this.extraFields) {
|
|
1178
|
+
extraFields.push(...this.extraFields?.split(','))
|
|
1179
|
+
}
|
|
1180
|
+
if (this.customExtraFields) {
|
|
1181
|
+
extraFields.push(...this.customExtraFields?.split(','))
|
|
1182
|
+
}
|
|
1183
|
+
this.data = (await this.$axios.get(this.url, {
|
|
1184
|
+
params: {
|
|
1185
|
+
pageSize: this.pageSize || '20',
|
|
1186
|
+
currentPage: this.currentPage,
|
|
1187
|
+
qstatus: this.qstatus,
|
|
1188
|
+
search: JSON.stringify(search),
|
|
1189
|
+
sorts: JSON.stringify(this.sorts),
|
|
1190
|
+
locale_id: this.localeId,
|
|
1191
|
+
extraFields: extraFields.join(',')
|
|
1192
|
+
},
|
|
1193
|
+
cancelToken: new CancelToken(function executor (c) {
|
|
1194
|
+
that.cancel = c
|
|
1195
|
+
})
|
|
1196
|
+
})).data
|
|
1197
|
+
// this.data.list.sort(this.handleListSort)
|
|
1198
|
+
this.listPage = this.currentPage
|
|
1199
|
+
},
|
|
1200
|
+
handleSearchInput ({ col_key, value, op }) {
|
|
1201
|
+
if (has(this.search, col_key)) {
|
|
1202
|
+
this.search[col_key].val = value
|
|
1203
|
+
if (op) {
|
|
1204
|
+
this.search[col_key].op = op
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
handleSearch () {
|
|
1209
|
+
if (this.localKeySearch) {
|
|
1210
|
+
localStorage.setItem(this.localKeySearch, JSON.stringify(this.search))
|
|
1211
|
+
}
|
|
1212
|
+
if (this.currentPage === 1) {
|
|
1213
|
+
this.handleRefreshList()
|
|
1214
|
+
} else {
|
|
1215
|
+
this.currentPage = 1
|
|
1216
|
+
}
|
|
1217
|
+
},
|
|
1218
|
+
async handleRefreshList (config) {
|
|
1219
|
+
let isCancel = false
|
|
1220
|
+
const start1 = new Date()
|
|
1221
|
+
this.clientDurationMs = null
|
|
1222
|
+
try {
|
|
1223
|
+
if (config && config.pageSize) {
|
|
1224
|
+
this.pageSize = config.pageSize
|
|
1225
|
+
}
|
|
1226
|
+
const localSorts = localStorage.getItem(this.localKeySort)
|
|
1227
|
+
const localSearch = localStorage.getItem(this.localKeySearch)
|
|
1228
|
+
// const localPageSize = localStorage.getItem(this.localKeyPageSize)
|
|
1229
|
+
if (localSorts && this.localKeySort) {
|
|
1230
|
+
try {
|
|
1231
|
+
this.sorts = JSON.parse(localSorts)
|
|
1232
|
+
} catch (_) {
|
|
1233
|
+
localStorage.removeItem(this.localKeySort)
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
if (localSearch && this.localKeySearch) {
|
|
1237
|
+
try {
|
|
1238
|
+
this.search = { ...this.search, ...JSON.parse(localSearch) }
|
|
1239
|
+
} catch (_) {
|
|
1240
|
+
localStorage.removeItem(this.localKeySearch)
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
// if (localPageSize && this.localKeyPageSize) {
|
|
1244
|
+
// try {
|
|
1245
|
+
// this.pageSize = Number(localPageSize)
|
|
1246
|
+
// } catch (_) {
|
|
1247
|
+
// localStorage.removeItem(this.localKeyPageSize)
|
|
1248
|
+
// }
|
|
1249
|
+
// }
|
|
1250
|
+
this.loading = true
|
|
1251
|
+
await this.$nextTick()
|
|
1252
|
+
await this.getList()
|
|
1253
|
+
// console.log('resetTemp', 'handleRefreshList')
|
|
1254
|
+
this.resetTemp()
|
|
1255
|
+
} catch (err) {
|
|
1256
|
+
isCancel = this.$axios.isCancel(err)
|
|
1257
|
+
if (!isCancel) {
|
|
1258
|
+
this.list = []
|
|
1259
|
+
this.count = 0
|
|
1260
|
+
this.$showError(err)
|
|
1261
|
+
}
|
|
1262
|
+
} finally {
|
|
1263
|
+
if (!isCancel) {
|
|
1264
|
+
this.clientDurationMs = new Date() - start1
|
|
1265
|
+
this.loading = false
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
handleRefresh () {
|
|
1270
|
+
localStorage.removeItem(this.localKeySearch)
|
|
1271
|
+
this.resetSearch()
|
|
1272
|
+
if (!this.onlyList) {
|
|
1273
|
+
this.resetTemp()
|
|
1274
|
+
}
|
|
1275
|
+
if (this.currentPage === 1) {
|
|
1276
|
+
this.handleRefreshList()
|
|
1277
|
+
} else {
|
|
1278
|
+
this.currentPage = 1
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
handleSortChange ({ prop, order }) {
|
|
1282
|
+
this.sorts = [{ prop, order }]
|
|
1283
|
+
if (this.localKeySort) {
|
|
1284
|
+
localStorage.setItem(this.localKeySort, JSON.stringify(this.sorts))
|
|
1285
|
+
}
|
|
1286
|
+
this.handleRefreshList()
|
|
1287
|
+
},
|
|
1288
|
+
handleCurrentChange (val) {
|
|
1289
|
+
this.currentPage = val
|
|
1290
|
+
},
|
|
1291
|
+
handleChangeSize (val) {
|
|
1292
|
+
this.currentPage = 1
|
|
1293
|
+
this.pageSize = val
|
|
1294
|
+
// if (this.localKeyPageSize) {
|
|
1295
|
+
// localStorage.setItem(this.localKeyPageSize, String(val))
|
|
1296
|
+
// }
|
|
1297
|
+
},
|
|
1298
|
+
async uploadImageBase64Id (responseBase64) {
|
|
1299
|
+
const blob = base64ToBlob(responseBase64, 'image/png')
|
|
1300
|
+
const formData = new FormData()
|
|
1301
|
+
formData.append('file', blob)
|
|
1302
|
+
const headers = { 'Content-Type': 'multipart/form-data' }
|
|
1303
|
+
headers.Authorization = `Bearer ${this.token}`
|
|
1304
|
+
const instance = this.$axios.create({ baseURL: this.env.baseUrl, headers })
|
|
1305
|
+
const { data } = await instance.post('file/upload', formData)
|
|
1306
|
+
return data
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
export const getAsyncData = async ({
|
|
1311
|
+
$axios,
|
|
1312
|
+
projectId,
|
|
1313
|
+
tableName,
|
|
1314
|
+
apiName,
|
|
1315
|
+
reApi,
|
|
1316
|
+
configColFields,
|
|
1317
|
+
configColHideFields,
|
|
1318
|
+
configColNullableFields,
|
|
1319
|
+
configColDisableFields,
|
|
1320
|
+
id,
|
|
1321
|
+
sub,
|
|
1322
|
+
isLog,
|
|
1323
|
+
readOnly,
|
|
1324
|
+
isInline,
|
|
1325
|
+
selectable,
|
|
1326
|
+
skipFormReadonly,
|
|
1327
|
+
parentLevel,
|
|
1328
|
+
inlineParentTemp = null,
|
|
1329
|
+
customExtraFields,
|
|
1330
|
+
checkPermission = false,
|
|
1331
|
+
error,
|
|
1332
|
+
rootApiId
|
|
1333
|
+
}) => {
|
|
1334
|
+
const configUrl = `config/table/${projectId}/${tableName}`
|
|
1335
|
+
const { data } = await $axios.get(configUrl, { params: { sub, id, apiName, reApi } })
|
|
1336
|
+
if (!data) {
|
|
1337
|
+
return {
|
|
1338
|
+
configProjectId: null, project: null, table: null,
|
|
1339
|
+
columns: [], configTableName: null,
|
|
1340
|
+
configColFields: [], hasPassword: null, refColumns: [],
|
|
1341
|
+
subColumn: null, parentRow: null, api_id: null, api_title: null, locales: []
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
const {
|
|
1345
|
+
project,
|
|
1346
|
+
table,
|
|
1347
|
+
sorts,
|
|
1348
|
+
columns,
|
|
1349
|
+
refColumns,
|
|
1350
|
+
subColumn,
|
|
1351
|
+
parentRow,
|
|
1352
|
+
config_group_fields,
|
|
1353
|
+
config_form_menus,
|
|
1354
|
+
apiTextSelectFields,
|
|
1355
|
+
level,
|
|
1356
|
+
api_id,
|
|
1357
|
+
level_api_id,
|
|
1358
|
+
api_title,
|
|
1359
|
+
hasHandbook,
|
|
1360
|
+
locales,
|
|
1361
|
+
isXypLog,
|
|
1362
|
+
columnUsers,
|
|
1363
|
+
statuses
|
|
1364
|
+
} = data
|
|
1365
|
+
if (!level && checkPermission) {
|
|
1366
|
+
error({ statusCode: 402 })
|
|
1367
|
+
}
|
|
1368
|
+
const fields = {}
|
|
1369
|
+
let selectFields = apiTextSelectFields
|
|
1370
|
+
if (!apiTextSelectFields && table.name === 'hrm_users') {
|
|
1371
|
+
selectFields = 'movement_id.name,organization_id.name,position_id.name,start_date,remove_movement_id.name,end_date'
|
|
1372
|
+
}
|
|
1373
|
+
if (selectFields) {
|
|
1374
|
+
selectFields.split(',').map((c) => {
|
|
1375
|
+
const k = c.split('*')
|
|
1376
|
+
const k0 = get(k, '[0]')
|
|
1377
|
+
return k0
|
|
1378
|
+
}).forEach(function (key) {
|
|
1379
|
+
set(fields, key, 1)
|
|
1380
|
+
})
|
|
1381
|
+
}
|
|
1382
|
+
let formReadonly = false
|
|
1383
|
+
if (!skipFormReadonly) {
|
|
1384
|
+
formReadonly = !['1'].includes(project._id) && !(parentLevel || level)?.actions?.some(c => ['EDIT', 'CREATE', 'DECISION'].includes(c.code))
|
|
1385
|
+
}
|
|
1386
|
+
const form_col = Number(table.form_col || 1)
|
|
1387
|
+
let hasPassword = false
|
|
1388
|
+
const isService = tableName && tableName.startsWith('service_')
|
|
1389
|
+
const getColumns = (columns1, parentKeys = [], parentFields) => {
|
|
1390
|
+
const configColumns = []
|
|
1391
|
+
const columns2 = columns1.filter((c) => {
|
|
1392
|
+
if (configColFields?.length) {
|
|
1393
|
+
return configColFields.includes(c.col_field)
|
|
1394
|
+
}
|
|
1395
|
+
if (configColHideFields?.length && configColHideFields.includes(c.col_field)) {
|
|
1396
|
+
return false
|
|
1397
|
+
}
|
|
1398
|
+
return true
|
|
1399
|
+
})
|
|
1400
|
+
for (const col of columns2) {
|
|
1401
|
+
if (col.col_type === 'password') {
|
|
1402
|
+
hasPassword = true
|
|
1403
|
+
continue
|
|
1404
|
+
}
|
|
1405
|
+
const getColId = (col_id, col_field) => {
|
|
1406
|
+
if (col_field === '_id') { return '1001' }
|
|
1407
|
+
if (col_field === 'created_at') { return '1002' }
|
|
1408
|
+
if (col_field === 'updated_at') { return '1003' }
|
|
1409
|
+
if (col_field === 'deleted_at') { return '1004' }
|
|
1410
|
+
return col_id
|
|
1411
|
+
}
|
|
1412
|
+
const conf = {
|
|
1413
|
+
col_id: getColId(col._id, col.col_field),
|
|
1414
|
+
col_key: parentKeys.concat(col.col_field).join('.'),
|
|
1415
|
+
col_field: col.col_field,
|
|
1416
|
+
col_type: col.col_type,
|
|
1417
|
+
col_default: col.col_default,
|
|
1418
|
+
ref_table: col.ref_table,
|
|
1419
|
+
ref_column: col.ref_column,
|
|
1420
|
+
trigger_fields: col.trigger_fields,
|
|
1421
|
+
col_hidden: isHidden(col, subColumn),
|
|
1422
|
+
col_length: col.col_length,
|
|
1423
|
+
col_nullable: col.col_nullable,
|
|
1424
|
+
col_multiple: col.col_multiple,
|
|
1425
|
+
form: {
|
|
1426
|
+
component: getFormComponent(col, {
|
|
1427
|
+
isInline,
|
|
1428
|
+
formReadonly,
|
|
1429
|
+
isXyp: isXypLog,
|
|
1430
|
+
table_name: table?.name,
|
|
1431
|
+
level_code: level?.level_code,
|
|
1432
|
+
projectId,
|
|
1433
|
+
serviceName: tableName,
|
|
1434
|
+
rootApiId: level_api_id || rootApiId || api_id
|
|
1435
|
+
}),
|
|
1436
|
+
label: col.col_title,
|
|
1437
|
+
width: getFormWidth(col, form_col),
|
|
1438
|
+
colSpan: getFormColSpan(col, form_col, table?.name),
|
|
1439
|
+
rowSpan: getFormRowSpan(col, form_col),
|
|
1440
|
+
prop: col.col_field.replace('.', ''),
|
|
1441
|
+
description: col.description
|
|
1442
|
+
},
|
|
1443
|
+
props: {
|
|
1444
|
+
label: col.col_title,
|
|
1445
|
+
align: getColAlign(col),
|
|
1446
|
+
sortable: true,
|
|
1447
|
+
...getColWidth({ ...col, col_key: parentKeys.concat(col.col_field).join('.') }, table.fill_field, isInline)
|
|
1448
|
+
},
|
|
1449
|
+
col_order: col.col_order,
|
|
1450
|
+
configHidden: false,
|
|
1451
|
+
tableHidden: false,
|
|
1452
|
+
child_key: null,
|
|
1453
|
+
child_type: null,
|
|
1454
|
+
search_key: null,
|
|
1455
|
+
search_type: null
|
|
1456
|
+
}
|
|
1457
|
+
const propColKeys = Object.keys(parentFields)
|
|
1458
|
+
if (!conf.col_hidden && propColKeys.length && propColKeys.length > 0) {
|
|
1459
|
+
const propIndex = propColKeys.findIndex(c => c === conf.col_field)
|
|
1460
|
+
conf.tableHidden = propIndex === -1
|
|
1461
|
+
conf.col_order = propIndex
|
|
1462
|
+
}
|
|
1463
|
+
const columnUser = columnUsers?.find(c => c.column_id === conf.col_id)
|
|
1464
|
+
if (columnUser) {
|
|
1465
|
+
if (has(columnUser, 'sort_order') && columnUser.sort_order !== null && columnUser.sort_order > -1) {
|
|
1466
|
+
conf.col_order = columnUser.sort_order
|
|
1467
|
+
}
|
|
1468
|
+
if (columnUser.col_width) {
|
|
1469
|
+
conf.props.width = columnUser.col_width
|
|
1470
|
+
}
|
|
1471
|
+
conf.configHidden = columnUser.hidden
|
|
1472
|
+
}
|
|
1473
|
+
if (['decimal', 'date', 'datetime', 'number'].includes(col.col_type)) {
|
|
1474
|
+
conf.searchOp = 'between'
|
|
1475
|
+
}
|
|
1476
|
+
if (col.col_type === 'boolean') {
|
|
1477
|
+
conf.form.col_default = getFormBoolean(col.col_default)
|
|
1478
|
+
} else if (col.col_default) {
|
|
1479
|
+
conf.form.col_default = col.col_default
|
|
1480
|
+
}
|
|
1481
|
+
if (getFormBoolean(col.col_readonly)) {
|
|
1482
|
+
conf.form.col_readonly = true
|
|
1483
|
+
set(conf, 'form.component.props.disabled', true)
|
|
1484
|
+
} else if (subColumn) {
|
|
1485
|
+
if (col.col_field === subColumn.col_field) {
|
|
1486
|
+
conf.form.col_readonly = true
|
|
1487
|
+
}
|
|
1488
|
+
const trigger_fields = getTriggerFields(subColumn.trigger_fields)
|
|
1489
|
+
for (const { localKey } of trigger_fields) {
|
|
1490
|
+
if (localKey === col.col_field) {
|
|
1491
|
+
conf.form.col_readonly = true
|
|
1492
|
+
break
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (['created_user_id', 'updated_user_id'].includes(col.col_field) || configColDisableFields?.includes(col.col_field)) {
|
|
1497
|
+
conf.form.col_readonly = true
|
|
1498
|
+
set(conf, 'form.component.props.disabled', true)
|
|
1499
|
+
}
|
|
1500
|
+
if (configColNullableFields?.includes(col.col_field)) {
|
|
1501
|
+
conf.form.required = false
|
|
1502
|
+
} else if ((!col.col_readonly && !col.col_nullable) || !!configColFields) {
|
|
1503
|
+
conf.form.required = true
|
|
1504
|
+
}
|
|
1505
|
+
if (!conf.tableHidden && (!!subColumn || selectable)) {
|
|
1506
|
+
// if (!isLog || !['created_by', 'created_at'].includes(col.col_field)) {
|
|
1507
|
+
// conf.tableHidden = groupFieldLog.col_fields.includes(col.col_field)
|
|
1508
|
+
// }
|
|
1509
|
+
if (!isLog && !['created_by', 'created_at'].includes(col.col_field)) {
|
|
1510
|
+
conf.tableHidden = groupFieldLog.col_fields.includes(col.col_field)
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
if (col.columns && col.columns.length > 0 && !conf.tableHidden) {
|
|
1514
|
+
const searchStringTables = ['firearm_gun', 'cstm_crime_places']
|
|
1515
|
+
const searchStringFields = ['model_id', 'calibre_id', 'expert_id']
|
|
1516
|
+
conf.columns = getColumns(col.columns, parentKeys.concat(col.col_field), parentFields[col.col_field] || {})
|
|
1517
|
+
const showChildColumn = conf.columns?.filter(c => !c.tableHidden && !['color', 'is_ping', 'code'].includes(c.col_field))
|
|
1518
|
+
conf.hasChildren = showChildColumn.length > 1
|
|
1519
|
+
if (conf.hasChildren) {
|
|
1520
|
+
const confChild = get(showChildColumn, '[0]')
|
|
1521
|
+
conf.child_key = confChild?.child_key || confChild?.col_key
|
|
1522
|
+
conf.child_type = confChild?.child_type || confChild?.col_type
|
|
1523
|
+
conf.props.align = 'center'
|
|
1524
|
+
} else {
|
|
1525
|
+
const confChild = get(showChildColumn, '[0]')
|
|
1526
|
+
// console.log('confChild', confChild)
|
|
1527
|
+
conf.child_key = confChild?.child_key || confChild?.col_key
|
|
1528
|
+
conf.child_type = confChild?.child_type || confChild?.col_type
|
|
1529
|
+
conf.search_type = conf.col_type
|
|
1530
|
+
conf.search_key = conf.col_field
|
|
1531
|
+
// console.log('conf', conf)
|
|
1532
|
+
// if (confChild?.col_key === 'position_id.name') {
|
|
1533
|
+
// conf.search_type = confChild?.col_type
|
|
1534
|
+
// conf.search_key = confChild?.col_key
|
|
1535
|
+
// }
|
|
1536
|
+
if (conf.props.width !== 'auto') {
|
|
1537
|
+
conf.props.width = get(confChild, 'props.width')
|
|
1538
|
+
conf.props['min-width'] = get(confChild, 'props.min-width')
|
|
1539
|
+
}
|
|
1540
|
+
if (searchStringTables.includes(table?.name) && searchStringFields.includes(col.col_field)) {
|
|
1541
|
+
conf.search_type = confChild?.col_type
|
|
1542
|
+
conf.search_key = confChild?.col_key
|
|
1543
|
+
conf.search_op = 'start'
|
|
1544
|
+
}
|
|
1545
|
+
// if (['created_by'].includes(conf.col_key)) {
|
|
1546
|
+
// conf.child_key = `${conf.col_key}.full_name`
|
|
1547
|
+
// conf.search_type = 'string'
|
|
1548
|
+
// conf.search_key = `${conf.col_key}.full_name`
|
|
1549
|
+
// }
|
|
1550
|
+
// if (conf.col_key?.endsWith('.employee_id')) {
|
|
1551
|
+
// conf.child_key = `${conf.col_key}.full_name`
|
|
1552
|
+
// }
|
|
1553
|
+
}
|
|
1554
|
+
} else if (col.col_type === 'manyToOne') {
|
|
1555
|
+
if (['created_by', 'updated_by'].includes(col.col_field)) {
|
|
1556
|
+
conf.child_key = parentKeys.concat(col.col_field, 'full_name').join('.')
|
|
1557
|
+
conf.search_key = conf.child_key
|
|
1558
|
+
conf.search_type = 'string'
|
|
1559
|
+
} else if (col.ref_column === 'given_name,surname,image') {
|
|
1560
|
+
conf.child_key = parentKeys.concat(col.col_field, 'full_name').join('.')
|
|
1561
|
+
} else {
|
|
1562
|
+
conf.child_key = `${col.col_field}.${col.ref_column}`
|
|
1563
|
+
}
|
|
1564
|
+
conf.child_type = 'string'
|
|
1565
|
+
}
|
|
1566
|
+
configColumns.push(conf)
|
|
1567
|
+
}
|
|
1568
|
+
const showColumns = configColumns.filter((c) => {
|
|
1569
|
+
if (getFormBoolean(c.col_hidden)) {
|
|
1570
|
+
return false
|
|
1571
|
+
}
|
|
1572
|
+
if (c.col_type === 'pkid') {
|
|
1573
|
+
return true
|
|
1574
|
+
}
|
|
1575
|
+
return true
|
|
1576
|
+
})
|
|
1577
|
+
return showColumns
|
|
1578
|
+
}
|
|
1579
|
+
const showColumns = getColumns(columns, [], fields)
|
|
1580
|
+
const isDetail = showColumns.some(c => c.col_field.includes('html_') && !c.col_field.includes('mini')) || config_group_fields?.some(c => ['SUB_TABLE', 'CUSTOM', 'SUB_TABLE_LOG'].includes(c.group_type))
|
|
1581
|
+
return {
|
|
1582
|
+
configProjectId: project._id,
|
|
1583
|
+
project,
|
|
1584
|
+
table,
|
|
1585
|
+
apiName,
|
|
1586
|
+
reApi,
|
|
1587
|
+
formWidth: (200 + form_col * 400) + 'px',
|
|
1588
|
+
columns: showColumns,
|
|
1589
|
+
sorts,
|
|
1590
|
+
configTableName: !sub && isService ? tableName : table.name, // Сервис дээр дуудах / SUB table дуудах
|
|
1591
|
+
configColFields,
|
|
1592
|
+
hasPassword,
|
|
1593
|
+
refColumns,
|
|
1594
|
+
subColumn,
|
|
1595
|
+
parentRow,
|
|
1596
|
+
inlineParentTemp,
|
|
1597
|
+
readOnly,
|
|
1598
|
+
config_group_fields,
|
|
1599
|
+
config_form_menus,
|
|
1600
|
+
level,
|
|
1601
|
+
api_id,
|
|
1602
|
+
api_title,
|
|
1603
|
+
rootApiId: level_api_id || rootApiId || api_id,
|
|
1604
|
+
hasHandbook,
|
|
1605
|
+
isDetail,
|
|
1606
|
+
locales,
|
|
1607
|
+
formReadonly,
|
|
1608
|
+
isXypLog,
|
|
1609
|
+
customExtraFields,
|
|
1610
|
+
statuses
|
|
1611
|
+
}
|
|
1612
|
+
}
|