Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
ff436ddb
提交
ff436ddb
authored
4月 03, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 替换excel后,切换tab 刷新字段
上级
6ca6e25a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
66 行增加
和
38 行删除
+66
-38
JdbcProvider.java
...in/java/io/dataease/provider/datasource/JdbcProvider.java
+2
-2
ViewTable.vue
frontend/src/views/dataset/data/ViewTable.vue
+64
-36
没有找到文件。
backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java
浏览文件 @
ff436ddb
...
@@ -284,8 +284,8 @@ public class JdbcProvider extends DatasourceProvider {
...
@@ -284,8 +284,8 @@ public class JdbcProvider extends DatasourceProvider {
String
f
=
metaData
.
getColumnName
(
j
+
1
);
String
f
=
metaData
.
getColumnName
(
j
+
1
);
String
l
=
StringUtils
.
isNotEmpty
(
metaData
.
getColumnLabel
(
j
+
1
))
?
metaData
.
getColumnLabel
(
j
+
1
)
:
f
;
String
l
=
StringUtils
.
isNotEmpty
(
metaData
.
getColumnLabel
(
j
+
1
))
?
metaData
.
getColumnLabel
(
j
+
1
)
:
f
;
String
t
=
metaData
.
getColumnTypeName
(
j
+
1
);
String
t
=
metaData
.
getColumnTypeName
(
j
+
1
);
if
(
datasourceRequest
.
getDatasource
().
getType
().
equalsIgnoreCase
(
DatasourceTypes
.
hive
.
name
())
&&
l
.
contains
(
"
\\
."
))
{
if
(
datasourceRequest
.
getDatasource
().
getType
().
equalsIgnoreCase
(
DatasourceTypes
.
hive
.
name
())
&&
l
.
contains
(
"."
))
{
l
=
l
.
split
(
"
\\
."
)[
1
];
l
=
l
.
split
(
"."
)[
1
];
}
}
TableField
field
=
new
TableField
();
TableField
field
=
new
TableField
();
field
.
setFieldName
(
l
);
field
.
setFieldName
(
l
);
...
...
frontend/src/views/dataset/data/ViewTable.vue
浏览文件 @
ff436ddb
...
@@ -11,12 +11,14 @@
...
@@ -11,12 +11,14 @@
@
show=
"showTab"
@
show=
"showTab"
@
hide=
"hideTab"
@
hide=
"hideTab"
>
>
<dataset-chart-detail
type=
"dataset"
:data=
"table"
:tab-status=
"tabStatus"
/>
<dataset-chart-detail
type=
"dataset"
:data=
"table"
:tab-status=
"tabStatus"
/>
<!--
<svg-icon
slot=
"reference"
class=
"title-text"
icon-class=
"more_v"
style=
"cursor: pointer;"
/>
-->
<!--
<svg-icon
slot=
"reference"
class=
"title-text"
icon-class=
"more_v"
style=
"cursor: pointer;"
/>
-->
<i
slot=
"reference"
class=
"el-icon-warning icon-class"
style=
"margin-left: 4px;cursor: pointer;font-size: 14px;"
/>
<i
slot=
"reference"
class=
"el-icon-warning icon-class"
style=
"margin-left: 4px;cursor: pointer;font-size: 14px;"
/>
</el-popover>
</el-popover>
<el-row
v-if=
"hasDataPermission('manage',param.privileges)"
style=
"float: right"
>
<el-row
v-if=
"hasDataPermission('manage',param.privileges)"
style=
"float: right"
>
<el-dropdown
v-if=
"table.type ==='excel'"
style=
"margin-right: 10px;"
size=
"small"
trigger=
"click"
@
command=
"clickEditExcel"
>
<el-dropdown
v-if=
"table.type ==='excel'"
style=
"margin-right: 10px;"
size=
"small"
trigger=
"click"
@
command=
"clickEditExcel"
>
<el-button
size=
"mini"
>
<el-button
size=
"mini"
>
{{
$t
(
'dataset.edit_excel'
)
}}
{{
$t
(
'dataset.edit_excel'
)
}}
</el-button>
</el-button>
...
@@ -40,44 +42,53 @@
...
@@ -40,44 +42,53 @@
</el-button>
</el-button>
</el-row>
</el-row>
</el-row>
</el-row>
<el-divider
/>
<el-divider/>
<el-tabs
v-model=
"tabActive"
@
tab-click=
"tabClick"
>
<el-tabs
v-model=
"tabActive"
@
tab-click=
"tabClick"
>
<el-tab-pane
:label=
"$t('dataset.data_preview')"
name=
"dataPreview"
>
<el-tab-pane
:label=
"$t('dataset.data_preview')"
name=
"dataPreview"
>
<tab-data-preview
:param=
"param"
:table=
"table"
:fields=
"fields"
:data=
"data"
:page=
"page"
:form=
"tableViewRowForm"
@
reSearch=
"reSearch"
/>
<tab-data-preview
:param=
"param"
:table=
"table"
:fields=
"fields"
:data=
"data"
:page=
"page"
:form=
"tableViewRowForm"
@
reSearch=
"reSearch"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
:label=
"$t('dataset.field_manage')"
name=
"fieldEdit"
>
<el-tab-pane
:label=
"$t('dataset.field_manage')"
:lazy=
"true"
name=
"fieldEdit"
>
<field-edit
:param=
"param"
:table=
"table"
/>
<field-edit
v-if=
"tabActive === 'fieldEdit'"
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"!hideCustomDs && table.type !== 'union' && table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)"
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
<el-tab-pane
<union-view
:param=
"param"
:table=
"table"
/>
v-if=
"!hideCustomDs && table.type !== 'union' && table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)"
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
<union-view
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql' || table.type === 'api')"
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<el-tab-pane
<update-info
v-if=
"tabActive=='updateInfo'"
:param=
"param"
:table=
"table"
/>
v-if=
"table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql' || table.type === 'api')"
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<update-info
v-if=
"tabActive=='updateInfo'"
:param=
"param"
:table=
"table"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded && hasDataPermission('manage',param.privileges)"
:lazy=
"true"
:label=
"$t('dataset.row_permissions')"
name=
"rowPermissions"
>
<el-tab-pane
v-if=
"isPluginLoaded && hasDataPermission('manage',param.privileges)"
:lazy=
"true"
<plugin-com
v-if=
"isPluginLoaded && tabActive=='rowPermissions'"
ref=
"RowPermissions"
component-name=
"RowPermissions"
:obj=
"table"
/>
:label=
"$t('dataset.row_permissions')"
name=
"rowPermissions"
>
<plugin-com
v-if=
"isPluginLoaded && tabActive=='rowPermissions'"
ref=
"RowPermissions"
component-name=
"RowPermissions"
:obj=
"table"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded && hasDataPermission('manage',param.privileges)"
:lazy=
"true"
:label=
"$t('dataset.column_permissions')"
name=
"columnPermissions"
>
<el-tab-pane
v-if=
"isPluginLoaded && hasDataPermission('manage',param.privileges)"
:lazy=
"true"
<plugin-com
v-if=
"isPluginLoaded && tabActive=='columnPermissions'"
ref=
"ColumnPermissions"
component-name=
"ColumnPermissions"
:obj=
"table"
/>
:label=
"$t('dataset.column_permissions')"
name=
"columnPermissions"
>
<plugin-com
v-if=
"isPluginLoaded && tabActive=='columnPermissions'"
ref=
"ColumnPermissions"
component-name=
"ColumnPermissions"
:obj=
"table"
/>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</el-row>
</el-row>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
post
}
from
'@/api/dataset/dataset'
import
{
post
}
from
'@/api/dataset/dataset'
import
TabDataPreview
from
'./TabDataPreview'
import
TabDataPreview
from
'./TabDataPreview'
import
UpdateInfo
from
'./UpdateInfo'
import
UpdateInfo
from
'./UpdateInfo'
import
DatasetChartDetail
from
'../common/DatasetChartDetail'
import
DatasetChartDetail
from
'../common/DatasetChartDetail'
import
UnionView
from
'./UnionView'
import
UnionView
from
'./UnionView'
import
FieldEdit
from
'./FieldEdit'
import
FieldEdit
from
'./FieldEdit'
import
{
pluginLoaded
}
from
'@/api/user'
import
{
pluginLoaded
}
from
'@/api/user'
import
PluginCom
from
'@/views/system/plugin/PluginCom'
import
PluginCom
from
'@/views/system/plugin/PluginCom'
export
default
{
export
default
{
name
:
'ViewTable'
,
name
:
'ViewTable'
,
components
:
{
FieldEdit
,
UnionView
,
DatasetChartDetail
,
UpdateInfo
,
TabDataPreview
,
PluginCom
},
components
:
{
FieldEdit
,
UnionView
,
DatasetChartDetail
,
UpdateInfo
,
TabDataPreview
,
PluginCom
},
props
:
{
props
:
{
param
:
{
param
:
{
type
:
Object
,
type
:
Object
,
...
@@ -105,12 +116,12 @@ export default {
...
@@ -105,12 +116,12 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
hideCustomDs
:
function
()
{
hideCustomDs
:
function
()
{
return
this
.
$store
.
getters
.
hideCustomDs
return
this
.
$store
.
getters
.
hideCustomDs
}
}
},
},
watch
:
{
watch
:
{
'param'
:
function
()
{
'param'
:
function
()
{
this
.
tabActive
=
'dataPreview'
this
.
tabActive
=
'dataPreview'
this
.
initTable
(
this
.
param
.
id
)
this
.
initTable
(
this
.
param
.
id
)
}
}
...
@@ -137,7 +148,7 @@ export default {
...
@@ -137,7 +148,7 @@ export default {
this
.
table
=
response
.
data
this
.
table
=
response
.
data
this
.
initPreviewData
(
this
.
page
)
this
.
initPreviewData
(
this
.
page
)
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
this
.
$emit
(
'switchComponent'
,
{
name
:
''
})
this
.
$emit
(
'switchComponent'
,
{
name
:
''
})
})
})
}
}
},
},
...
@@ -168,17 +179,26 @@ export default {
...
@@ -168,17 +179,26 @@ export default {
},
},
edit
()
{
edit
()
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'FieldEdit'
,
param
:
{
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'FieldEdit'
,
param
:
{
table
:
this
.
table
}})
},
},
editSql
()
{
editSql
()
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddSQL'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddSQL'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}
})
},
},
editCustom
()
{
editCustom
()
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddCustom'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddCustom'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}
})
},
},
editUnion
()
{
editUnion
()
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddUnion'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddUnion'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
table
:
this
.
table
}
})
},
},
reSearch
(
val
)
{
reSearch
(
val
)
{
...
@@ -197,10 +217,16 @@ export default {
...
@@ -197,10 +217,16 @@ export default {
// console.log(param);
// console.log(param);
switch
(
param
.
type
)
{
switch
(
param
.
type
)
{
case
'0'
:
case
'0'
:
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddExcel'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
editType
:
0
,
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddExcel'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
editType
:
0
,
table
:
this
.
table
}
})
break
break
case
'1'
:
case
'1'
:
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddExcel'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
editType
:
1
,
table
:
this
.
table
}})
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddExcel'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
,
editType
:
1
,
table
:
this
.
table
}
})
break
break
}
}
},
},
...
@@ -233,17 +259,19 @@ export default {
...
@@ -233,17 +259,19 @@ export default {
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.el-divider--horizontal
{
.el-divider--horizontal
{
margin
:
12px
0
;
margin
:
12px
0
;
}
}
.form-item
{
.form-item
{
margin-bottom
:
6px
;
margin-bottom
:
6px
;
}
}
.icon-class
{
color
:
#6c6c6c
;
.icon-class
{
}
color
:
#6c6c6c
;
.blackTheme
.icon-class
{
}
.blackTheme
.icon-class
{
color
:
#cccccc
;
color
:
#cccccc
;
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论