Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3ce8fc13
authored
Feb 13, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】BPM:sliceName => subString 更通用
parent
45ac20e5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
src/utils/index.ts
+7
-7
src/views/bpm/model/CategoryDraggableModel.vue
+2
-2
src/views/bpm/processInstance/create/index.vue
+4
-4
No files found.
src/utils/index.ts
View file @
3ce8fc13
...
@@ -453,14 +453,14 @@ export function jsonParse(str: string) {
...
@@ -453,14 +453,14 @@ export function jsonParse(str: string) {
/**
/**
* 截取字符串
* 截取字符串
*
*
* @param
name
* @param
str 字符串
* @param start
* @param start
开始位置
* @param end
* @param end
结束位置
*/
*/
export
const
s
liceName
=
(
name
:
string
,
start
:
number
,
end
:
number
)
=>
{
export
const
s
ubString
=
(
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
}
}
src/views/bpm/model/CategoryDraggableModel.vue
View file @
3ce8fc13
...
@@ -89,7 +89,7 @@
...
@@ -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"
>
{{
s
liceName
(
row
.
name
,
0
,
2
)
}}
</span>
<span
style=
"font-size: 12px; color: #fff"
>
{{
s
ubString
(
row
.
name
,
0
,
2
)
}}
</span>
</div>
</div>
{{
row
.
name
}}
{{
row
.
name
}}
</div>
</div>
...
@@ -273,7 +273,7 @@ import { useAppStore } from '@/store/modules/app'
...
@@ -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
{
s
liceName
}
from
'@/utils/index'
import
{
s
ubString
}
from
'@/utils/index'
defineOptions
({
name
:
'BpmModel'
})
defineOptions
({
name
:
'BpmModel'
})
...
...
src/views/bpm/processInstance/create/index.vue
View file @
3ce8fc13
...
@@ -64,9 +64,9 @@
...
@@ -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'
...
@@ -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
{
s
liceName
}
from
'@/utils/index'
import
{
s
ubString
}
from
'@/utils/index'
defineOptions
({
name
:
'BpmProcessInstanceCreate'
})
defineOptions
({
name
:
'BpmProcessInstanceCreate'
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment