feat: library-服装-画布添加从library上传
This commit is contained in:
2
components.d.ts
vendored
2
components.d.ts
vendored
@@ -18,6 +18,7 @@ declare module 'vue' {
|
||||
AMenu: typeof import('ant-design-vue/es')['Menu']
|
||||
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
||||
AModal: typeof import('ant-design-vue/es')['Modal']
|
||||
APagination: typeof import('ant-design-vue/es')['Pagination']
|
||||
APopover: typeof import('ant-design-vue/es')['Popover']
|
||||
ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
|
||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||
@@ -27,6 +28,7 @@ declare module 'vue' {
|
||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
ATable: typeof import('ant-design-vue/es')['Table']
|
||||
AUpload: typeof import('ant-design-vue/es')['Upload']
|
||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ import { RedGreenModeManager } from "./managers/RedGreenModeManager";
|
||||
import texturePresetManager from "./managers/brushes/TexturePresetManager";
|
||||
import { BrushStore } from "./store/BrushStore";
|
||||
import cuowuImg from '@/assets/images/homePage/cuowu.svg'
|
||||
import { Https } from "@/tool/https";
|
||||
import SelectImages from '@/component/common/SelectImages.vue'
|
||||
import { UrlToFile } from '@/tool/util'
|
||||
|
||||
|
||||
// import { MinimapManager } from "./managers/minimap/MinimapManager";
|
||||
@@ -102,6 +105,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false, // 是否显示固定图层
|
||||
},
|
||||
isGeneral: { // 从generalMiniCanvas来的
|
||||
type: Boolean,
|
||||
default:false
|
||||
}
|
||||
});
|
||||
|
||||
// 引用和状态
|
||||
@@ -706,9 +713,19 @@ function handleImageUpload(event) {
|
||||
});
|
||||
}
|
||||
|
||||
const selectImages = ref(null);
|
||||
const handleImageSelect = (data) => {
|
||||
UrlToFile(data.url,data.name).then((file)=>{
|
||||
handleImageUpload({ target: { files: [file] } })
|
||||
})
|
||||
}
|
||||
function triggerLibrary() {
|
||||
console.log('打开收藏')
|
||||
emit("trigger-library");
|
||||
if (props.isGeneral) {
|
||||
selectImages.value.init()
|
||||
} else {
|
||||
emit("trigger-library");
|
||||
}
|
||||
}
|
||||
|
||||
function handleAddText() {
|
||||
@@ -1171,6 +1188,14 @@ defineExpose({
|
||||
style="display: none"
|
||||
@change="handleImageUpload"
|
||||
/>
|
||||
<SelectImages
|
||||
ref="selectImages"
|
||||
full-data
|
||||
radio
|
||||
@select="handleImageSelect"
|
||||
:api="Https.httpUrls.queryLibraryPage"
|
||||
isLibrary
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<editCanvas v-if="canvasLoad" :config="canvasConfig"
|
||||
@canvasInit="canvasInit"
|
||||
@changeCanvas="changeCanvas"
|
||||
is-general
|
||||
ref="editCanvas"></editCanvas>
|
||||
</div>
|
||||
<div class="btn">
|
||||
|
||||
Reference in New Issue
Block a user