@mptw/skylens-ui 1.3.14 → 1.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/SLTabs.vue +377 -337
- package/package.json +1 -1
package/components/SLTabs.vue
CHANGED
|
@@ -1,388 +1,428 @@
|
|
|
1
1
|
<template lang="pug">
|
|
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
|
-
|
|
2
|
+
SLSitePage.m03-02p-page
|
|
3
|
+
ClientOnly
|
|
4
|
+
Teleport(to="#app-header-welcome-message") 受眾行為內單元提供單次的資料分析,可隨時查看歷史分析結果
|
|
5
|
+
Teleport(to='#header-breadcrumbs')
|
|
6
|
+
SLBreadcrumbs(:items='["受眾試算"]' info="依照設定的投放條件,在媒體投放前試算可接觸的受眾數量")
|
|
7
|
+
template(#site-page-header)
|
|
8
|
+
.site-page-header
|
|
9
|
+
.site-page-header-left
|
|
10
|
+
.site-page-title 受眾試算
|
|
11
|
+
.site-page-desc
|
|
12
|
+
span 依照設定的受眾條件,在媒體投放前試算可接觸的受眾數量
|
|
13
|
+
a(href='javascript:;')
|
|
14
|
+
SLIcon(icon='book')
|
|
15
|
+
span 單元導覽
|
|
16
|
+
.site-page-actions
|
|
17
|
+
SLButton(title='新增受眾包', post-icon='chevron-right', color='primary' class='create-btn')
|
|
18
|
+
.site-page-header-right
|
|
19
|
+
img(src='~/assets/images/m03/02p/m0302p-page-logo.svg')
|
|
20
|
+
SLNewTabs(:type='5')
|
|
21
|
+
template(#tabs-nav-right)
|
|
22
|
+
.inline-flex.items-center.space-x-4
|
|
23
|
+
SLSearchInput(
|
|
24
|
+
size='sm',
|
|
25
|
+
placeholder='搜尋標題名稱(部分字元即可)',
|
|
26
|
+
class='m0302p-search-input'
|
|
27
|
+
)
|
|
28
|
+
SLTab(title='受眾列表 (125)')
|
|
29
|
+
SLCard.audience-package-card
|
|
30
|
+
.audience-package
|
|
31
|
+
.audience-package-header
|
|
32
|
+
.header-left
|
|
33
|
+
SLButton(
|
|
34
|
+
title='新增受眾包',
|
|
35
|
+
color='primary',
|
|
36
|
+
size='lg',
|
|
37
|
+
@click='onClickedAdd'
|
|
38
|
+
)
|
|
39
|
+
.header-right
|
|
40
|
+
SLPagination(
|
|
41
|
+
v-if='totalCount > 0',
|
|
42
|
+
:total='totalCount',
|
|
43
|
+
:perPage='perPage',
|
|
44
|
+
:page='currentPage',
|
|
45
|
+
:showInfo='true'
|
|
46
|
+
@update:perPage='onUpdatedPerPage'
|
|
47
|
+
@update:page='onUpdatedPage'
|
|
48
|
+
)
|
|
49
|
+
.audience-package-body
|
|
50
|
+
template(v-if='tasks.length > 0')
|
|
51
|
+
ModuleM12AudiencePackageListItem(
|
|
52
|
+
v-for='task in tasks',
|
|
53
|
+
:task='task',
|
|
54
|
+
:key='task.id',
|
|
55
|
+
@delete='onClickedDelete',
|
|
56
|
+
@repack='onClickedRepack'
|
|
57
|
+
)
|
|
58
|
+
template(v-else) 沒有任何受眾包
|
|
59
|
+
.audience-package-footer
|
|
60
|
+
SLPagination(
|
|
61
|
+
v-if='totalCount > 0',
|
|
62
|
+
:total='totalCount',
|
|
63
|
+
:perPage='perPage',
|
|
64
|
+
:page='currentPage',
|
|
65
|
+
:showInfo='true'
|
|
66
|
+
@update:perPage='onUpdatedPerPage'
|
|
67
|
+
@update:page='onUpdatedPage'
|
|
32
68
|
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
69
|
+
SLTab(title='投放 (125)')
|
|
70
|
+
ClientOnly
|
|
71
|
+
Teleport(to="#popup")
|
|
72
|
+
SLConfirmModal(
|
|
73
|
+
v-model:show='isShowDeleteConfirmModal',
|
|
74
|
+
title='刪除受眾包',
|
|
75
|
+
confirmButtonTitle='刪除',
|
|
76
|
+
confirmButtonColor='danger',
|
|
77
|
+
confirmButtonVariant='',
|
|
78
|
+
modalClass='m12-delete-confirm-modal',
|
|
79
|
+
@confirm='onDeleteApply',
|
|
80
|
+
data-cy="delete-confirm-modal"
|
|
81
|
+
)
|
|
82
|
+
SLIcon(icon='exclamation-triangle')
|
|
83
|
+
p 確定要刪除此受眾包嗎?
|
|
37
84
|
</template>
|
|
38
85
|
|
|
39
86
|
<script lang="ts">
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
import
|
|
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
|
-
|
|
87
|
+
import uniqueId from 'lodash/uniqueId';
|
|
88
|
+
import { format as formatDate } from 'date-fns';
|
|
89
|
+
import useAppStore from '~/store/app';
|
|
90
|
+
import useM12Store from '~/store/app/m12';
|
|
91
|
+
import DomainUnionSubset from '@/models/DomainUnionSubset';
|
|
92
|
+
import LatlonUnionSubset from '@/models/LatlonUnionSubset';
|
|
93
|
+
import type { IAudTaskResponse, IUnionSubsetSource } from '~/interface/IAudTask';
|
|
94
|
+
import type IAudTask from '~/interface/IAudTask';
|
|
95
|
+
import { AudTaskStatus, AudTaskCMType } from '~/interface/IAudTask';
|
|
96
|
+
|
|
97
|
+
const PER_PAGE = 10;
|
|
98
|
+
|
|
99
|
+
function normalizeTask(task: IAudTaskResponse): IAudTask {
|
|
100
|
+
let gender = '';
|
|
101
|
+
|
|
102
|
+
switch ((task.genders || [])[0]) {
|
|
103
|
+
case '0':
|
|
104
|
+
gender = '未知';
|
|
105
|
+
break;
|
|
106
|
+
case '1':
|
|
107
|
+
gender = '男性';
|
|
108
|
+
break;
|
|
109
|
+
case '2':
|
|
110
|
+
gender = '女性';
|
|
111
|
+
break;
|
|
112
|
+
case '3':
|
|
113
|
+
gender = '不限';
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
id: task.task_id || '',
|
|
121
|
+
name: task.name || '',
|
|
122
|
+
status: task.status || AudTaskStatus.Run,
|
|
123
|
+
includeSets: JSON.parse(task.and || '[]').map((includeSets: Array<IUnionSubsetSource>) => {
|
|
124
|
+
return {
|
|
125
|
+
id: uniqueId(),
|
|
126
|
+
sets: includeSets
|
|
127
|
+
.map((includeSet) => {
|
|
128
|
+
if (includeSet.domains) {
|
|
129
|
+
return DomainUnionSubset.normalize(includeSet);
|
|
130
|
+
}
|
|
131
|
+
if (includeSet.pg_id) {
|
|
132
|
+
return LatlonUnionSubset.normalize(includeSet);
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
})
|
|
136
|
+
.filter((includeSet) => !!includeSet),
|
|
137
|
+
};
|
|
138
|
+
}),
|
|
139
|
+
differenceSets: JSON.parse(task.not || '[]').map((differenceSets: Array<IUnionSubsetSource>) => {
|
|
140
|
+
return {
|
|
141
|
+
id: uniqueId(),
|
|
142
|
+
sets: differenceSets
|
|
143
|
+
.map((differenceSet) => {
|
|
144
|
+
if (differenceSet.domains) {
|
|
145
|
+
return DomainUnionSubset.normalize(differenceSet);
|
|
146
|
+
}
|
|
147
|
+
if (differenceSet.pg_id) {
|
|
148
|
+
return LatlonUnionSubset.normalize(differenceSet);
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
})
|
|
152
|
+
.filter((differenceSet) => !!differenceSet),
|
|
153
|
+
};
|
|
154
|
+
}),
|
|
155
|
+
uuid: task.uuid || '',
|
|
156
|
+
steps: task.steps || [],
|
|
157
|
+
ages: (task.ages || []).map((age) => {
|
|
158
|
+
let name = '';
|
|
159
|
+
switch (age) {
|
|
160
|
+
case 'A':
|
|
161
|
+
name = '17以下';
|
|
162
|
+
break;
|
|
163
|
+
case 'B':
|
|
164
|
+
name = '18 - 24';
|
|
165
|
+
break;
|
|
166
|
+
case 'C':
|
|
167
|
+
name = '25 - 34';
|
|
168
|
+
break;
|
|
169
|
+
case 'D':
|
|
170
|
+
name = '35 - 44';
|
|
171
|
+
break;
|
|
172
|
+
case 'E':
|
|
173
|
+
name = '45 - 54';
|
|
174
|
+
break;
|
|
175
|
+
case 'F':
|
|
176
|
+
name = '55 - 64';
|
|
177
|
+
break;
|
|
178
|
+
case 'G':
|
|
179
|
+
name = '65 - 74';
|
|
180
|
+
break;
|
|
181
|
+
case 'H':
|
|
182
|
+
name = '75以上';
|
|
183
|
+
break;
|
|
184
|
+
default:
|
|
185
|
+
break;
|
|
89
186
|
}
|
|
90
187
|
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const tabLinks =
|
|
114
|
-
navComp.value?.$el.querySelectorAll(".tab-nav-item-link");
|
|
115
|
-
const tabLinkTitles = [];
|
|
116
|
-
if (tabLinks) {
|
|
117
|
-
for (let i = 0; i < tabLinks.length; i += 1) {
|
|
118
|
-
tabLinkTitles.push((tabLinks[i] as HTMLElement).innerText);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
tabTitles.value = tabLinkTitles;
|
|
122
|
-
|
|
123
|
-
const tabsNavLeftRect = tabsNavLeftEl.value?.getBoundingClientRect();
|
|
124
|
-
const navRect = navComp.value?.$el?.getBoundingClientRect();
|
|
125
|
-
|
|
126
|
-
if (tabsNavLeftRect && navRect) {
|
|
127
|
-
tabItemsOversizeProxy.value = navRect.width > tabsNavLeftRect.width;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function changeTabTo(newTab: number) {
|
|
133
|
-
activeTabIndex.value = newTab;
|
|
134
|
-
emit("update:activeTab", newTab);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function onClickedTab(i: number) {
|
|
138
|
-
changeTabTo(i);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
watch(activeTab, () => {
|
|
142
|
-
activeTabIndex.value = activeTab.value || 0;
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
onMounted(() => {
|
|
146
|
-
resizeSubscriber = fromEvent(window, "resize")
|
|
147
|
-
.pipe(debounce(() => interval(500)))
|
|
148
|
-
.pipe(startWith(0))
|
|
149
|
-
.subscribe(() => {
|
|
150
|
-
caculateTabs();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (navComp.value) {
|
|
154
|
-
observer = new MutationObserver(caculateTabs);
|
|
155
|
-
observer.observe(navComp.value.$el, {
|
|
156
|
-
characterData: true,
|
|
157
|
-
attributes: false,
|
|
158
|
-
childList: true,
|
|
159
|
-
subtree: true,
|
|
160
|
-
});
|
|
188
|
+
return {
|
|
189
|
+
key: age,
|
|
190
|
+
name,
|
|
191
|
+
};
|
|
192
|
+
}),
|
|
193
|
+
gender: {
|
|
194
|
+
key: (task.genders || [])[0],
|
|
195
|
+
name: gender,
|
|
196
|
+
},
|
|
197
|
+
workAt: task.workCity || [],
|
|
198
|
+
homeAt: task.homeCity || [],
|
|
199
|
+
cms: (task.cm || []).map((cm) => {
|
|
200
|
+
let name = '';
|
|
201
|
+
switch (cm) {
|
|
202
|
+
case AudTaskCMType.GID:
|
|
203
|
+
name = 'Google瀏覽器受眾';
|
|
204
|
+
break;
|
|
205
|
+
case AudTaskCMType.IFA:
|
|
206
|
+
name = '行動裝置受眾';
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
break;
|
|
161
210
|
}
|
|
162
|
-
|
|
211
|
+
const foundCM = (task.reports?.cm || []).find(
|
|
212
|
+
(reportsCM) => reportsCM.name === cm
|
|
213
|
+
);
|
|
163
214
|
|
|
164
|
-
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
if (observer) {
|
|
169
|
-
observer.disconnect();
|
|
215
|
+
let cmStatus = foundCM?.status || AudTaskStatus.Run;
|
|
216
|
+
if (task.status === AudTaskStatus.Warn || task.status === AudTaskStatus.Error) {
|
|
217
|
+
cmStatus = AudTaskStatus.Error;
|
|
170
218
|
}
|
|
171
|
-
resizeSubscriber = null;
|
|
172
|
-
observer = null;
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
tabsContentBody,
|
|
177
|
-
tabsNavLeftEl,
|
|
178
|
-
navComp,
|
|
179
|
-
activeTabIndex,
|
|
180
|
-
tabTitles,
|
|
181
|
-
showDropdown,
|
|
182
|
-
tabItemsOversize,
|
|
183
|
-
tabsClass,
|
|
184
|
-
currentTab,
|
|
185
|
-
changeTabTo,
|
|
186
|
-
onClickedTab,
|
|
187
|
-
};
|
|
188
|
-
},
|
|
189
|
-
});
|
|
190
|
-
</script>
|
|
191
|
-
|
|
192
|
-
<style lang="stylus">
|
|
193
|
-
.tabs
|
|
194
|
-
&.tabs-sm
|
|
195
|
-
&.tabs-type-1
|
|
196
|
-
& > .tabs-nav
|
|
197
|
-
ul
|
|
198
|
-
.tab-nav-item
|
|
199
|
-
&-link
|
|
200
|
-
@apply text-sm
|
|
201
|
-
|
|
202
|
-
&.tabs-xs
|
|
203
|
-
&.tabs-type-1
|
|
204
|
-
& > .tabs-nav
|
|
205
|
-
ul
|
|
206
|
-
.tab-nav-item
|
|
207
|
-
&.active
|
|
208
|
-
&:before
|
|
209
|
-
@apply hidden
|
|
210
219
|
|
|
211
|
-
|
|
212
|
-
|
|
220
|
+
const sourceCount = foundCM?.sourceCount || 0;
|
|
221
|
+
const targetCount = foundCM?.targetCount || 0;
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
key: cm,
|
|
225
|
+
name,
|
|
226
|
+
status: cmStatus,
|
|
227
|
+
sourceCount: numberToLocaleString(sourceCount, { NaNString: '-' }) as string,
|
|
228
|
+
targetCount: numberToLocaleString(targetCount, { NaNString: '-' }) as string,
|
|
229
|
+
ratio: sourceCount ? toFixed((targetCount / sourceCount) * 100, 2, { NaNString: '-', unit: '%' }) as string : '0.00%',
|
|
230
|
+
};
|
|
231
|
+
}),
|
|
232
|
+
profile: task.reports?.profile || null,
|
|
233
|
+
interest: task.reports?.interest || null,
|
|
234
|
+
createdAt: formatDate(task.created_at ? new Date(task.created_at) : new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
235
|
+
updatedAt: formatDate(task.updated_at ? new Date(task.updated_at) : new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
213
238
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
.tabs-nav-left
|
|
223
|
-
@apply flex-grow overflow-hidden
|
|
224
|
-
|
|
225
|
-
.tabs-nav-right
|
|
226
|
-
@apply flex-grow-0 flex-shrink-0
|
|
227
|
-
|
|
228
|
-
ul
|
|
229
|
-
@apply inline-flex items-start s("-space-x-px")
|
|
230
|
-
|
|
231
|
-
.tab-nav-item
|
|
232
|
-
@apply relative rounded-t bg-white
|
|
233
|
-
|
|
234
|
-
&:first-child
|
|
235
|
-
.tab-nav-item-link
|
|
236
|
-
&:after
|
|
237
|
-
content ""
|
|
238
|
-
@apply absolute bottom-0 left-0 w-px h-3 s("-mb-3") s("-ml-px") bg-border
|
|
239
|
-
|
|
240
|
-
&.active
|
|
241
|
-
@apply s("pb-1.75")
|
|
242
|
-
|
|
243
|
-
&:before
|
|
244
|
-
content ""
|
|
245
|
-
@apply block absolute s("top-0.5") s("right-0.75") s("left-0.75") h-1 bg-secondary-hover
|
|
246
|
-
|
|
247
|
-
.tab-nav-item-link
|
|
248
|
-
@apply text-primary cursor-default
|
|
249
|
-
|
|
250
|
-
&-link
|
|
251
|
-
@apply relative block s("py-1.75") s("px-3.75") border-t border-r border-l border-border rounded-t text-lg text-primary-light
|
|
252
|
-
|
|
253
|
-
&-title
|
|
254
|
-
@apply truncate
|
|
255
|
-
|
|
256
|
-
.tab-pane
|
|
257
|
-
@apply space-y-8
|
|
258
|
-
|
|
259
|
-
& > .tabs-content
|
|
260
|
-
@apply p-4 border border-border rounded-lg bg-white overflow-hidden
|
|
239
|
+
export default defineComponent({
|
|
240
|
+
name: 'M0302IndexPage',
|
|
241
|
+
components: {},
|
|
242
|
+
setup() {
|
|
243
|
+
definePageMeta({
|
|
244
|
+
middleware: ['acl-route'],
|
|
245
|
+
});
|
|
261
246
|
|
|
262
|
-
|
|
263
|
-
@apply flex items-start justify-between mb-4
|
|
247
|
+
const router = useRouter();
|
|
264
248
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
@apply mb-0
|
|
249
|
+
const appStore = useAppStore();
|
|
250
|
+
const m12Store = useM12Store();
|
|
268
251
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
252
|
+
const loading = ref(false);
|
|
253
|
+
const tasks = ref<Array<IAudTask>>([]);
|
|
254
|
+
const search = ref('');
|
|
255
|
+
const totalCount = ref(0);
|
|
256
|
+
const currentPage = ref(1);
|
|
257
|
+
const isShowDeleteConfirmModal = ref(false);
|
|
258
|
+
const perPage = ref(PER_PAGE);
|
|
272
259
|
|
|
273
|
-
|
|
274
|
-
@apply relative flex-grow s('py-6') rounded bg-bg text-lg text-primary-hover text-center
|
|
275
|
-
@apply s('lg:py-5.5')
|
|
260
|
+
let taskId = '';
|
|
276
261
|
|
|
277
|
-
|
|
278
|
-
content ""
|
|
279
|
-
@apply absolute s('top-0.5') s('left-0.5') block rounded bg-white
|
|
280
|
-
width calc(100% - theme('spacing.1'))
|
|
281
|
-
height calc(100% - theme('spacing.1'))
|
|
262
|
+
const project = computed(() => appStore.project);
|
|
282
263
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
@apply absolute left-0 bottom-0 s('-ml-4') s('-mb-5') block w-full h-3 rounded-t bg-primary-lighter opacity-0
|
|
286
|
-
width calc(100% + theme('spacing.4') * 2)
|
|
264
|
+
async function fetch() {
|
|
265
|
+
loading.value = true;
|
|
287
266
|
|
|
288
|
-
|
|
289
|
-
|
|
267
|
+
const { data, error } = await m12Store.getTasks({
|
|
268
|
+
offset: (currentPage.value - 1) * perPage.value,
|
|
269
|
+
limit: perPage.value,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
loading.value = false;
|
|
273
|
+
|
|
274
|
+
if (error) {
|
|
275
|
+
appStore.addAlert({
|
|
276
|
+
title: '錯誤',
|
|
277
|
+
color: 'danger',
|
|
278
|
+
message: error.message,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
290
281
|
|
|
291
|
-
|
|
292
|
-
|
|
282
|
+
totalCount.value = data?.aud_task_list.totalCount || 0;
|
|
283
|
+
tasks.value = (data?.aud_task_list.data || []).map((task) => normalizeTask(task));
|
|
284
|
+
}
|
|
293
285
|
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
function onClickedAdd() {
|
|
287
|
+
router.push('/application/m03/02/create');
|
|
288
|
+
}
|
|
296
289
|
|
|
297
|
-
|
|
298
|
-
|
|
290
|
+
function onClearedSearch() {
|
|
291
|
+
search.value = '';
|
|
292
|
+
}
|
|
299
293
|
|
|
300
|
-
|
|
301
|
-
|
|
294
|
+
function onClickedDelete(id: string) {
|
|
295
|
+
taskId = id;
|
|
296
|
+
isShowDeleteConfirmModal.value = true;
|
|
297
|
+
}
|
|
302
298
|
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
function onClickedRepack(id: string) {
|
|
300
|
+
const foundTask = tasks.value.find((task) => task.id === id);
|
|
301
|
+
if (!foundTask) return;
|
|
305
302
|
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
m12Store.setTask(foundTask);
|
|
304
|
+
router.push(`/application/m03/02/create`);
|
|
305
|
+
}
|
|
308
306
|
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
async function onDeleteApply() {
|
|
308
|
+
isShowDeleteConfirmModal.value = false;
|
|
311
309
|
|
|
312
|
-
|
|
313
|
-
& > .tabs-nav
|
|
314
|
-
@apply flex items-start justify-between h-0 space-x-8 overflow-hidden
|
|
315
|
-
@apply s('lg:space-x-30')
|
|
310
|
+
const { error } = await m12Store.deleteTask(taskId);
|
|
316
311
|
|
|
317
|
-
|
|
318
|
-
|
|
312
|
+
if (error) {
|
|
313
|
+
appStore.addAlert({
|
|
314
|
+
color: 'danger',
|
|
315
|
+
code: error.code,
|
|
316
|
+
message: error.message,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
319
|
|
|
320
|
-
.
|
|
321
|
-
|
|
320
|
+
if (tasks.value.length === 1) {
|
|
321
|
+
currentPage.value = Math.max(1, currentPage.value - 1);
|
|
322
|
+
}
|
|
323
|
+
fetch();
|
|
324
|
+
}
|
|
322
325
|
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
function onUpdatedPerPage(newPerPage: number) {
|
|
327
|
+
perPage.value = newPerPage;
|
|
328
|
+
currentPage.value = 1;
|
|
329
|
+
fetch();
|
|
330
|
+
}
|
|
325
331
|
|
|
326
|
-
|
|
327
|
-
|
|
332
|
+
function onUpdatedPage(newPage: number) {
|
|
333
|
+
currentPage.value = newPage;
|
|
334
|
+
}
|
|
328
335
|
|
|
329
|
-
|
|
330
|
-
|
|
336
|
+
watch(search, () => {
|
|
337
|
+
currentPage.value = 1;
|
|
338
|
+
});
|
|
339
|
+
watch(currentPage, () => {
|
|
340
|
+
fetch();
|
|
341
|
+
});
|
|
342
|
+
watch(project, () => {
|
|
343
|
+
currentPage.value = 1;
|
|
344
|
+
fetch();
|
|
345
|
+
});
|
|
331
346
|
|
|
332
|
-
|
|
333
|
-
|
|
347
|
+
onMounted(() => {
|
|
348
|
+
fetch();
|
|
349
|
+
});
|
|
334
350
|
|
|
335
|
-
|
|
336
|
-
|
|
351
|
+
return {
|
|
352
|
+
tasks,
|
|
353
|
+
search,
|
|
354
|
+
totalCount,
|
|
355
|
+
currentPage,
|
|
356
|
+
loading,
|
|
357
|
+
isShowDeleteConfirmModal,
|
|
358
|
+
perPage,
|
|
359
|
+
onClickedAdd,
|
|
360
|
+
onClearedSearch,
|
|
361
|
+
onClickedDelete,
|
|
362
|
+
onClickedRepack,
|
|
363
|
+
onDeleteApply,
|
|
364
|
+
onUpdatedPerPage,
|
|
365
|
+
onUpdatedPage,
|
|
366
|
+
};
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
</script>
|
|
337
370
|
|
|
338
|
-
|
|
339
|
-
|
|
371
|
+
<style lang="stylus">
|
|
372
|
+
.m03-02p-page
|
|
373
|
+
.site-page-header
|
|
374
|
+
@apply p-6 bg-white rounded-lg shadow
|
|
340
375
|
|
|
341
|
-
|
|
342
|
-
|
|
376
|
+
&-left
|
|
377
|
+
.site-page-title
|
|
378
|
+
@apply mb-2 s('text-3.33xl') text-primary font-bold
|
|
343
379
|
|
|
344
|
-
|
|
345
|
-
|
|
380
|
+
.site-page-desc
|
|
381
|
+
@apply flex items-center mb-6 space-x-2 text-sm text-gray-2 font-medium
|
|
346
382
|
|
|
347
|
-
|
|
348
|
-
|
|
383
|
+
a
|
|
384
|
+
@apply inline-flex items-center space-x-1 text-blue-1 font-normal
|
|
349
385
|
|
|
350
|
-
.
|
|
351
|
-
|
|
386
|
+
.site-page-actions
|
|
387
|
+
.create-btn
|
|
388
|
+
@apply s('py-1.75') s('pl-[23px]') s('pr-3.75') rounded-lg text-lg
|
|
352
389
|
|
|
353
|
-
|
|
354
|
-
|
|
390
|
+
.site-page-content
|
|
391
|
+
@apply p-0 bg-transparent
|
|
355
392
|
|
|
356
|
-
|
|
357
|
-
|
|
393
|
+
.m0302p-search-input
|
|
394
|
+
@apply s('w-[238px]')
|
|
358
395
|
|
|
359
|
-
|
|
360
|
-
|
|
396
|
+
.input-group
|
|
397
|
+
.input.input-sm
|
|
398
|
+
input
|
|
399
|
+
@apply text-sm
|
|
361
400
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
@apply flex flex-col s('space-y-0.5')
|
|
401
|
+
& > .card
|
|
402
|
+
@apply border-0 rounded-lg shadow-none
|
|
365
403
|
|
|
366
|
-
|
|
367
|
-
|
|
404
|
+
.audience-package-card
|
|
405
|
+
.audience-package
|
|
406
|
+
@apply space-y-4
|
|
368
407
|
|
|
369
|
-
|
|
370
|
-
|
|
408
|
+
&-header
|
|
409
|
+
@apply flex items-end justify-between
|
|
371
410
|
|
|
372
|
-
|
|
373
|
-
|
|
411
|
+
.header-left
|
|
412
|
+
@apply flex-shrink-0 flex-grow-0
|
|
374
413
|
|
|
375
|
-
|
|
376
|
-
|
|
414
|
+
.header-right
|
|
415
|
+
@apply flex-grow flex items-end justify-end
|
|
377
416
|
|
|
378
|
-
|
|
379
|
-
|
|
417
|
+
&-body
|
|
418
|
+
@apply space-y-4
|
|
380
419
|
|
|
381
|
-
|
|
382
|
-
|
|
420
|
+
.m12-delete-confirm-modal
|
|
421
|
+
.modal-body
|
|
422
|
+
&-content
|
|
423
|
+
@apply flex flex-col items-center justify-center space-y-6 text-base text-gray-2
|
|
383
424
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
& > .tabs-content
|
|
387
|
-
@apply shadow-md
|
|
425
|
+
.icon
|
|
426
|
+
@apply text-16xl text-danger
|
|
388
427
|
</style>
|
|
428
|
+
|