diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index 7e71fd5ff..206cf57a1 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -10,7 +10,12 @@ import { setupVbenVxeTable, useVbenVxeGrid, } from '@vben/plugins/vxe-table'; -import { isFunction, isString } from '@vben/utils'; +import { + floatToFixed2, + formatToFractionDigit, + isFunction, + isString, +} from '@vben/utils'; import { Button, Image, Popconfirm, Switch } from 'ant-design-vue'; @@ -313,33 +318,13 @@ setupVbenVxeTable({ // add by 星语:数量格式化,例如说:金额 vxeUI.formats.add('formatNumber', { tableCellFormatMethod({ cellValue }, digits = 2) { - if (cellValue === null || cellValue === undefined) { - return ''; - } - if (isString(cellValue)) { - cellValue = Number.parseFloat(cellValue); - } - // 如果非 number,则直接返回空串 - if (Number.isNaN(cellValue)) { - return ''; - } - return cellValue.toFixed(digits); + return formatToFractionDigit(cellValue, digits); }, }); vxeUI.formats.add('formatAmount2', { tableCellFormatMethod({ cellValue }) { - if (cellValue === null || cellValue === undefined) { - return '0.00'; - } - if (isString(cellValue)) { - cellValue = Number.parseFloat(cellValue); - } - // 如果非 number,则直接返回空串 - if (Number.isNaN(cellValue)) { - return '0.00'; - } - return `${(cellValue / 100).toFixed(2)}元`; + return `${floatToFixed2(cellValue)}元`; }, }); }, diff --git a/apps/web-antd/src/components/dict-tag/dict-tag.vue b/apps/web-antd/src/components/dict-tag/dict-tag.vue index fb26b4ae1..7d9a5f1f3 100644 --- a/apps/web-antd/src/components/dict-tag/dict-tag.vue +++ b/apps/web-antd/src/components/dict-tag/dict-tag.vue @@ -23,6 +23,11 @@ interface DictTagProps { const props = defineProps(); +function isHexColor(color: string) { + const reg = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i; + return reg.test(color); +} + /** 获取字典标签 */ const dictTag = computed(() => { // 校验参数有效性 @@ -66,7 +71,16 @@ const dictTag = computed(() => { diff --git a/apps/web-antd/src/components/simple-process-design/components/nodes-config/condition-node-config.vue b/apps/web-antd/src/components/simple-process-design/components/nodes-config/condition-node-config.vue index ffa494726..11e0da4b4 100644 --- a/apps/web-antd/src/components/simple-process-design/components/nodes-config/condition-node-config.vue +++ b/apps/web-antd/src/components/simple-process-design/components/nodes-config/condition-node-config.vue @@ -1,7 +1,7 @@ + + diff --git a/apps/web-antd/src/views/bpm/model/form/modules/extra-setting.vue b/apps/web-antd/src/views/bpm/model/form/modules/extra-setting.vue index 10bbfed01..ee42d6801 100644 --- a/apps/web-antd/src/views/bpm/model/form/modules/extra-setting.vue +++ b/apps/web-antd/src/views/bpm/model/form/modules/extra-setting.vue @@ -26,8 +26,11 @@ import { HttpRequestSetting, parseFormFields, } from '#/components/simple-process-design'; -import { ProcessVariableEnum } from '#/utils'; -import { BpmAutoApproveType, BpmModelFormType } from '#/utils/constants'; +import { + BpmAutoApproveType, + BpmModelFormType, + ProcessVariableEnum, +} from '#/utils'; const modelData = defineModel(); diff --git a/apps/web-antd/src/views/bpm/model/index.vue b/apps/web-antd/src/views/bpm/model/index.vue index 3259ae92b..882cae7cb 100644 --- a/apps/web-antd/src/views/bpm/model/index.vue +++ b/apps/web-antd/src/views/bpm/model/index.vue @@ -178,13 +178,13 @@ async function handleCategorySortSubmit() { @@ -543,7 +569,7 @@ const handleRenameSuccess = () => {