Merge pull request #2776 from dataease/dev

dev
This commit is contained in:
王嘉豪 2022-08-03 15:49:34 +08:00 committed by GitHub
commit d6e6551677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 20 deletions

View File

@ -80,11 +80,14 @@ public class PanelTemplateService {
exampleDelete.createCriteria().andPidEqualTo(request.getPid()).andNameEqualTo(request.getName());
panelTemplateMapper.deleteByExample(exampleDelete);
}
//Store static resource into the server
staticResourceService.saveFilesToServe(request.getStaticResource());
String snapshotName = "template-" + request.getId() + ".jpeg";
staticResourceService.saveSingleFileToServe(snapshotName,request.getSnapshot().replace("data:image/jpeg;base64,","") );
request.setSnapshot("/"+UPLOAD_URL_PREFIX+'/'+snapshotName);
if ("template".equals(request.getNodeType())) {
//Store static resource into the server
staticResourceService.saveFilesToServe(request.getStaticResource());
String snapshotName = "template-" + request.getId() + ".jpeg";
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
request.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
}
panelTemplateMapper.insert(request);
} else {
String nameCheckResult = this.nameCheck(CommonConstants.OPT_TYPE.UPDATE, request.getName(), request.getPid(), request.getId());

View File

@ -5,7 +5,7 @@
<el-checkbox v-model="linkageInfo.linkageActive" size="medium" />
<linkage-field v-if="linkageInfo.linkageActive" :element="element" />
</div>
<div v-if="positionCheck('multiplexing')" style="margin-right: 1px;width: 18px;z-index: 5">
<div v-if="positionCheck('multiplexing') && showMultiplexingCheck" style="margin-right: 1px;width: 18px;z-index: 5">
<el-checkbox v-model="multiplexingCheckModel" size="medium" @change="multiplexingCheck" />
</div>
<div v-if="batchOptAreaShow" style="margin-right: -1px;width: 20px;z-index: 5">
@ -108,6 +108,16 @@ export default {
mounted() {
},
computed: {
curComponentTypes() {
const types = []
this.componentData.forEach(component => {
types.push(component.type)
})
return types
},
showMultiplexingCheck() {
return this.element.type !== 'custom-button' || (this.element.type === 'custom-button' && !this.curComponentTypes.includes('custom-button'))
},
showEditPosition() {
if (this.activeModel === 'edit' && !this.linkageAreaShow && !this.batchOptAreaShow) {
const toRight = (this.canvasStyleData.width - this.element.style.left - this.element.style.width) * this.curCanvasScale.scalePointWidth

View File

@ -25,6 +25,9 @@ export default {
},
baseUrl: {
type: String
},
width: {
type: Number
}
},
data() {
@ -34,6 +37,8 @@ export default {
computed: {
classBackground() {
return {
width: this.width + 'px',
height: this.width * 0.58 + 'px',
background: `url(${this.thumbnailUrl}) no-repeat`,
'background-size': `100% 100%`
}
@ -66,12 +71,12 @@ export default {
.testcase-template {
position: relative;
display: inline-block;
margin: 24px 0 0 0;
margin: 0;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
border: solid 2px #fff;
box-sizing: border-box;
border-radius: 4px;
height: 256px;
width: 100%;
}
.demonstration {
@ -87,8 +92,6 @@ export default {
.template-img {
background-size: 100% 100%;
height: 180px;
width: 318px;
margin: 0 auto;
border: solid 2px #fff;
box-sizing: border-box;
@ -110,7 +113,10 @@ export default {
position:absolute;
bottom: 5px;
left: 0px;
width: 318px;
width: 100%;
}
.bottom-area{
height: 75px;
}
</style>

View File

@ -22,12 +22,13 @@
v-for="(templateItem) in currentMarketTemplateShowList"
v-show="templateItem.showFlag"
:key="templateItem.id"
style="text-align: center"
style="text-align: center;padding: 24px 12px 0 12px"
:style="{width: templateSpan}"
>
<template-market-item
:template="templateItem"
:base-url="baseUrl"
:width="templateCurWidth"
@templateApply="templateApply"
@templatePreview="templatePreview"
/>
@ -85,7 +86,6 @@ import { groupTree, panelSave } from '@/api/panel/panel'
import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel'
import MarketPreview from '@/views/panel/templateMarket/component/MarketPreview'
import elementResizeDetectorMaker from 'element-resize-detector'
import { PHONE_REGEX } from '@/utils/validate'
export default {
name: 'TemplateMarket',
@ -94,6 +94,7 @@ export default {
return {
hasResult: true,
templateMiniWidth: 330,
templateCurWidth: 310,
templateSpan: '25%',
previewModel: false,
previewVisible: false,
@ -155,8 +156,9 @@ export default {
// div
erd.listenTo(templateMainDom, element => {
_this.$nextTick(() => {
const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)
_this.templateSpan = (100 / Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)) + '%'
console.log('templateSpan=' + _this.templateSpan)
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 32
})
})
},
@ -260,7 +262,7 @@ export default {
.template-main{
text-align: center;
border-radius: 4px;
padding-bottom: 24px;
padding: 0 12px 24px 12px;
height: calc(100vh - 190px)!important;
overflow-x: hidden;
overflow-y: auto;

View File

@ -719,8 +719,8 @@ export default {
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
color: var(----deTextPrimary, #1F2329);
border: 1px solid var(--deBorderBase, #BBBFC4);
margin-left: 12px;
}
@ -755,9 +755,6 @@ export default {
.name-email-search {
width: 240px;
::v-deep input {
border-color: #bbbfc4;
}
}
.active-btn {