resolver-egretimp-plus 0.0.115 → 0.0.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.0.115",
3
+ "version": "0.0.117",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -53,7 +53,7 @@ const initSelEmployee = async () => {
53
53
  let feiShuTokens = ''
54
54
  const { getToken, loadStyle, loadScript, initSelUser } = useSelEmployeeJs()
55
55
  let ret = await Promise.all([getToken(), loadStyle(), loadScript()])
56
- if (ret && ret.length) {
56
+ if (ret && ret.length) {
57
57
  feiShuTokens = ret[0]
58
58
  if (!feiShuTokens) return
59
59
  }
@@ -62,7 +62,7 @@ const initSelEmployee = async () => {
62
62
  }, async (val) => {
63
63
  if (!val) return
64
64
  await seelp(200)
65
- console('select-employees modelValue:', modelValue.value)
65
+ console.log('select-employees modelValue:', modelValue.value)
66
66
  const data = modelValue.value ? modelValue.value.split(',') : []
67
67
  const initParams = {
68
68
  el: `#${metaCode.value}`,
@@ -408,7 +408,7 @@ export function getRenderComponentProps({ props, component, modelValue, selects,
408
408
  ...getRenderCompMargins(config),
409
409
  width: commonProps.width || getBuildCompDefaultWidth(config)
410
410
  }
411
- if (config.hidden === '1') {
411
+ if (!isHidden(config)) {
412
412
  defprops.style.display = 'none'
413
413
  }
414
414
 
@@ -524,7 +524,7 @@ function elColSpecialProsp (config) {
524
524
  const style = {
525
525
  textAlign: config.colTextAlign
526
526
  }
527
- if ((typeof config.hidden === 'boolean' && config.hidden) || config.hidden === '1') {
527
+ if (!isHidden(config)) {
528
528
  style.display = 'none'
529
529
  } else {
530
530
  if (hasOwn(config, 'elWidth')) {
@@ -666,7 +666,7 @@ function getFormItemExtendProps(config, lang, params) {
666
666
  const style = {
667
667
  ...getFormItemMargins(config)
668
668
  }
669
- if (config.hidden === '1') {
669
+ if (!isHidden(config)) {
670
670
  style.display = 'none'
671
671
  }
672
672
  return {
@@ -687,7 +687,14 @@ function getFormItemRule(config, lang, params) {
687
687
  const rules = [{
688
688
  // required,
689
689
  validator: (rule, value, callback) => {
690
- if (config.editFlag === '0') callback()
690
+ if (config.editFlag === '0') {
691
+ callback()
692
+ return
693
+ }
694
+ if (!isHidden(config)) {
695
+ callback()
696
+ return
697
+ }
691
698
  const val = config.bindValue
692
699
  const message = lang.indexOf('zh') > -1 ? `${config.metaNameZh}不能为空` : `${config.metaNameEn} can not be empty`
693
700
  if (!onlyRequiredFlag && required) {
@@ -730,7 +737,14 @@ function getFormItemRule(config, lang, params) {
730
737
  if (regexPattern?.length) {
731
738
  rules.push({
732
739
  validator: (rule, value, callback) => {
733
- if (config.editFlag === '0') callback()
740
+ if (config.editFlag === '0') {
741
+ callback()
742
+ return
743
+ }
744
+ if (!isHidden(config)) {
745
+ callback()
746
+ return
747
+ }
734
748
  const val = (config.bindValue === null || config.bindValue === undefined) ? '' : config.bindValue
735
749
 
736
750
  for (let i = 0; i < regexPattern.length; i++) {
@@ -759,7 +773,17 @@ function getFormItemRule(config, lang, params) {
759
773
  validators.forEach(validator => {
760
774
  if (isFunction(validator)) {
761
775
  rules.push({
762
- validator,
776
+ validator: (rule, value, callback) => {
777
+ if (config.editFlag === '0') {
778
+ callback()
779
+ return
780
+ }
781
+ if (!isHidden(config)) {
782
+ callback()
783
+ return
784
+ }
785
+ return validator(rule, value, callback)
786
+ },
763
787
  trigger: ['blur', 'change']
764
788
  })
765
789
  }
@@ -848,4 +872,8 @@ export function getComponentPropsKeys(comp, config) {
848
872
 
849
873
  function isTransCellMobile(config, disabled) {
850
874
  return config?.alwaysNative !== '1' && disabled && findComponent(TRANS_CELL_COMPONETS, config.renderby || config.metaType) !== -1
875
+ }
876
+
877
+ function isHidden({config}) {
878
+ return (typeof config.hidden === 'boolean' && config.hidden) || config.hidden === '1'
851
879
  }