Skip to content

Commit 2c9695e

Browse files
committed
feat(template-center)
1 parent ac1bb46 commit 2c9695e

5 files changed

Lines changed: 14 additions & 25 deletions

File tree

packages/design-core/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default {
2525
const layoutRegistry = getMergeMeta('engine.layout')
2626
const materialsApi = getMetaApi('engine.plugins.materials')
2727
const blockApi = getMetaApi('engine.plugins.blockmanage')
28-
console.log(layoutRegistry)
28+
2929
// 此处接收画布内部的错误和警告提示
3030
const { data } = useBroadcastChannel({ name: BROADCAST_CHANNEL.Notify })
3131

packages/design-core/src/template/src/template/AppCenter.vue

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@
103103
@current-change="currentChange"
104104
></tiny-pager>
105105
</div>
106-
<app-dialog
107-
v-model:visible="state.appVisible"
108-
:template="currentTemplate"
109-
@confirm="confirmApp"
110-
></app-dialog>
106+
<app-dialog v-model:visible="state.appVisible" :template="currentTemplate" @confirm="confirmApp"></app-dialog>
111107
</div>
112108
</template>
113109

@@ -128,8 +124,6 @@ export default {
128124
TinyGridColumn: GridColumn,
129125
TinyPopover: Popover,
130126
TinySearch: Search,
131-
TinyModal: Modal,
132-
TinyNotify: Notify,
133127
SearchEmpty,
134128
TinyIconSearch: iconSearch(),
135129
AppDialog
@@ -197,7 +191,7 @@ export default {
197191
if (state.orderBy === 'last_updated_time') {
198192
params.orderBy = state.orderBy
199193
}
200-
fetchApplicationList(Object.fromEntries(Object.entries(params).filter(([key, value]) => !!value))).then((res) => {
194+
fetchApplicationList(Object.fromEntries(Object.entries(params).filter((item) => !!item[1]))).then((res) => {
201195
appList.value = res.apps || []
202196
state.total = res.total
203197
})
@@ -213,7 +207,7 @@ export default {
213207
}
214208
215209
const handleDelete = (template) => {
216-
TinyModal.confirm({
210+
Modal.confirm({
217211
message: '即将删除应用,删除后不可恢复,请谨慎操作。',
218212
title: '删除应用'
219213
}).then((res) => {
@@ -223,7 +217,7 @@ export default {
223217
getTemplateList()
224218
})
225219
.catch((error) => {
226-
TinyNotify({
220+
Notify({
227221
type: 'error',
228222
message: error,
229223
position: 'top-right',
@@ -260,7 +254,7 @@ export default {
260254
delete formData.id
261255
updateApplication(updateId, formData)
262256
.then(() => {
263-
TinyNotify({
257+
Notify({
264258
type: 'success',
265259
message: '应用更新成功',
266260
position: 'top-right',
@@ -269,7 +263,7 @@ export default {
269263
getApplicationList()
270264
})
271265
.catch((error) => {
272-
TinyNotify({
266+
Notify({
273267
type: 'error',
274268
message: error,
275269
position: 'top-right',
@@ -279,7 +273,7 @@ export default {
279273
} else {
280274
createApplication(formData)
281275
.then(() => {
282-
TinyNotify({
276+
Notify({
283277
type: 'success',
284278
message: '应用创建成功',
285279
position: 'top-right',
@@ -288,7 +282,7 @@ export default {
288282
getApplicationList()
289283
})
290284
.catch((error) => {
291-
TinyNotify({
285+
Notify({
292286
type: 'error',
293287
message: error,
294288
position: 'top-right',

packages/design-core/src/template/src/template/AppDialog.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div v-if="isOpen" class="dropdown-menu">
5050
<!-- 菜单项 -->
5151
<div class="icon-list">
52-
<template v-for="iconIndex in 15" :key="icon">
52+
<template v-for="iconIndex in 15" :key="iconIndex">
5353
<svg-icon
5454
:name="'template-cover-' + iconIndex"
5555
class="icon"
@@ -89,8 +89,7 @@ export default {
8989
TinyDialogBox,
9090
TinyForm,
9191
TinyFormItem,
92-
TinySelect,
93-
Notify
92+
TinySelect
9493
},
9594
props: {
9695
visible: {

packages/design-core/src/template/src/template/TemplateCenter.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export default {
119119
TemplateDetail,
120120
TinyPager: Pager,
121121
TinySearch: Search,
122-
TinyNotify: Notify,
123122
SearchEmpty,
124123
TinyIconSearch: iconSearch()
125124
},
@@ -153,7 +152,7 @@ export default {
153152
tagList.industry = res[1] || []
154153
})
155154
.catch((error) => {
156-
TinyNotify({
155+
Notify({
157156
type: 'error',
158157
message: error,
159158
position: 'top-right',
@@ -171,13 +170,13 @@ export default {
171170
industryId: state.industry,
172171
framework: state.framework
173172
}
174-
fetchTemplateList(Object.fromEntries(Object.entries(params).filter(([key, value]) => !!value)))
173+
fetchTemplateList(Object.fromEntries(Object.entries(params).filter((item) => !!item[1])))
175174
.then((res) => {
176175
templateList.value = res.apps || []
177176
state.total = res.total
178177
})
179178
.catch((error) => {
180-
TinyNotify({
179+
Notify({
181180
type: 'error',
182181
message: error,
183182
position: 'top-right',

packages/design-core/src/template/src/template/TemplateDetail.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export default {
4545
components: {
4646
TinyButton: Button,
4747
TinyDrawer: Drawer,
48-
Notify,
49-
Modal,
5048
AppDialog
5149
},
5250
props: {
@@ -101,7 +99,6 @@ export default {
10199
}
102100
103101
onMounted(() => {
104-
console.log(props.template)
105102
getPageList(1).then((pages: any) => {
106103
if (pages?.length) {
107104
const href = window.location.href.split('?')[0] || './'

0 commit comments

Comments
 (0)