Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
b9559e2d
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 搜索 >>
提交
b9559e2d
编写于
3月 02, 2023
作者:
Z
zhaoke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add edit© link
上级
3ac12aa1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
68 addition
and
9 deletion
+68
-9
ui/package.json
ui/package.json
+1
-0
ui/src/api/manage.js
ui/src/api/manage.js
+2
-4
ui/src/locales/lang/en-US.js
ui/src/locales/lang/en-US.js
+5
-0
ui/src/locales/lang/zh-CN.js
ui/src/locales/lang/zh-CN.js
+5
-0
ui/src/main.js
ui/src/main.js
+4
-0
ui/src/views/data/mine/Preview.vue
ui/src/views/data/mine/Preview.vue
+51
-5
未找到文件。
ui/package.json
浏览文件 @
b9559e2d
...
...
@@ -19,6 +19,7 @@
"moment"
:
"^2.29.1"
,
"store"
:
"^2.0.12"
,
"vue"
:
"^2.6.11"
,
"vue-clipboard2"
:
"^0.3.3"
,
"vue-codemirror"
:
"4.0.6"
,
"vue-i18n"
:
"^8.22.1"
,
"vue-router"
:
"^3.4.8"
,
...
...
ui/src/api/manage.js
浏览文件 @
b9559e2d
...
...
@@ -116,11 +116,9 @@ export function moveDefField (src, dist, mode) {
})
}
export
function
previewDefData
(
defId
)
{
const
params
=
{
defId
:
defId
}
export
function
previewDefData
(
params
)
{
return
request
({
url
:
`/d
efs/previewData
`
,
url
:
`/d
ata/generate
`
,
method
:
'
get
'
,
params
})
...
...
ui/src/locales/lang/en-US.js
浏览文件 @
b9559e2d
...
...
@@ -173,6 +173,11 @@ const locale = {
'
update.reboot
'
:
'
Reboot Now
'
,
'
update.pending
'
:
'
Reboot Later
'
,
'
update.failed
'
:
'
Upgrade error. Please contact the administrator.
'
,
'
copy.success
'
:
'
Copy Success
'
,
'
copy.title
'
:
'
Copy Link
'
,
'
preview.title
'
:
'
Refresh Data
'
,
}
export
default
{
...
...
ui/src/locales/lang/zh-CN.js
浏览文件 @
b9559e2d
...
...
@@ -173,6 +173,11 @@ const locale = {
'
update.reboot
'
:
'
立即重启
'
,
'
update.pending
'
:
'
稍后重启
'
,
'
update.failed
'
:
'
升级错误,请联系管理员。
'
,
'
copy.success
'
:
'
复制成功
'
,
'
copy.title
'
:
'
复制链接
'
,
'
preview.title
'
:
'
刷新数据
'
,
}
export
default
{
...
...
ui/src/main.js
浏览文件 @
b9559e2d
...
...
@@ -80,6 +80,9 @@ import notification from "ant-design-vue/lib/notification";
import
'
ant-design-vue/lib/notification/style
'
;
import
message
from
"
ant-design-vue/lib/message
"
;
import
'
ant-design-vue/lib/message/style
'
;
import
VueClipboard
from
'
vue-clipboard2
'
Vue
.
prototype
.
$message
=
message
;
Vue
.
prototype
.
$notification
=
notification
;
...
...
@@ -117,6 +120,7 @@ Vue.use(Card)
Vue
.
use
(
Upload
)
Vue
.
use
(
Drawer
)
Vue
.
use
(
Progress
)
Vue
.
use
(
VueClipboard
)
new
Vue
({
router
,
...
...
ui/src/views/data/mine/Preview.vue
浏览文件 @
b9559e2d
<
template
>
<a-card>
<
span
slot=
"title"
>
<
div
slot=
"title"
>
<a-icon
type=
"profile"
/>
<span>
{{
$t
(
'
msg.preview
'
)
}}
</span>
</span>
<a-input
v-model=
"previewUrl"
id=
"url"
/>
<a
@
click=
"doCopy"
:title=
"$t('action.design')"
>
{{
$t
(
'
copy.title
'
)
}}
</a>
<a
@
click=
"loadPreviewData"
:title=
"$t('action.design')"
>
{{
$t
(
'
preview.title
'
)
}}
</a>
</div>
<pre
v-if=
"previewData !== null"
v-html=
"previewData"
style=
"margin: 0"
></pre>
<div
v-else
style=
"padding: 10px; text-align: center"
><a-icon
type=
"loading"
/></div>
</a-card>
...
...
@@ -11,6 +18,7 @@
<
script
>
import
{
previewDefData
}
from
"
../../../api/manage
"
;
import
{
serverUrl
}
from
'
../../../utils/request
'
export
default
{
name
:
'
Preview
'
,
...
...
@@ -23,7 +31,10 @@ export default {
},
},
data
:
function
()
{
return
{
previewData
:
null
};
return
{
previewData
:
null
,
previewUrl
:
serverUrl
+
"
/data/generate?format=txt&config=
"
+
this
.
record
.
referName
.
replace
(
/
\\
/g
,
"
/
"
),
};
},
mounted
:
function
()
{
this
.
loadPreviewData
();
...
...
@@ -32,15 +43,50 @@ export default {
loadPreviewData
()
{
console
.
log
(
this
.
record
)
this
.
previewData
=
null
;
previewDefData
(
this
.
record
.
id
).
then
(
json
=>
{
this
.
previewData
=
json
.
data
let
params
=
this
.
getQuery
()
previewDefData
(
params
).
then
(
data
=>
{
this
.
previewData
=
data
})
},
getQuery
()
{
let
url
=
decodeURI
(
this
.
previewUrl
);
// 获取url中"?"符后的字串(包括问号)
url
=
url
.
replace
(
`
${
serverUrl
}
/data/generate`
,
""
)
let
query
=
{};
if
(
url
.
indexOf
(
"
?
"
)
!=
-
1
)
{
const
str
=
url
.
substr
(
1
);
const
pairs
=
str
.
split
(
"
&
"
);
for
(
let
i
=
0
;
i
<
pairs
.
length
;
i
++
)
{
const
pair
=
pairs
[
i
].
split
(
"
=
"
);
query
[
pair
[
0
]]
=
pair
[
1
];
}
}
return
query
;
// 返回对象
},
doCopy
:
function
()
{
let
that
=
this
;
this
.
$copyText
(
this
.
previewUrl
).
then
(
function
()
{
that
.
$notification
[
'
success
'
]({
message
:
that
.
$t
(
'
copy.success
'
),
});
},
function
(
e
)
{
console
.
log
(
e
)
})
}
},
watch
:
{
record
:
function
()
{
this
.
previewUrl
=
serverUrl
+
"
/data/generate?format=txt&config=
"
+
this
.
record
.
referName
.
replace
(
/
\\
/g
,
"
/
"
);
this
.
loadPreviewData
();
}
}
}
</
script
>
<
style
>
#url
{
max-width
:
30vw
;
margin-left
:
20px
;
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录