Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
18786f92
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 搜索 >>
提交
18786f92
编写于
5月 16, 2022
作者:
Z
zhaoke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* add script tree list
上级
527ba533
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
646 addition
and
125 deletion
+646
-125
ui/.env.development
ui/.env.development
+1
-1
ui/src/layouts/MainLayout/components/ButtonList.vue
ui/src/layouts/MainLayout/components/ButtonList.vue
+6
-1
ui/src/layouts/MainLayout/components/TabPageScript.vue
ui/src/layouts/MainLayout/components/TabPageScript.vue
+3
-3
ui/src/layouts/MainLayout/components/Toolbar.vue
ui/src/layouts/MainLayout/components/Toolbar.vue
+1
-0
ui/src/layouts/MainLayout/components/WorkDir.vue
ui/src/layouts/MainLayout/components/WorkDir.vue
+601
-118
ui/src/locales/en-US.ts
ui/src/locales/en-US.ts
+2
-0
ui/src/locales/zh-CN.ts
ui/src/locales/zh-CN.ts
+2
-0
ui/src/views/script/service.ts
ui/src/views/script/service.ts
+26
-0
ui/src/views/script/store.ts
ui/src/views/script/store.ts
+4
-2
未找到文件。
ui/.env.development
浏览文件 @
18786f92
...
...
@@ -9,5 +9,5 @@ VUE_APP_MOCK = true
#api接口域名
VUE_APP_APIHOST_MOCK = /api
VUE_APP_APIHOST = http://
127.0.0.1
:8085/api/v1
VUE_APP_APIHOST = http://
app.me
:8085/api/v1
# VUE_APP_APIHOST = http://192.168.0.112:8085/api/v1
\ No newline at end of file
ui/src/layouts/MainLayout/components/ButtonList.vue
浏览文件 @
18786f92
...
...
@@ -15,7 +15,7 @@
<
script
setup
lang=
"ts"
>
import
{
useI18n
}
from
"
vue-i18n
"
;
const
{
t
}
=
useI18n
();
const
{
t
,
te
}
=
useI18n
();
import
{
defineProps
,
computed
,
defineEmits
}
from
'
vue
'
;
import
Button
,
{
ButtonProps
}
from
'
./Button.vue
'
;
...
...
@@ -40,6 +40,7 @@ const buttonPropsList = computed(() => {
}
return
props
.
buttons
.
map
((
x
,
i
)
=>
{
let
item
:
(
ButtonProps
|
Record
<
string
,
any
>
)
&
{
key
:
string
|
number
|
symbol
};
if
(
props
.
replaceFields
&&
Button
.
props
)
{
item
=
Object
.
keys
(
Button
.
props
).
reduce
((
item
,
propName
)
=>
{
const
replacePropName
=
props
.
replaceFields
?
props
.
replaceFields
[
propName
]
:
null
;
...
...
@@ -58,6 +59,10 @@ const buttonPropsList = computed(() => {
...
x
};
}
if
(
te
(
item
.
hint
)){
item
.
hint
=
t
(
item
.
hint
)
}
return
item
;
});
});
...
...
ui/src/layouts/MainLayout/components/TabPageScript.vue
浏览文件 @
18786f92
<
template
>
<div
class=
"ztf-script-main"
>
<div
id=
"editor-panel"
class=
"tab-page-script"
>
<div
id=
"editor-panel"
class=
"tab-page-script
editor-panel
"
>
<MonacoEditor
v-if=
"scriptCode !== '' && scriptCode !== ScriptFileNotExist"
v-model:value=
"scriptCode"
:language=
"lang"
:options=
"editorOptions"
class=
"editor"
ref=
"editorRef"
@
change=
"editorChange"
/>
</div>
...
...
@@ -23,7 +23,6 @@ const props = defineProps<{
tab
:
PageTab
}
>
();
let
tabMap
=
ref
({})
const
scriptStore
=
useStore
<
{
Script
:
ScriptData
}
>
();
let
script
=
computed
<
any
>
(()
=>
scriptStore
.
state
.
Script
.
detail
);
let
scriptCode
=
ref
(
''
)
...
...
@@ -45,7 +44,8 @@ watch(script, () => {
scriptCode
.
value
=
script
.
value
.
code
?
script
.
value
.
code
:
t
(
'
empty
'
)
lang
.
value
=
script
.
value
.
lang
setTimeout
(()
=>
{
resizeHeight
(
'
editor-panel
'
,
100
)
resizeHeight
(
'
ztf-script-main
'
,
'
editor-panel
'
,
'
splitter-v
'
,
'
logs-panel
'
,
100
,
100
,
90
)
},
600
)
}
else
{
scriptCode
.
value
=
''
...
...
ui/src/layouts/MainLayout/components/Toolbar.vue
浏览文件 @
18786f92
...
...
@@ -29,6 +29,7 @@ withDefaults(defineProps<{
defaultIconSize
:
'
1.4em
'
,
gap
:
0
});
</
script
>
<
style
scoped
>
...
...
ui/src/layouts/MainLayout/components/WorkDir.vue
浏览文件 @
18786f92
此差异已折叠。
点击以展开。
ui/src/locales/en-US.ts
浏览文件 @
18786f92
...
...
@@ -74,6 +74,8 @@ export default {
'
dir
'
:
'
Dir
'
,
'
create_workspace
'
:
'
Create WorkDir
'
,
'
edit_workspace
'
:
'
Edit WorkDir
'
,
'
create_file
'
:
'
Create file
'
,
'
del_file
'
:
'
Delete File
'
,
'
duration
'
:
'
Duration
'
,
'
duration_sec
'
:
'
Duration(sec)
'
,
...
...
ui/src/locales/zh-CN.ts
浏览文件 @
18786f92
...
...
@@ -84,6 +84,8 @@ export default {
'
dir
'
:
'
目录
'
,
'
create_workspace
'
:
'
新建工作目录
'
,
'
edit_workspace
'
:
'
编辑工作目录
'
,
'
create_file
'
:
'
新建脚本
'
,
'
del_file
'
:
'
删除脚本
'
,
'
duration
'
:
'
耗时
'
,
'
duration_sec
'
:
'
耗时(秒)
'
,
...
...
ui/src/views/script/service.ts
浏览文件 @
18786f92
...
...
@@ -207,4 +207,30 @@ export const getFileNodesUnderParent = (node): string[] => {
export
function
getSyncToInfoFromMenu
(
key
:
string
,
node
:
any
):
any
{
return
}
export
function
scriptTreeAddAttr
(
treeData
)
{
if
(
treeData
==
undefined
){
return
treeData
;
}
treeData
=
treeData
.
map
((
item
,
index
)
=>
{
item
.
id
=
item
.
path
;
if
(
item
.
isLeaf
)
{
item
.
toolbarItems
=
[
// { hint: 'Add sub folder', icon: 'folder-add' },
{
hint
:
'
create_file
'
,
icon
:
'
file-add
'
},
];
}
else
{
item
.
toolbarItems
=
[
{
hint
:
'
create_workspace
'
,
icon
:
'
folder-add
'
},
// {hint: 'Add file', icon: 'file-add'},
];
}
if
(
item
.
children
!=
undefined
&&
item
.
children
.
length
>
0
)
{
item
.
children
=
scriptTreeAddAttr
(
item
.
children
)
}
return
item
;
})
return
treeData
}
\ No newline at end of file
ui/src/views/script/store.ts
浏览文件 @
18786f92
...
...
@@ -3,7 +3,7 @@ import { StoreModuleType } from "@/utils/store";
import
{
ResponseData
}
from
'
@/utils/request
'
;
import
{
list
,
get
,
extract
,
create
,
update
,
remove
,
loadChildren
,
updateCode
,
syncFromZentao
,
syncToZentao
,
move
list
,
get
,
extract
,
create
,
update
,
remove
,
loadChildren
,
updateCode
,
syncFromZentao
,
syncToZentao
,
move
,
scriptTreeAddAttr
}
from
'
./service
'
;
import
{
ScriptFileNotExist
}
from
"
@/utils/const
"
;
...
...
@@ -70,7 +70,9 @@ const StoreModel: ModuleType = {
actions
:
{
async
listScript
({
commit
},
playload
:
any
)
{
const
response
:
ResponseData
=
await
list
(
playload
);
const
{
data
}
=
response
;
const
data
=
response
.
data
;
data
.
id
=
data
.
path
;
data
.
children
=
scriptTreeAddAttr
(
data
.
children
);
commit
(
'
setList
'
,
[
data
]);
commit
(
'
setQueryParams
'
,
playload
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录