提交 5e8af7cf authored 作者: junjie's avatar junjie

feat(frontend): group css search等调整

上级 cd65f762
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
</el-button> </el-button>
</el-row> </el-row>
<el-row> <!-- <el-row>-->
<el-form> <!-- <el-form>-->
<el-form-item class="form-item"> <!-- <el-form-item class="form-item">-->
<el-input <!-- <el-input-->
v-model="search" <!-- v-model="search"-->
size="mini" <!-- size="mini"-->
:placeholder="$t('chart.search')" <!-- :placeholder="$t('chart.search')"-->
prefix-icon="el-icon-search" <!-- prefix-icon="el-icon-search"-->
clearable <!-- clearable-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
</el-form> <!-- </el-form>-->
</el-row> <!-- </el-row>-->
<el-col class="custom-tree-container"> <el-col class="custom-tree-container">
<div class="block"> <div class="block">
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
:data="chartData" :data="chartData"
node-key="id" node-key="id"
:expand-on-click-node="true" :expand-on-click-node="true"
class="tree-list"
@node-click="sceneClick" @node-click="sceneClick"
> >
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node, data }" class="custom-tree-node">
...@@ -260,7 +261,8 @@ export default { ...@@ -260,7 +261,8 @@ export default {
] ]
}, },
selectTableFlag: false, selectTableFlag: false,
table: {} table: {},
tables: []
} }
}, },
computed: { computed: {
...@@ -269,7 +271,15 @@ export default { ...@@ -269,7 +271,15 @@ export default {
return this.$store.state.chart.chartSceneData return this.$store.state.chart.chartSceneData
} }
}, },
watch: {}, watch: {
search(val) {
if (val && val !== '') {
this.chartData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
} else {
this.chartData = JSON.parse(JSON.stringify(this.tables))
}
}
},
mounted() { mounted() {
this.groupTree(this.groupForm) this.groupTree(this.groupForm)
this.refresh() this.refresh()
...@@ -447,13 +457,15 @@ export default { ...@@ -447,13 +457,15 @@ export default {
}, },
chartTree() { chartTree() {
this.tables = []
this.chartData = [] this.chartData = []
if (this.currGroup.id) { if (this.currGroup.id) {
post('/chart/view/list', { post('/chart/view/list', {
sort: 'create_time desc,name asc', sort: 'create_time desc,name asc',
sceneId: this.currGroup.id sceneId: this.currGroup.id
}).then(response => { }).then(response => {
this.chartData = response.data this.tables = response.data
this.chartData = JSON.parse(JSON.stringify(this.tables))
}) })
} }
}, },
...@@ -564,13 +576,21 @@ export default { ...@@ -564,13 +576,21 @@ export default {
padding: 12px 0; padding: 12px 0;
} }
.custom-tree-container{
margin-top: 10px;
}
.custom-tree-node { .custom-tree-node {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
padding-right: 8px; padding:0 8px;
}
.tree-list>>>.el-tree-node__expand-icon.is-leaf{
display: none;
} }
.custom-position { .custom-position {
......
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
</el-button> </el-button>
</el-row> </el-row>
<el-row> <!-- <el-row>-->
<el-form> <!-- <el-form>-->
<el-form-item class="form-item"> <!-- <el-form-item class="form-item">-->
<el-input <!-- <el-input-->
v-model="search" <!-- v-model="search"-->
size="mini" <!-- size="mini"-->
:placeholder="$t('dataset.search')" <!-- :placeholder="$t('dataset.search')"-->
prefix-icon="el-icon-search" <!-- prefix-icon="el-icon-search"-->
clearable <!-- clearable-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
</el-form> <!-- </el-form>-->
</el-row> <!-- </el-row>-->
<el-col class="custom-tree-container"> <el-col class="custom-tree-container">
<div class="block"> <div class="block">
...@@ -170,6 +170,7 @@ ...@@ -170,6 +170,7 @@
:data="tableData" :data="tableData"
node-key="id" node-key="id"
:expand-on-click-node="true" :expand-on-click-node="true"
class="tree-list"
@node-click="sceneClick" @node-click="sceneClick"
> >
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node, data }" class="custom-tree-node">
...@@ -245,6 +246,7 @@ export default { ...@@ -245,6 +246,7 @@ export default {
editTable: false, editTable: false,
tData: [], tData: [],
tableData: [], tableData: [],
tables: [],
currGroup: {}, currGroup: {},
expandedArray: [], expandedArray: [],
groupForm: { groupForm: {
...@@ -287,6 +289,13 @@ export default { ...@@ -287,6 +289,13 @@ export default {
// this.groupForm.name = val; // this.groupForm.name = val;
// this.tree(this.groupForm); // this.tree(this.groupForm);
// } // }
search(val) {
if (val && val !== '') {
this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
} else {
this.tableData = JSON.parse(JSON.stringify(this.tables))
}
}
}, },
mounted() { mounted() {
this.tree(this.groupForm) this.tree(this.groupForm)
...@@ -472,13 +481,15 @@ export default { ...@@ -472,13 +481,15 @@ export default {
}, },
tableTree() { tableTree() {
this.tables = []
this.tableData = [] this.tableData = []
if (this.currGroup.id) { if (this.currGroup.id) {
loadTable({ loadTable({
sort: 'type asc,create_time desc,name asc', sort: 'type asc,create_time desc,name asc',
sceneId: this.currGroup.id sceneId: this.currGroup.id
}).then(res => { }).then(res => {
this.tableData = res.data this.tables = res.data
this.tableData = JSON.parse(JSON.stringify(this.tables))
}) })
} }
}, },
...@@ -575,13 +586,21 @@ export default { ...@@ -575,13 +586,21 @@ export default {
padding: 12px 0; padding: 12px 0;
} }
.custom-tree-container{
margin-top: 10px;
}
.tree-list>>>.el-tree-node__expand-icon.is-leaf{
display: none;
}
.custom-tree-node { .custom-tree-node {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
padding-right: 8px; padding:0 8px;
} }
.custom-position { .custom-position {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论