Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
0465bd86
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
9 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0465bd86
编写于
8月 03, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code review issues
上级
ccbb954d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
44 addition
and
177 deletion
+44
-177
ui/src/components/TreeNode.vue
ui/src/components/TreeNode.vue
+1
-7
ui/src/utils/dom.ts
ui/src/utils/dom.ts
+1
-0
ui/src/utils/request.ts
ui/src/utils/request.ts
+1
-13
ui/src/utils/routes.ts
ui/src/utils/routes.ts
+19
-62
ui/src/utils/testing.ts
ui/src/utils/testing.ts
+9
-8
ui/src/views/interpreter/service.ts
ui/src/views/interpreter/service.ts
+2
-4
ui/src/views/refresh/index.vue
ui/src/views/refresh/index.vue
+1
-1
ui/src/views/result/store.ts
ui/src/views/result/store.ts
+2
-2
ui/src/views/script/TreeContextMenu.vue
ui/src/views/script/TreeContextMenu.vue
+0
-3
ui/src/views/script/component/tree.vue
ui/src/views/script/component/tree.vue
+8
-77
未找到文件。
ui/src/components/TreeNode.vue
浏览文件 @
0465bd86
...
@@ -50,13 +50,6 @@
...
@@ -50,13 +50,6 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
>
export
default
{
name
:
'
TreeNode
'
,
inheritAttrs
:
false
}
</
script
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
defineEmits
,
withDefaults
,
computed
,
ref
}
from
'
vue
'
;
import
{
defineProps
,
defineEmits
,
withDefaults
,
computed
,
ref
}
from
'
vue
'
;
import
Toolbar
,
{
ToolbarItemProps
}
from
'
./Toolbar.vue
'
;
import
Toolbar
,
{
ToolbarItemProps
}
from
'
./Toolbar.vue
'
;
...
@@ -65,6 +58,7 @@ import Button from './Button.vue';
...
@@ -65,6 +58,7 @@ import Button from './Button.vue';
export
interface
TreeNodeData
{
export
interface
TreeNodeData
{
id
:
string
,
id
:
string
,
type
:
string
,
title
:
string
,
title
:
string
,
level
?:
number
,
level
?:
number
,
indent
?:
number
,
indent
?:
number
,
...
...
ui/src/utils/dom.ts
浏览文件 @
0465bd86
...
@@ -140,3 +140,4 @@ export function getContextMenuStyle(x, y, height) {
...
@@ -140,3 +140,4 @@ export function getContextMenuStyle(x, y, height) {
top
:
`
${
top
}
px`
,
top
:
`
${
top
}
px`
,
}
}
}
}
ui/src/utils/request.ts
浏览文件 @
0465bd86
/**
* 自定义 request 网络请求工具,基于axios
* @author LiQingSong
*/
import
axios
,
{
AxiosPromise
,
AxiosRequestConfig
,
AxiosResponse
}
from
'
axios
'
;
import
axios
,
{
AxiosPromise
,
AxiosRequestConfig
,
AxiosResponse
}
from
'
axios
'
;
import
settings
from
'
@/config/settings
'
;
import
settings
from
'
@/config/settings
'
;
import
i18n
from
"
@/config/i18n
"
;
import
i18n
from
"
@/config/i18n
"
;
...
@@ -45,9 +41,6 @@ const request = axios.create({
...
@@ -45,9 +41,6 @@ const request = axios.create({
timeout
:
0
// 请求超时时间,5000(单位毫秒) / 0 不做限制
timeout
:
0
// 请求超时时间,5000(单位毫秒) / 0 不做限制
});
});
// 全局设置 - post请求头
// request.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
/**
/**
* 请求拦截器
* 请求拦截器
*/
*/
...
@@ -71,11 +64,6 @@ request.interceptors.request.use(
...
@@ -71,11 +64,6 @@ request.interceptors.request.use(
console
.
log
(
`currSiteId=
${
config
.
params
[
settings
.
currSiteId
]}
, currProductId=
${
config
.
params
[
settings
.
currProductId
]}
`
)
console
.
log
(
`currSiteId=
${
config
.
params
[
settings
.
currSiteId
]}
, currProductId=
${
config
.
params
[
settings
.
currProductId
]}
`
)
// if (!config.params[settings.currWorkspace]) {
// const workspacePath = await getCache(settings.currWorkspace);
// config.params = { ...config.params, [settings.currWorkspace]: workspacePath, lang: i18n.global.locale.value };
// }
console
.
log
(
'
=== request ===
'
,
config
.
url
,
config
)
console
.
log
(
'
=== request ===
'
,
config
.
url
,
config
)
return
config
;
return
config
;
},
},
...
@@ -90,7 +78,7 @@ request.interceptors.response.use(
...
@@ -90,7 +78,7 @@ request.interceptors.response.use(
console
.
log
(
'
=== response ===
'
,
axiosResponse
.
config
.
url
,
axiosResponse
)
console
.
log
(
'
=== response ===
'
,
axiosResponse
.
config
.
url
,
axiosResponse
)
const
data
:
ResponseData
=
axiosResponse
.
data
;
const
data
:
ResponseData
=
axiosResponse
.
data
;
const
{
code
,
msg
}
=
data
;
const
{
code
}
=
data
;
// 自定义状态码验证
// 自定义状态码验证
if
(
code
!==
0
)
{
if
(
code
!==
0
)
{
...
...
ui/src/utils/routes.ts
浏览文件 @
0465bd86
import
{
RouteRecordRaw
,
RouteLocationNormalizedLoaded
}
from
'
vue-router
'
;
/**
/**
* Route utils
* Route utils
* @author LiQingSong
*/
*/
/**
/**
* 面包屑类型
* 面包屑类型
...
@@ -31,13 +32,6 @@ declare module 'vue-router' {
...
@@ -31,13 +32,6 @@ declare module 'vue-router' {
roles
?:
string
[];
roles
?:
string
[];
// 标题,路由在菜单、浏览器title 或 面包屑中展示的文字,目前可以使用locales
// 标题,路由在菜单、浏览器title 或 面包屑中展示的文字,目前可以使用locales
title
:
string
;
title
:
string
;
/**
* 面包屑自定义内容:
* 1、默认不配置按照路由自动读取;
* 2、设置为 false , 按照路由自动读取并不读当前自己;
* 3、配置对应的面包屑格式如下:
*/
breadcrumb
?:
BreadcrumbType
[]
|
false
;
/**
/**
* 设置tab导航存储规则类型
* 设置tab导航存储规则类型
* 1、默认不配置按照path(route.path)规则
* 1、默认不配置按照path(route.path)规则
...
@@ -64,22 +58,12 @@ declare module 'vue-router' {
...
@@ -64,22 +58,12 @@ declare module 'vue-router' {
belongTopMenu
?:
string
;
belongTopMenu
?:
string
;
}
}
}
}
import
{
RouteRecordRaw
,
RouteLocationNormalizedLoaded
}
from
'
vue-router
'
;
/**
/**
* 自定义重命名 - 路由类型
* 自定义重命名 - 路由类型
*/
*/
export
type
RoutesDataItem
=
RouteRecordRaw
;
export
type
RoutesDataItem
=
RouteRecordRaw
;
/**
* 头部tab导航类型
*/
export
interface
TabNavItem
{
route
:
RouteLocationNormalizedLoaded
,
menu
:
RoutesDataItem
}
import
{
isExternal
}
from
'
./validate
'
;
import
{
isExternal
}
from
'
./validate
'
;
import
{
equalObject
}
from
"
./object
"
;
import
{
equalObject
}
from
"
./object
"
;
...
@@ -99,7 +83,7 @@ export const getRouteItem = (pathname: string, routesData: RoutesDataItem[]): Ro
...
@@ -99,7 +83,7 @@ export const getRouteItem = (pathname: string, routesData: RoutesDataItem[]): Ro
item
=
element
;
item
=
element
;
break
;
break
;
}
else
if
(
element
.
path
.
indexOf
(
'
:
'
)
>
0
)
{
}
else
if
(
element
.
path
.
indexOf
(
'
:
'
)
>
0
)
{
const
reg
=
new
RegExp
(
"
(:[^/]+)
"
,
"
gmi
"
);
const
reg
=
/
(
:
[^/]
+
)
/gmi
const
path
=
element
.
path
.
replaceAll
(
reg
,
"
.+
"
)
const
path
=
element
.
path
.
replaceAll
(
reg
,
"
.+
"
)
const
pass
=
new
RegExp
(
path
).
test
(
pathname
)
const
pass
=
new
RegExp
(
path
).
test
(
pathname
)
...
@@ -168,7 +152,7 @@ export const setRoutePathForParent = (pathname: string, parentPath = '/', headSt
...
@@ -168,7 +152,7 @@ export const setRoutePathForParent = (pathname: string, parentPath = '/', headSt
return
pathname
;
return
pathname
;
}
}
return
pathname
.
substr
(
0
,
headStart
.
length
)
===
headStart
return
pathname
.
substr
ing
(
0
,
headStart
.
length
)
===
headStart
?
pathname
?
pathname
:
`
${
parentPath
}
/
${
pathname
}
`
;
:
`
${
parentPath
}
/
${
pathname
}
`
;
};
};
...
@@ -192,26 +176,6 @@ export const getPathsTheRoutes = ( pathname: string[], routesData: RoutesDataIte
...
@@ -192,26 +176,6 @@ export const getPathsTheRoutes = ( pathname: string[], routesData: RoutesDataIte
return
routeItem
;
return
routeItem
;
};
};
/**
* 获取面包屑对应的 route 数组
* @param route route 当前routeItem
* @param pathname path[]
* @param routesData routes
*/
export
const
getBreadcrumbRoutes
=
(
route
:
RoutesDataItem
,
pathname
:
string
[],
routesData
:
RoutesDataItem
[]):
BreadcrumbType
[]
=>
{
if
(
!
route
.
breadcrumb
)
{
const
routePaths
=
getPathsTheRoutes
(
pathname
,
routesData
);
const
ret
=
route
.
breadcrumb
===
false
?
routePaths
:
[...
routePaths
,
route
]
return
ret
;
}
return
route
.
breadcrumb
;
};
/**
/**
* 获取当前路由选中的侧边栏菜单path
* 获取当前路由选中的侧边栏菜单path
* @param route route
* @param route route
...
@@ -244,7 +208,7 @@ export const vueRoutes = (routesData: RoutesDataItem[], parentPath = '/', headSt
...
@@ -244,7 +208,7 @@ export const vueRoutes = (routesData: RoutesDataItem[], parentPath = '/', headSt
const
itemChildren
=
children
||
[];
const
itemChildren
=
children
||
[];
const
newItem
:
RoutesDataItem
=
{
...
other
};
const
newItem
:
RoutesDataItem
=
{
...
other
};
newItem
.
path
=
setRoutePathForParent
(
newItem
.
path
,
parentPath
,
headStart
);
newItem
.
path
=
setRoutePathForParent
(
newItem
.
path
,
parentPath
,
headStart
);
if
(
item
.
children
)
{
if
(
item
.
children
)
{
newItem
.
children
=
[
newItem
.
children
=
[
...
vueRoutes
(
itemChildren
,
newItem
.
path
,
headStart
),
...
vueRoutes
(
itemChildren
,
newItem
.
path
,
headStart
),
...
@@ -261,20 +225,18 @@ export const vueRoutes = (routesData: RoutesDataItem[], parentPath = '/', headSt
...
@@ -261,20 +225,18 @@ export const vueRoutes = (routesData: RoutesDataItem[], parentPath = '/', headSt
*/
*/
export
const
routesSetMeta
=
(
routesData
:
RoutesDataItem
[]):
RoutesDataItem
[]
=>
{
export
const
routesSetMeta
=
(
routesData
:
RoutesDataItem
[]):
RoutesDataItem
[]
=>
{
return
routesData
.
map
(
item
=>
{
return
routesData
.
map
(
item
=>
{
const
{
children
,
tabNavType
,
meta
,
...
other
}
=
item
;
const
{
children
,
tabNavType
,
meta
,
...
other
}
=
item
;
const
newItem
:
RoutesDataItem
=
{
const
newItem
:
RoutesDataItem
=
{
meta
:
{
meta
:
{
...
meta
,
...
meta
,
// 自定义设置的 meta 值 S
// 自定义设置的 meta 值 S
tabNavType
:
tabNavType
||
'
path
'
,
tabNavType
:
tabNavType
||
'
path
'
,
// 自定义设置的 meta 值 E
// 自定义设置的 meta 值 E
},
},
...
other
...
other
};
};
if
(
item
.
children
)
{
if
(
item
.
children
)
{
const
itemChildren
=
children
||
[];
const
itemChildren
=
children
||
[];
newItem
.
children
=
[
newItem
.
children
=
[
...
@@ -304,7 +266,7 @@ export const hasPermissionRouteRoles = (userRoles: string[], roles?: string | st
...
@@ -304,7 +266,7 @@ export const hasPermissionRouteRoles = (userRoles: string[], roles?: string | st
if
(
typeof
roles
===
'
string
'
)
{
if
(
typeof
roles
===
'
string
'
)
{
return
userRoles
.
includes
(
roles
);
return
userRoles
.
includes
(
roles
);
}
}
if
(
roles
instanceof
Array
&&
roles
.
length
>
0
)
{
if
(
roles
instanceof
Array
&&
roles
.
length
>
0
)
{
return
roles
.
some
(
role
=>
userRoles
.
includes
(
role
));
return
roles
.
some
(
role
=>
userRoles
.
includes
(
role
));
...
@@ -325,7 +287,6 @@ export const hasPermission = (roles: string[], route: RoutesDataItem): boolean =
...
@@ -325,7 +287,6 @@ export const hasPermission = (roles: string[], route: RoutesDataItem): boolean =
if
(
route
.
roles
)
{
if
(
route
.
roles
)
{
return
route
.
roles
.
some
(
role
=>
roles
.
includes
(
role
));
return
route
.
roles
.
some
(
role
=>
roles
.
includes
(
role
));
//return roles.some(role => route.roles?.includes(role));
}
}
return
true
;
return
true
;
...
@@ -357,28 +318,24 @@ export const getPermissionMenuData = ( roles: string[], routes: RoutesDataItem[]
...
@@ -357,28 +318,24 @@ export const getPermissionMenuData = ( roles: string[], routes: RoutesDataItem[]
* @param route1 vue-route
* @param route1 vue-route
* @param route2 vue-route
* @param route2 vue-route
* @param type 判断规则
* @param type 判断规则
* @returns
* @returns
*/
*/
export
const
equalTabNavRoute
=
(
route1
:
RouteLocationNormalizedLoaded
,
export
const
equalTabNavRoute
=
(
route1
:
RouteLocationNormalizedLoaded
,
route2
:
RouteLocationNormalizedLoaded
,
route2
:
RouteLocationNormalizedLoaded
,
type
:
TabNavType
=
'
path
'
):
boolean
=>
{
type
:
TabNavType
=
'
path
'
):
boolean
=>
{
let
is
=
false
;
let
is
=
false
;
switch
(
type
)
{
if
(
type
===
'
querypath
'
)
{
// path + query
case
'
querypath
'
:
// path + query
is
=
equalObject
(
route1
.
query
,
route2
.
query
)
&&
route1
.
path
===
route2
.
path
is
=
equalObject
(
route1
.
query
,
route2
.
query
)
&&
route1
.
path
===
route2
.
path
}
else
{
// path
break
;
is
=
route1
.
path
===
route2
.
path
default
:
// path
is
=
route1
.
path
===
route2
.
path
if
(
!
is
)
{
if
(
!
is
)
{
const
arr1
=
route1
.
path
.
split
(
'
/
'
)
const
arr1
=
route1
.
path
.
split
(
'
/
'
)
const
arr2
=
route2
.
path
.
split
(
'
/
'
)
const
arr2
=
route2
.
path
.
split
(
'
/
'
)
is
=
arr1
[
1
]
==
'
~
'
&&
arr2
[
1
]
==
'
~
'
&&
arr1
[
2
]
==
arr2
[
2
]
// 同源高亮
is
=
arr1
[
1
]
==
'
~
'
&&
arr2
[
1
]
==
'
~
'
&&
arr1
[
2
]
==
arr2
[
2
]
// 同源高亮
}
}
break
;
}
}
return
is
;
return
is
;
...
...
ui/src/utils/testing.ts
浏览文件 @
0465bd86
import
moment
from
"
moment
"
;
import
moment
from
"
moment
"
;
import
{
AutoTestTools
,
ScriptLanguages
,
TestTools
,
BuildTools
}
from
"
@/utils/const
"
;
import
{
AutoTestTools
,
TestTools
,
BuildTools
}
from
"
@/utils/const
"
;
import
request
from
"
@/utils/request
"
;
function
addItems
(
item
,
list
,
map
)
{
const
lowerCase
=
item
.
toLowerCase
()
list
.
push
(
lowerCase
)
map
[
lowerCase
]
=
item
}
export
function
getUnitTestFrameworks
():
any
{
export
function
getUnitTestFrameworks
():
any
{
const
list
=
new
Array
<
string
>
()
const
list
=
new
Array
<
string
>
()
const
map
=
{}
const
map
=
{}
TestTools
.
forEach
((
item
)
=>
{
TestTools
.
forEach
((
item
)
=>
{
const
lowerCase
=
item
.
toLowerCase
()
addItems
(
item
,
list
,
map
)
list
.
push
(
lowerCase
)
map
[
lowerCase
]
=
item
})
})
return
{
list
:
list
,
map
:
map
}
return
{
list
:
list
,
map
:
map
}
...
@@ -34,9 +37,7 @@ export function getAutoTestTools(): any {
...
@@ -34,9 +37,7 @@ export function getAutoTestTools(): any {
const
list
=
new
Array
<
string
>
()
const
list
=
new
Array
<
string
>
()
const
map
=
{}
const
map
=
{}
AutoTestTools
.
forEach
((
item
)
=>
{
AutoTestTools
.
forEach
((
item
)
=>
{
const
lowerCase
=
item
.
toLowerCase
()
addItems
(
item
,
list
,
map
)
list
.
push
(
lowerCase
)
map
[
lowerCase
]
=
item
})
})
return
{
list
:
list
,
map
:
map
}
return
{
list
:
list
,
map
:
map
}
...
...
ui/src/views/interpreter/service.ts
浏览文件 @
0465bd86
...
@@ -10,8 +10,7 @@ export async function getLangSettings() {
...
@@ -10,8 +10,7 @@ export async function getLangSettings() {
})
})
if
(
json
.
code
===
0
)
{
if
(
json
.
code
===
0
)
{
const
data
=
json
.
data
return
json
.
data
return
data
}
}
return
{
languages
:
[],
languageMap
:
{}}
return
{
languages
:
[],
languageMap
:
{}}
...
@@ -26,8 +25,7 @@ export async function getLangInterpreter(lang) {
...
@@ -26,8 +25,7 @@ export async function getLangInterpreter(lang) {
})
})
if
(
json
.
code
===
0
)
{
if
(
json
.
code
===
0
)
{
const
data
=
json
.
data
return
json
.
data
return
data
}
}
return
{
path
:
''
,
info
:
''
}
return
{
path
:
''
,
info
:
''
}
...
...
ui/src/views/refresh/index.vue
浏览文件 @
0465bd86
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
defineComponent
}
from
'
vue
'
import
{
defineComponent
}
from
'
vue
'
export
default
defineComponent
({
export
default
defineComponent
({
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
_
to
,
from
,
next
)
{
// 在渲染该组件的对应路由被验证前调用
// 在渲染该组件的对应路由被验证前调用
// 不能获取组件实例 `this` !
// 不能获取组件实例 `this` !
// 因为当守卫执行时,组件实例还没被创建!
// 因为当守卫执行时,组件实例还没被创建!
...
...
ui/src/views/result/store.ts
浏览文件 @
0465bd86
...
@@ -3,7 +3,7 @@ import { StoreModuleType } from "@/utils/store";
...
@@ -3,7 +3,7 @@ import { StoreModuleType } from "@/utils/store";
import
{
ResponseData
}
from
'
@/utils/request
'
;
import
{
ResponseData
}
from
'
@/utils/request
'
;
import
{
QueryParams
,
QueryResult
}
from
'
@/types/data.d
'
;
import
{
QueryParams
,
QueryResult
}
from
'
@/types/data.d
'
;
import
{
import
{
list
,
get
,
remove
,
getLastest
,
list
,
get
,
remove
,
}
from
'
./service
'
;
}
from
'
./service
'
;
export
interface
StateType
{
export
interface
StateType
{
...
@@ -74,7 +74,7 @@ const StoreModel: ModuleType = {
...
@@ -74,7 +74,7 @@ const StoreModel: ModuleType = {
return
true
;
return
true
;
},
},
async
delete
({
commit
,
dispatch
,
state
},
data
:
any
)
{
async
delete
({
dispatch
},
data
:
any
)
{
try
{
try
{
await
remove
(
data
);
await
remove
(
data
);
dispatch
(
'
list
'
,
{})
dispatch
(
'
list
'
,
{})
...
...
ui/src/views/script/TreeContextMenu.vue
浏览文件 @
0465bd86
...
@@ -38,10 +38,7 @@
...
@@ -38,10 +38,7 @@
import
{
computed
,
defineComponent
,
PropType
,
ref
,
Ref
}
from
"
vue
"
;
import
{
computed
,
defineComponent
,
PropType
,
ref
,
Ref
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
StateType
as
GlobalData
}
from
"
@/store/global
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
WorkspaceData
}
from
"
@/store/workspace
"
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
TreeContextMenu
'
,
name
:
'
TreeContextMenu
'
,
...
...
ui/src/views/script/component/tree.vue
浏览文件 @
0465bd86
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
import
{
computed
,
computed
,
defineComponent
,
defineComponent
,
...
@@ -199,23 +199,12 @@ import {testToolMap} from "@/utils/testing";
...
@@ -199,23 +199,12 @@ import {testToolMap} from "@/utils/testing";
import
{
ExecStatus
}
from
"
@/store/exec
"
;
import
{
ExecStatus
}
from
"
@/store/exec
"
;
import
debounce
from
"
lodash.debounce
"
;
import
debounce
from
"
lodash.debounce
"
;
import
throttle
from
"
lodash.debounce
"
;
import
throttle
from
"
lodash.debounce
"
;
import
{
expandOneKey
}
from
"
@/utils/dom
"
;
import
TreeContextMenu
from
"
./treeContextMenu.vue
"
import
TreeContextMenu
from
"
./treeContextMenu.vue
"
import
{
ZentaoCasePrefix
}
from
"
@/utils/const
"
;
import
{
ZentaoCasePrefix
}
from
"
@/utils/const
"
;
import
NameForm
from
"
./nodeName.vue
"
;
import
NameForm
from
"
./nodeName.vue
"
;
import
{
isInArray
}
from
"
@/utils/array
"
;
import
{
isInArray
}
from
"
@/utils/array
"
;
export
default
defineComponent
({
name
:
'
ScriptTreePage
'
,
components
:
{
CloseOutlined
,
CheckOutlined
,
TreeContextMenu
,
NameForm
,
SyncFromZentao
,
},
props
:
{
},
setup
(
props
)
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
isWin
=
isWindows
()
const
isWin
=
isWindows
()
...
@@ -718,72 +707,14 @@ export default defineComponent({
...
@@ -718,72 +707,14 @@ export default defineComponent({
return
false
return
false
}
}
return
{
const
expandOneKey
=
(
treeMap
:
any
,
key
:
string
,
expandedKeys
:
string
[])
=>
{
t
,
if
(
!
expandedKeys
.
includes
(
key
))
expandedKeys
.
push
(
key
)
isWin
,
currSite
,
currProduct
,
treeData
,
currWorkspace
,
testToolMap
,
nameFormVisible
,
treeDataEmpty
,
filerItems
,
filerType
,
filerValue
,
selectFilerType
,
selectFilerValue
,
replaceFields
,
onLoadData
,
expandNode
,
selectNode
,
checkNode
,
isRunning
,
execSelected
,
execStop
,
toExecUnit
,
checkoutCases
,
checkinCases
,
isExpand
,
showCheckbox
,
displayBy
,
expandAllOrNot
,
showCheckboxOrNot
,
onDisplayBy
,
tree
,
expandedKeys
,
selectedKeys
,
checkedKeys
,
simpleImage
:
Empty
.
PRESENTED_IMAGE_SIMPLE
,
fromTitle
,
fromVisible
,
onSave
,
onCancel
,
noScript
,
rightVisible
,
contextNode
,
menuStyle
,
treeDataMap
,
editedData
,
rightClickedNode
,
updateName
,
cancelUpdate
,
onRightClick
,
menuClick
,
clearMenu
,
createNode
,
removeNode
,
onDragEnter
,
onDrop
,
}
}
})
const
parentId
=
treeMap
[
key
].
parentId
if
(
parentId
)
{
expandOneKey
(
treeMap
,
parentId
,
expandedKeys
)
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录