cancel config

This commit is contained in:
Qiuxia Fan 2022-03-22 14:33:25 +08:00
parent f9aacb72e1
commit 6e01db4871

View File

@ -65,7 +65,7 @@ limitations under the License. -->
</el-collapse> </el-collapse>
</div> </div>
<div class="footer"> <div class="footer">
<el-button size="small"> <el-button size="small" @click="cancelConfig">
{{ t("cancel") }} {{ t("cancel") }}
</el-button> </el-button>
<el-button size="small" type="primary" @click="applyConfig"> <el-button size="small" type="primary" @click="applyConfig">
@ -112,6 +112,7 @@ export default defineComponent({
index: dashboardStore.selectedGrid.i, index: dashboardStore.selectedGrid.i,
visType: [], visType: [],
}); });
const originConfig = dashboardStore.selectedGrid;
function getSource(source: unknown) { function getSource(source: unknown) {
states.source = source; states.source = source;
@ -126,6 +127,11 @@ export default defineComponent({
dashboardStore.setConfigPanel(false); dashboardStore.setConfigPanel(false);
} }
function cancelConfig() {
dashboardStore.selectWidget(originConfig);
dashboardStore.setConfigPanel(false);
}
return { return {
states, states,
loading, loading,
@ -134,6 +140,7 @@ export default defineComponent({
configHeight, configHeight,
dashboardStore, dashboardStore,
applyConfig, applyConfig,
cancelConfig,
getSource, getSource,
setLoading, setLoading,
}; };