mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-09 08:52:41 +08:00
【代码优化】BPM:sliceName => subString 更通用
This commit is contained in:
parent
45ac20e5c3
commit
3ce8fc1364
@ -453,14 +453,14 @@ export function jsonParse(str: string) {
|
|||||||
/**
|
/**
|
||||||
* 截取字符串
|
* 截取字符串
|
||||||
*
|
*
|
||||||
* @param name
|
* @param str 字符串
|
||||||
* @param start
|
* @param start 开始位置
|
||||||
* @param end
|
* @param end 结束位置
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const sliceName = (name: string,start: number, end : number) => {
|
export const subString = (str: string, start: number, end: number) => {
|
||||||
if (name.length > end) {
|
if (str.length > end) {
|
||||||
return name.slice(start, end)
|
return str.slice(start, end)
|
||||||
}
|
}
|
||||||
return name
|
return str
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-image v-if="row.icon" :src="row.icon" class="h-38px w-38px mr-10px rounded" />
|
<el-image v-if="row.icon" :src="row.icon" class="h-38px w-38px mr-10px rounded" />
|
||||||
<div v-else class="flow-icon">
|
<div v-else class="flow-icon">
|
||||||
<span style="font-size: 12px; color: #fff">{{ sliceName(row.name,0,2) }}</span>
|
<span style="font-size: 12px; color: #fff">{{ subString(row.name, 0, 2) }}</span>
|
||||||
</div>
|
</div>
|
||||||
{{ row.name }}
|
{{ row.name }}
|
||||||
</div>
|
</div>
|
||||||
@ -273,7 +273,7 @@ import { useAppStore } from '@/store/modules/app'
|
|||||||
import { cloneDeep, isEqual } from 'lodash-es'
|
import { cloneDeep, isEqual } from 'lodash-es'
|
||||||
import { useTagsView } from '@/hooks/web/useTagsView'
|
import { useTagsView } from '@/hooks/web/useTagsView'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
import { sliceName } from '@/utils/index'
|
import { subString } from '@/utils/index'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmModel' })
|
defineOptions({ name: 'BpmModel' })
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@
|
|||||||
class="w-32px h-32px"
|
class="w-32px h-32px"
|
||||||
/>
|
/>
|
||||||
<div v-else class="flow-icon">
|
<div v-else class="flow-icon">
|
||||||
<span style="font-size: 12px; color: #fff">{{
|
<span style="font-size: 12px; color: #fff">
|
||||||
sliceName(definition.name,0,2)
|
{{ subString(definition.name, 0, 2) }}
|
||||||
}}</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
@ -97,7 +97,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
|||||||
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
|
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
|
||||||
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
|
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
|
||||||
import { groupBy } from 'lodash-es'
|
import { groupBy } from 'lodash-es'
|
||||||
import { sliceName } from '@/utils/index'
|
import { subString } from '@/utils/index'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmProcessInstanceCreate' })
|
defineOptions({ name: 'BpmProcessInstanceCreate' })
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user