Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/plugins/materials/src/block/BlockGroupPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</template>
<script>
import { nextTick, reactive, watch, inject } from 'vue'
import { Search } from '@opentiny/vue'
import { Search, Loading } from '@opentiny/vue'
import { iconSearch } from '@opentiny/vue-icon'
import { PluginSetting } from '@opentiny/tiny-engine-common'
import { useApp, useBlock, useModal, useResource } from '@opentiny/tiny-engine-controller'
Expand Down Expand Up @@ -89,6 +89,11 @@ export default {
})

const addBlocks = () => {
let loadingInstance = Loading.service({
lock: true,
text: '区块分组保存中',
background: 'rgba(0, 0, 0, 0.6)'
})
const groupId = selectedGroup.value.groupId
fetchGroupBlocksById({ groupId })
.then((data) => {
Expand Down Expand Up @@ -127,6 +132,7 @@ export default {
status: 'error'
})
})
loadingInstance.close()
panelState.isBlockGroupPanel = false
closePanel()
Comment thread
chilingling marked this conversation as resolved.
}
Expand Down
7 changes: 7 additions & 0 deletions packages/plugins/materials/src/block/BlockList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<script lang="jsx">
import { computed, inject, reactive, ref } from 'vue'
import { Notify } from '@opentiny/vue'
import { useBlock, useResource, useModal, useApp } from '@opentiny/tiny-engine-controller'
import { PluginBlockList } from '@opentiny/tiny-engine-common'
import { dragStart, addComponent } from '@opentiny/tiny-engine-canvas'
Expand Down Expand Up @@ -141,6 +142,7 @@ export default {
const groupName = name || selectedGroup.value.groupName

const title = `删除区块${label}`
const titleSuccess = `删除区块${label}成功`
const status = 'error'
const messageRender = {
render: () => (
Expand All @@ -162,6 +164,11 @@ export default {
requestUpdateGroup({ id: groupId, blocks, app: appId }).then(() => {
isRefresh.value = true
})
Notify({
type: 'success',
message: titleSuccess,
position: 'top-right'
})
})
.catch((error) => {
message({ message: `删除区块失败: ${error.message || error}`, status: 'error' })
Expand Down