This commit is contained in:
X1627315083
2024-01-26 15:12:10 +08:00
parent 085349ae8b
commit 2ec8b12fbf
4 changed files with 262 additions and 42 deletions

View File

@@ -35,7 +35,7 @@
<div class="operate_list" v-if="column?.Operations">
<div class="operate_item" @click="turnToDetail(record)">{{ $t('HistoryPage.Detail') }}</div>
<!-- <div class="operate_item" @click="renameCollection(record,index)">{{ $t('HistoryPage.Rename') }}</div> -->
<div class="operate_item" @click="exportCanvas(record)">{{ $t('HomeView.Export') }}</div>
<div class="operate_item" @click="setExport(record)">{{ $t('HomeView.Export') }}</div>
<div class="operate_item" @click="deleteGroup(record, index)">{{ $t('HistoryPage.Delete') }}</div>
</div>
</template>
@@ -64,9 +64,10 @@
</a-modal> -->
<RobotAssist></RobotAssist>
</div>
<OldExportNewCoolection id="oldExportNewCoolection" allBoardData="allBoardData"></OldExportNewCoolection>
</template>
<script lang="ts">
import { defineComponent,ref,createVNode,computed} from 'vue'
import { defineComponent,ref,createVNode,computed, nextTick} from 'vue'
import HeaderComponent from "@/component/HomePage/Header.vue";
import HistoryDetail from "@/component/Detail/HistoryDetail.vue";
import { Https } from "@/tool/https";
@@ -80,12 +81,15 @@ import html2canvas from "html2canvas";
import { useStore } from "vuex";
import { useI18n } from 'vue-i18n';
import { getCookie } from "@/tool/cookie";
import OldExportNewCoolection from "@/component/HomePage/OldExportNewCoolection.vue";
const FileSaver = require("file-saver");
export default defineComponent({
components: {
HeaderComponent,
HistoryDetail,
RobotAssist
RobotAssist,
OldExportNewCoolection
},
setup() {
let rangePickerValue:any = ref([])
@@ -113,6 +117,7 @@ export default defineComponent({
let collectionList:any = ref([])
let {t} = useI18n()
let userInfo:any = ref()
let allBoardData:any = ref({})
return {
rangePickerValue,
columns,
@@ -121,6 +126,7 @@ export default defineComponent({
t,
store,
userInfo,
allBoardData,
}
},
data(){
@@ -177,10 +183,9 @@ export default defineComponent({
endDate:endDate,
userId:83,
}
Https.axiosPost('http://192.168.1.9:5566/api/history/queryUserGroup', data).then(
Https.axiosPost('https://old.api.aida.com.hk/api/history/queryUserGroup', data).then(
(rv: any) => {
console.log(rv);
this.collectionList = rv.content
this.total = rv.total
}
@@ -212,45 +217,78 @@ export default defineComponent({
}
});
},
dealViewChooseData(data:any){
if(!data){
return []
}
let filesList = data.map((v:any)=>{
let newData:any = {
imgUrl:v.url,
id:v.id,
status:'done',
resData:v,
}
if(v.level1Type === 'Sketchboard'){
newData.pin = v.isPin
newData.category = v.level2Type
}
if(v.level1Type === 'Printboard'){
newData.pin = v.isPin
}
return newData
})
return filesList
},
//修改名字
// renameCollection(record:any,index:number){
// this.renameVisivle = true
// this.renameData = {
// ...record,
// index:index
// }
// },
//确定修改名字
// confrimRename(){
// let data = {
// timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
// userGroupId: this.renameData.id,
// userGroupName: this.newCollectionName
// }
// Https.axiosPost(Https.httpUrls.updateUserGroupName,data).then(
// (rv: any) => {
// message.success(this.t('HistoryPage.jsContent3'))
// this.collectionList[this.renameData.index].name = this.newCollectionName
// this.collectionList[this.renameData.index].updateDate = rv.updateDate
// this.renameVisivle = false
// this.newCollectionName = ''
// this.renameData = {}
// }
// );
// },
exportCanvas(recold:any){
console.log(recold);
return
let url = Https.httpUrls.historyChoose + `?userGroupId=${recold.id}`
dealHistoryChooseData(data:any,type:any){
let collectionData = {
moodboardFiles:this.dealViewChooseData(data.collection.moodBoards),
printboardFiles:this.dealViewChooseData(data.collection.printBoards),
generatePrintFiles:[],
colorBoards:this.dealViewChooseColor(data.collection.colorBoards),
skecthboardFiles:this.dealViewChooseData(data.collection.sketchBoards),
marketingSketchFiles:this.dealViewChooseData(data.collection.marketingSketchs),
moodTemplateId:data.collection.moodTemplateId
}
this.allBoardData = collectionData
// if(type === 'normal'){
// let likeDesignCollectionList = data.userLikeDetails.map((v:any)=>{
// let data = {
// ...v,
// groupDetailId:v.id,
// designItemUrl:v.url,
// }
// return data
// })
// }
},
dealViewChooseColor(data:any){
let colorList = data.map((v:any)=>{
let rgbValue = v.rgbValue.split(' ')
let newData:any = {
id:v.id,
name:v.name,
tcx:v.tcx || '',
rgbValue:{r:rgbValue[0],g:rgbValue[1],b:rgbValue[2],a:1}
}
return newData
})
return colorList
},
setExport(recold:any){
let url = 'https://old.api.aida.com.hk/api/history/choose' + `?userGroupId=${recold.id}`
Https.axiosGet(url).then(
(rv: any) => {
// this.dealHistoryChooseData(rv,type)
this.dealHistoryChooseData(rv,'')
nextTick().then(()=>{
this.exportCanvas()
})
}
).catch(rv=>{
});
let collectionReview:any = document.querySelector("#exportNewCoolection")
},
exportCanvas(){
let collectionReview:any = document.querySelector("#oldExportNewCoolection")
let a = document.createElement('a');
this.isShowMark = true
html2canvas(collectionReview,{useCORS:true,scale:3}).then((canvas) => {