refactor: 去掉多余请求;数据集tree修复
This commit is contained in:
parent
a48ee0155a
commit
38838e3162
@ -257,13 +257,13 @@
|
||||
|
||||
<!--添加视图-选择数据集-->
|
||||
<el-dialog
|
||||
v-if="selectTableFlag"
|
||||
v-dialogDrag
|
||||
:title="$t('chart.add_chart')"
|
||||
:visible="selectTableFlag"
|
||||
:show-close="false"
|
||||
width="70%"
|
||||
class="dialog-css"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<el-row style="width: 800px;">
|
||||
<el-form ref="form" :model="table" label-width="80px" size="mini" class="form-item">
|
||||
|
||||
@ -398,13 +398,13 @@
|
||||
|
||||
<!--视图更换数据集-->
|
||||
<el-dialog
|
||||
v-if="selectTableFlag"
|
||||
v-dialogDrag
|
||||
:title="changeDsTitle"
|
||||
:visible="selectTableFlag"
|
||||
:show-close="false"
|
||||
width="70%"
|
||||
class="dialog-css"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<table-selector @getTable="getTable" />
|
||||
<p style="margin-top: 10px;color:#F56C6C;font-size: 12px;">{{ $t('chart.change_ds_tip') }}</p>
|
||||
@ -416,11 +416,11 @@
|
||||
|
||||
<!--编辑视图使用的数据集的字段-->
|
||||
<el-dialog
|
||||
v-if="editDsField"
|
||||
v-dialogDrag
|
||||
:visible="editDsField"
|
||||
:show-close="false"
|
||||
class="dialog-css"
|
||||
:destroy-on-close="true"
|
||||
:fullscreen="true"
|
||||
>
|
||||
<field-edit :param="{table:table}" @switchComponent="closeEditDsField" />
|
||||
|
||||
@ -68,7 +68,6 @@
|
||||
|
||||
<script>
|
||||
import { isKettleRunning, post } from '@/api/dataset/dataset'
|
||||
import { authModel } from '@/api/system/sysAuth'
|
||||
import { hasDataPermission } from '@/utils/permission'
|
||||
|
||||
export default {
|
||||
@ -403,11 +402,14 @@ export default {
|
||||
|
||||
searchTree(val) {
|
||||
const queryCondition = {
|
||||
withExtend: 'parent',
|
||||
modelType: 'dataset',
|
||||
// withExtend: 'parent',
|
||||
// modelType: 'dataset',
|
||||
name: val
|
||||
}
|
||||
authModel(queryCondition).then(res => {
|
||||
// authModel(queryCondition).then(res => {
|
||||
// this.data = this.buildTree(res.data)
|
||||
// })
|
||||
post('/dataset/table/search', queryCondition).then(res => {
|
||||
this.data = this.buildTree(res.data)
|
||||
})
|
||||
},
|
||||
@ -420,8 +422,8 @@ export default {
|
||||
const roots = []
|
||||
arrs.forEach(el => {
|
||||
// 判断根节点 ###
|
||||
el.type = el.modelInnerType
|
||||
el.isLeaf = el.leaf
|
||||
// el.type = el.modelInnerType
|
||||
// el.isLeaf = el.leaf
|
||||
if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') {
|
||||
roots.push(el)
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user