Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
ea794496
Z
zendata
项目概览
易企天创
/
zendata
10 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ea794496
编写于
12月 04, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add work dir in header, show file name in list
上级
1dfe730a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
89 addition
and
19 deletion
+89
-19
src/zd.go
src/zd.go
+4
-0
ui/src/api/manage.js
ui/src/api/manage.js
+8
-0
ui/src/api/utils.js
ui/src/api/utils.js
+7
-0
ui/src/layout/Header.vue
ui/src/layout/Header.vue
+19
-1
ui/src/utils/vari.js
ui/src/utils/vari.js
+3
-0
ui/src/views/data/buildin/config/List.vue
ui/src/views/data/buildin/config/List.vue
+8
-3
ui/src/views/data/buildin/excel/List.vue
ui/src/views/data/buildin/excel/List.vue
+8
-3
ui/src/views/data/buildin/instances/List.vue
ui/src/views/data/buildin/instances/List.vue
+8
-3
ui/src/views/data/buildin/ranges/List.vue
ui/src/views/data/buildin/ranges/List.vue
+8
-3
ui/src/views/data/buildin/text/List.vue
ui/src/views/data/buildin/text/List.vue
+8
-3
ui/src/views/data/mine/List.vue
ui/src/views/data/mine/List.vue
+8
-3
未找到文件。
src/zd.go
浏览文件 @
ea794496
...
...
@@ -370,6 +370,10 @@ func (s *Server) admin(writer http.ResponseWriter, req *http.Request) {
ret
:=
model
.
ResData
{
Code
:
1
,
Msg
:
"success"
}
switch
reqData
.
Action
{
// common
case
"getWorkDir"
:
ret
.
WorkDir
=
vari
.
WorkDir
// def
case
"syncData"
:
s
.
syncService
.
SyncData
(
reqData
.
Mode
)
...
...
ui/src/api/manage.js
浏览文件 @
ea794496
...
...
@@ -6,6 +6,14 @@ const api = {
export
default
api
export
function
getWorkDir
()
{
return
request
({
url
:
api
.
admin
,
method
:
'
post
'
,
data
:
{
'
action
'
:
'
getWorkDir
'
}
})
}
export
function
listDef
(
keywords
,
page
)
{
return
request
({
url
:
api
.
admin
,
...
...
ui/src/api/utils.js
浏览文件 @
ea794496
import
{
config
}
from
'
../utils/vari
'
const
PageSize
=
15
const
ResTypeDef
=
"
def
"
const
ResTypeRanges
=
"
ranges
"
...
...
@@ -44,6 +46,11 @@ export function checkDirIsUsers (rule, value, callback){
callback
()
}
export
function
pathToRelated
(
path
){
const
name
=
path
.
substr
(
config
.
workDir
.
length
)
return
name
}
export
function
sectionStrToArr
(
str
){
str
=
str
.
substring
(
1
,
str
.
length
-
1
)
let
arr
=
str
.
split
(
'
,
'
)
...
...
ui/src/layout/Header.vue
浏览文件 @
ea794496
...
...
@@ -5,23 +5,36 @@
</h2>
<div
class=
"center"
></div>
<div
class=
"right"
>
<span
class=
"dir"
>
工作目录:
{{
workDir
}}
</span>
<a
href=
"https://www.zendata.cn/book/zendata/"
target=
"_blank"
>
帮助
</a>
</div>
</div>
</
template
>
<
script
>
import
{
getWorkDir
}
from
"
../api/manage
"
;
import
{
config
}
from
"
../utils/vari
"
;
export
default
{
name
:
'
Header
'
,
components
:
{
},
data
()
{
return
{
workDir
:
''
,
}
},
computed
:
{
},
created
()
{
getWorkDir
().
then
(
json
=>
{
console
.
log
(
'
getWorkDir
'
,
json
)
const
that
=
this
that
.
defs
=
json
.
data
this
.
workDir
=
json
.
workDir
config
.
workDir
=
this
.
workDir
})
},
mounted
()
{
},
...
...
@@ -50,8 +63,13 @@ export default {
}
.right {
margin: 0 15px;
width:
1
00px;
width:
5
00px;
text-align: right;
.dir {
display: inline-block;
padding-right: 20px;
}
}
}
</
style
>
ui/src/utils/vari.js
0 → 100644
浏览文件 @
ea794496
let
config
=
{}
export
{
config
}
ui/src/views/data/buildin/config/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -57,7 +57,7 @@
<
script
>
import
{
listConfig
,
removeConfig
}
from
"
../../../../api/manage
"
;
import
{
PageSize
}
from
"
../../../../api/utils
"
;
import
{
PageSize
,
pathToRelated
}
from
"
../../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -66,7 +66,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -104,6 +104,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
create
()
{
this
.
$router
.
push
({
path
:
'
/data/buildin/config/edit/0
'
});
...
...
ui/src/views/data/buildin/excel/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -60,7 +60,7 @@
<
script
>
import
{
listExcel
,
removeExcel
}
from
"
../../../../api/manage
"
;
import
{
PageSize
}
from
"
../../../../api/utils
"
;
import
{
PageSize
,
pathToRelated
}
from
"
../../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -69,7 +69,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -107,6 +107,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
create
()
{
this
.
$router
.
push
({
path
:
'
/data/buildin/excel/edit/0
'
});
...
...
ui/src/views/data/buildin/instances/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -73,7 +73,7 @@
import
{
listInstances
,
removeInstances
}
from
"
../../../../api/manage
"
;
import
{
DesignComponent
}
from
'
../../../../components
'
import
{
PageSize
,
ResTypeInstances
}
from
"
../../../../api/utils
"
;
import
{
PageSize
,
ResTypeInstances
,
pathToRelated
}
from
"
../../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -82,7 +82,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -122,6 +122,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
create
()
{
this
.
$router
.
push
({
path
:
'
/data/buildin/instances/edit/0
'
});
...
...
ui/src/views/data/buildin/ranges/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -73,7 +73,7 @@
import
{
listRanges
,
removeRanges
}
from
"
../../../../api/manage
"
;
import
{
DesignComponent
}
from
'
../../../../components
'
import
{
PageSize
}
from
"
../../../../api/utils
"
;
import
{
PageSize
,
pathToRelated
}
from
"
../../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -82,7 +82,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -121,6 +121,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
create
()
{
this
.
$router
.
push
({
path
:
'
/data/buildin/ranges/edit/0
'
});
...
...
ui/src/views/data/buildin/text/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -58,7 +58,7 @@
<
script
>
import
{
listText
,
removeText
}
from
"
../../../../api/manage
"
;
import
{
PageSize
}
from
"
../../../../api/utils
"
;
import
{
PageSize
,
pathToRelated
}
from
"
../../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -67,7 +67,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -105,6 +105,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
create
()
{
this
.
$router
.
push
({
path
:
'
/data/buildin/text/edit/0
'
});
...
...
ui/src/views/data/mine/List.vue
浏览文件 @
ea794496
...
...
@@ -16,7 +16,7 @@
<template
slot=
"title"
>
<span>
{{
record
.
path
}}
</span>
</
template
>
<a>
{{record.
folder
}}
</a>
<a>
{{record.
path | pathToRelated
}}
</a>
</a-tooltip>
</span>
...
...
@@ -67,7 +67,7 @@
import
{
listDef
,
removeDef
,
previewDefData
}
from
"
../../../api/manage
"
;
import
{
DesignComponent
}
from
'
../../../components
'
import
{
PageSize
,
ResTypeDef
}
from
"
../../../api/utils
"
;
import
{
PageSize
,
ResTypeDef
,
pathToRelated
}
from
"
../../../api/utils
"
;
import
debounce
from
"
lodash.debounce
"
const
columns
=
[
...
...
@@ -76,7 +76,7 @@ const columns = [
dataIndex
:
'
title
'
,
},
{
title
:
'
目录
'
,
title
:
'
文件
'
,
dataIndex
:
'
folder
'
,
scopedSlots
:
{
customRender
:
'
folderWithPath
'
},
},
...
...
@@ -117,6 +117,11 @@ export default {
},
mounted
()
{
},
filters
:
{
pathToRelated
:
function
(
path
)
{
return
pathToRelated
(
path
)
}
},
methods
:
{
loadData
()
{
listDef
(
this
.
keywords
,
this
.
page
).
then
(
json
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录