forked from DevExpress/devextreme-ui-template-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplanning-task-details.vue
196 lines (173 loc) · 4.81 KB
/
planning-task-details.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<template>
<dx-scroll-view class="view-wrapper-scroll">
<div class="view-wrapper">
<dx-toolbar class="toolbar-details theme-dependent">
<dx-toolbar-item location="before">
<dx-button
icon="arrowleft"
styling-mode="text"
/>
</dx-toolbar-item>
<dx-toolbar-item
location="before"
:text="taskName"
/>
<dx-toolbar-item
location="after"
locate-in-menu="auto"
>
<dx-drop-down-button
text="Actions"
styling-mode="text"
drop-down-options="{ width: 'auto' }"
>
<dx-drop-down-item text="Duplicate" />
<dx-drop-down-item text="Close" />
<dx-drop-down-item text="Delete" />
</dx-drop-down-button>
</dx-toolbar-item>
<dx-toolbar-item
location="after"
locate-in-menu="auto"
widget="dxButton"
show-text="inMenu"
:options="attachOptions"
/>
<dx-toolbar-item
location="after"
locate-in-menu="auto"
widget="dxButton"
show-text="inMenu"
:options="refreshOptions"
/>
</dx-toolbar>
<div class="panels">
<div class="left">
<dx-validation-group>
<task-form
:data="taskData"
:is-editing="false"
:content-by-screen="{ xs: 2, sm: 2 }"
:is-loading="isLoading"
/>
</dx-validation-group>
</div>
<div class="right">
<div class="dx-card details-card">
<dx-tab-panel
:focus-state-enabled="false"
:show-nav-buttons="true"
:defer-rendering="false"
>
<dx-item title="Activities">
<card-activities
:items="taskData?.activities"
:is-loading="isLoading"
:show-by="true"
/>
</dx-item>
<dx-item title="Notes">
<card-notes
:user="taskData?.owner"
:items="notes"
/>
</dx-item>
<dx-item
title="Messages"
>
<card-messages
:user="taskData?.owner"
:messages="taskData?.messages"
:is-loading="false"
/>
</dx-item>
</dx-tab-panel>
</div>
</div>
</div>
</div>
</dx-scroll-view>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { DxScrollView } from 'devextreme-vue/scroll-view';
import { DxDropDownButton, DxItem as DxDropDownItem } from 'devextreme-vue/drop-down-button';
import {
DxToolbar,
DxItem as DxToolbarItem,
} from 'devextreme-vue/toolbar';
import { DxTabPanel, DxItem } from 'devextreme-vue/tab-panel';
import { DxValidationGroup, DxButton } from 'devextreme-vue';
// eslint-disable-next-line import/no-unresolved
import { getTask } from 'dx-template-gallery-data';
import type { Task } from '@/types/task';
import CardNotes from '@/components/library/card-notes.vue';
import CardActivities from '@/components/library/card-activities.vue';
import CardMessages from '@/components/library/card-messages.vue';
import TaskForm from '@/components/library/task-form.vue';
const taskId = 1;
const taskName = ref('');
const taskData = ref<Task>();
const isLoading = ref(false);
const notes = computed(() => taskData.value?.notes);
async function loadData() {
isLoading.value = true;
const data = await getTask(taskId);
taskData.value = data;
taskName.value = data.text;
isLoading.value = false;
}
const refresh = () => {
loadData();
};
onMounted(() => {
loadData();
});
const attachOptions = {
text: 'Attach',
icon: 'attach',
stylingMode: 'text',
};
const refreshOptions = {
text: 'Refresh',
icon: 'refresh',
onClick: refresh,
stylingMode: 'text',
};
</script>
<style scoped lang="scss">
@use "@/variables" as *;
@use "sass:math";
@media only screen and (max-width: 875px) {
:deep(.contact-name-toolbar-item) {
min-width: calc(var(--left-panel-width) + var(--right-panel-width) - 145px);
}
}
.dx-toolbar {
margin-bottom: calc(var(--toolbar-margin-bottom) / 2);
:deep(.dx-toolbar-label > div) {
@include header();
}
}
.view-wrapper {
--left-panel-width: 400px;
--right-panel-width: 360px;
padding-top: var(--content-padding);
padding-bottom: var(--content-padding);
.panels {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 20px;
.left {
flex: 1 400px;
margin-top: 8px;
}
.right {
flex: 1 calc(100% - 400px - 20px);
margin-top: 8px;
min-width: 340px;
}
}
}
</style>