resolver-egretimp-plus 0.0.155 → 0.0.157

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.155",
3
+ "version": "0.0.157",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
2
+ <svg class="loadin-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
3
3
  <path
4
4
  fill="currentColor"
5
5
  d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
@@ -11,3 +11,9 @@ defineOptions({
11
11
  name: 'Loading',
12
12
  })
13
13
  </script>
14
+ <style lang="scss">
15
+ .loadin-svg {
16
+ width: 1em;
17
+ height: 1em;
18
+ }
19
+ </style>
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed, defineProps, inject, useAttrs } from 'vue'
3
- import { commonPropsType, formatDate, hasOwn } from '../../utils/index.js'
3
+ import { commonPropsType, formatDate, formatAmount, hasOwn } from '../../utils/index.js'
4
4
 
5
5
  const lang = inject('lang')
6
6
  const modelValue = defineModel()
@@ -24,6 +24,10 @@ const dateFormat = computed(() => {
24
24
  return props.config?.dateFormat
25
25
  })
26
26
 
27
+ const amountFormat = computed(() => {
28
+ return props.config?.amountFormat
29
+ })
30
+
27
31
  const calcProps = computed(() => {
28
32
  let desc = normalVal.value || props.config?.desc
29
33
  try {
@@ -33,8 +37,11 @@ const calcProps = computed(() => {
33
37
  if (dateFormat.value) {
34
38
  desc = formatDate(desc, dateFormat.value)
35
39
  }
40
+ if (amountFormat.value) {
41
+ desc = formatAmount(desc, amountFormat.value)
42
+ }
36
43
  if (props.formatter && typeof props.formatter === "function") {
37
- desc = props.formatter(desc)
44
+ desc = props.formatter(desc, props.config)
38
45
  }
39
46
  } catch (error) {
40
47
  console.log('CmiCell, error==:', error)
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { commonPropsType, formatDate, getConfigOptions, hasOwn } from '../../utils/index.js'
2
+ import { commonPropsType, formatDate, formatAmount, getConfigOptions, hasOwn } from '../../utils/index.js'
3
3
  import { computed, inject, onMounted, reactive, ref, useAttrs, watch } from 'vue'
4
4
 
5
5
  const attrs = useAttrs()
@@ -198,6 +198,12 @@ function normalTableRowValue(row) {
198
198
  if (config?.dateFormat) {
199
199
  ret[config.metaCode] = formatDate(ret[config.metaCode], config.dateFormat)
200
200
  }
201
+ if (config?.amountFormat) {
202
+ ret[config.metaCode] = formatAmount(ret[config.metaCode], config.amountFormat)
203
+ }
204
+ if (typeof config?.formatter === "function") {
205
+ ret[config.metaCode] = config.formatter(ret[config.metaCode], config)
206
+ }
201
207
  })
202
208
  return ret
203
209
  }
@@ -27,7 +27,9 @@ const datePickerProps = computed(() => {
27
27
  if (!ret['value-format'] && !ret.valueFormat) {
28
28
  ret.valueFormat = 'YYYY-MM-DD'
29
29
  }
30
-
30
+ if (props?.config?.displayType) {
31
+ ret.type = props?.config?.displayType
32
+ }
31
33
  return ret
32
34
  })
33
35
  const attrs = useAttrs()
@@ -14,6 +14,7 @@ const props = defineProps({
14
14
  ...ElInputNumber.props,
15
15
  ...commonPropsType,
16
16
  step: [String, Number],
17
+ precision: [String, Number],
17
18
  modeValue: [String, Number]
18
19
  })
19
20
  const textAlignClass = computed(() => {
@@ -26,13 +27,13 @@ const inputNumberProps = computed(() => {
26
27
  return ret
27
28
  }, {})
28
29
  if (props.config?.maxValue && !isNaN(props.config.maxValue)) {
29
- ret.max = props.config.maxValue
30
+ ret.max =parseFloat(props.config.maxValue)
30
31
  }
31
32
  if (props.config?.minValue && !isNaN(props.config.minValue)) {
32
- ret.min = props.config.minValue
33
+ ret.min = parseFloat(props.config.minValue)
33
34
  }
34
35
  if (props.config?.precise && !isNaN(props.config.minValue)) {
35
- ret.precision = props.config.precise
36
+ ret.precision = parseInt(props.config.precise)
36
37
  }
37
38
  if (ret.step) {
38
39
  ret.step = parseFloat(ret.step)
@@ -328,7 +328,9 @@ const TabNav = defineComponent({
328
328
 
329
329
  const tabLabelContent = pane.slots.label?.() || pane.props.label
330
330
  const tabindex = !disabled && pane.active ? 0 : -1
331
-
331
+ if (hidden) {
332
+ return null
333
+ }
332
334
  return (
333
335
  <div
334
336
  ref={`tab-${uid}`}
@@ -27,7 +27,9 @@
27
27
  --prmary-marign-second: 12px;
28
28
  --prmary-marign: 16px
29
29
  }
30
-
30
+ .poppper-class {
31
+ max-width: calc(100vw - 20px)
32
+ }
31
33
  @import './card.scss';
32
34
  @import './collapse.scss';
33
35
  @import './date.scss';
@@ -143,6 +143,28 @@ export function formatDate(date, fmt) {
143
143
  return fmt
144
144
  }
145
145
 
146
+ export const formatAmount = (val, data) => {
147
+ if (!data) {
148
+ return val
149
+ }
150
+ if (typeof val !== "string" && typeof val !== "number") {
151
+ return val
152
+ }
153
+ let params = isPlainObject(data) ? data : { decimals: 2, isThousandth: true }
154
+ let str = String(val).replace(/[^\d\.\-]/g, "")
155
+ if (params?.decimals || params?.decimals == 0) {
156
+ str = parseFloat(str).toFixed(params.decimals).toString()
157
+ }
158
+ let reg = /(\d)(?=(?:\d{3})+$)/g
159
+ let arr = str.split(".")
160
+ if (params?.isThousandth) {
161
+ if (arr[0]) {
162
+ arr[0] = arr[0].replace(reg, "$1,")
163
+ }
164
+ }
165
+ return arr.join(".")
166
+ }
167
+
146
168
  function padLeftZero(str) {
147
169
  return (`00${str}`).substr(str.length)
148
170
  }
@@ -834,7 +834,7 @@ function createFormLable(config, lang = 'zh') {
834
834
  </span>
835
835
  {
836
836
  config.hintFlag == '1' ? (
837
- <ElTooltip effect="dark" content={lang.indexOf('zh') > -1 ? config.hintContentZh : config.hintContentEn} placement="top">
837
+ <ElTooltip popper-class="poppper-class" effect="dark" content={lang.indexOf('zh') > -1 ? config.hintContentZh : config.hintContentEn} placement="top">
838
838
  <span class="label-tip"><elIcon><QuestionFilled /></elIcon></span>
839
839
  </ElTooltip>
840
840
  ) : null