From 3ce8fc13646c6a60f60b534677ed1f5c4e12a1bb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 13 Feb 2025 19:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91BPM=EF=BC=9AsliceName=20=3D>=20subString=20=E6=9B=B4?= =?UTF-8?q?=E9=80=9A=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.ts | 14 +++++++------- src/views/bpm/model/CategoryDraggableModel.vue | 4 ++-- src/views/bpm/processInstance/create/index.vue | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 7e56e8be..fc6cea8e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -453,14 +453,14 @@ export function jsonParse(str: string) { /** * 截取字符串 * - * @param name - * @param start - * @param end + * @param str 字符串 + * @param start 开始位置 + * @param end 结束位置 */ -export const sliceName = (name: string,start: number, end : number) => { - if (name.length > end) { - return name.slice(start, end) +export const subString = (str: string, start: number, end: number) => { + if (str.length > end) { + return str.slice(start, end) } - return name + return str } diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index 27457936..71b79b78 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -89,7 +89,7 @@
- {{ sliceName(row.name,0,2) }} + {{ subString(row.name, 0, 2) }}
{{ row.name }} @@ -273,7 +273,7 @@ import { useAppStore } from '@/store/modules/app' import { cloneDeep, isEqual } from 'lodash-es' import { useTagsView } from '@/hooks/web/useTagsView' import { useDebounceFn } from '@vueuse/core' -import { sliceName } from '@/utils/index' +import { subString } from '@/utils/index' defineOptions({ name: 'BpmModel' }) diff --git a/src/views/bpm/processInstance/create/index.vue b/src/views/bpm/processInstance/create/index.vue index 62d9ea21..2c714d17 100644 --- a/src/views/bpm/processInstance/create/index.vue +++ b/src/views/bpm/processInstance/create/index.vue @@ -64,9 +64,9 @@ class="w-32px h-32px" />
- {{ - sliceName(definition.name,0,2) - }} + + {{ subString(definition.name, 0, 2) }} +
{{ definition.name }} @@ -97,7 +97,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance' import { CategoryApi, CategoryVO } from '@/api/bpm/category' import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue' import { groupBy } from 'lodash-es' -import { sliceName } from '@/utils/index' +import { subString } from '@/utils/index' defineOptions({ name: 'BpmProcessInstanceCreate' })