Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
3c17fc57
提交
3c17fc57
authored
4月 20, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main' into main
上级
23729a4c
46ff744b
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
322 行增加
和
14 行删除
+322
-14
DataSetTableController.java
...o/dataease/controller/dataset/DataSetTableController.java
+6
-0
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+134
-0
index.js
frontend/src/api/link/index.js
+7
-0
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+9
-1
zh.js
frontend/src/lang/zh.js
+2
-1
Link.vue
frontend/src/link/Link.vue
+1
-1
link.js
frontend/src/link/link.js
+3
-0
AddExcel.vue
frontend/src/views/dataset/add/AddExcel.vue
+26
-3
index.vue
frontend/src/views/link/index.vue
+1
-1
index.vue
frontend/src/views/link/view/index.vue
+38
-3
filterDialog.vue
frontend/src/views/panel/filter/filterDialog.vue
+95
-4
没有找到文件。
backend/src/main/java/io/dataease/controller/dataset/DataSetTableController.java
浏览文件 @
3c17fc57
...
@@ -7,6 +7,7 @@ import io.dataease.controller.request.dataset.DataSetTableRequest;
...
@@ -7,6 +7,7 @@ import io.dataease.controller.request.dataset.DataSetTableRequest;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.service.dataset.DataSetTableService
;
import
io.dataease.service.dataset.DataSetTableService
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -86,4 +87,9 @@ public class DataSetTableController {
...
@@ -86,4 +87,9 @@ public class DataSetTableController {
public
Map
<
String
,
Object
>
datasetDetail
(
@PathVariable
String
id
)
{
public
Map
<
String
,
Object
>
datasetDetail
(
@PathVariable
String
id
)
{
return
dataSetTableService
.
getDatasetDetail
(
id
);
return
dataSetTableService
.
getDatasetDetail
(
id
);
}
}
@PostMapping
(
"excel/upload"
)
public
Map
<
String
,
Object
>
excelUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
return
dataSetTableService
.
excelSaveAndParse
(
file
);
}
}
}
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
3c17fc57
...
@@ -18,10 +18,26 @@ import io.dataease.dto.dataset.DataTableInfoDTO;
...
@@ -18,10 +18,26 @@ import io.dataease.dto.dataset.DataTableInfoDTO;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.hssf.usermodel.HSSFRow
;
import
org.apache.poi.hssf.usermodel.HSSFSheet
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.nio.charset.StandardCharsets
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.text.DecimalFormat
;
import
java.text.MessageFormat
;
import
java.text.MessageFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -42,6 +58,8 @@ public class DataSetTableService {
...
@@ -42,6 +58,8 @@ public class DataSetTableService {
private
DataSetTableTaskService
dataSetTableTaskService
;
private
DataSetTableTaskService
dataSetTableTaskService
;
@Resource
@Resource
private
DatasetTableIncrementalConfigMapper
datasetTableIncrementalConfigMapper
;
private
DatasetTableIncrementalConfigMapper
datasetTableIncrementalConfigMapper
;
@Value
(
"${upload.file.path}"
)
private
String
path
;
public
void
batchInsert
(
List
<
DatasetTable
>
datasetTable
)
throws
Exception
{
public
void
batchInsert
(
List
<
DatasetTable
>
datasetTable
)
throws
Exception
{
for
(
DatasetTable
table
:
datasetTable
)
{
for
(
DatasetTable
table
:
datasetTable
)
{
...
@@ -434,4 +452,120 @@ public class DataSetTableService {
...
@@ -434,4 +452,120 @@ public class DataSetTableService {
}
}
return
map
;
return
map
;
}
}
public
Map
<
String
,
Object
>
excelSaveAndParse
(
MultipartFile
file
)
throws
Exception
{
String
filename
=
file
.
getOriginalFilename
();
String
suffix
=
filename
.
substring
(
filename
.
lastIndexOf
(
"."
)
+
1
);
List
<
TableFiled
>
fields
=
new
ArrayList
<>();
List
<
String
[]>
data
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
jsonArray
=
new
ArrayList
<>();
InputStream
inputStream
=
file
.
getInputStream
();
if
(
StringUtils
.
equalsIgnoreCase
(
suffix
,
"xls"
))
{
HSSFWorkbook
workbook
=
new
HSSFWorkbook
(
inputStream
);
HSSFSheet
sheet0
=
workbook
.
getSheetAt
(
0
);
if
(
sheet0
.
getNumMergedRegions
()
>
0
)
{
throw
new
RuntimeException
(
"Sheet have merged regions."
);
}
int
rows
=
Math
.
min
(
sheet0
.
getPhysicalNumberOfRows
(),
100
);
for
(
int
i
=
0
;
i
<
rows
;
i
++)
{
HSSFRow
row
=
sheet0
.
getRow
(
i
);
String
[]
r
=
new
String
[
row
.
getPhysicalNumberOfCells
()];
for
(
int
j
=
0
;
j
<
row
.
getPhysicalNumberOfCells
();
j
++)
{
if
(
i
==
0
)
{
TableFiled
tableFiled
=
new
TableFiled
();
tableFiled
.
setFieldName
(
readCell
(
row
.
getCell
(
j
)));
tableFiled
.
setRemarks
(
readCell
(
row
.
getCell
(
j
)));
fields
.
add
(
tableFiled
);
}
else
{
r
[
j
]
=
readCell
(
row
.
getCell
(
j
));
}
}
if
(
i
>
0
)
{
data
.
add
(
r
);
}
}
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
suffix
,
"xlsx"
))
{
XSSFWorkbook
xssfWorkbook
=
new
XSSFWorkbook
(
inputStream
);
XSSFSheet
sheet0
=
xssfWorkbook
.
getSheetAt
(
0
);
if
(
sheet0
.
getNumMergedRegions
()
>
0
)
{
throw
new
RuntimeException
(
"Sheet have merged regions."
);
}
int
rows
=
Math
.
min
(
sheet0
.
getPhysicalNumberOfRows
(),
100
);
for
(
int
i
=
0
;
i
<
rows
;
i
++)
{
XSSFRow
row
=
sheet0
.
getRow
(
i
);
String
[]
r
=
new
String
[
row
.
getPhysicalNumberOfCells
()];
for
(
int
j
=
0
;
j
<
row
.
getPhysicalNumberOfCells
();
j
++)
{
if
(
i
==
0
)
{
TableFiled
tableFiled
=
new
TableFiled
();
tableFiled
.
setFieldName
(
readCell
(
row
.
getCell
(
j
)));
tableFiled
.
setRemarks
(
readCell
(
row
.
getCell
(
j
)));
fields
.
add
(
tableFiled
);
}
else
{
r
[
j
]
=
readCell
(
row
.
getCell
(
j
));
}
}
if
(
i
>
0
)
{
data
.
add
(
r
);
}
}
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
suffix
,
"csv"
))
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
,
StandardCharsets
.
UTF_8
));
String
s
=
reader
.
readLine
();
// first line
String
[]
split
=
s
.
split
(
","
);
for
(
String
s1
:
split
)
{
TableFiled
tableFiled
=
new
TableFiled
();
tableFiled
.
setFieldName
(
s1
);
tableFiled
.
setRemarks
(
s1
);
fields
.
add
(
tableFiled
);
}
int
num
=
1
;
String
line
=
null
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
if
(
num
>
100
)
{
break
;
}
data
.
add
(
line
.
split
(
","
));
num
++;
}
}
String
[]
fieldArray
=
fields
.
stream
().
map
(
TableFiled:
:
getFieldName
).
toArray
(
String
[]::
new
);
if
(
CollectionUtils
.
isNotEmpty
(
data
))
{
jsonArray
=
data
.
stream
().
map
(
ele
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
ele
.
length
;
i
++)
{
map
.
put
(
fieldArray
[
i
],
ele
[
i
]);
}
return
map
;
}).
collect
(
Collectors
.
toList
());
}
inputStream
.
close
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"fields"
,
fields
);
map
.
put
(
"data"
,
jsonArray
);
return
map
;
}
private
String
readCell
(
Cell
cell
)
{
CellType
cellTypeEnum
=
cell
.
getCellTypeEnum
();
if
(
cellTypeEnum
.
equals
(
CellType
.
STRING
))
{
return
cell
.
getStringCellValue
();
}
else
if
(
cellTypeEnum
.
equals
(
CellType
.
NUMERIC
))
{
double
d
=
cell
.
getNumericCellValue
();
try
{
return
new
Double
(
d
).
longValue
()
+
""
;
}
catch
(
Exception
e
)
{
BigDecimal
b
=
new
BigDecimal
(
d
);
return
b
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()
+
""
;
}
}
else
if
(
cellTypeEnum
.
equals
(
CellType
.
BOOLEAN
))
{
return
cell
.
getBooleanCellValue
()
?
"1"
:
"0"
;
}
else
{
return
""
;
}
}
}
}
frontend/src/api/link/index.js
浏览文件 @
3c17fc57
...
@@ -48,3 +48,10 @@ export function loadGenerate(resourceId) {
...
@@ -48,3 +48,10 @@ export function loadGenerate(resourceId) {
method
:
'post'
method
:
'post'
})
})
}
}
export
function
loadResource
(
resourceId
)
{
return
request
({
url
:
'panel/group/findOne/'
+
resourceId
,
method
:
'get'
})
}
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
3c17fc57
...
@@ -324,7 +324,15 @@ export default {
...
@@ -324,7 +324,15 @@ export default {
this
.
addCondition
(
condition
)
this
.
addCondition
(
condition
)
},
},
addCondition
(
condition
)
{
addCondition
(
condition
)
{
this
.
conditions
.
push
(
condition
)
let
conditionExist
=
false
for
(
let
index
=
0
;
index
<
this
.
conditions
.
length
;
index
++
)
{
const
element
=
this
.
conditions
[
index
]
if
(
condition
.
componentId
===
element
.
componentId
)
{
this
.
conditions
[
index
]
=
condition
conditionExist
=
true
}
}
!
conditionExist
&&
this
.
conditions
.
push
(
condition
)
this
.
executeSearch
()
this
.
executeSearch
()
},
},
deleteCondition
(
condition
)
{
deleteCondition
(
condition
)
{
...
...
frontend/src/lang/zh.js
浏览文件 @
3c17fc57
...
@@ -783,7 +783,8 @@ export default {
...
@@ -783,7 +783,8 @@ export default {
detail
:
'详情'
,
detail
:
'详情'
,
type
:
'类型'
,
type
:
'类型'
,
create_by
:
'创建者'
,
create_by
:
'创建者'
,
create_time
:
'创建时间'
create_time
:
'创建时间'
,
preview_100_data
:
'预览前100行数据'
},
},
datasource
:
{
datasource
:
{
datasource
:
'数据源'
,
datasource
:
'数据源'
,
...
...
frontend/src/link/Link.vue
浏览文件 @
3c17fc57
<
template
>
<
template
>
<div
id=
"link"
><router-view
/>
<div
id=
"link"
style=
"height:100%;"
><router-view
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
...
frontend/src/link/link.js
浏览文件 @
3c17fc57
...
@@ -5,6 +5,9 @@ import store from '../store'
...
@@ -5,6 +5,9 @@ import store from '../store'
import
'@/styles/index.scss'
// global css
import
'@/styles/index.scss'
// global css
import
i18n
from
'../lang'
// internationalization
import
i18n
from
'../lang'
// internationalization
import
ElementUI
from
'element-ui'
import
ElementUI
from
'element-ui'
import
'@/components/canvas/custom-component'
// 注册自定义组件
import
*
as
echarts
from
'echarts'
Vue
.
prototype
.
$echarts
=
echarts
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
,
{
Vue
.
use
(
ElementUI
,
{
...
...
frontend/src/views/dataset/add/AddExcel.vue
浏览文件 @
3c17fc57
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<el-button
size=
"mini"
@
click=
"cancel"
>
<el-button
size=
"mini"
@
click=
"cancel"
>
{{
$t
(
'dataset.cancel'
)
}}
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"save"
>
<el-button
:disabled=
"!form.name || fileList.length === 0"
size=
"mini"
type=
"primary"
@
click=
"save"
>
{{
$t
(
'dataset.confirm'
)
}}
{{
$t
(
'dataset.confirm'
)
}}
</el-button>
</el-button>
</el-row>
</el-row>
...
@@ -24,11 +24,14 @@
...
@@ -24,11 +24,14 @@
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-upload
<el-upload
action=
"/posts/
"
:action=
"baseUrl+'dataset/table/excel/upload'
"
:multiple=
"false"
:multiple=
"false"
:show-file-list=
"false"
:show-file-list=
"false"
:file-list=
"fileList"
accept=
".xls,.xlsx,.csv"
accept=
".xls,.xlsx,.csv"
:on-success=
"uploadSuccess"
:on-success=
"uploadSuccess"
name=
"file"
:headers=
"headers"
>
>
<el-button
size=
"mini"
type=
"primary"
>
{{
$t
(
'dataset.upload_file'
)
}}
</el-button>
<el-button
size=
"mini"
type=
"primary"
>
{{
$t
(
'dataset.upload_file'
)
}}
</el-button>
</el-upload>
</el-upload>
...
@@ -42,6 +45,7 @@
...
@@ -42,6 +45,7 @@
<el-card
class=
"box-card dataPreview"
shadow=
"never"
>
<el-card
class=
"box-card dataPreview"
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
$t
(
'dataset.data_preview'
)
}}
</span>
<span>
{{
$t
(
'dataset.data_preview'
)
}}
</span>
<span
style=
"font-size: 12px;color: #3d4d66;"
>
(
{{
$t
(
'dataset.preview_100_data'
)
}}
)
</span>
</div>
</div>
<div
class=
"text item"
>
<div
class=
"text item"
>
<ux-grid
<ux-grid
...
@@ -70,6 +74,9 @@
...
@@ -70,6 +74,9 @@
<
script
>
<
script
>
import
{
post
}
from
'@/api/dataset/dataset'
import
{
post
}
from
'@/api/dataset/dataset'
import
{
getToken
}
from
'@/utils/auth'
const
token
=
getToken
()
export
default
{
export
default
{
name
:
'AddExcel'
,
name
:
'AddExcel'
,
...
@@ -85,8 +92,12 @@ export default {
...
@@ -85,8 +92,12 @@ export default {
name
:
''
name
:
''
},
},
fields
:
[],
fields
:
[],
data
:
[],
mode
:
'1'
,
mode
:
'1'
,
height
:
600
height
:
600
,
fileList
:
[],
headers
:
{
Authorization
:
token
},
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
}
}
},
},
watch
:
{
watch
:
{
...
@@ -120,6 +131,18 @@ export default {
...
@@ -120,6 +131,18 @@ export default {
// },
// },
uploadSuccess
(
response
,
file
,
fileList
)
{
uploadSuccess
(
response
,
file
,
fileList
)
{
console
.
log
(
response
)
console
.
log
(
response
)
console
.
log
(
file
)
console
.
log
(
fileList
)
this
.
fields
=
response
.
data
.
fields
this
.
data
=
response
.
data
.
data
const
datas
=
this
.
data
this
.
$refs
.
plxTable
.
reloadData
(
datas
)
if
(
file
.
name
.
lastIndexOf
(
'.'
)
>
0
)
{
this
.
form
.
name
=
file
.
name
.
substring
(
0
,
file
.
name
.
lastIndexOf
(
'.'
))
}
this
.
fileList
=
fileList
},
},
save
()
{
save
()
{
...
...
frontend/src/views/link/index.vue
浏览文件 @
3c17fc57
<
template
>
<
template
>
<div>
<div
style=
"height: 100%;"
>
<link-error
v-if=
"showIndex===0"
:resource-id=
"resourceId"
/>
<link-error
v-if=
"showIndex===0"
:resource-id=
"resourceId"
/>
<link-pwd
v-if=
"showIndex===1"
:resource-id=
"resourceId"
/>
<link-pwd
v-if=
"showIndex===1"
:resource-id=
"resourceId"
/>
<link-view
v-if=
"showIndex===2"
:resource-id=
"resourceId"
/>
<link-view
v-if=
"showIndex===2"
:resource-id=
"resourceId"
/>
...
...
frontend/src/views/link/view/index.vue
浏览文件 @
3c17fc57
<
template
>
<
template
>
<div>
<div
style=
"width: 100%;height: 100%;background-color: #f7f8fa"
>
我是视图页面
<Preview
v-if=
"show"
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
loadResource
}
from
'@/api/link'
import
{
uuid
}
from
'vue-uuid'
import
Preview
from
'@/components/canvas/components/Editor/Preview'
export
default
{
export
default
{
name
:
'LinkView'
,
name
:
'LinkView'
,
components
:
{
Preview
},
props
:
{
resourceId
:
{
type
:
String
,
default
:
null
}
},
data
()
{
data
()
{
return
{
return
{
show
:
false
}
}
},
},
created
()
{
this
.
show
=
false
this
.
setPanelInfo
()
},
methods
:
{
methods
:
{
setPanelInfo
()
{
loadResource
(
this
.
resourceId
).
then
(
res
=>
{
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
JSON
.
parse
(
res
.
data
.
panelData
)))
// this.$store.commit('setComponentData', JSON.parse(res.data.panelData))
this
.
$store
.
commit
(
'setCanvasStyle'
,
JSON
.
parse
(
res
.
data
.
panelStyle
))
this
.
show
=
true
})
},
resetID
(
data
)
{
data
.
forEach
(
item
=>
{
item
.
id
=
uuid
.
v1
()
})
return
data
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
*
{
margin
:
0
;
padding
:
0
;
}
</
style
>
frontend/src/views/panel/filter/filterDialog.vue
浏览文件 @
3c17fc57
...
@@ -12,12 +12,12 @@
...
@@ -12,12 +12,12 @@
</el-breadcrumb-item>
</el-breadcrumb-item>
</el-breadcrumb>
</el-breadcrumb>
</div>
</div>
<div
class=
"component-search filter-common"
>
<
!--
<
div
class=
"component-search filter-common"
>
<el-input
<el-input
placeholder=
"请输入内容"
placeholder=
"请输入内容"
prefix-icon=
"el-icon-search"
prefix-icon=
"el-icon-search"
/>
/>
</div>
</div>
-->
<!--
<div
class=
"component-result-content filter-common"
@
dragstart=
"handleDragStart"
@
dragend=
"handleDragEnd"
>
-->
<!--
<div
class=
"component-result-content filter-common"
@
dragstart=
"handleDragStart"
@
dragend=
"handleDragEnd"
>
-->
<div
class=
"component-result-content filter-common"
>
<div
class=
"component-result-content filter-common"
>
...
@@ -68,7 +68,61 @@
...
@@ -68,7 +68,61 @@
</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
:lazy=
"true"
class=
"de-tab"
label=
"按组件选择"
name=
"assembly"
>
按组件选择
</el-tab-pane>
<el-tab-pane
:lazy=
"true"
class=
"de-tab"
label=
"按组件选择"
name=
"assembly"
>
<div
class=
"component-header filter-common"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
v-for=
"bread in componentSetBreads"
:key=
"bread.label"
>
<a
v-if=
"bread.link"
:class=
"{'link-text' : bread.link}"
@
click=
"comBackLink(bread)"
>
{{ bread.label }}
</a>
<span
v-else
>
{{ bread.label }}
</span>
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<!-- <div class="component-search filter-common">
<el-input
placeholder="请输入内容"
prefix-icon="el-icon-search"
/>
</div> -->
<div
class=
"component-result-content filter-common"
>
<el-table
v-if=
"comShowDomType === 'view'"
class=
"de-filter-data-table"
:data=
"viewInfos"
:show-header=
"false"
size=
"mini"
:highlight-current-row=
"true"
style=
"width: 100%"
>
<el-table-column
prop=
"name"
label=
"名称"
>
<
template
v-if=
"comShowDomType === 'view'"
:id=
"scope.row.id"
slot-scope=
"scope"
>
<div
class=
"filter-db-row"
@
click=
"comShowFieldDatas(scope.row)"
>
<i
class=
"el-icon-s-data"
/>
<span>
{{
scope
.
row
.
name
}}
</span>
</div>
</
template
>
</el-table-column>
</el-table>
<div
v-else-if=
"comShowDomType === 'field'"
>
<draggable
v-model=
"comFieldDatas"
:options=
"{group:{name: 'dimension',pull:'clone'},sort: true}"
animation=
"300"
:move=
"onMove"
class=
"drag-list"
@
end=
"end1"
@
start=
"start1"
>
<transition-group>
<div
v-for=
"item in comFieldDatas"
:key=
"item.id"
class=
"filter-db-row"
>
<i
class=
"el-icon-s-data"
/>
<span>
{{ item.name }}
</span>
</div>
</transition-group>
</draggable>
</div>
</div>
</el-tab-pane>
</el-tabs>
</el-tabs>
</de-aside-container>
</de-aside-container>
...
@@ -200,12 +254,18 @@ export default {
...
@@ -200,12 +254,18 @@ export default {
return
{
return
{
activeName
:
'dataset'
,
activeName
:
'dataset'
,
showDomType
:
'tree'
,
showDomType
:
'tree'
,
comShowDomType
:
'view'
,
dataSetBreads
:
[
dataSetBreads
:
[
{
label
:
'数据列表'
,
link
:
false
,
type
:
'root'
}
{
label
:
'数据列表'
,
link
:
false
,
type
:
'root'
}
],
],
componentSetBreads
:
[
{
label
:
'组件列表'
,
link
:
false
,
type
:
'root'
}
],
data
:
[],
data
:
[],
sceneDatas
:
[],
sceneDatas
:
[],
// viewDatas: [],
fieldDatas
:
[],
fieldDatas
:
[],
comFieldDatas
:
[],
defaultProps
:
{
defaultProps
:
{
children
:
'children'
,
children
:
'children'
,
label
:
'label'
label
:
'label'
...
@@ -319,15 +379,28 @@ export default {
...
@@ -319,15 +379,28 @@ export default {
tail
.
type
=
node
.
type
tail
.
type
=
node
.
type
tail
.
link
=
true
tail
.
link
=
true
},
},
comSetTailLink
(
node
)
{
const
tail
=
this
.
componentSetBreads
[
this
.
componentSetBreads
.
length
-
1
]
tail
.
type
=
node
.
type
tail
.
link
=
true
},
addTail
(
node
)
{
addTail
(
node
)
{
const
tail
=
{
link
:
false
,
label
:
node
.
label
||
node
.
name
,
type
:
node
.
type
}
const
tail
=
{
link
:
false
,
label
:
node
.
label
||
node
.
name
,
type
:
node
.
type
}
this
.
dataSetBreads
.
push
(
tail
)
this
.
dataSetBreads
.
push
(
tail
)
},
},
comAddTail
(
node
)
{
const
tail
=
{
link
:
false
,
label
:
node
.
label
||
node
.
name
,
type
:
node
.
type
}
this
.
componentSetBreads
.
push
(
tail
)
},
removeTail
()
{
removeTail
()
{
this
.
dataSetBreads
=
this
.
dataSetBreads
.
slice
(
0
,
this
.
dataSetBreads
.
length
-
1
)
this
.
dataSetBreads
=
this
.
dataSetBreads
.
slice
(
0
,
this
.
dataSetBreads
.
length
-
1
)
this
.
dataSetBreads
[
this
.
dataSetBreads
.
length
-
1
][
'link'
]
=
false
this
.
dataSetBreads
[
this
.
dataSetBreads
.
length
-
1
][
'link'
]
=
false
},
},
comRemoveTail
()
{
this
.
componentSetBreads
=
this
.
componentSetBreads
.
slice
(
0
,
this
.
componentSetBreads
.
length
-
1
)
this
.
componentSetBreads
[
this
.
componentSetBreads
.
length
-
1
][
'link'
]
=
false
},
backToLink
(
bread
)
{
backToLink
(
bread
)
{
if
(
bread
.
type
===
'db'
)
{
if
(
bread
.
type
===
'db'
)
{
this
.
showDomType
=
'db'
this
.
showDomType
=
'db'
...
@@ -337,6 +410,10 @@ export default {
...
@@ -337,6 +410,10 @@ export default {
this
.
removeTail
()
this
.
removeTail
()
},
},
comBackLink
(
bread
)
{
this
.
comShowDomType
=
'view'
this
.
comRemoveTail
()
},
loadTable
(
sceneId
)
{
loadTable
(
sceneId
)
{
loadTable
({
sceneId
:
sceneId
,
sort
:
'type asc,create_time desc,name asc'
}).
then
(
res
=>
{
loadTable
({
sceneId
:
sceneId
,
sort
:
'type asc,create_time desc,name asc'
}).
then
(
res
=>
{
this
.
sceneDatas
=
res
.
data
this
.
sceneDatas
=
res
.
data
...
@@ -352,13 +429,27 @@ export default {
...
@@ -352,13 +429,27 @@ export default {
this
.
fieldDatas
=
datas
this
.
fieldDatas
=
datas
})
})
},
},
comLoadField
(
tableId
)
{
fieldList
(
tableId
).
then
(
res
=>
{
let
datas
=
res
.
data
if
(
this
.
widget
&&
this
.
widget
.
filterFieldMethod
)
{
datas
=
this
.
widget
.
filterFieldMethod
(
datas
)
}
this
.
comFieldDatas
=
datas
})
},
showFieldDatas
(
row
)
{
showFieldDatas
(
row
)
{
this
.
showDomType
=
'field'
this
.
showDomType
=
'field'
this
.
setTailLink
(
row
)
this
.
setTailLink
(
row
)
this
.
addTail
(
row
)
this
.
addTail
(
row
)
this
.
loadField
(
row
.
id
)
this
.
loadField
(
row
.
id
)
},
},
test
(
row
)
{},
comShowFieldDatas
(
row
)
{
this
.
comShowDomType
=
'field'
this
.
comSetTailLink
(
row
)
this
.
comAddTail
(
row
)
this
.
comLoadField
(
row
.
tableId
)
},
onMove
(
e
,
originalEvent
)
{
onMove
(
e
,
originalEvent
)
{
this
.
moveId
=
e
.
draggedContext
.
element
.
id
this
.
moveId
=
e
.
draggedContext
.
element
.
id
return
true
return
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论