Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
6f8bad60
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
8 个月 前同步成功
通知
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 搜索 >>
提交
6f8bad60
编写于
8月 08, 2022
作者:
Z
zhaoke
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' into ztf-35_zhaoke
上级
bce89949
25982465
变更
49
展开全部
隐藏空白更改
内联
并排
Showing
49 changed file
with
140 addition
and
19774 deletion
+140
-19774
.gitignore
.gitignore
+1
-0
README.md
README.md
+1
-1
client/src/app/app.js
client/src/app/app.js
+17
-20
client/src/app/core/lang.js
client/src/app/core/lang.js
+2
-3
client/src/app/core/ztf.js
client/src/app/core/ztf.js
+3
-6
client/src/app/utils/lang.js
client/src/app/utils/lang.js
+1
-1
client/src/app/utils/string.js
client/src/app/utils/string.js
+1
-1
client/src/main.js
client/src/main.js
+1
-1
sonar-project.properties
sonar-project.properties
+17
-0
ui/package-lock.json
ui/package-lock.json
+0
-19532
ui/src/components/AppToolbar.vue
ui/src/components/AppToolbar.vue
+1
-2
ui/src/components/ButtonList.vue
ui/src/components/ButtonList.vue
+3
-3
ui/src/components/Col.vue
ui/src/components/Col.vue
+2
-3
ui/src/components/Dropdown.vue
ui/src/components/Dropdown.vue
+1
-1
ui/src/components/DropdownMenu.vue
ui/src/components/DropdownMenu.vue
+3
-3
ui/src/components/Form.vue
ui/src/components/Form.vue
+0
-1
ui/src/components/FormItem.vue
ui/src/components/FormItem.vue
+1
-1
ui/src/components/List.vue
ui/src/components/List.vue
+4
-4
ui/src/components/MonacoEditor.vue
ui/src/components/MonacoEditor.vue
+2
-5
ui/src/components/Panel.vue
ui/src/components/Panel.vue
+1
-1
ui/src/components/TabPage.vue
ui/src/components/TabPage.vue
+0
-1
ui/src/components/Tree.vue
ui/src/components/Tree.vue
+1
-1
ui/src/components/WindowToolbar.vue
ui/src/components/WindowToolbar.vue
+1
-1
ui/src/config/i18n.ts
ui/src/config/i18n.ts
+1
-1
ui/src/config/router.ts
ui/src/config/router.ts
+0
-0
ui/src/hooks/use-current-product.ts
ui/src/hooks/use-current-product.ts
+1
-3
ui/src/hooks/use-current-site.ts
ui/src/hooks/use-current-site.ts
+1
-3
ui/src/main.ts
ui/src/main.ts
+1
-1
ui/src/utils/i18n.ts
ui/src/utils/i18n.ts
+1
-1
ui/src/views/exec/BatchRunButton.vue
ui/src/views/exec/BatchRunButton.vue
+1
-5
ui/src/views/interpreter/FormInterpreter.vue
ui/src/views/interpreter/FormInterpreter.vue
+3
-4
ui/src/views/result/FormBug.vue
ui/src/views/result/FormBug.vue
+2
-9
ui/src/views/result/FormResult.vue
ui/src/views/result/FormResult.vue
+1
-10
ui/src/views/result/ResultList.vue
ui/src/views/result/ResultList.vue
+3
-3
ui/src/views/result/ResultListPanel.vue
ui/src/views/result/ResultListPanel.vue
+0
-1
ui/src/views/result/TabPageResult.vue
ui/src/views/result/TabPageResult.vue
+4
-4
ui/src/views/script/FilterModal.vue
ui/src/views/script/FilterModal.vue
+5
-5
ui/src/views/script/FormNode.vue
ui/src/views/script/FormNode.vue
+0
-1
ui/src/views/script/FormSyncFromZentao.vue
ui/src/views/script/FormSyncFromZentao.vue
+2
-3
ui/src/views/script/TabPageScript.vue
ui/src/views/script/TabPageScript.vue
+2
-3
ui/src/views/script/WorkDir.vue
ui/src/views/script/WorkDir.vue
+27
-47
ui/src/views/script/WorkDirPanel.vue
ui/src/views/script/WorkDirPanel.vue
+2
-7
ui/src/views/settings/SettingsModal.vue
ui/src/views/settings/SettingsModal.vue
+3
-15
ui/src/views/site/FormSite.vue
ui/src/views/site/FormSite.vue
+1
-10
ui/src/views/site/SiteNav.vue
ui/src/views/site/SiteNav.vue
+2
-2
ui/src/views/site/sitesModal.vue
ui/src/views/site/sitesModal.vue
+6
-11
ui/src/views/workspace/FormWorkspace.vue
ui/src/views/workspace/FormWorkspace.vue
+4
-14
ui/vue.config.js
ui/vue.config.js
+1
-14
xdoc/notes.txt
xdoc/notes.txt
+2
-5
未找到文件。
.gitignore
浏览文件 @
6f8bad60
...
...
@@ -36,3 +36,4 @@ logs/
/product1/
/gui/
/ui/report.json
README.md
浏览文件 @
6f8bad60
...
...
@@ -12,4 +12,4 @@ ZTF is an automated testing framework written in Golang.
2.
Type 'ztf
\z
tf.exe help' to get the help doc.
## Licenses
All source code is licensed under the
[
GPLv3 License
](
LICENSE.md
)
.
All source code is licensed under the
[
GPLv3 License
](
LICENSE.md
)
.
\ No newline at end of file
client/src/app/app.js
浏览文件 @
6f8bad60
...
...
@@ -3,7 +3,7 @@ import {app, BrowserWindow, ipcMain, Menu, shell, dialog, globalShortcut} from '
import
{
DEBUG
,
electronMsg
,
electronMsgReplay
,
minimumSizeHeight
,
minimumSizeWidth
}
from
'
./utils/consts
'
;
import
{
IS_MAC_OSX
,
IS_LINUX
,
IS_WINDOWS_OS
}
from
'
./utils/env
'
;
import
{
logInfo
,
logErr
}
from
'
./utils/log
'
;
import
Config
,
{
updateConfig
}
from
'
./utils/config
'
;
import
Config
from
'
./utils/config
'
;
import
Lang
,
{
initLang
}
from
'
./core/lang
'
;
import
{
startUIService
}
from
"
./core/ui
"
;
import
{
startZtfServer
,
killZtfServer
}
from
"
./core/ztf
"
;
...
...
@@ -12,7 +12,7 @@ const cp = require('child_process');
const
fs
=
require
(
'
fs
'
);
const
pth
=
require
(
'
path
'
);
export
default
class
ZtfApp
{
export
class
ZtfApp
{
constructor
()
{
app
.
name
=
Lang
.
string
(
'
app.title
'
,
Config
.
pkg
.
displayName
);
...
...
@@ -24,7 +24,6 @@ export default class ZtfApp {
}).
catch
((
err
)
=>
{
logErr
(
'
>> ztf server started failed, err:
'
+
err
);
process
.
exit
(
1
);
return
;
})
}
...
...
@@ -63,10 +62,8 @@ export default class ZtfApp {
const
url
=
await
startUIService
()
await
mainWin
.
loadURL
(
url
);
const
{
ipcMain
}
=
require
(
'
electron
'
)
ipcMain
.
on
(
electronMsg
,
(
event
,
arg
)
=>
{
logInfo
(
'
msg from renderer:
'
+
arg
)
const
mainWin
=
this
.
_windows
.
get
(
'
main
'
);
switch
(
arg
)
{
case
'
selectDir
'
:
...
...
@@ -103,11 +100,7 @@ export default class ZtfApp {
this
.
openInTerminal
(
arg
.
path
)
}
})
// if (DEBUG) {
// mainWin.webContents.openDevTools({mode: 'bottom'});
// }
};
}
async
openOrCreateWindow
()
{
const
mainWin
=
this
.
_windows
.
get
(
'
main
'
);
...
...
@@ -163,8 +156,7 @@ export default class ZtfApp {
this
.
buildAppMenu
();
// 在 OS X 系统上,可能存在所有应用窗口关闭了,但是程序还没关闭,此时如果收到激活应用请求,需要重新打开应用窗口并创建应用菜单。
this
.
openOrCreateWindow
().
then
(()
=>
{
})
this
.
openOrCreateWindow
()
});
}
...
...
@@ -172,9 +164,7 @@ export default class ZtfApp {
dialog
.
showOpenDialog
({
properties
:
[
'
openFile
'
]
}).
then
(
result
=>
{
if
(
result
.
filePaths
&&
result
.
filePaths
.
length
>
0
)
{
event
.
reply
(
electronMsgReplay
,
result
.
filePaths
[
0
]);
}
this
.
reply
(
event
,
result
)
}).
catch
(
err
=>
{
logErr
(
err
)
})
...
...
@@ -184,14 +174,18 @@ export default class ZtfApp {
dialog
.
showOpenDialog
({
properties
:
[
'
openDirectory
'
]
}).
then
(
result
=>
{
if
(
result
.
filePaths
&&
result
.
filePaths
.
length
>
0
)
{
event
.
reply
(
electronMsgReplay
,
result
.
filePaths
[
0
]);
}
this
.
reply
(
event
,
result
)
}).
catch
(
err
=>
{
logErr
(
err
)
})
}
reply
(
event
,
result
)
{
if
(
result
.
filePaths
&&
result
.
filePaths
.
length
>
0
)
{
event
.
reply
(
electronMsgReplay
,
result
.
filePaths
[
0
]);
}
}
openInExplore
(
path
)
{
shell
.
showItemInFolder
(
path
);
}
...
...
@@ -206,7 +200,7 @@ export default class ZtfApp {
if
(
IS_WINDOWS_OS
)
{
cp
.
exec
(
'
start cmd.exe /K cd /D
'
+
path
);
}
else
if
(
IS_LINUX
)
{
//
TODO:
support other terminal types
// support other terminal types
cp
.
spawn
(
'
gnome-terminal
'
,
[],
{
cwd
:
path
});
}
else
if
(
IS_MAC_OSX
)
{
cp
.
exec
(
'
open -a Terminal
'
+
path
);
...
...
@@ -222,12 +216,15 @@ export default class ZtfApp {
if
(
!
app
.
setAboutPanelOptions
)
{
return
;
}
let
version
=
Config
.
pkg
.
buildTime
?
'
build at
'
+
new
Date
(
Config
.
pkg
.
buildTime
).
toLocaleString
()
:
''
version
+=
DEBUG
?
'
[debug]
'
:
''
app
.
setAboutPanelOptions
({
applicationName
:
Lang
.
string
(
Config
.
pkg
.
name
)
||
Config
.
pkg
.
displayName
,
applicationVersion
:
Config
.
pkg
.
version
,
copyright
:
`
${
Config
.
pkg
.
copyright
}
${
Config
.
pkg
.
company
}
`
,
credits
:
`Licence:
${
Config
.
pkg
.
license
}
`
,
version
:
`
${
Config
.
pkg
.
buildTime
?
`build at
${
new
Date
(
Config
.
pkg
.
buildTime
).
toLocaleString
()}
`
:
''
}${
DEBUG
?
'
[debug]
'
:
''
}
`
version
:
version
});
}
...
...
client/src/app/core/lang.js
浏览文件 @
6f8bad60
...
...
@@ -4,7 +4,7 @@ const fs = require('fs');
import
{
DEBUG
}
from
'
../utils/consts
'
;
import
{
logInfo
}
from
"
../utils/log
"
;
import
LangHelper
from
'
../utils/lang
'
;
import
{
LangHelper
}
from
'
../utils/lang
'
;
const
langHelper
=
new
LangHelper
();
...
...
@@ -42,8 +42,7 @@ const loadLangData = (langName) => {
logInfo
(
`load language res from
${
pth
}
`
)
const
buf
=
fs
.
readFileSync
(
pth
)
const
data
=
JSON
.
parse
(
buf
.
toString
())
return
data
return
JSON
.
parse
(
buf
.
toString
())
}
if
(
DEBUG
)
{
...
...
client/src/app/core/ztf.js
浏览文件 @
6f8bad60
...
...
@@ -49,8 +49,7 @@ export async function startZtfServer() {
cmd
.
stdout
.
on
(
'
data
'
,
data
=>
{
const
dataString
=
String
(
data
);
const
lines
=
dataString
.
split
(
'
\n
'
);
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
const
line
=
lines
[
i
];
for
(
let
line
of
lines
)
{
if
(
DEBUG
)
{
logInfo
(
'
\t
'
+
line
);
}
...
...
@@ -93,8 +92,7 @@ export async function startZtfServer() {
cmd
.
stdout
.
on
(
'
data
'
,
data
=>
{
const
dataString
=
String
(
data
);
const
lines
=
dataString
.
split
(
'
\n
'
);
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
const
line
=
lines
[
i
];
for
(
let
line
of
lines
)
{
if
(
DEBUG
)
{
logInfo
(
'
\t
'
+
line
);
}
...
...
@@ -120,11 +118,10 @@ export async function startZtfServer() {
}
export
function
killZtfServer
()
{
let
cmd
=
''
if
(
!
IS_WINDOWS_OS
)
{
logInfo
(
`>> not windows`
);
cmd
=
`ps -ef | grep
${
uuid
}
| grep -v "grep" | awk '{print $2}' | xargs kill -9`
c
onst
c
md
=
`ps -ef | grep
${
uuid
}
| grep -v "grep" | awk '{print $2}' | xargs kill -9`
logInfo
(
`>> exit cmd:
${
cmd
}
`
);
const
cp
=
require
(
'
child_process
'
);
...
...
client/src/app/utils/lang.js
浏览文件 @
6f8bad60
import
TextMap
from
'
./text-map
'
;
import
{
formatString
}
from
'
./string
'
;
export
default
class
LangHelper
extends
TextMap
{
export
class
LangHelper
extends
TextMap
{
constructor
(
name
,
langData
)
{
super
(
langData
);
this
.
_name
=
name
;
...
...
client/src/app/utils/string.js
浏览文件 @
6f8bad60
...
...
@@ -108,7 +108,7 @@ export const ifEmptyStringThen = (str, thenStr) => (isEmptyString(str) ? thenStr
*/
export
const
limitStringLength
=
(
str
,
length
,
suffix
)
=>
{
if
(
str
.
length
>
length
)
{
str
=
str
.
substr
(
0
,
length
);
str
=
str
.
substr
ing
(
0
,
length
);
if
(
suffix
)
{
str
=
`
${
str
}${
suffix
}
`
;
}
...
...
client/src/main.js
浏览文件 @
6f8bad60
import
{
app
}
from
'
electron
'
;
import
{
DEBUG
}
from
'
./app/utils/consts
'
;
import
ZtfApp
from
"
./app/app
"
;
import
{
ZtfApp
}
from
"
./app/app
"
;
import
{
logInfo
}
from
"
./app/utils/log
"
;
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
...
...
sonar-project.properties
0 → 100644
浏览文件 @
6f8bad60
sonar.projectKey
=
ztf
sonar.sources
=
.
sonar.exclusions
=
bin/**,demo/**,log/**,xdoc/**,client/node_modules/**,client/ui/**,client/out/**,client/bin/**,ui/node_modules/**
sonar.host.url
=
http://localhost:59001
sonar.login
=
sqp_fbda64ddf414b8ec8ad53f0b5cc02925e52383b0
sonar.issue.ignore.multicriteria
=
e1,e2,e3
sonar.issue.ignore.multicriteria.e1.ruleKey
=
typescript:S3358
sonar.issue.ignore.multicriteria.e1.resourceKey
=
**/*.vue
sonar.issue.ignore.multicriteria.e2.ruleKey
=
typescript:S3358
sonar.issue.ignore.multicriteria.e2.resourceKey
=
**/*.ts
sonar.issue.ignore.multicriteria.e3.ruleKey
=
javascript:S3358
sonar.issue.ignore.multicriteria.e3.resourceKey
=
**/*.js
sonar.eslint.reportPaths
=
ui/report.json
\ No newline at end of file
ui/package-lock.json
已删除
100644 → 0
浏览文件 @
bce89949
此差异已折叠。
点击以展开。
ui/src/components/AppToolbar.vue
浏览文件 @
6f8bad60
<
template
>
<Toolbar>
<!--
<Button
class=
"rounded pure"
icon=
"search"
iconSize=
"1.5em"
:hint=
"t('search')"
/>
-->
<Button
class=
"rounded pure"
icon=
"settings"
iconSize=
"1.5em"
:hint=
"t('settings')"
@
click=
"openSettings"
/>
</Toolbar>
<SettingsModal
<SettingsModal
:show=
"showSettingsModal"
@
cancel=
"settingsModalClose"
:showOkBtn=
"false"
...
...
ui/src/components/ButtonList.vue
浏览文件 @
6f8bad60
...
...
@@ -42,10 +42,10 @@ const buttonPropsList = computed(() => {
let
item
:
(
ButtonProps
|
Record
<
string
,
any
>
)
&
{
key
:
string
|
number
|
symbol
};
if
(
props
.
replaceFields
&&
Button
.
props
)
{
item
=
Object
.
keys
(
Button
.
props
).
reduce
((
item
,
propName
)
=>
{
item
=
Object
.
keys
(
Button
.
props
).
reduce
((
item
2
,
propName
)
=>
{
const
replacePropName
=
props
.
replaceFields
?
props
.
replaceFields
[
propName
]
:
null
;
item
[
propName
]
=
x
[
typeof
replacePropName
===
'
string
'
?
replacePropName
:
propName
];
return
item
;
item2
[
propName
]
=
x
[
typeof
replacePropName
===
'
string
'
?
replacePropName
:
propName
];
return
item
2
;
},
{
key
:
x
.
key
!==
undefined
?
x
.
key
:
i
});
}
else
{
item
=
{
...
...
ui/src/components/Col.vue
浏览文件 @
6f8bad60
...
...
@@ -9,7 +9,6 @@ import {useI18n} from "vue-i18n";
const
{
t
}
=
useI18n
();
import
{
computed
,
defineProps
,
inject
}
from
"
vue
"
;
import
{
ButtonProps
}
from
"
@/components/Button.vue
"
;
export
interface
ColumnProps
{
width
?:
string
,
...
...
@@ -20,7 +19,7 @@ export interface ColumnProps {
const
props
=
defineProps
<
ColumnProps
>
();
let
gutter
=
inject
(
'
gutter
'
);
let
gutter
=
inject
(
'
gutter
'
)
as
any
;
const
colClass
=
computed
(()
=>
{
const
classes
:
string
[]
=
[];
...
...
@@ -30,7 +29,7 @@ const colClass = computed(() => {
classes
.
push
(
`z-col-
${
span
}
`
);
}
if
(
props
.
offset
>
0
)
{
if
(
props
.
offset
&&
props
.
offset
>
0
)
{
classes
.
push
(
`z-col-offset-
${
props
.
offset
}
`
);
}
...
...
ui/src/components/Dropdown.vue
浏览文件 @
6f8bad60
...
...
@@ -40,7 +40,7 @@ defineProps<{
keyName
?:
string
,
checkedKey
?:
ListItemKey
,
activeKey
?:
ListItemKey
,
replaceFields
?:
Record
<
string
,
string
>
,
// {title: 'name'}
replaceFields
?:
Record
<
string
,
string
>
,
listClass
?:
string
,
listCompact
?:
boolean
,
listDivider
?:
boolean
,
...
...
ui/src/components/DropdownMenu.vue
浏览文件 @
6f8bad60
...
...
@@ -39,7 +39,7 @@ const props = withDefaults(defineProps<{
keyName
?:
string
,
checkedKey
?:
ListItemKey
,
activeKey
?:
ListItemKey
,
replaceFields
?:
Record
<
string
,
string
>
,
// {title: 'name'}
replaceFields
?:
Record
<
string
,
string
>
,
listClass
?:
string
,
listCompact
?:
boolean
,
listDivider
?:
boolean
,
...
...
@@ -89,7 +89,7 @@ function _handleClickMenu(event: MouseEvent) {
const
emit
=
defineEmits
<
{(
type
:
'
click
'
,
event
:
{
originalEvent
:
Event
,
key
:
ListItemKey
,
item
:
ListItemProps
|
Record
<
string
,
any
>
})
:
void
}
>
();
onClickOutside
(
menuRef
,
event
=>
{
onClickOutside
(
menuRef
,
_
event
=>
{
if
(
props
.
hideOnClickAway
&&
state
.
showed
)
{
_toggle
(
false
);
}
...
...
@@ -200,7 +200,7 @@ onMounted(() => {
}
const
triggerEvent
=
props
.
triggerEvent
??
'
click
'
;
const
handler
=
(
event
:
E
vent
)
=>
{
const
handler
=
(
_e
vent
)
=>
{
if
(
state
.
showed
)
{
_toggle
(
false
);
}
else
if
(
!
state
.
show
)
{
...
...
ui/src/components/Form.vue
浏览文件 @
6f8bad60
...
...
@@ -6,7 +6,6 @@
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
provide
}
from
"
vue
"
;
import
{
FormItemProps
}
from
"
@/components/FormItem.vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
const
{
t
}
=
useI18n
();
...
...
ui/src/components/FormItem.vue
浏览文件 @
6f8bad60
...
...
@@ -67,7 +67,7 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
computed
,
ref
}
from
"
vue
"
;
import
{
defineProps
}
from
"
vue
"
;
import
Icon
from
'
@/components/Icon.vue
'
;
export
interface
FormItemProps
{
...
...
ui/src/components/List.vue
浏览文件 @
6f8bad60
...
...
@@ -27,7 +27,7 @@ const props = defineProps<{
keyName
?:
string
,
checkedKey
?:
ListItemKey
,
activeKey
?:
ListItemKey
,
replaceFields
?:
Record
<
string
,
string
>
,
// {title: 'name'}
replaceFields
?:
Record
<
string
,
string
>
,
}
>
();
const
keyItemMap
=
ref
<
Record
<
NonNullable
<
ListItemKey
>
,
ListItemProps
|
Record
<
string
,
any
>>>
({});
...
...
@@ -39,10 +39,10 @@ const itemList = computed(() => {
return
props
.
items
.
map
((
x
,
i
)
=>
{
let
item
:
(
ListItemProps
|
Record
<
string
,
any
>
)
&
{
key
:
NonNullable
<
ListItemKey
>
};
if
(
props
.
replaceFields
&&
ListItem
.
props
)
{
item
=
Object
.
keys
(
ListItem
.
props
).
reduce
((
item
,
propName
)
=>
{
item
=
Object
.
keys
(
ListItem
.
props
).
reduce
((
item
2
,
propName
)
=>
{
const
replacePropName
=
props
.
replaceFields
?
props
.
replaceFields
[
propName
]
:
null
;
item
[
propName
]
=
x
[
typeof
replacePropName
===
'
string
'
?
replacePropName
:
propName
];
return
item
;
item
2
[
propName
]
=
x
[
typeof
replacePropName
===
'
string
'
?
replacePropName
:
propName
];
return
item
2
;
},
{
key
:
x
.
key
!==
undefined
?
x
.
key
:
i
});
}
else
{
item
=
{
...
...
ui/src/components/MonacoEditor.vue
浏览文件 @
6f8bad60
...
...
@@ -3,7 +3,7 @@
</
template
>
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
onBeforeUnmount
,
computed
,
CSSProperties
,
watch
,
shallowRef
,
defineEmits
,
onMounted
,
defineExpose
,
toRaw
}
from
'
vue
'
;
import
{
defineProps
,
onBeforeUnmount
,
computed
,
CSSProperties
,
watch
,
shallowRef
,
defineEmits
,
onMounted
,
defineExpose
}
from
'
vue
'
;
import
*
as
monaco
from
'
monaco-editor
'
;
import
{
useElementSize
}
from
'
@vueuse/core
'
...
...
@@ -38,7 +38,7 @@ const style = computed(()=>{
const
{
height
:
containerHeight
}
=
useElementSize
(
elRef
);
watch
(
containerHeight
,
(
newVal
,
oldValue
)
=>
{
watch
(
containerHeight
,
(
_newVal
,
_
oldValue
)
=>
{
if
(
editorRef
.
value
)
{
editorRef
.
value
.
layout
();
}
...
...
@@ -91,9 +91,6 @@ onMounted(() => {
editor
.
onDidChangeModelContent
(
event
=>
{
const
editorValue
=
editor
.
getValue
()
emit
(
'
change
'
,
editorValue
,
event
);
// if (props.value !== editorValue) {
// emit('change', editorValue, event)
// }
});
emit
(
'
editorDidMount
'
,
editor
);
...
...
ui/src/components/Panel.vue
浏览文件 @
6f8bad60
...
...
@@ -29,7 +29,7 @@
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
reactive
}
from
'
vue
'
;
import
Button
,
{
ButtonProps
}
from
'
./Button.vue
'
;
import
{
ButtonProps
}
from
'
./Button.vue
'
;
import
Toolbar
from
'
./Toolbar.vue
'
;
import
{
useI18n
}
from
"
vue-i18n
"
;
const
{
t
}
=
useI18n
();
...
...
ui/src/components/TabPage.vue
浏览文件 @
6f8bad60
...
...
@@ -12,7 +12,6 @@ import TabPageScript from '@/views/script/TabPageScript.vue';
import
TabPageExecUnit
from
'
@/views/exec/TabPageExecUnit.vue
'
;
import
TabPageUnknown
from
'
./TabPageUnknown.vue
'
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
SaveFilledIconType
}
from
"
@ant-design/icons-vue/lib/icons/SaveFilled
"
;
const
{
t
}
=
useI18n
();
...
...
ui/src/components/Tree.vue
浏览文件 @
6f8bad60
...
...
@@ -102,7 +102,7 @@ function getNodeCheckState(id: string): boolean | 'indeterminate' {
return
checked
;
}
function
_convertNodeData
(
node
:
TreeNodeData
,
parent
:
TreeNodeData
|
undefined
,
index
:
number
)
{
function
_convertNodeData
(
node
:
TreeNodeData
,
parent
:
TreeNodeData
|
undefined
,
_
index
:
number
)
{
node
=
{
...
node
,
level
:
parent
?
((
parent
.
level
??
0
)
+
1
)
:
0
...
...
ui/src/components/WindowToolbar.vue
浏览文件 @
6f8bad60
...
...
@@ -25,7 +25,7 @@
<
script
setup
lang=
"ts"
>
import
Button
from
'
./Button.vue
'
;
import
Toolbar
from
'
./Toolbar.vue
'
;
import
{
defineComponent
,
ref
}
from
"
vue
"
;
import
{
ref
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
getElectron
}
from
"
@/utils/comm
"
;
...
...
ui/src/config/i18n.ts
浏览文件 @
6f8bad60
...
...
@@ -9,7 +9,7 @@ import { getLocale, setLocale, importAllLocales, defaultLang } from "@/utils/i18
/**
* 框架 多语言 配置
*/
export
const
messages
=
importAllLocales
();
export
const
messages
=
importAllLocales
()
as
any
;
const
sysLocale
=
getLocale
();
const
i18n
=
createI18n
({
legacy
:
false
,
...
...
ui/src/config/route
s
.ts
→
ui/src/config/route
r
.ts
浏览文件 @
6f8bad60
文件已移动
ui/src/hooks/use-current-product.ts
浏览文件 @
6f8bad60
...
...
@@ -16,9 +16,7 @@ interface ProductInfo {
export
default
function
useCurrentProduct
():
ComputedRef
<
ProductInfo
>
{
const
store
=
useStore
<
{
Zentao
:
ZentaoData
}
>
();
const
curr
=
computed
<
any
>
(()
=>
{
return
computed
<
any
>
(()
=>
{
return
store
.
state
.
Zentao
.
currProduct
;
});
return
curr
;
}
ui/src/hooks/use-current-site.ts
浏览文件 @
6f8bad60
...
...
@@ -16,10 +16,8 @@ interface SiteInfo {
export
default
function
useCurrentSite
():
ComputedRef
<
SiteInfo
>
{
const
store
=
useStore
<
{
Zentao
:
ZentaoData
}
>
();
const
currSite
=
computed
<
any
>
(()
=>
{
return
computed
<
any
>
(()
=>
{
const
site
=
store
.
state
.
Zentao
.
currSite
;
return
site
.
username
?
site
:
null
;
});
return
currSite
;
}
ui/src/main.ts
浏览文件 @
6f8bad60
import
{
createApp
}
from
'
vue
'
;
import
App
from
'
@/App.vue
'
;
import
router
from
'
@/config/route
s
'
;
import
router
from
'
@/config/route
r
'
;
import
store
from
'
@/config/store
'
;
import
i18n
from
'
@/config/i18n
'
;
...
...
ui/src/utils/i18n.ts
浏览文件 @
6f8bad60
...
...
@@ -81,7 +81,7 @@ export const setLocale = (lang: string, callback: () => void, realReload = true)
* @author LiQingSong
*/
export
function
importAllLocales
():
LocaleMessages
<
VueMessageType
>
{
const
modules
:
LocaleMessages
<
VueMessageType
>
=
{};
const
modules
:
any
=
{};
try
{
// 导入 @/views 下文件,包含子目录,文件名为:[/\\]locales[/\\]([a-z]{2})-?([A-Z]{2})?\.ts
const
viewsRequireContext
:
__WebpackModuleApi
.
RequireContext
=
require
.
context
(
'
../views
'
,
true
,
/
[/\\]
locales
[/\\]([
a-z
]{2})
-
?([
A-Z
]{2})?\.
ts$/
);
...
...
ui/src/views/exec/BatchRunButton.vue
浏览文件 @
6f8bad60
...
...
@@ -89,18 +89,14 @@ function _handleDropDownMenuClick(event) {
bus
.
emit
(
settings
.
eventExec
,
{
execType
:
'
ztf
'
,
scripts
:
arr
});
}
return
}
const
getOpenedScripts
=
()
=>
{
const
openedScripts
=
tabs
.
value
.
filter
((
item
,
index
)
=>
{
return
tabs
.
value
.
filter
((
item
)
=>
{
return
item
.
type
===
'
script
'
}).
map
((
script
:
any
)
=>
{
return
{
path
:
script
.
data
,
workspaceId
:
currWorkspace
.
value
.
id
}
});
return
openedScripts
}
</
script
>
...
...
ui/src/views/interpreter/FormInterpreter.vue
浏览文件 @
6f8bad60
...
...
@@ -138,7 +138,7 @@ const selectInterpreter = async () => {
modelRef
.
value
.
path
=
selectedInterpreter
.
value
;
}
;
const
selectLang
=
async
(
item
)
=>
{
const
selectLang
=
async
()
=>
{
console
.
log
(
"
selectLang
"
,
modelRef
.
value
.
lang
);
modelRef
.
value
.
path
=
""
;
...
...
@@ -212,9 +212,8 @@ const selectFile = () => {
const
{
ipcRenderer
}
=
window
.
require
(
'
electron
'
)
ipcRenderer
.
send
(
settings
.
electronMsg
,
'
selectFile
'
)
ipcRenderer
.
on
(
settings
.
electronMsgReplay
,
(
event
,
arg
)
=>
{
console
.
log
(
arg
)
modelRef
.
value
.
path
=
arg
ipcRenderer
.
on
(
settings
.
electronMsgReplay
,
(
_event
,
arg
)
=>
{
modelRef
.
value
.
path
=
arg
}
)
}
defineExpose
({
...
...
ui/src/views/result/FormBug.vue
浏览文件 @
6f8bad60
...
...
@@ -82,18 +82,11 @@ import { useI18n } from "vue-i18n";
import
{
useStore
}
from
"
vuex
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
unitTestTypesDef
,
ztfTestTypesDef
}
from
"
@/utils/const
"
;
import
{
computed
,
defineExpose
,
onMounted
,
withDefaults
,
ref
,
defineProps
,
reactive
,
}
from
"
vue
"
;
import
{
computed
,
defineExpose
,
withDefaults
,
ref
,
defineProps
,
reactive
}
from
"
vue
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
import
Form
from
"
@/components/Form.vue
"
;
import
FormItem
from
"
@/components/FormItem.vue
"
;
import
{
queryBugFields
,
queryTask
}
from
"
@/services/zentao
"
;
import
{
queryBugFields
}
from
"
@/services/zentao
"
;
import
notification
from
"
@/utils/notification
"
;
import
{
prepareBugData
,
submitBugToZentao
}
from
"
@/services/bug
"
;
...
...
ui/src/views/result/FormResult.vue
浏览文件 @
6f8bad60
...
...
@@ -29,17 +29,8 @@
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
unitTestTypesDef
,
ztfTestTypesDef
}
from
"
@/utils/const
"
;
import
{
computed
,
defineExpose
,
onMounted
,
withDefaults
,
ref
,
defineProps
,
defineEmits
,
reactive
,
PropType
,
}
from
"
vue
"
;
import
{
computed
,
defineExpose
,
withDefaults
,
ref
,
defineProps
}
from
"
vue
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
import
Form
from
"
@/components/Form.vue
"
;
import
FormItem
from
"
@/components/FormItem.vue
"
;
...
...
ui/src/views/result/ResultList.vue
浏览文件 @
6f8bad60
...
...
@@ -57,9 +57,9 @@ const refreshExec = async (item): Promise<void> => {
const
failedCases
:
object
[]
=
[];
reportVal
.
funcResult
.
forEach
(
cs
=>
{
const
item
=
{
path
:
cs
.
path
,
workspaceId
:
reportVal
.
workspaceId
}
allCases
.
push
(
item
)
if
(
cs
.
status
===
'
fail
'
)
failedCases
.
push
(
item
)
const
item
2
=
{
path
:
cs
.
path
,
workspaceId
:
reportVal
.
workspaceId
}
allCases
.
push
(
item
2
)
if
(
cs
.
status
===
'
fail
'
)
failedCases
.
push
(
item
2
)
})
return
{
all
:
allCases
,
fail
:
failedCases
}
...
...
ui/src/views/result/ResultListPanel.vue
浏览文件 @
6f8bad60
...
...
@@ -11,7 +11,6 @@
<
script
setup
lang=
"ts"
>
import
Panel
from
'
@/components/Panel.vue
'
;
import
Button
from
'
@/components/Button.vue
'
;
import
ResultList
from
'
@/views/result/ResultList.vue
'
;
import
ResultStatistic
from
'
@/views/result/ResultStatistic.vue
'
;
import
{
useI18n
}
from
"
vue-i18n
"
;
...
...
ui/src/views/result/TabPageResult.vue
浏览文件 @
6f8bad60
...
...
@@ -183,7 +183,7 @@
<
/template
>
<
script
setup
lang
=
"
ts
"
>
import
{
computed
,
defineProps
,
onMounted
,
reactive
,
ref
,
toRefs
,
watch
}
from
"
vue
"
;
import
{
computed
,
defineProps
,
onMounted
,
reactive
,
ref
,
toRefs
}
from
"
vue
"
;
import
{
PageTab
}
from
"
@/store/tabs
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
...
...
@@ -253,13 +253,13 @@ function toggleItemCollapsed(item) {
}
const
exec
=
(
scope
):
void
=>
{
const
testType
=
report
.
value
.
testType
;
if
(
testType
===
"
func
"
)
{
const
testType
2
=
report
.
value
.
testType
;
if
(
testType
2
===
"
func
"
)
{
const
caseMap
=
getCaseIdsInReport
(
report
.
value
)
const
cases
=
caseMap
[
scope
]
bus
.
emit
(
settings
.
eventExec
,
{
execType
:
'
ztf
'
,
scripts
:
cases
}
);
}
else
if
(
testType
===
"
unit
"
)
{
}
else
if
(
testType
2
===
"
unit
"
)
{
const
data
=
{
execType
:
'
unit
'
,
cmd
:
report
.
value
.
testCommand
,
...
...
ui/src/views/script/FilterModal.vue
浏览文件 @
6f8bad60
...
...
@@ -45,7 +45,7 @@ import {
defineEmits
,
}
from
"
vue
"
;
import
{
useWindowSize
,
onClickOutside
}
from
"
@vueuse/core
"
;
import
{
ListItemKey
,
ListItemProps
}
from
"
.
/ListItem.vue
"
;
import
{
ListItemKey
,
ListItemProps
}
from
"
@/components
/ListItem.vue
"
;
import
List
from
"
@/components/List.vue
"
;
export
type
PopperPosition
=
...
...
@@ -74,7 +74,7 @@ const props = withDefaults(
keyName
?:
string
;
checkedKey
?:
ListItemKey
;
checkedTab
?:
ListItemKey
;
replaceFields
?:
Record
<
string
,
string
>
;
// {title: 'name'}
replaceFields
?:
Record
<
string
,
string
>
;
defaultShow
?:
boolean
;
}
>
(),
{}
...
...
@@ -127,7 +127,7 @@ const emit = defineEmits<{
):
void
;
}
>
();
onClickOutside
(
menuRef
,
(
event
)
=>
{
onClickOutside
(
menuRef
,
(
_
event
)
=>
{
if
(
state
.
showed
)
{
_toggle
(
false
);
}
...
...
@@ -237,7 +237,7 @@ onMounted(() => {
}
const
triggerEvent
=
props
.
triggerEvent
??
"
click
"
;
const
handler
=
(
event
:
E
vent
)
=>
{
const
handler
=
(
_e
vent
)
=>
{
if
(
state
.
showed
)
{
_toggle
(
false
);
}
else
if
(
!
state
.
show
)
{
...
...
@@ -256,7 +256,7 @@ onMounted(() => {
const
activeKey
=
computed
(()
=>
props
.
checkedTab
);
const
tabRef
=
ref
(
null
);
const
onTabClick
=
(
event
,
tab
,
index
)
=>
{
const
onTabClick
=
(
_event
,
tab
)
=>
{
emit
(
"
tabChanged
"
,
tab
);
};
...
...
ui/src/views/script/FormNode.vue
浏览文件 @
6f8bad60
...
...
@@ -19,7 +19,6 @@ import { useI18n } from "vue-i18n";
import
{
computed
,
defineExpose
,
onMounted
,
withDefaults
,
ref
,
defineProps
,
...
...
ui/src/views/script/FormSyncFromZentao.vue
浏览文件 @
6f8bad60
...
...
@@ -88,17 +88,16 @@ import {
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
WorkspaceData
}
from
"
../
../
workspace/store
"
;
import
{
WorkspaceData
}
from
"
../workspace/store
"
;
import
{
isWindows
}
from
"
@/utils/comm
"
;
import
{
get
as
getWorkspace
}
from
"
@/views/workspace/service
"
;
import
Form
from
"
@/components/Form.vue
"
;
import
FormItem
from
"
@/components/FormItem.vue
"
;
import
notification
from
"
@/utils/notification
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
import
Switch
from
"
@/components/Switch.vue
"
;
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
queryCase
}
from
"
@/services/zentao
"
;
import
notification
from
"
@/utils/notification
"
;
import
Table
from
"
@/components/Table.vue
"
;
export
interface
FormWorkspaceProps
{
...
...
ui/src/views/script/TabPageScript.vue
浏览文件 @
6f8bad60
...
...
@@ -9,13 +9,12 @@
<
script
setup
lang=
"ts"
>
import
notification
from
"
@/utils/notification
"
;
import
{
defineProps
,
defineExpose
}
from
"
vue
"
;
import
{
defineProps
,
defineExpose
,
computed
,
ref
,
watch
,
onMounted
,
onBeforeUnmount
}
from
"
vue
"
;
import
{
PageTab
}
from
"
@/store/tabs
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
computed
,
ref
,
watch
,
onMounted
,
onBeforeUnmount
}
from
"
vue
"
;
import
{
MonacoOptions
,
ScriptFileNotExist
}
from
"
@/utils/const
"
;
import
{
resizeHeight
,
resizeWidth
}
from
"
@/utils/dom
"
;
import
{
resizeHeight
}
from
"
@/utils/dom
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
MonacoEditor
from
"
@/components/MonacoEditor.vue
"
;
import
bus
from
"
@/utils/eventBus
"
;
...
...
ui/src/views/script/WorkDir.vue
浏览文件 @
6f8bad60
...
...
@@ -51,26 +51,14 @@ import TreeContextMenu from './TreeContextMenu.vue';
import
FormSyncFromZentao
from
"
./FormSyncFromZentao.vue
"
;
import
bus
from
"
@/utils/eventBus
"
;
import
{
getExpandedKeys
,
getScriptDisplayBy
,
getScriptFilters
,
setExpandedKeys
,
}
from
"
@/utils/cache
"
;
import
{
getCaseIdsFromReport
,
getNodeMap
,
listFilterItems
,
}
from
"
@/views/script/service
"
;
import
{
getExpandedKeys
,
getScriptDisplayBy
,
getScriptFilters
,
setExpandedKeys
}
from
"
@/utils/cache
"
;
import
{
getCaseIdsFromReport
,
getNodeMap
,
listFilterItems
,
getFileNodesUnderParent
,
genWorkspaceToScriptsMap
}
from
"
@/views/script/service
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
isWindows
}
from
"
@/utils/comm
"
;
import
debounce
from
"
lodash.debounce
"
;
import
throttle
from
"
lodash.debounce
"
;
import
Modal
from
"
@/utils/modal
"
import
FormNode
from
"
./FormNode.vue
"
;
import
{
key
}
from
"
localforage
"
;
import
settings
from
"
@/config/settings
"
;
import
{
getFileNodesUnderParent
,
genWorkspaceToScriptsMap
}
from
"
@/views/script/service
"
;
const
{
t
}
=
useI18n
();
...
...
@@ -208,7 +196,7 @@ watch(currProduct, () => {
initData
()
},
{
deep
:
true
})
watch
(
treeData
,
(
currConfig
)
=>
{
watch
(
treeData
,
()
=>
{
console
.
log
(
'
watch treeData
'
,
treeData
.
value
)
onTreeDataChanged
()
},
{
deep
:
true
})
...
...
@@ -230,12 +218,6 @@ const onTreeDataChanged = async () => {
console
.
log
(
'
cachedKeys
'
,
currSite
.
value
.
id
,
currProduct
.
value
.
id
)
if
(
cachedKeys
)
expandedKeys
.
value
=
cachedKeys
if
(
!
cachedKeys
||
cachedKeys
.
length
===
0
)
{
// 修改
// getOpenKeys(treeData.value[0], false) // expend first level folder
// await setExpandedKeys(currSite.value.id, currProduct.value.id, expandedKeys.value)
}
})
}
...
...
@@ -292,7 +274,7 @@ const getOpenKeys = (treeNode: any, openAll: boolean) => { // expand top one lev
expandedKeys
.
value
.
push
(
treeNode
.
path
)
if
(
treeNode
.
children
&&
openAll
)
{
treeNode
.
children
.
forEach
((
item
,
index
)
=>
{
treeNode
.
children
.
forEach
((
item
)
=>
{
getOpenKeys
(
item
,
openAll
)
})
}
...
...
@@ -351,14 +333,12 @@ const checkNode = (keys) => {
console
.
log
(
'
checkNode
'
,
keys
.
checked
)
store
.
dispatch
(
'
Script/setCheckedNodes
'
,
keys
.
checked
)
let
checkedKeysTmp
:
string
[]
=
[];
for
(
let
k
ey
in
keys
.
checked
){
if
(
keys
.
checked
[
k
ey
]
===
true
){
checkedKeysTmp
.
push
(
k
ey
)
for
(
let
checkedK
ey
in
keys
.
checked
){
if
(
keys
.
checked
[
checkedK
ey
]
===
true
){
checkedKeysTmp
.
push
(
checkedK
ey
)
}
}
checkedKeys
.
value
=
checkedKeysTmp
;
// scriptStore.dispatch('Script/changeWorkspace',
// {id: e.node.dataRef.workspaceId, type: e.node.dataRef.workspaceType})
}
const
checkNothing
=
()
=>
{
...
...
@@ -367,9 +347,9 @@ const checkNothing = () => {
const
execSelected
=
()
=>
{
let
arr
=
[]
as
string
[]
checkedKeys
.
value
.
forEach
(
item
=>
{
if
(
treeDataMap
.
value
[
item
]?.
type
===
'
file
'
)
{
arr
.
push
(
treeDataMap
.
value
[
item
])
checkedKeys
.
value
.
forEach
(
checkedKey
=>
{
if
(
treeDataMap
.
value
[
checkedKey
]?.
type
===
'
file
'
)
{
arr
.
push
(
treeDataMap
.
value
[
checkedKey
])
}
})
bus
.
emit
(
settings
.
eventExec
,
{
execType
:
'
ztf
'
,
scripts
:
arr
});
...
...
@@ -378,7 +358,7 @@ const execSelected = () => {
const
nameFormVisible
=
ref
(
false
)
const
treeDataMap
=
computed
<
any
>
(()
=>
store
.
state
.
Script
.
treeDataMap
);
const
getNodeMapCall
=
throttl
e
(
async
()
=>
{
const
getNodeMapCall
=
debounc
e
(
async
()
=>
{
treeData
.
value
.
forEach
(
item
=>
{
getNodeMap
(
item
,
treeDataMap
.
value
)
})
...
...
@@ -658,21 +638,21 @@ onUnmounted(() => {
<
style
lang=
"less"
scoped
>
.left-pannel-contain{
text-align: center;
.workdir {
height: calc(100vh - 80px);
overflow: auto;
text-align: left;
}
.workdir-with-btn {
height: calc(100vh - 120px);
overflow: auto;
text-align: left;
}
.run-selected{
max-width: 100px;
margin: auto;
text-align: center;
margin-top: 10px;
}
.workdir {
height: calc(100vh - 80px);
overflow: auto;
text-align: left;
}
.workdir-with-btn {
height: calc(100vh - 120px);
overflow: auto;
text-align: left;
}
.run-selected{
max-width: 100px;
margin: auto;
text-align: center;
margin-top: 10px;
}
}
</
style
>
ui/src/views/script/WorkDirPanel.vue
浏览文件 @
6f8bad60
...
...
@@ -67,7 +67,7 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
computed
,
defineComponent
,
onMounted
,
onUnmounted
,
ref
,
watch
}
from
"
vue
"
;
import
{
computed
,
ref
,
watch
}
from
"
vue
"
;
import
Panel
from
'
@/components/Panel.vue
'
;
import
Button
from
'
@/components/Button.vue
'
;
...
...
@@ -80,12 +80,7 @@ import {ZentaoData} from "@/store/zentao";
import
debounce
from
"
lodash.debounce
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
ScriptData
}
from
"
@/views/script/store
"
;
import
{
genWorkspaceToScriptsMap
,
listFilterItems
,
getCaseIdsFromReport
,
getSyncFromInfoFromMenu
,
getNodeMap
,
getFileNodesUnderParent
,
updateNameReq
}
from
"
@/views/script/service
"
;
import
{
listFilterItems
}
from
"
@/views/script/service
"
;
import
FormWorkspace
from
"
@/views/workspace/FormWorkspace.vue
"
;
import
notification
from
"
@/utils/notification
"
;
import
FilterModal
from
"
./FilterModal.vue
"
;
...
...
ui/src/views/settings/SettingsModal.vue
浏览文件 @
6f8bad60
...
...
@@ -57,27 +57,16 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
defineProps
,
defineEmits
}
from
"
vue
"
;
import
{
defineProps
,
defineEmits
,
computed
,
onMounted
,
ref
,
watch
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
computed
,
onMounted
,
ref
,
watch
,
}
from
"
vue
"
;
import
{
momentUtcDef
}
from
"
@/utils/datetime
"
;
import
Table
from
"
@/components/Table.vue
"
;
import
notification
from
"
@/utils/notification
"
;
import
Modal
from
"
@/utils/modal
"
;
import
Button
from
"
@/components/Button.vue
"
;
import
LanguageSettings
from
"
./LanguageSettings.vue
"
;
import
{
saveInterpreter
}
from
"
@/views/interpreter/service
"
;
import
{
listInterpreter
,
removeInterpreter
,
}
from
"
@/views/interpreter/service
"
;
import
{
saveInterpreter
,
listInterpreter
,
removeInterpreter
,
getLangSettings
}
from
"
@/views/interpreter/service
"
;
import
FormInterpreter
from
"
@/views/interpreter/FormInterpreter.vue
"
;
import
{
getLangSettings
}
from
"
@/views/interpreter/service
"
;
const
props
=
defineProps
<
{
show
:
boolean
;
...
...
@@ -196,7 +185,6 @@ const createInterpreter = (formData) => {
saveInterpreter
(
formData
).
then
((
json
)
=>
{
if
(
json
.
code
===
0
)
{
formInterpreter
.
value
.
clearFormData
();
// notification.success({ message: t("save_success") });
showCreateInterpreterModal
.
value
=
false
;
list
();
}
...
...
ui/src/views/site/FormSite.vue
浏览文件 @
6f8bad60
...
...
@@ -34,16 +34,7 @@
<
script
setup
lang=
"ts"
>
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
computed
,
defineExpose
,
onMounted
,
withDefaults
,
ref
,
defineProps
,
defineEmits
,
watch
,
}
from
"
vue
"
;
import
{
computed
,
defineExpose
,
withDefaults
,
ref
,
defineProps
,
defineEmits
,
watch
}
from
"
vue
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
import
Form
from
"
@/components/Form.vue
"
;
import
FormItem
from
"
@/components/FormItem.vue
"
;
...
...
ui/src/views/site/SiteNav.vue
浏览文件 @
6f8bad60
...
...
@@ -43,7 +43,7 @@
@
click=
"selectProduct"
:replaceFields=
"replaceFields"
/>
<SitesModal
<SitesModal
:show=
"showSitesModal"
@
cancel=
"sitesModalClose"
:showOkBtn=
"false"
...
...
@@ -111,7 +111,7 @@ const showZentaoMsg = (payload): void => {
}
}
const
openSiteManagementTab
=
(
showCreateSiteModal
?:
boolean
)
=>
{
const
openSiteManagementTab
=
()
=>
{
console
.
log
(
'
openSiteManagementModal
'
);
showSitesModal
.
value
=
true
;
};
...
...
ui/src/views/site/sitesModal.vue
浏览文件 @
6f8bad60
...
...
@@ -70,10 +70,8 @@
<
/template
>
<
script
setup
lang
=
"
ts
"
>
import
{
defineProps
,
defineEmits
}
from
"
vue
"
;
import
{
PageTab
}
from
"
@/store/tabs
"
;
import
{
defineProps
,
defineEmits
,
ref
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
ref
,
computed
}
from
"
vue
"
;
import
{
useStore
}
from
"
vuex
"
;
import
{
StateType
}
from
"
@/views/site/store
"
;
import
{
momentUtcDef
}
from
"
@/utils/datetime
"
;
...
...
@@ -81,7 +79,6 @@ import { momentUtcDef } from "@/utils/datetime";
import
List
from
"
@/components/List.vue
"
;
import
ListItem
from
"
@/components/ListItem.vue
"
;
import
Icon
from
"
@/components/Icon.vue
"
;
import
notification
from
"
@/utils/notification
"
;
import
Modal
from
"
@/utils/modal
"
;
import
Button
from
"
@/components/Button.vue
"
;
import
FormSite
from
"
@/views/site/FormSite.vue
"
;
...
...
@@ -124,9 +121,8 @@ const remove = (item) => {
okText
:
t
(
"
confirm
"
),
cancelText
:
t
(
"
cancel
"
),
onOk
:
async
()
=>
{
store
.
dispatch
(
"
Site/delete
"
,
item
.
id
).
then
((
success
)
=>
{
store
.
dispatch
(
"
Zentao/fetchSitesAndProduct
"
).
then
((
success
)
=>
{
// notification.success(t("delete_success"));
store
.
dispatch
(
"
Site/delete
"
,
item
.
id
).
then
((
_success
)
=>
{
store
.
dispatch
(
"
Zentao/fetchSitesAndProduct
"
).
then
((
_success2
)
=>
{
fetchSites
();
}
);
}
);
...
...
@@ -145,12 +141,11 @@ const createSite = (formData) => {
if
(
formDataNew
.
url
.
indexOf
(
"
http
"
)
!==
0
)
{
formDataNew
.
url
=
"
http://
"
+
formDataNew
.
url
;
}
store
.
dispatch
(
'
Site/save
'
,
formDataNew
).
then
((
response
)
=>
{
if
(
response
)
{
store
.
dispatch
(
'
Site/save
'
,
formDataNew
).
then
((
success
)
=>
{
if
(
success
)
{
formSite
.
value
.
clearFormData
()
showCreateSiteModal
.
value
=
false
;
store
.
dispatch
(
'
Zentao/fetchSitesAndProduct
'
).
then
((
success
)
=>
{
// notification.success(
{
message
:
t
(
'
save_success
'
)
}
);
store
.
dispatch
(
'
Zentao/fetchSitesAndProduct
'
).
then
((
_success2
)
=>
{
fetchSites
();
}
);
}
...
...
ui/src/views/workspace/FormWorkspace.vue
浏览文件 @
6f8bad60
...
...
@@ -57,16 +57,7 @@ import { useStore } from "vuex";
import
{
ZentaoData
}
from
"
@/store/zentao
"
;
import
{
unitTestTypesDef
,
ztfTestTypesDef
}
from
"
@/utils/const
"
;
import
{
computed
,
defineExpose
,
onMounted
,
withDefaults
,
ref
,
defineProps
,
defineEmits
,
watch
,
}
from
"
vue
"
;
import
{
computed
,
defineExpose
,
withDefaults
,
ref
,
defineProps
,
defineEmits
,
watch
,}
from
"
vue
"
;
import
{
useForm
}
from
"
@/utils/form
"
;
import
Form
from
"
@/components/Form.vue
"
;
import
FormItem
from
"
@/components/FormItem.vue
"
;
...
...
@@ -127,7 +118,7 @@ const rulesRef = ref({
cmd
:
[
{
trigger
:
'
blur
'
,
validator
:
async
(
rule
:
any
,
value
:
string
)
=>
{
validator
:
async
(
_
rule
:
any
,
value
:
string
)
=>
{
if
(
modelRef
.
value
.
type
!==
'
ztf
'
&&
(
value
===
''
||
!
value
))
{
throw
new
Error
(
t
(
'
pls_cmd
'
));
}
...
...
@@ -159,9 +150,8 @@ const selectDir = () => {
const
{
ipcRenderer
}
=
window
.
require
(
'
electron
'
)
ipcRenderer
.
send
(
settings
.
electronMsg
,
'
selectDir
'
)
ipcRenderer
.
on
(
settings
.
electronMsgReplay
,
(
event
,
arg
)
=>
{
console
.
log
(
arg
)
modelRef
.
value
.
path
=
arg
ipcRenderer
.
on
(
settings
.
electronMsgReplay
,
(
_event
,
arg
)
=>
{
modelRef
.
value
.
path
=
arg
})
}
...
...
ui/vue.config.js
浏览文件 @
6f8bad60
...
...
@@ -12,20 +12,7 @@ module.exports = {
host
:
'
0.0.0.0
'
,
//set minpc accessible
port
:
VUE_APP_PORT
||
8000
,
disableHostCheck
:
true
,
// 配置反向代理
/*
proxy: {
'/api': {
target: '<url>',
ws: true,
changeOrigin: true
},
'/foo': {
target: '<other_url>'
}
},
*/
before
:
function
(
app
,
server
)
{
before
:
function
(
_app
,
_server
)
{
}
},
css
:
{
...
...
xdoc/notes.txt
浏览文件 @
6f8bad60
...
...
@@ -62,8 +62,5 @@ sips -z 32 32 ztf.png --out tmp.iconset/icon_32x32.png
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -ldflags "-X 'commConsts.appVersion=3.0.0' -X 'commConsts.buildTime=Mon Jul 25 09:31:39 2022 +0800' -X 'commConsts.goVersion=go version go1.17.1 darwin/amd64
' -X 'commConsts.gitHash=d118c05ae38d76231abfb6430e52ec517e080f50'" -x -v -ldflags "-s -w" -o client/bin/win32/ztf.exe cmd/command/main.go cmd/command/main.syso
sonar-scanner \
-Dsonar.projectKey=ztf \
-Dsonar.sources=. \
-Dsonar.host.url=http://localhost:59001 \
-Dsonar.login=sqp_94f2484e50b1cfea719eb791f4e5d544be887f87
cd ui && yarn lint && cd ..
sonar-scanner
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录