Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 51100d9

Browse files
committed
添加变量后自动更新
1 parent 60d8731 commit 51100d9

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

frontend/src/components/VariableAllDialog.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
<v-dialog v-model="dialog" fullscreen hide-overlay transition="dialog-bottom-transition">
44
<v-card>
55
<v-toolbar dark color="primary">
6-
<v-toolbar-title>变量列表</v-toolbar-title>
7-
<v-spacer></v-spacer>
86
<v-toolbar-items>
9-
<v-btn icon dark @click="dialog = false">
7+
<v-btn icon dark v-on:click="closeDialog">
108
<v-icon>mdi-close</v-icon>
119
</v-btn>
1210
</v-toolbar-items>
11+
<v-toolbar-title>变量列表</v-toolbar-title>
1312
</v-toolbar>
1413
<v-row>
1514
<v-col cols="4">
@@ -117,6 +116,10 @@ export default {
117116
openDialog() {
118117
this.dialog = true;
119118
},
119+
closeDialog() {
120+
this.$emit("getAllV");
121+
this.dialog = false;
122+
},
120123
getVariableList() {
121124
axios.get("/file/variables").then(response => {
122125
this.lists = response.data.Variables;

frontend/src/views/Variables.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<v-container>
33
<v-row>
44
<v-col cols="12" sm="6" md="6">
5-
<VariableCard showtext="观察" />
5+
<VariableCard showtext="观察" ref="cardRead" />
66
</v-col>
77

88
<v-col cols="12" sm="6" md="6">
9-
<VariableCard showtext="修改" />
9+
<VariableCard showtext="修改" ref="cardModi" />
1010
</v-col>
1111

1212
<v-btn color="secondary" dark absolute bottom right fab v-on:click="openDialog()">
1313
<v-icon>mdi-plus</v-icon>
1414
</v-btn>
15-
<VariableAllDialog ref="VariableAllDialog" />
15+
<VariableAllDialog ref="VariableAllDialog" @getAllV="getAllV" />
1616
</v-row>
1717
</v-container>
1818
</template>
@@ -28,6 +28,10 @@ export default {
2828
methods: {
2929
openDialog() {
3030
this.$refs.VariableAllDialog.openDialog();
31+
},
32+
getAllV() {
33+
this.$refs.cardRead.getVariables();
34+
this.$refs.cardModi.getVariables();
3135
}
3236
}
3337
};

0 commit comments

Comments
 (0)