添加画布颜色历史
This commit is contained in:
@@ -66,6 +66,7 @@ import ColorboardUpload from '@/component/HomePage/ColorboardUpload.vue'
|
||||
import SketchboardUpload from '@/component/HomePage/SketchboardUpload.vue'
|
||||
import MarketingSketchUpload from '@/component/HomePage/MarketingSketchUpload.vue'
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { rgbToHsv, dataURLtoBlob } from "@/tool/util";
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { Https } from "@/tool/https";
|
||||
import {useStore} from 'vuex'
|
||||
@@ -83,7 +84,13 @@ export default defineComponent({
|
||||
SketchboardUpload,
|
||||
MarketingSketchUpload
|
||||
},
|
||||
setup(){
|
||||
props:{
|
||||
getDesignData: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
setup(props){
|
||||
const store = useStore()
|
||||
let {t} = useI18n()
|
||||
let driver__:any = computed(()=>{
|
||||
@@ -285,9 +292,46 @@ export default defineComponent({
|
||||
})
|
||||
return bor
|
||||
},
|
||||
getPantongName() {
|
||||
let colorBoards = this.store.state.UploadFilesModule.colorBoards;
|
||||
let data: any = [];
|
||||
for (let v of colorBoards) {
|
||||
let color: any = [v.rgbValue.r, v.rgbValue.g, v.rgbValue.b];
|
||||
let hsv = rgbToHsv(color);
|
||||
v.hsv = hsv[0] + hsv[1] + hsv[2];
|
||||
data.push({
|
||||
h: hsv[0],
|
||||
s: hsv[1],
|
||||
v: hsv[2],
|
||||
});
|
||||
}
|
||||
|
||||
return new Promise((resolve: any, reject: any) => {
|
||||
Https.axiosPost(Https.httpUrls.getRgbByHsvBatch, data)
|
||||
.then((rv: any) => {
|
||||
if (rv) {
|
||||
rv.forEach((ele: any, index: number) => {
|
||||
colorBoards[index].id = ele.id;
|
||||
colorBoards[index].tcx = ele.tcx;
|
||||
colorBoards[index].name = ele.name;
|
||||
});
|
||||
this.store.commit("setColorboardList", colorBoards);
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
},
|
||||
//完成
|
||||
async finishCollection(){
|
||||
this.isShowMark = true
|
||||
this.store.commit('clearAllId')
|
||||
this.$emit('finishCollection')
|
||||
await this.getPantongName()
|
||||
this.store.commit("setAllBoardData");
|
||||
|
||||
let sketchList = this.store.state.UploadFilesModule.sketchboard
|
||||
let arr:any = []
|
||||
sketchList.forEach((item:any) => {
|
||||
@@ -299,12 +343,14 @@ export default defineComponent({
|
||||
}
|
||||
arr.push(obj)
|
||||
});
|
||||
let data = {sketchBoards:arr}
|
||||
// let data = {sketchBoards:arr}
|
||||
let data = this.getDesignData(-1)
|
||||
data.moodboardPosition = JSON.stringify(this.store.state.UploadFilesModule.moodboardPosition)
|
||||
data.collectionId = this.store.state.HomeStoreModule.designCollectionId?this.store.state.HomeStoreModule.designCollectionId:null
|
||||
if(!await this.isPinOpen(sketchList)){
|
||||
this.isShowMark = false
|
||||
return
|
||||
}
|
||||
|
||||
let elList = document.querySelectorAll('.img_block_item_sketch img')
|
||||
Https.axiosPost(Https.httpUrls.sketchBoardsBoundingBox, data)
|
||||
.then((rv: any) => {
|
||||
@@ -314,7 +360,6 @@ export default defineComponent({
|
||||
GO.id = 0
|
||||
this.showCollectionModal =false
|
||||
this.collectionStep = 1
|
||||
this.$emit('finishCollection')
|
||||
if(this.driver__.driver){
|
||||
driverObj__.moveNext()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user