2020-07-11 10:13:11 +09:00
|
|
|
<template>
|
2020-12-28 11:56:42 +09:00
|
|
|
<XColumn :func="{ handler: func, title: $ts.editWidgets }" :naked="true" :column="column" :is-stacked="isStacked">
|
2020-10-17 20:12:00 +09:00
|
|
|
<template #header><Fa :icon="faWindowMaximize" style="margin-right: 8px;"/>{{ column.name }}</template>
|
2020-07-11 10:13:11 +09:00
|
|
|
|
|
|
|
<div class="wtdtxvec">
|
2021-02-16 22:17:13 +09:00
|
|
|
<XWidgets :edit="edit" :widgets="column.widgets" @add-widget="addWidget" @remove-widget="removeWidget" @update-widget="updateWidget" @update-widgets="updateWidgets" @exit="edit = false"/>
|
2020-07-11 10:13:11 +09:00
|
|
|
</div>
|
2020-10-17 20:12:00 +09:00
|
|
|
</XColumn>
|
2020-07-11 10:13:11 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 20:12:00 +09:00
|
|
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
2020-07-26 13:30:36 +09:00
|
|
|
import { faWindowMaximize, faTimes, faCog, faPlus } from '@fortawesome/free-solid-svg-icons';
|
2021-03-23 17:30:14 +09:00
|
|
|
import XWidgets from '@client/components/widgets.vue';
|
2020-07-11 10:13:11 +09:00
|
|
|
import XColumn from './column.vue';
|
2020-12-19 10:55:52 +09:00
|
|
|
import { addColumnWidget, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store';
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2020-07-11 10:13:11 +09:00
|
|
|
components: {
|
|
|
|
XColumn,
|
2021-02-16 22:17:13 +09:00
|
|
|
XWidgets,
|
2020-07-11 10:13:11 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
edit: false,
|
2020-07-26 13:30:36 +09:00
|
|
|
faWindowMaximize, faTimes, faPlus
|
2020-07-11 10:13:11 +09:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2021-02-16 22:17:13 +09:00
|
|
|
addWidget(widget) {
|
|
|
|
addColumnWidget(this.column.id, widget);
|
2020-07-11 10:13:11 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
removeWidget(widget) {
|
2020-12-19 10:55:52 +09:00
|
|
|
removeColumnWidget(this.column.id, widget);
|
2020-07-11 10:13:11 +09:00
|
|
|
},
|
2020-12-19 10:55:52 +09:00
|
|
|
|
2021-02-16 22:17:13 +09:00
|
|
|
updateWidget({ id, data }) {
|
2020-12-19 10:55:52 +09:00
|
|
|
updateColumnWidget(this.column.id, id, data);
|
2020-12-28 11:56:42 +09:00
|
|
|
},
|
|
|
|
|
2021-02-16 22:17:13 +09:00
|
|
|
updateWidgets(widgets) {
|
|
|
|
setColumnWidgets(this.column.id, widgets);
|
|
|
|
},
|
|
|
|
|
2020-12-28 11:56:42 +09:00
|
|
|
func() {
|
|
|
|
this.edit = !this.edit;
|
2020-12-19 10:55:52 +09:00
|
|
|
}
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wtdtxvec {
|
2021-02-16 22:17:13 +09:00
|
|
|
--margin: 8px;
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2021-02-16 22:17:13 +09:00
|
|
|
padding: 0 var(--margin);
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2021-02-16 22:17:13 +09:00
|
|
|
::v-deep(._panel) {
|
|
|
|
box-shadow: none;
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|