resolver-egretimp-plus 0.1.113 → 0.1.115

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.
Files changed (219) hide show
  1. package/dist/h5/index.js +1 -1
  2. package/dist/theme/element/index.css +1 -1
  3. package/dist/theme/element/src/components/common.scss +4 -0
  4. package/dist/theme/element/src/components/text.scss +17 -0
  5. package/dist/web/index.js +2 -2
  6. package/package.json +1 -1
  7. package/src/analysisComponent.jsx +2 -1
  8. package/src/components/helper/table.jsx +26 -23
  9. package/src/components/packages-H5/CustomComponentCollapseH5.vue +6 -2
  10. package/src/components/packages-web/ElText.jsx +0 -1
  11. package/src/theme/element/components/common.scss +4 -0
  12. package/src/theme/element/components/text.scss +17 -0
  13. package/src-bak/analysisComponent.jsx +343 -0
  14. package/src-bak/api/builtIn.js +10 -0
  15. package/src-bak/bpm/bpmInstance.js +388 -0
  16. package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +8 -0
  17. package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +97 -0
  18. package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +88 -0
  19. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +3 -0
  20. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +76 -0
  21. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +201 -0
  22. package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +69 -0
  23. package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +56 -0
  24. package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +76 -0
  25. package/src-bak/bpm/udc-sdk-esm/cjs/index.js +46 -0
  26. package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +21 -0
  27. package/src-bak/components/childDialog/index.js +39 -0
  28. package/src-bak/components/childDialog/src/index.vue +185 -0
  29. package/src-bak/components/cmiFormItem/index.js +1 -0
  30. package/src-bak/components/cmiFormItem/src/index.vue +112 -0
  31. package/src-bak/components/confirmInstance-H5/index.js +53 -0
  32. package/src-bak/components/confirmInstance-H5/src/index.vue +54 -0
  33. package/src-bak/components/helper/FormPolyfill.jsx +25 -0
  34. package/src-bak/components/helper/calcTooltip.jsx +134 -0
  35. package/src-bak/components/helper/dock.js +141 -0
  36. package/src-bak/components/helper/eventOrchestration.js +763 -0
  37. package/src-bak/components/helper/resolver.js +163 -0
  38. package/src-bak/components/helper/table.jsx +103 -0
  39. package/src-bak/components/icons/date.vue +33 -0
  40. package/src-bak/components/icons/info.vue +62 -0
  41. package/src-bak/components/icons/loading.vue +19 -0
  42. package/src-bak/components/icons/question-filled.vue +8 -0
  43. package/src-bak/components/loading/index.js +6 -0
  44. package/src-bak/components/loading/loading.js +98 -0
  45. package/src-bak/components/loading/loading.scss +74 -0
  46. package/src-bak/components/loading/loading.vue +89 -0
  47. package/src-bak/components/loadingComponent/LoadingComponent.vue +33 -0
  48. package/src-bak/components/modal/index.js +9 -0
  49. package/src-bak/components/modal/modal.scss +195 -0
  50. package/src-bak/components/modal/modal.vue +201 -0
  51. package/src-bak/components/options/OptionsDefault.vue +47 -0
  52. package/src-bak/components/packages-H5/CmiButton.vue +120 -0
  53. package/src-bak/components/packages-H5/CmiCalendar.vue +152 -0
  54. package/src-bak/components/packages-H5/CmiCell.vue +87 -0
  55. package/src-bak/components/packages-H5/CmiCheckbox.vue +82 -0
  56. package/src-bak/components/packages-H5/CmiDatetimePicker.vue +98 -0
  57. package/src-bak/components/packages-H5/CmiDivider.vue +30 -0
  58. package/src-bak/components/packages-H5/CmiDropdownMenu.vue +58 -0
  59. package/src-bak/components/packages-H5/CmiInput.vue +69 -0
  60. package/src-bak/components/packages-H5/CmiLink.vue +28 -0
  61. package/src-bak/components/packages-H5/CmiPicker.vue +229 -0
  62. package/src-bak/components/packages-H5/CmiRadio.vue +29 -0
  63. package/src-bak/components/packages-H5/CmiSearch.vue +39 -0
  64. package/src-bak/components/packages-H5/CmiSelect.vue +84 -0
  65. package/src-bak/components/packages-H5/CustomComponentCardH5.vue +129 -0
  66. package/src-bak/components/packages-H5/CustomComponentColH5.vue +8 -0
  67. package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +137 -0
  68. package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +54 -0
  69. package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +38 -0
  70. package/src-bak/components/packages-H5/CustomComponentTableH5.vue +352 -0
  71. package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +170 -0
  72. package/src-bak/components/packages-web/CustomComponentCard.vue +40 -0
  73. package/src-bak/components/packages-web/CustomComponentCol.vue +66 -0
  74. package/src-bak/components/packages-web/CustomComponentCollapse.vue +164 -0
  75. package/src-bak/components/packages-web/CustomComponentCycle.vue +95 -0
  76. package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +155 -0
  77. package/src-bak/components/packages-web/CustomComponentDialog.vue +192 -0
  78. package/src-bak/components/packages-web/CustomComponentEditor.vue +50 -0
  79. package/src-bak/components/packages-web/CustomComponentFileExport.vue +60 -0
  80. package/src-bak/components/packages-web/CustomComponentFileImport.vue +60 -0
  81. package/src-bak/components/packages-web/CustomComponentFormLayout.vue +65 -0
  82. package/src-bak/components/packages-web/CustomComponentGrid.vue +29 -0
  83. package/src-bak/components/packages-web/CustomComponentGridCol.vue +29 -0
  84. package/src-bak/components/packages-web/CustomComponentInputDialog.vue +144 -0
  85. package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +84 -0
  86. package/src-bak/components/packages-web/CustomComponentPlain.vue +243 -0
  87. package/src-bak/components/packages-web/CustomComponentRow.vue +83 -0
  88. package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +203 -0
  89. package/src-bak/components/packages-web/CustomComponentSendMail.vue +62 -0
  90. package/src-bak/components/packages-web/CustomComponentSteps.vue +41 -0
  91. package/src-bak/components/packages-web/CustomComponentTabPane.vue +20 -0
  92. package/src-bak/components/packages-web/CustomComponentTable.jsx +813 -0
  93. package/src-bak/components/packages-web/CustomComponentTabs.vue +126 -0
  94. package/src-bak/components/packages-web/CustomComponentTree.vue +28 -0
  95. package/src-bak/components/packages-web/ElButton.vue +146 -0
  96. package/src-bak/components/packages-web/ElCheckbox.vue +97 -0
  97. package/src-bak/components/packages-web/ElDatePicker.vue +93 -0
  98. package/src-bak/components/packages-web/ElInput copy.jsx +393 -0
  99. package/src-bak/components/packages-web/ElInput.jsx +312 -0
  100. package/src-bak/components/packages-web/ElInputNumber.vue +81 -0
  101. package/src-bak/components/packages-web/ElPagination.vue +61 -0
  102. package/src-bak/components/packages-web/ElRadio.vue +47 -0
  103. package/src-bak/components/packages-web/ElSelect.jsx +249 -0
  104. package/src-bak/components/packages-web/ElSelect_bak.vue +155 -0
  105. package/src-bak/components/packages-web/ElText.jsx +187 -0
  106. package/src-bak/components/packages-web/ElTextaa.vue +169 -0
  107. package/src-bak/components/packages-web/ElTimePicker.vue +39 -0
  108. package/src-bak/components/patchComponents-H5.js +46 -0
  109. package/src-bak/components/patchComponents-web.js +46 -0
  110. package/src-bak/components/simpleFormItemPc/index.js +1 -0
  111. package/src-bak/components/simpleFormItemPc/src/index.vue +94 -0
  112. package/src-bak/components/table/index.ts +29 -0
  113. package/src-bak/components/table/src/composables/use-scrollbar.ts +30 -0
  114. package/src-bak/components/table/src/config.ts +256 -0
  115. package/src-bak/components/table/src/filter-panel.vue +260 -0
  116. package/src-bak/components/table/src/h-helper.ts +34 -0
  117. package/src-bak/components/table/src/layout-observer.ts +78 -0
  118. package/src-bak/components/table/src/store/current.ts +85 -0
  119. package/src-bak/components/table/src/store/expand.ts +76 -0
  120. package/src-bak/components/table/src/store/helper.ts +74 -0
  121. package/src-bak/components/table/src/store/index.ts +246 -0
  122. package/src-bak/components/table/src/store/tree.ts +230 -0
  123. package/src-bak/components/table/src/store/watcher.ts +543 -0
  124. package/src-bak/components/table/src/table/defaults.ts +402 -0
  125. package/src-bak/components/table/src/table/key-render-helper.ts +27 -0
  126. package/src-bak/components/table/src/table/style-helper.ts +378 -0
  127. package/src-bak/components/table/src/table/utils-helper.ts +47 -0
  128. package/src-bak/components/table/src/table-body/defaults.ts +52 -0
  129. package/src-bak/components/table/src/table-body/events-helper.ts +203 -0
  130. package/src-bak/components/table/src/table-body/index.ts +119 -0
  131. package/src-bak/components/table/src/table-body/render-helper.ts +283 -0
  132. package/src-bak/components/table/src/table-body/styles-helper.ts +164 -0
  133. package/src-bak/components/table/src/table-column/defaults.ts +237 -0
  134. package/src-bak/components/table/src/table-column/index.ts +202 -0
  135. package/src-bak/components/table/src/table-column/render-helper.ts +214 -0
  136. package/src-bak/components/table/src/table-column/watcher-helper.ts +88 -0
  137. package/src-bak/components/table/src/table-footer/index.ts +128 -0
  138. package/src-bak/components/table/src/table-footer/mapState-helper.ts +33 -0
  139. package/src-bak/components/table/src/table-footer/style-helper.ts +51 -0
  140. package/src-bak/components/table/src/table-header/event-helper.ts +213 -0
  141. package/src-bak/components/table/src/table-header/index.ts +244 -0
  142. package/src-bak/components/table/src/table-header/style.helper.ts +119 -0
  143. package/src-bak/components/table/src/table-header/utils-helper.ts +94 -0
  144. package/src-bak/components/table/src/table-layout.ts +259 -0
  145. package/src-bak/components/table/src/table.vue +389 -0
  146. package/src-bak/components/table/src/tableColumn.ts +3 -0
  147. package/src-bak/components/table/src/tokens.ts +5 -0
  148. package/src-bak/components/table/src/util.ts +521 -0
  149. package/src-bak/components/table/style/css.ts +5 -0
  150. package/src-bak/components/table/style/index.ts +5 -0
  151. package/src-bak/components/tabs/index.js +8 -0
  152. package/src-bak/components/tabs/src/constants.js +23 -0
  153. package/src-bak/components/tabs/src/tab-bar.js +8 -0
  154. package/src-bak/components/tabs/src/tab-bar.vue +92 -0
  155. package/src-bak/components/tabs/src/tab-nav.jsx +424 -0
  156. package/src-bak/components/tabs/src/tab-pane.js +16 -0
  157. package/src-bak/components/tabs/src/tab-pane.vue +80 -0
  158. package/src-bak/components/tabs/src/tabs.jsx +223 -0
  159. package/src-bak/components/tabs/style/css.js +2 -0
  160. package/src-bak/components/tabs/style/index.js +2 -0
  161. package/src-bak/components/thirdPartyFrame/index.js +32 -0
  162. package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +125 -0
  163. package/src-bak/enums/index.js +16 -0
  164. package/src-bak/hooks/configLoad.js +45 -0
  165. package/src-bak/hooks/index.js +189 -0
  166. package/src-bak/hooks/mock.js +6960 -0
  167. package/src-bak/hooks/pageConfig.js +127 -0
  168. package/src-bak/index.jsx +440 -0
  169. package/src-bak/renderer.jsx +77 -0
  170. package/src-bak/resolver-H5.vue +88 -0
  171. package/src-bak/resolver-common.vue +129 -0
  172. package/src-bak/resolver-web.vue +91 -0
  173. package/src-bak/rules/eventsSupplement.js +573 -0
  174. package/src-bak/rules/parseCondition.js +378 -0
  175. package/src-bak/rules/ruleUtils.js +273 -0
  176. package/src-bak/rules/rulesDriver.js +118 -0
  177. package/src-bak/rulesImp/events.js +588 -0
  178. package/src-bak/rulesImp/index.js +33 -0
  179. package/src-bak/rulesImp/ruleInstance.js +231 -0
  180. package/src-bak/rulesImp/ruleUtils.js +124 -0
  181. package/src-bak/theme/element/components/button.scss +122 -0
  182. package/src-bak/theme/element/components/card.scss +8 -0
  183. package/src-bak/theme/element/components/checkbox.scss +19 -0
  184. package/src-bak/theme/element/components/collapse.scss +174 -0
  185. package/src-bak/theme/element/components/common.scss +30 -0
  186. package/src-bak/theme/element/components/cycle.scss +0 -0
  187. package/src-bak/theme/element/components/date.scss +13 -0
  188. package/src-bak/theme/element/components/dialog.scss +44 -0
  189. package/src-bak/theme/element/components/form.scss +104 -0
  190. package/src-bak/theme/element/components/index.scss +55 -0
  191. package/src-bak/theme/element/components/input.scss +36 -0
  192. package/src-bak/theme/element/components/message.scss +48 -0
  193. package/src-bak/theme/element/components/pagination.scss +47 -0
  194. package/src-bak/theme/element/components/popper.scss +3 -0
  195. package/src-bak/theme/element/components/radio.scss +40 -0
  196. package/src-bak/theme/element/components/scrollbar.scss +14 -0
  197. package/src-bak/theme/element/components/select.scss +82 -0
  198. package/src-bak/theme/element/components/steps.scss +6 -0
  199. package/{src/components/styles/CustomComponenTable.scss → src-bak/theme/element/components/table.scss} +90 -13
  200. package/src-bak/theme/element/components/tabs.scss +128 -0
  201. package/src-bak/theme/element/components/tag.scss +6 -0
  202. package/{src/components/styles → src-bak/theme/element/components}/text.scss +3 -3
  203. package/src-bak/theme/element/components/textarea.scss +3 -0
  204. package/src-bak/theme/element/components/tree.scss +0 -0
  205. package/src-bak/theme/element/index.scss +55 -0
  206. package/src-bak/utils/cipher.js +141 -0
  207. package/src-bak/utils/common.js +664 -0
  208. package/src-bak/utils/const.js +259 -0
  209. package/src-bak/utils/defaultVal.js +92 -0
  210. package/src-bak/utils/dom.js +36 -0
  211. package/src-bak/utils/format.js +19 -0
  212. package/src-bak/utils/index.js +4 -0
  213. package/src-bak/utils/is.js +74 -0
  214. package/src-bak/utils/loadModule.js +75 -0
  215. package/src-bak/utils/preserveFunc.js +33 -0
  216. package/src-bak/utils/render.jsx +1138 -0
  217. package/src-bak/utils/request.js +136 -0
  218. package/src-bak/utils/respone.js +70 -0
  219. package/src-bak/utils/valid.js +89 -0
@@ -0,0 +1,33 @@
1
+ import { RuleDriver } from "./ruleInstance"
2
+
3
+ export class RuleExecuter {
4
+ penddingRules = {}
5
+ ruleEngines = {}
6
+ constructor() {
7
+ }
8
+ run({
9
+ rootValue,
10
+ rules,
11
+ config,
12
+ dynamicMapComp,
13
+ _mapComp,
14
+ lang,
15
+ messageInstance,
16
+ isInit
17
+ }) {
18
+ rules?.forEach(rule => {
19
+ const key = `${rule.relId}_${config.dynamicHireRelat}`
20
+ if (!this.ruleEngines[key]) {
21
+ this.ruleEngines[key] = new RuleDriver({
22
+ rule,
23
+ config,
24
+ dynamicMapComp,
25
+ lang,
26
+ messageInstance,
27
+ _mapComp
28
+ })
29
+ }
30
+ this.ruleEngines[key].run(rootValue?.value, isInit)
31
+ })
32
+ }
33
+ }
@@ -0,0 +1,231 @@
1
+ import { Engine, Rule } from 'json-rules-engine'
2
+ import { hasOwn } from '../utils'
3
+ import { calcRelateCodes} from './ruleUtils'
4
+ import { EVENS_INFO, getEventPriority, runEvent } from './events'
5
+
6
+ const AlwayFlase = 'alwaysFalse'
7
+ const symbolOperatorMap = {
8
+ '1': 'greaterThan',
9
+ '2': 'greaterThanInclusive',
10
+ '3': 'lessThan',
11
+ '4': 'lessThanInclusive',
12
+ '5': 'customEqual',
13
+ '6': 'notEqual',
14
+ '7': 'fullInclude',
15
+ '8': 'regular',
16
+ }
17
+
18
+ export const conditionType = {
19
+ COMPONENT: 1, // 1: 组件
20
+ SYSTEM: 2, // 2: 系统参数
21
+ SELF: 3, // 3: 手动输入
22
+ COMPONENT_ENMU: 4, // 组件枚举
23
+ NULL: 5 // 空
24
+ }
25
+
26
+ export class RuleDriver {
27
+ engine = null
28
+ config = null
29
+ dynamicMapComp = null
30
+ _mapComp = null
31
+ penddingRules = null
32
+ recovers = null
33
+ engineRule = null
34
+ rule = null
35
+ lang = 'zh'
36
+ messageInstance = null
37
+ constructor({
38
+ rule,
39
+ config,
40
+ dynamicMapComp,
41
+ _mapComp,
42
+ lang,
43
+ messageInstance,
44
+ penddingRules = {}
45
+ }) {
46
+ this.config = config
47
+ this.dynamicMapComp = dynamicMapComp
48
+ this._mapComp = _mapComp
49
+ this.penddingRules = penddingRules
50
+ this.rule = rule
51
+ this.lang = lang
52
+ this.messageInstance = messageInstance
53
+
54
+ this.engineRule = new Rule({
55
+ conditions: {all:[]},
56
+ onSuccess: (...arg) => {
57
+ this.executeEvents(...arg)
58
+ },
59
+ onFailure: (...arg) => {
60
+ this.executeRecoveEvents(...arg)
61
+ }
62
+ })
63
+ this.engine = new Engine()
64
+ this.engine.addRule(this.engineRule)
65
+ this.polyfillOperators()
66
+ }
67
+ run(rootValue, isInit) {
68
+ const conditions = this.generateRuleConditions(this.rule)
69
+ this.engineRule?.setConditions(conditions)
70
+ this.engine.updateRule(this.engineRule)
71
+ this.isInit = isInit // 执行run的时候传进来,表示是否时初始化的时候执行的
72
+ this.engine.run({
73
+ rootValue,
74
+ isInit
75
+ })
76
+ }
77
+ async executeEvents(...arg) {
78
+ console.log('executeEvents arg==:', arg)
79
+ const isInit = await arg[1]?.factValue?.('isInit')
80
+ const { pmRuleTargetEventVoList, pmRuleTargetEventVOList } = this.rule
81
+ const EventVoList = (pmRuleTargetEventVoList || pmRuleTargetEventVOList).sort((a, b) => getEventPriority(a.eventId) - getEventPriority(b.eventId))
82
+ this.recovers = runEvent.call(this, EventVoList, isInit)
83
+ }
84
+ async executeRecoveEvents(...arg) {
85
+ console.log('executeRecoveEvents arg==:', arg)
86
+ if (this.recovers) {
87
+ this.recovers?.reverse?.()?.forEach(recover => {
88
+ if (recover) {
89
+ recover()
90
+ }
91
+ })
92
+ } else {
93
+ const { pmRuleTargetEventVoList, pmRuleTargetEventVOList } = this.rule
94
+ const initRecoverEventVoList = (pmRuleTargetEventVoList || pmRuleTargetEventVOList).map(item => {
95
+ const ret = {
96
+ ...item
97
+ }
98
+ ret.eventId = EVENS_INFO[item.eventId]?.recover
99
+ return ret
100
+ })
101
+ const EventVoList = initRecoverEventVoList.sort((a, b) => getEventPriority(b.eventId) - getEventPriority(a.eventId))
102
+ const isInit = await arg[1]?.factValue?.('isInit')
103
+ runEvent.call(this, EventVoList, isInit)
104
+ }
105
+ }
106
+ generateRuleConditions(rule) {
107
+ const { eventExpress } = rule || {}
108
+ if (!eventExpress) return false
109
+
110
+ const expressObj = JSON.parse(eventExpress)
111
+ return this.paseRuleExpress(expressObj)
112
+ }
113
+ paseRuleExpress(expressInfo) {
114
+ const { relation, conditions } = expressInfo
115
+ const key = relation == '1' ? 'all' : 'any'
116
+ return {
117
+ [key]: conditions?.map(condition => {
118
+ if (hasOwn(condition ,'relation') && hasOwn(condition ,'conditions')) {
119
+ return this.paseRuleExpress(condition)
120
+ } else {
121
+ return this.generateRuleFace(condition)
122
+ }
123
+ })
124
+ }
125
+ }
126
+ polyfillOperators() {
127
+ this.engine?.addOperator('customEqual', (factValue, jsonValue) => {
128
+ return factValue == jsonValue || (!jsonValue && isArray(factValue) && !factValue.length)
129
+ })
130
+ this.engine?.addOperator('fullInclude', (factValue, jsonValue) => {
131
+ if (typeof factValue === 'number') factValue = `${factValue}`
132
+ if (Array.isArray(factValue) || typeof factValue === 'string') {
133
+ return factValue.indexOf(jsonValue) > -1
134
+ }
135
+ return false
136
+ })
137
+ this.engine?.addOperator('regular', (factValue, jsonValue) => {
138
+ if (['string', 'number'].includes(typeof jsonValue)) {
139
+ const reg = new RegExp(jsonValue)
140
+ return reg.test(factValue)
141
+ }
142
+ return false
143
+ })
144
+ this.engine?.addOperator('AlwayFlase', (factValue, jsonValue) => {
145
+ return false
146
+ })
147
+ }
148
+ getRelateCodes(path) {
149
+ return calcRelateCodes.call(this, path)
150
+ }
151
+ generateRuleFace(condition) {
152
+ let retCondition = {
153
+ fact: 'rootValue',
154
+ path: '',
155
+ operator: symbolOperatorMap[condition.symbol],
156
+ value: '',
157
+ }
158
+ const { refType, refValue, targetType, targetValue } = condition
159
+ if (conditionType.COMPONENT == refType) {
160
+ const configKeys = this.getRelateCodes(refValue)
161
+ if (configKeys.length > 1) {
162
+ console.error('ref config must single config', this.config, configCodes, path)
163
+ retCondition.operator = AlwayFlase
164
+ return
165
+ }
166
+ if (!configKeys.length) {
167
+ retCondition.operator = AlwayFlase
168
+ console.error('rule get refType Config fail,', '\nrefType:', refType, '\nrule:', this.rule, '\nconfig:', this.config)
169
+ return
170
+ }
171
+ retCondition.path = `$.${configKeys[0]?.replaceAll('->', '.')}`
172
+ }
173
+ if (conditionType.COMPONENT == targetType) {
174
+ retCondition.value = {
175
+ fact: 'rootValue',
176
+ }
177
+ const configKeys = this.getRelateCodes(targetValue)
178
+ if (configKeys.length > 1) {
179
+ console.error('target config must single config', this.config, configCodes, path)
180
+ retCondition.operator = AlwayFlase
181
+ return
182
+ }
183
+ if (!configKeys.length) {
184
+ retCondition.operator = AlwayFlase
185
+ console.error('rule get targetType Config fail,', '\nrefType:', refType, '\nrule:', this.rule, '\nconfig:', this.config)
186
+ return
187
+ }
188
+ retCondition.value.path = `$.${configKeys[0]?.replaceAll('->', '.')}`
189
+ }
190
+ if (conditionType.SYSTEM == targetType) {
191
+ retCondition.value = getSystemArgVal(targetValue)
192
+ }
193
+ if (conditionType.SELF == targetType) {
194
+ retCondition.value = targetValue
195
+ }
196
+ if (conditionType.COMPONENT_ENMU == targetType) {
197
+ retCondition.value = targetValue
198
+ }
199
+ if (conditionType.NULL == targetType) {
200
+ retCondition.value = null
201
+ }
202
+ console.log('face, refVal===:', refValue, 'targetValue==:', targetValue, 'condition==:', retCondition)
203
+ return retCondition
204
+ }
205
+ }
206
+
207
+
208
+ function getSystemArgVal(flag) {
209
+ const now = new Date()
210
+ switch (flag) {
211
+ case systemFlag.currentDate:
212
+ return formatDate(new Date(),"yyyy-MM-dd")
213
+ case systemFlag.currentTimestamp:
214
+ return new Date().getTime()
215
+ case systemFlag.CurrentYear:
216
+ return formatDate(new Date(),"yyyy")
217
+ case systemFlag.CurrentMonth:
218
+ return formatDate(new Date(),"MM")
219
+ case systemFlag.CurrentDay:
220
+ return formatDate(new Date(),"dd")
221
+ case systemFlag.CurrentAfter30Day:
222
+ now.setDate(now.getDate() + 30);
223
+ return formatDate(now, "yyyy-MM-dd")
224
+ case systemFlag.CurrentBefore30Day:
225
+ now.setDate(now.getDate() - 30);
226
+ return formatDate(now, "yyyy-MM-dd")
227
+ default:
228
+ return flag
229
+ }
230
+ }
231
+
@@ -0,0 +1,124 @@
1
+ import { hasOwn, isPlainObject } from "../utils"
2
+
3
+ export function getRelateConfigKeys(keys = [], path = '', relatePath = '') {
4
+ // 这边逻辑目前主要是为了兼容日志的时候,也可以正常使用规则========start=====
5
+ let normalRelatePath = relatePath
6
+ let preFlagStr = ''
7
+ // 这个规则是因为在日志直接拷贝配置的时候,在analysisComponent组件中会在前面额外加上 这个 标识 所以需要转换一下
8
+ const preFlagStrReg = /(__@__[^(->)]*__)$/
9
+ const preFlagStrMatchs = relatePath?.match(preFlagStrReg)
10
+ if (preFlagStrMatchs) {
11
+ preFlagStr = preFlagStrMatchs[1]
12
+ normalRelatePath = normalRelatePath?.replace(preFlagStrReg, '')
13
+ }
14
+ // 这边逻辑目前主要是为了兼容日志的时候,也可以正常使用规则========end=====
15
+
16
+ const relatePathArr = normalRelatePath ? normalRelatePath.split('->') : []
17
+ const pathArr = path ? path.split('->') : []
18
+ let diffIdx = -1 // 此标识表示,是从那个所以开始,code不一样了
19
+ let currentIdx = 0
20
+ while(diffIdx === -1 && currentIdx < pathArr.length && currentIdx < relatePathArr.length) {
21
+ const pathCode = pathArr[currentIdx]
22
+ const pathCodeReg = new RegExp(`^${pathCode}(\\[\\d+\\])?$`)
23
+ const relateCode = relatePathArr[currentIdx]
24
+ if (pathCodeReg.test(relateCode)) {
25
+ pathArr.splice(currentIdx, 1, relateCode)
26
+ currentIdx++
27
+ } else {
28
+ diffIdx = currentIdx
29
+ }
30
+ }
31
+ const normalPath = pathArr.reduce((ret, pathCode) => {
32
+ const noramlPathCode = pathCode.replace(/([\[\]]{1})/g, (_,b) => {return `\\${b}`})
33
+ return ret + (ret ? `->${noramlPathCode}(\\[\\d+\\])?` : `${noramlPathCode}(\\[\\d+\\])?`)
34
+ }, '')
35
+ const normalPathReg = new RegExp(`^${normalPath}${preFlagStr}$`)
36
+ return keys.filter(code => {
37
+ return normalPathReg.test(code)
38
+ })
39
+ }
40
+
41
+ export function calcRelateCodes(path) {
42
+ const dynamicMapCompKeys = Object.keys(this.dynamicMapComp || {})
43
+ const { dynamicHireRelat = '' } = this.config || {}
44
+ const configCodes = getRelateConfigKeys(dynamicMapCompKeys, path, dynamicHireRelat,)
45
+ if (!configCodes.length) {
46
+ if (this._mapComp[path]) {
47
+ if (!this.penddingRules[path]) {
48
+ this.penddingRules[path] = []
49
+ }
50
+ if (!this.penddingRules[path].some((item) => item?.rule === this?.rule && item?.config === this?.config)) {
51
+ this.penddingRules[path].push(this)
52
+ }
53
+ }
54
+ }
55
+ return configCodes
56
+ }
57
+
58
+ export function getConfigValue(codesStr = '', refVal) {
59
+ if (!codesStr) return ''
60
+ const { config} = this
61
+ const { hireRelat = '' } = config
62
+ if (hireRelat === codesStr) {
63
+ // 如果走到这里,表示是触发条件中的一个条件是当前的配置项(config)
64
+ return config.bindValue
65
+ }
66
+ const configs = getCurrentComp.call(this, codesStr)
67
+ if (configs.length !== 1) {
68
+ return null
69
+ }
70
+ const retVal = refVal ? configs[0]?.refValue : configs[0]?.bindValue
71
+ return retVal
72
+ }
73
+
74
+
75
+ /**
76
+ * 根据code path 获取到对应的组件或者label
77
+ */
78
+ export function getCurrentComp(codesStr) {
79
+ if (!codesStr) return null
80
+ const { dynamicMapComp } = this
81
+ const configCodes = calcRelateCodes.call(this, codesStr)
82
+ return configCodes.map(code => {
83
+ return dynamicMapComp[code]
84
+ })
85
+ }
86
+
87
+ // 设置对应的值
88
+ export function setFormVal(pathStr, val) {
89
+ if (!pathStr) {
90
+ return
91
+ }
92
+ if (isPlainObject(pathStr)) {
93
+ hasOwn(pathStr, 'refValue') && (pathStr.refValue = val)
94
+ return
95
+ }
96
+ const configs = getCurrentComp.call(this, pathStr)
97
+ configs.forEach(cg => {
98
+ hasOwn(cg, 'refValue') && (cg.refValue = val)
99
+ })
100
+ }
101
+
102
+ export function greaterThan(val, targ) {
103
+ const valCanTran = canTransNumber(val)
104
+ const tragCanTran = canTransNumber(targ)
105
+ if (valCanTran && tragCanTran) {
106
+ return Number(val) > Number(targ)
107
+ } else {
108
+ return val + '' > targ + ''
109
+ }
110
+ }
111
+
112
+ export function lessThan(val, targ) {
113
+ const valCanTran = canTransNumber(val)
114
+ const tragCanTran = canTransNumber(targ)
115
+ if (valCanTran && tragCanTran) {
116
+ return Number(val) < Number(targ)
117
+ } else {
118
+ return val + '' < targ + ''
119
+ }
120
+ }
121
+
122
+ export function canTransNumber(val) {
123
+ return !isNaN(Number(val))
124
+ }
@@ -0,0 +1,122 @@
1
+ .el-button {
2
+ --el-button-disabled-text-color: #BBBFC4;
3
+ --el-button-hover-bg-color: #EFF0F1;
4
+ --el-button-text-color: #1F2329;
5
+ --el-font-size-base: 14px;
6
+ --el-font-weight-primary: 400;
7
+
8
+ padding: 5px 18px;
9
+ }
10
+ .el-button--large {
11
+ padding: 8px 12px;
12
+ font-size: 16px;
13
+ }
14
+ .el-button--small {
15
+ --el-button-sizee: 24px;
16
+ padding: 2px 12px;
17
+ }
18
+ .el-button--medium {
19
+ --el-button-size: 36px;
20
+ padding: 6px 12px;
21
+ height: var(--el-button-size);
22
+ }
23
+ .el-button--def {
24
+ --el-button-size: 32px;
25
+ padding: 5px 8px;
26
+ height: var(--el-button-size);
27
+ }
28
+ .el-button:hover {
29
+ color: var(--el-button-text-color);
30
+ border-color: var(--el-border-color);
31
+ background-color: var(--el-button-hover-bg-color);
32
+ }
33
+ .el-button:active {
34
+ background-color: #DEE0E3;
35
+ }
36
+
37
+ .el-button--primary {
38
+ --el-button-text-color: #FFFFFF;
39
+ --el-button-bg-color: #3271FE;
40
+ --el-button-hover-bg-color: #4E83FD;
41
+
42
+ --el-button-disabled-text-color: #FFFFFF;
43
+ --el-button-disabled-bg-color: #BBBFC4;
44
+ --el-button-disabled-border-color: #BBBFC4;
45
+ &.is-text {
46
+ &:not(.is-disabled):hover {
47
+ background-color: #EAF0FE
48
+ }
49
+ &:not(.is-disabled):active {
50
+ background-color: #B9CFFC;
51
+ }
52
+ &.is-disabled {
53
+ color: #BBBFC4;
54
+ &:hover {
55
+ color: #BBBFC4;
56
+ }
57
+ }
58
+ }
59
+ &.is-plain {
60
+ --el-button-bg-color: #FFFFFF;
61
+ --el-button-border-color: #3271FE;
62
+
63
+ --el-button-hover-bg-color: #EAF0FE;
64
+ --el-border-color: #3271FE;
65
+
66
+ &:active {
67
+ background-color: #B9CFFC;
68
+ }
69
+ &.is-disabled {
70
+ color: #BBBFC4;
71
+ background-color: #FAFAFA;
72
+ border-color: #D0D3D6;
73
+ &:hover {
74
+ color: #BBBFC4;
75
+ background-color: #FAFAFA;
76
+ border-color: #D0D3D6;
77
+ }
78
+ }
79
+ }
80
+ }
81
+ .el-button--primary:active {
82
+ background-color: #245BDB;
83
+ }
84
+
85
+ .el-button--danger {
86
+ --el-border-color: #F54A45;
87
+ --el-button-text-color: #FFFFFF;
88
+ --el-button-bg-color: #F54A45;
89
+ --el-button-hover-bg-color: #F76964;
90
+
91
+ --el-button-disabled-text-color: #FFFFFF;
92
+ --el-button-disabled-bg-color: #BBBFC4;
93
+ --el-button-disabled-border-color: #BBBFC4;
94
+
95
+ &.is-plain {
96
+ --el-button-bg-color: #FFFFFF;
97
+ --el-button-border-color: #F54A45;
98
+
99
+ --el-button-hover-bg-color: #FDE2E2;
100
+
101
+ &:active {
102
+ background-color: #FBBFBC;
103
+ }
104
+ &.is-disabled {
105
+ color: #BBBFC4;
106
+ background-color: #FFFFFF;
107
+ border-color: #D0D3D6;
108
+ &:hover {
109
+ color: #BBBFC4;
110
+ background-color: #FFFFFF;
111
+ border-color: #D0D3D6;
112
+ }
113
+ }
114
+ }
115
+ }
116
+ .el-button--danger:hover {
117
+ --el-border-color: #F76964;
118
+ }
119
+ .el-button--danger:active {
120
+ background-color: #D83931;
121
+ border-color: #D83931;
122
+ }
@@ -0,0 +1,8 @@
1
+ .custom-component-card.el-card {
2
+ overflow: unset;
3
+ }
4
+
5
+
6
+ .el-card__body {
7
+ padding: var(--prmary-marign) var(--prmary-marign) 0 var(--prmary-marign);
8
+ }
@@ -0,0 +1,19 @@
1
+ .el-checkbox {
2
+ --el-checkbox-border-radius: 4px;
3
+ --el-checkbox-input-height: 16px;
4
+ --el-checkbox-input-width: 16px;
5
+ --el-checkbox-disabled-checked-input-fill: #646A73;
6
+ --el-checkbox-disabled-checked-input-border-color: #646A73;
7
+ --el-checkbox-disabled-checked-icon-color: #FFFFFF;
8
+ }
9
+ .el-checkbox__inner::after {
10
+ border: 2px solid transparent;
11
+ border-left: 0;
12
+ border-top: 0;
13
+ height: 6px;
14
+ left: 5px;
15
+ top: 2px;
16
+ }
17
+ .el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
18
+ height: 4px;
19
+ }
@@ -0,0 +1,174 @@
1
+ @import "./common.scss";not-wrap-border
2
+
3
+ // 配置被包裹的一层样式
4
+ .standard-wrap {
5
+ box-sizing: border-box;
6
+ }
7
+ .CustomComponentCollapse {
8
+ .show-segment {
9
+ & > .el-collapse-item__header {
10
+ position: relative;
11
+ &::after {
12
+ display: block;
13
+ content: '';
14
+ position: absolute;
15
+ width: calc(100% + 32px);
16
+ border-bottom: 1px solid #DEE0E3;
17
+ left: -16px;
18
+ bottom: 0px;
19
+ }
20
+ }
21
+ & > .el-collapse-item__wrap {
22
+ margin-top: 16px;
23
+ }
24
+ }
25
+
26
+ .el-collapse {
27
+ --el-collapse-header-height: 22px;
28
+ --el-collapse-header-font-size: 14px;
29
+ --el-collapse-header-text-color: #1F2329;
30
+ // margin-bottom: var(--prmary-marign);
31
+ .el-collapse-item__header {
32
+ font-weight: 600;
33
+ padding-bottom: 16px;
34
+ box-sizing: content-box;
35
+ height: unset;
36
+ min-height: var(--el-collapse-header-height);
37
+ & > .el-collapse-item__title {
38
+ width: 100%;
39
+ }
40
+ }
41
+ .el-collapse-item__content {
42
+ padding-bottom: 0;
43
+ }
44
+ .el-collapse-item__wrap {
45
+ margin-right: calc(var(--prmary-marign) - var(--prmary-marign) * 2);
46
+ }
47
+ }
48
+
49
+ .el-collapse-item__wrap, .el-collapse-item__header {
50
+ border-bottom: none;
51
+ &::before {
52
+ display: none;
53
+ }
54
+ }
55
+ .el-collapse-item__wrap {
56
+ overflow: unset;
57
+ }
58
+ &.is-card {
59
+ .el-collapse-item {
60
+ &::after {
61
+ display: none;
62
+ }
63
+ }
64
+ }
65
+ .el-collapse-item {
66
+ position: relative;
67
+ &::after {
68
+ content: "";
69
+ display: block;
70
+ // position: absolute;
71
+ // width: 100%;
72
+ // bottom: 0;
73
+ // left: 0;
74
+ position: unset;
75
+ height: 0px;
76
+ border-bottom: 1px solid #d0d3d6;
77
+ // background-color: #d0d3d6;
78
+ // margin-bottom: var(--prmary-marign);
79
+ }
80
+ .el-collapse-item__content {
81
+ & > .el-row {
82
+ & > .el-col {
83
+ &:last-child {
84
+ & > {
85
+ .el-form-item, .simple-form-item {
86
+ margin-bottom: 24px;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ .el-collapse-item__arrow {
95
+ font-size: 16px;
96
+ color: #646A73;
97
+ svg path {
98
+ d: path("M 338.752 104.704 a 64 64 0 0 0 0 90.496 l 316.8 316.8 l -316.8 316.8 a 64 64 0 0 0 90.496 90.496 l 362.048 -362.048 a 64 64 0 0 0 0 -90.496 L 429.248 104.704 a 64 64 0 0 0 -90.496 0 Z");
99
+ }
100
+ }
101
+ .el-collapse-item__content {
102
+ @include nestMargin
103
+ }
104
+
105
+ .el-collapse-item__arrow {
106
+ margin-right: 0;
107
+ }
108
+ .hidden-head {
109
+ & > .el-collapse-item__header {
110
+ display: none;
111
+ }
112
+ }
113
+ .hidden-head-flag {
114
+ &.hidden-head-flag.hidden-head-flag > span::before {
115
+ display: none;
116
+ }
117
+ }
118
+ }
119
+
120
+ .CustomComponentCollapse:has(+ .CustomComponentCollapse) {
121
+ margin-bottom: 16px;
122
+ }
123
+
124
+ // 选择第一个
125
+ // :not(.CustomComponentCollapse.is-card) + .CustomComponentCollapse.is-card {
126
+ // background: red;
127
+ // }
128
+ .CustomComponentCollapse.is-card:has(+ .CustomComponentCollapse.is-card) {
129
+ margin-bottom: 16px;
130
+ }
131
+
132
+ .CustomComponentCollapse.is-card:has(+ .CustomComponentCard.is-card) {
133
+ margin-bottom: 16px;
134
+ }
135
+
136
+ .CustomComponentCard.is-card:has(+ .CustomComponentCollapse.is-card) {
137
+ margin-bottom: 16px;
138
+ }
139
+
140
+
141
+ .CustomComponentCard.is-card:has(+ .CustomComponentCard.is-card) {
142
+ margin-bottom: 16px;
143
+ }
144
+
145
+ // 加权
146
+ .CustomComponentCollapse.CustomComponentCollapse.CustomComponentCollapse:last-child {
147
+ margin-bottom: 0;
148
+ }
149
+ .underline-hidden {
150
+ .el-collapse-item {
151
+ &::after {
152
+ display: none;
153
+ }
154
+ }
155
+ }
156
+ .not-wrap-border {
157
+ &.el-collapse {
158
+ border-top: none;
159
+ border-bottom: none;
160
+ }
161
+ }
162
+ .no-collpase {
163
+ & > .el-collapse-item__header {
164
+ .el-collapse-item__arrow {
165
+ display: none;
166
+ }
167
+ }
168
+ &.el-collapse-item.is-disabled .el-collapse-item__header {
169
+ color: var(--el-collapse-header-text-color);
170
+ }
171
+ &.el-collapse-item.is-disabled .el-collapse-item__header {
172
+ cursor: default;
173
+ }
174
+ }