Browse Source

增加签名 文字描述

old
wangqing 4 years ago
parent
commit
9f027427f8
  1. 1
      package.json
  2. BIN
      public/favicon.ico
  3. 1
      src/assets/icons/image-carousel.svg
  4. 1
      src/assets/icons/image-select.svg
  5. 2
      src/assets/icons/image.svg
  6. 1
      src/assets/icons/text.svg
  7. BIN
      src/assets/images/indexLogo.png
  8. 14
      src/components/Form/DescText/index.vue
  9. 77
      src/components/Form/SignPad/index.css
  10. 125
      src/components/Form/SignPad/index.vue
  11. 33
      src/components/generator/config.js
  12. 6
      src/utils/convert.js
  13. 85
      src/views/form/RightPanel.vue
  14. 14
      src/views/form/editor.vue
  15. 100
      src/views/form/theme.vue
  16. 29
      src/views/test.vue
  17. 5
      yarn.lock

1
package.json

@ -22,6 +22,7 @@
"file-saver": "^2.0.2",
"js-cookie": "^2.2.1",
"nprogress": "^0.2.0",
"signature_pad": "^3.0.0-beta.4",
"ua-parser-js": "^0.7.23",
"vue": "^2.6.12",
"vue-clipboard2": "^0.3.1",

BIN
public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 194 KiB

1
src/assets/icons/image-carousel.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1621141930534" class="icon" viewBox="0 0 1144 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="961" xmlns:xlink="http://www.w3.org/1999/xlink" width="223.4375" height="200"><defs><style type="text/css"></style></defs><path d="M331.294118 903.529412a60.235294 60.235294 0 1 1 0 120.470588 60.235294 60.235294 0 0 1 0-120.470588z m240.941176 0a60.235294 60.235294 0 1 1 0 120.470588 60.235294 60.235294 0 0 1 0-120.470588z m240.941177 0a60.235294 60.235294 0 1 1 0 120.470588 60.235294 60.235294 0 0 1 0-120.470588z m150.588235-903.529412a180.705882 180.705882 0 0 1 180.705882 180.705882v481.882353a180.705882 180.705882 0 0 1-180.705882 180.705883H180.705882a180.705882 180.705882 0 0 1-180.705882-180.705883V180.705882a180.705882 180.705882 0 0 1 180.705882-180.705882h783.058824z m0 90.352941H180.705882a90.352941 90.352941 0 0 0-90.202353 85.052235L90.352941 180.705882v481.882353a90.352941 90.352941 0 0 0 85.052235 90.202353L180.705882 752.941176h783.058824a90.352941 90.352941 0 0 0 90.202353-85.052235L1054.117647 662.588235V180.705882a90.352941 90.352941 0 0 0-85.052235-90.202353L963.764706 90.352941zM573.259294 521.938824l5.210353 6.234352 7.137882 8.884706a145.167059 145.167059 0 0 0 215.762824 19.817412l5.903059-5.812706 34.032941-35.599059A30.117647 30.117647 0 0 1 887.265882 554.164706l-2.409411 2.891294-34.032942 35.599059a205.402353 205.402353 0 0 1-26.413176 23.280941c-89.148235 65.897412-213.985882 48.971294-281.810824-36.020706l-4.638117-6.023529-6.354824-7.890824a174.501647 174.501647 0 0 0-242.176-28.732235 30.117647 30.117647 0 1 1-36.743529-47.736471 234.736941 234.736941 0 0 1 320.572235 32.406589zM813.176471 150.588235a120.470588 120.470588 0 1 1 0 240.941177 120.470588 120.470588 0 0 1 0-240.941177z m0 60.235294a60.235294 60.235294 0 1 0 0 120.470589 60.235294 60.235294 0 0 0 0-120.470589z" p-id="962"></path></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

1
src/assets/icons/image-select.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1621142146845" class="icon" viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1655" xmlns:xlink="http://www.w3.org/1999/xlink" width="375" height="300"><defs><style type="text/css"></style></defs><path d="M1137.728 21.312H142.272A143.168 143.168 0 0 0 0 164.608v716.224C0 959.552 64 1024 142.272 1024h995.456A143.168 143.168 0 0 0 1280 880.704V164.608c0-78.784-64-143.296-142.272-143.296zM142.272 92.992h995.456c39.296 0 71.168 32.064 71.168 71.616v593.984L960 507.84l-231.104 232.768-407.68-410.56-250.112 252.032V164.608c0-39.552 31.872-71.68 71.168-71.68zM71.04 880.64v-197.376L321.28 431.232l517.376 521.152H142.272a71.424 71.424 0 0 1-71.168-71.68z m1066.624 71.68h-198.592l-160-161.152L960 609.152l248.896 250.688v20.992c0 39.424-31.872 71.552-71.168 71.552z m-284.352-501.376a142.72 142.72 0 0 0 142.272-143.232 142.72 142.72 0 0 0-142.272-143.296 142.72 142.72 0 0 0-142.272 143.296 142.72 142.72 0 0 0 142.272 143.232z m0-214.912c39.232 0 71.104 32.128 71.104 71.68 0 39.488-31.872 71.616-71.104 71.616a71.424 71.424 0 0 1-71.104-71.68c0-39.488 31.872-71.616 71.104-71.616z" p-id="1656"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

2
src/assets/icons/image.svg

@ -1 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1616919955098" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2050" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M934.4 981.312H89.6a46.08 46.08 0 0 1-46.912-46.848V89.6A46.08 46.08 0 0 1 89.6 42.688h844.8a46.08 46.08 0 0 1 46.912 46.848V934.4c0 24.96-20.352 46.848-46.912 46.848zM136.512 887.68h750.976V136.384H136.512v751.232z" fill="#2c2c2c" p-id="2051"></path><path d="M89.6 981.312a45.056 45.056 0 0 1-32.832-14.08c-18.816-18.688-18.816-48.384 0-65.536l560-560.704a45.312 45.312 0 0 1 56.32-7.808l242.56 137.408a47.36 47.36 0 0 1 17.152 64 47.552 47.552 0 0 1-64.128 17.28l-211.2-120.32-535.04 535.68a45.056 45.056 0 0 1-32.832 14.08zM330.496 494.08c-89.152 0-162.688-73.472-162.688-164.032a162.432 162.432 0 0 1 162.688-162.432c89.216 0 164.288 73.408 164.288 163.968 0 89.024-73.536 162.432-164.288 162.432z m0-232.768c-37.504 0-68.8 31.232-68.8 68.736 0 39.04 31.296 70.272 70.4 70.272 39.104 0 70.4-31.232 70.4-70.272a72.192 72.192 0 0 0-72-68.736z" fill="#2c2c2c" p-id="2052"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1621142188326" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"><defs><style type="text/css"></style></defs><path d="M856.34718025 87.13253925H168.94735803c-65.76254419 0-119.09752098 53.3349768-119.097521 119.097521v563.12414814c-1.55344592 6.2137837-1.55344592 12.16865975 0 18.1235358v30.55110322c0 65.76254419 53.3349768 119.09752098 119.097521 119.09752098h687.39982222c65.76254419 0 119.09752098-53.3349768 119.09752099-119.09752098V206.23006025c0-65.76254419-53.3349768-119.09752098-119.09752099-119.097521z m-687.39982222 72.49414322h687.39982222c25.63185778 0 46.60337778 20.97152 46.60337778 46.60337778v452.3116721c-26.92639605-36.50597925-59.5487605-76.37775803-93.46566321-107.96449185-20.19479703-18.90025876-45.3088395-26.66748839-72.75305087-22.78387359-43.23757827 6.2137837-90.61767902 42.20194765-144.72937877 109.77684544-12.94538272 16.05227457-24.59622717 32.10454914-34.17581036 45.82665482-47.63900839-65.76254419-141.36357925-187.19023408-220.84822913-243.11428742-23.56059653-16.57008987-49.96917728-20.45370469-76.89557334-11.65084444-29.25656494 9.5795832-57.73640691 34.43471803-86.7340642 75.85994272-16.82899753 23.81950419-33.91690272 53.3349768-51.26371556 88.02860247V206.23006025c0.25890765-25.89076543 20.97152-46.60337778 46.86228544-46.60337778z" fill="#707070" p-id="2481"></path><path d="M632 374.8a63 63 0 1 0 126 0 63 63 0 1 0-126 0z" fill="#707070" p-id="2482"></path></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

1
src/assets/icons/text.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1621147233884" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3283" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"><defs><style type="text/css"></style></defs><path d="M214.101333 283.861333a42.666667 42.666667 0 1 1 0-85.333333h640a42.666667 42.666667 0 1 1 0 85.333333h-277.333333v554.666667a42.666667 42.666667 0 1 1-85.333333 0v-554.666667h-277.333334z" p-id="3284"></path></svg>

After

Width:  |  Height:  |  Size: 592 B

BIN
src/assets/images/indexLogo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 20 KiB

14
src/components/Form/DescText/index.vue

@ -1,5 +1,5 @@
<template>
<p>
<p :style="{'color':color,'text-align':textAlign}">
{{ value }}
</p>
</template>
@ -11,10 +11,16 @@ export default {
value: {
type: String,
default: ''
}
},
methods: {
color: {
type: String,
default: '#000000'
},
textAlign: {
type: String,
default: 'left'
}
},
methods: {}
}
</script>

77
src/components/Form/SignPad/index.css

@ -0,0 +1,77 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
.signature-pad {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
font-size: 10px;
width: 100%;
height: 100%;
max-width: 700px;
max-height: 460px;
border: 1px solid #e8e8e8;
background-color: #fff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.08) inset;
border-radius: 4px;
padding: 16px;
}
.signature-pad::before,
.signature-pad::after {
position: absolute;
z-index: -1;
content: "";
width: 40%;
height: 10px;
bottom: 10px;
background: transparent;
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}
.signature-pad::before {
left: 20px;
-webkit-transform: skew(-3deg) rotate(-3deg);
transform: skew(-3deg) rotate(-3deg);
}
.signature-pad::after {
right: 20px;
-webkit-transform: skew(3deg) rotate(3deg);
transform: skew(3deg) rotate(3deg);
}
.signature-pad--body {
position: relative;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
border: 1px solid #f4f4f4;
}
.signature-pad--body canvas {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
border-radius: 4px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.02) inset;
}
.signature-pad--footer {
color: #c3c3c3;
text-align: center;
font-size: 1.2em;
margin-top: 8px;
}
.signature-pad--actions {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
margin-top: 8px;
}

125
src/components/Form/SignPad/index.vue

@ -0,0 +1,125 @@
<template>
<div id="signature-pad" class="signature-pad">
<div class="signature-pad--body">
<canvas v-show="!signImageUrl" class="canvasId" style="border: 2px dashed #f7f7f7;" />
</div>
<img v-if="signImageUrl" :src="signImageUrl">
<p class="desc-text">请在上面区域完成签名 然后点击确"确认"按钮</p>
<div v-if="!signImageUrl">
<el-button plain size="mini" type="danger" @click="clear">清除</el-button>
<el-button plain size="mini" type="warning" @click="undo">回撤</el-button>
<el-button size="mini" type="success" @click="savePng">确认</el-button>
</div>
<div v-if="signImageUrl">
<el-button size="mini" type="primary" @click="reSign">重签</el-button>
</div>
</div>
</template>
<script>
import SignaturePad from 'signature_pad'
export default {
name: 'SignPad',
components: {},
data() {
return {
signaturePad: null,
canvas: null,
signImageUrl: '',
config: {
minWidth: 1,
maxWidth: 3,
penColor: 'rgb(66, 133, 244)'
}
}
},
mounted() {
this.init()
window.onresize = () => {
return (() => {
this.resizeCanvas()
})()
}
this.resizeCanvas()
},
methods: {
resizeCanvas() {
console.log('resizeCanvas')
let canvas = this.canvas
// When zoomed out to less than 100%, for some very strange reason,
// some browsers report devicePixelRatio as less than 1
// and only part of the canvas is cleared then.
let ratio = Math.max(window.devicePixelRatio || 1, 1)
// This part causes the canvas to be cleared
canvas.width = canvas.offsetWidth * ratio
canvas.height = canvas.offsetHeight * ratio
canvas.getContext('2d').scale(ratio, ratio)
// This library does not listen for canvas changes, so after the canvas is automatically
// cleared by the browser, SignaturePad#isEmpty might still return false, even though the
// canvas looks empty, because the internal data of this library wasn't cleared. To make sure
// that the state of this library is consistent with visual state of the canvas, you
// have to clear it manually.
this.signaturePad.clear()
},
init() {
this.canvas = document.querySelector('.canvasId')
let canvas = this.canvas
this.signaturePad = new SignaturePad(canvas, this.config)
// canvas.height = 300
// canvas.width = 500
},
clear() {
this.signaturePad.clear()
},
undo() {
let data = this.signaturePad.toData()
if (data) {
data.pop() // remove the last dot or line
this.signaturePad.fromData(data)
}
},
savePng() {
if (this.signaturePad.isEmpty()) {
this.msgError('请先填写')
return
}
let data = this.signaturePad.toDataURL('image/png')
let file = this.dataURLtoFile(data, `${new Date().getTime()}.png`)
let param = new FormData() // form
param.append('file', file) // appendform
let config = {
headers: {'Content-Type': 'multipart/form-data'}
}
this.$api.post('/project/file/upload/77f1648542af4caf98deb8345a3d0406', param, config).then(res => {
this.signImageUrl = res.data
})
},
reSign() {
this.signImageUrl = ''
this.signaturePad.clear()
},
dataURLtoFile(dataurl, filename) {
// base64
const arr = dataurl.split(',')
// base64
const bstr = window.atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n) // 0length
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new File([u8arr], filename, {
type: 'image/png'
})
}
}
}
</script>
<style scoped>
@import "index.css";
.sign-pad-container {
padding: 1px;
}
</style>

33
src/components/generator/config.js

@ -489,7 +489,7 @@ export const selectComponents = [
}
]
// 布局型组件 【左面板】
// 图片型组件 【左面板】
export const imageComponents = [
{
typeId: 'IMAGE',
@ -529,7 +529,7 @@ export const imageComponents = [
showClearable: false,
showRegList: false,
tag: 'el-carousel',
tagIcon: 'image',
tagIcon: 'image-carousel',
layout: 'colFormItem',
span: 24,
required: true,
@ -556,7 +556,7 @@ export const imageComponents = [
showClearable: false,
showRegList: false,
tag: 'image-select',
tagIcon: 'image',
tagIcon: 'image-select',
layout: 'colFormItem',
span: 24,
required: true,
@ -564,12 +564,35 @@ export const imageComponents = [
changeTag: true
},
multiple: false,
__slot__: {
options: [{
label: '选项1',
value: 1
}]
}],
style: {width: '100%'}
}
]
// 辅助型组件 【左面板】
export const assistComponents = [
{
typeId: 'DESC_TEXT',
__config__: {
label: '文字描述',
defaultValue: '描述文字',
showDefaultValue: true,
showRequired: false,
showClearable: false,
showRegList: false,
tag: 'desc-text',
tagIcon: 'text',
layout: 'colFormItem',
span: 24,
required: true,
regList: [],
changeTag: false
},
color: '',
textAlign: 'left',
style: {width: '100%'}
}
]

6
src/utils/convert.js

@ -3,7 +3,7 @@
*
*/
import _ from 'lodash'
import {imageComponents, inputComponents, selectComponents} from '@/components/generator/config'
import {assistComponents, imageComponents, inputComponents, selectComponents} from '@/components/generator/config'
/**
* 表单json转换为后台需要的对象
@ -48,7 +48,7 @@ export function dbDataConvertForItemJson(data) {
}
if (!typeMap.size > 0) {
// 根据类型获取默认数据
_.concat(inputComponents, selectComponents, imageComponents).forEach(item => {
_.concat(inputComponents, selectComponents, imageComponents, assistComponents).forEach(item => {
typeMap.set(item.typeId, item)
})
}
@ -171,7 +171,7 @@ const dataParams = {
},
// 图片选择
'IMAGE_SELECT': {
'options': '__slot__.options',
'options': 'options',
'multiple': 'multiple'
},
// 图片轮播

85
src/views/form/RightPanel.vue

@ -7,7 +7,7 @@
<el-scrollbar class="right-scrollbar">
<!-- 组件属性 -->
<el-form v-show="currentTab==='field' && showField" size="small" label-width="90px">
<el-form-item v-if="activeData.__config__.changeTag" label="组件类型">
<el-form-item v-if="activeData.__config__.changeTag" label="组件类型" >
<el-select
v-model="activeData.__config__.tagIcon"
placeholder="请选择组件类型"
@ -365,7 +365,7 @@
</template>
<template
v-if="['image-select','el-carousel'].indexOf(activeData.__config__.tag) > -1"
v-if="['el-carousel'].indexOf(activeData.__config__.tag) > -1"
>
<el-divider>选项</el-divider>
<draggable
@ -410,6 +410,64 @@
</div>
</div>
</draggable>
<div style="margin-left: 20px;">
<el-button
style="padding-bottom: 0;"
icon="el-icon-circle-plus-outline"
type="text"
@click="addImageCarouselItem "
>
添加选项
</el-button>
</div>
<el-divider/>
</template>
<template
v-if="['image-select'].indexOf(activeData.__config__.tag) > -1"
>
<el-divider>选项</el-divider>
<draggable
:list="activeData.options"
:animation="340"
group="selectItem"
handle=".option-drag"
>
<div v-for="(item, index) in activeData.options" :key="index" class="select-item">
<div class="select-line-icon option-drag">
<i class="el-icon-s-operation"/>
</div>
<div class="width-full">
<div class="flex-row">
<el-input v-model="item.label" placeholder="选项名" size="small"/>
<div class="close-btn select-line-icon"
@click="activeData.options.splice(index, 1)"
>
<i class="el-icon-remove-outline"/>
</div>
</div>
<div class="flex-row">
<el-input v-model="item.image" placeholder="图片" size="small"/>
<el-upload
ref="logoUpload"
style="text-align: center;"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:headers="getUploadHeader"
:on-success="(response, file, fileList)=>{
item.image = response.data
$set(activeData.options,index,item)
closeUploadProgressHandle()
}"
:on-progress="uploadProgressHandle"
:action="getUploadUrl"
:show-file-list="false">
<div class=" select-line-icon" slot="trigger">
<i class="el-icon-upload"/>
</div>
</el-upload>
</div>
</div>
</div>
</draggable>
<div style="margin-left: 20px;">
<el-button
style="padding-bottom: 0;"
@ -618,6 +676,22 @@
<el-form-item v-if="activeData.__config__.tag === 'el-select'" label="是否多选">
<el-switch v-model="activeData.multiple" @change="multipleChange"/>
</el-form-item>
<el-form-item v-if="activeData['color'] !== undefined" label="颜色">
<el-color-picker v-model="activeData['color']"/>
</el-form-item>
<el-form-item v-if="activeData['textAlign'] !== undefined" label="颜色">
<el-radio-group v-model="activeData.textAlign">
<el-radio-button label="left">
左对齐
</el-radio-button>
<el-radio-button label="center">
居中
</el-radio-button>
<el-radio-button label="right">
右对齐
</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item v-if="activeData.__config__.tag === 'el-image'" label="图片地址">
<el-input v-model="activeData.src" placeholder="请输入图片url地址"/>
<el-upload
@ -962,6 +1036,13 @@ export default {
})
},
addImageSelectItem() {
this.activeData.options.push({
label: '',
image: '',
value: this.activeData.options.length + 1
})
},
addImageCarouselItem() {
this.activeData.__slot__.options.push({
label: '',
image: '',

14
src/views/form/editor.vue

@ -111,7 +111,13 @@ import draggable from 'vuedraggable'
import {debounce} from 'throttle-debounce'
import RightPanel from './RightPanel'
import {formConf, imageComponents, inputComponents, selectComponents} from '@/components/generator/config'
import {
assistComponents,
formConf,
imageComponents,
inputComponents,
selectComponents
} from '@/components/generator/config'
import {deepClone} from '@/utils/index'
import {dbDataConvertForItemJson, formItemConvertData} from '@/utils/convert'
import drawingDefalut from '@/components/generator/drawingDefalut'
@ -157,6 +163,10 @@ export default {
title: '图片型组件',
list: imageComponents
},
{
title: '辅助型组件',
list: assistComponents
},
{
title: '选择型组件',
list: selectComponents
@ -281,9 +291,11 @@ export default {
params.afterPosition = sort2
}
params.formItemId = this.drawingList[obj.newIndex].__config__.formId
if (params.beforePosition || params.afterPosition) {
this.$api.post('/user/project/item/sort', params).then(res => {
this.drawingList[obj.newIndex].sort = res.data.sort
})
}
},
addComponent(item) {
const clone = this.cloneComponent(item)

100
src/views/form/theme.vue

@ -1,9 +1,7 @@
<template>
<div class="theme-container">
<el-row>
<el-col :span="5" :offset="1">
<el-scrollbar>
<div class="left-container">
<el-scrollbar class="left-scrollbar-container">
<p class="theme-title">外观主题</p>
<el-row>
<el-col :span="3">
@ -32,73 +30,69 @@
<el-col
v-for="c in colorList"
:key="c" :class="{'style-btn-active':activeColor==c}"
:span="3"
:style="{backgroundColor: c}"
class="color-btn"
:span="3" @click.native="activeColorHandle(c)"
class="color-btn" @click.native="activeColorHandle(c)"
/>
</el-row>
<el-row>
<el-col
v-for="t in themeList"
:key="t.id"
class="theme-img-view" :span="8"
:span="8" class="theme-img-view"
@click.native="activeThemeHandle(t)"
>
<p :class="{'head-list-view-select':activeTheme.id==t.id}">
<el-image
:class="{'head-list-img-active':activeTheme.id==t.id}"
class="head-list-img"
style="width: 100px; height: 100px;"
:src="t.headImgUrl"
class="head-list-img"
fit="cover"
style="width: 100px; height: 100px;"
/>
</p>
</el-col>
</el-row>
</div>
</el-scrollbar>
</el-col>
<el-col :offset="0" :span="14">
</div>
<pre-view :key="projectFormKey" :project-key="projectKey" />
</el-col>
<el-col :span="4">
<div class="right-container">
<p class="right-title">外观设置</p>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">添加logo</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="showSettings.logoSetting"
/>
</el-col>
</el-row>
<el-row v-if="showSettings.logoSetting" type="flex" align="middle">
<el-row v-if="showSettings.logoSetting" align="middle" type="flex">
<el-col :span="6">
<span class="option-line-sub-title">logo设置</span>
</el-col>
<el-col :span="4">
<img
v-if="userProjectTheme.logoImg"
style="width: 30px; height: 30px;"
:src="userProjectTheme.logoImg"
style="width: 30px; height: 30px;"
>
</el-col>
<el-col :span="8" :offset="6">
<el-col :offset="6" :span="8">
<el-upload
ref="logoUpload"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadLogoHandle"
:action="getUploadUrl"
:show-file-list="false"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
>
<el-button slot="trigger" size="small" type="text">上传Logo</el-button>
</el-upload>
</el-col>
</el-row>
<el-row v-if="showSettings.logoSetting" type="flex" align="middle">
<el-row v-if="showSettings.logoSetting" align="middle" type="flex">
<el-col :span="6">
<span class="option-line-sub-title">logo位置</span>
</el-col>
@ -113,11 +107,11 @@
</el-radio-group>
</el-col>
</el-row>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">背景设置</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="showSettings.backgroundSetting"
@change="()=>{
@ -129,7 +123,7 @@
</el-col>
</el-row>
<el-row v-if="showSettings.backgroundSetting">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<span class="option-line-sub-title">背景类型</span>
</el-col>
@ -148,7 +142,7 @@
</el-row>
</el-row>
<el-row v-if="showSettings.backgroundSetting&&showSettings.backgroundType=='color'">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<span class="option-line-sub-title">选择颜色</span>
</el-col>
@ -162,76 +156,76 @@
</el-row>
</el-row>
<el-row v-if="showSettings.backgroundType=='img'">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<span class="option-line-sub-title">选择图片</span>
</el-col>
<el-col :spvan="18">
<el-upload
ref="upload"
class="upload-demo"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadBackgroundHandle"
:action="getUploadUrl"
:show-file-list="false"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
class="upload-demo"
>
<el-button slot="trigger" size="small" type="text">上传背景</el-button>
</el-upload>
</el-col>
</el-row>
</el-row>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">按钮设置</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="showSettings.btnSetting"
/>
</el-col>
</el-row>
<el-row v-if="showSettings.btnSetting">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<span class="option-line-sub-title">按钮提示文字</span>
</el-col>
<el-col :spvan="10">
<el-input v-model="userProjectTheme.submitBtnText"
style="width: 80%;"
placeholder="请输入内容"
size="mini" @change="saveUserTheme"
size="mini"
style="width: 80%;" @change="saveUserTheme"
/>
</el-col>
</el-row>
</el-row>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">显示标题</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="userProjectTheme.showTitle"
@change="saveUserTheme"
/>
</el-col>
</el-row>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">显示描述</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="userProjectTheme.showDescribe"
@change="saveUserTheme"
/>
</el-col>
</el-row>
<el-row class="option-line-view" type="flex" align="middle">
<el-row align="middle" class="option-line-view" type="flex">
<el-col :span="8">
<span class="option-line-title">显示序号</span>
</el-col>
<el-col :span="8" :offset="8">
<el-col :offset="8" :span="8">
<el-switch
v-model="userProjectTheme.showNumber"
@change="saveUserTheme"
@ -239,8 +233,6 @@
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</div>
</template>
@ -399,14 +391,26 @@ export default {
height: 100%;
background-color: #f7f7f7;
overflow: hidden;
display: flex;
flex-direction: row;
box-sizing: border-box;
justify-content: center;
}
.left-container {
line-height: 20px;
border-radius: 7px;
text-align: center;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 100);
background-color: white;
height: 90vh;
width: 20%;
height: calc(100vh - 60px);
}
.left-scrollbar-container {
height: 100%;
margin: 20px;
}
::v-deep .el-scrollbar__wrap {
overflow-x: hidden !important;
}
.style-btn {
line-height: 30px;
@ -417,6 +421,9 @@ export default {
text-align: center;
border: 1px solid #eaeaea;
}
.preview-container {
width: 70%;
}
.theme-title {
color: rgba(16, 16, 16, 100);
font-size: 24px;
@ -470,13 +477,14 @@ export default {
}
.right-container {
width: 310px;
height: 78vh;
height: calc(100vh - 60px);
line-height: 20px;
text-align: center;
padding: 22px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.4);
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 100);
background-color: white;
margin-right: 5px;
}
.right-title {
color: rgba(16, 16, 16, 100);

29
src/views/test.vue

@ -1,46 +1,25 @@
<template>
<div>
<image-select v-model="radio" :options="options" :multiple="false" />
<el-radio-group v-model="radio">
<el-radio :label="3">备选项</el-radio>
<el-radio :label="6">备选项</el-radio>
<el-radio :label="9">备选项</el-radio>
</el-radio-group>
<sign-pad />
</div>
</template>
<script>
import SignPad from '@/components/form/SignPad'
export default {
name: 'App',
components: {
SignPad
},
data() {
return {
options: [{
'label': '选项一',
'value': 1,
'image': 'https://freebrio.oss-cn-shanghai.aliyuncs.com/05f1fb3e58764a48a5094f0bc9351bd3.png'
}, {
'label': '选项二',
'value': 2,
'image': 'https://freebrio.oss-cn-shanghai.aliyuncs.com/062cf61ad5724ac3bc99f0341b3770da.png'
}],
radio: [1]
}
},
mounted() {
},
methods: {
success(params) {
// eslint-disable-next-line no-debugger
// params , 便
console.log(params)
},
useVerify() {
this.$refs.verify.show()
}
}
}
</script>

5
yarn.lock

@ -9528,6 +9528,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
resolved "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=
signature_pad@^3.0.0-beta.4:
version "3.0.0-beta.4"
resolved "https://registry.npm.taobao.org/signature_pad/download/signature_pad-3.0.0-beta.4.tgz#2a8441559e9f439e7f2f525da3ee630ef973ecf6"
integrity sha1-KoRBVZ6fQ55/L1Jdo+5jDvlz7PY=
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.npm.taobao.org/simple-swizzle/download/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"

Loading…
Cancel
Save