Commit 5d96362a by zhangquan

ui初版

1 parent 37465db3
<template>
<div class="bar-content">
<label for="" class="content-label">{{label}}</label>
<div class="editor">
<quill-editor ref="myQuillEditor" class="quill" v-model="content[key]" :options="editorOption"></quill-editor>
<div class="extend-bar">
<i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i>
</div>
</div>
</div>
</template>
<script>
import { quillEditor, Quill } from 'vue-quill-editor'
import Label from '@/util/quillTool'
Quill.register(Label, true)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
export default {
name: 'FoldFrame',
components:{
quillEditor,
},
props: {
content: {
type: Object,
default: ()=>{
return {}
},
},
key: {
type: String,
default: '',
},
label:{
type: String,
default: '',
},
editorOption: {
type: String,
default: ()=>{
return {
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
// [{ list: 'ordered' }],
// [{ script: 'sub' }, { script: 'super' }],
[{ color: [] }, { background: [] }],
[{'indent': '-1'}, {'indent': '+1'}],
[{ align: [] }],
[{ size: ['small', false, 'large', 'huge'] }],
// ['clean']
// ['link', 'image']
],
}
}
}
}
}
},
data() {
return {
}
},
methods: {
insertContent(){
let quill = this.$refs.myQuillEditor.quill;
let length = quill.selection.savedRange.index;
quill.insertEmbed(length, 'label', 132);
quill.setSelection(length + 1);
}
}
}
</script>
<style lang="scss" scoped>
.bar-content{
background: #F9F9F9;
padding: 20px;
margin-bottom: 10px;
.content-label{
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
.editor{
display: inline-block;
background-color: #fff;
.quill{
background-color: #fff;
display: inline-block;
border-color: #E5E5E5;
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
}
/deep/ .ql-label{
color: #26a2ff;
}
}
.extend-bar{
width: 100%;
height: 40px;
padding: 0 20px;
line-height: 40px;
margin-top: -1px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
.extend-icon{
cursor: pointer;
&::before{
// font-size: 16px;
margin-right: 5px;
}
font-size: 14px;
color: #666;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="table-wrap">
<table>
<tr>
<th rowspan="2">规格</th>
<th rowspan="2">价格区间(万元)</th>
<th rowspan="2">价格系数</th>
<th colspan="2">1年版</th>
<th colspan="2">2年版</th>
<th colspan="2">3年版</th>
</tr>
<tr>
<th>上架成本</th>
<th>销售成本</th>
<th>上架成本</th>
<th>销售成本</th>
<th>上架成本</th>
<th>销售成本</th>
</tr>
<tr>
<td rowspan="4">A</td>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: 'ServicesTable',
props: {
name: {
type: String,
default: ''
},
url: {
type: String,
default: ''
},
key: {
type: String,
default: ''
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.table-wrap{
th, td{
border: 1px solid #E5E5E5;
padding: 0 16px;
vertical-align: middle;
text-align: center;
}
th{
background: #F4F6FC;
font-weight: 600;
font-size: 14px;
color: #333333;
}
td{
font-weight: 400;
font-size: 14px;
color: #666666;
}
}
</style>
\ No newline at end of file
<template>
<div class="upload-wrap">
<div class="upload-ctnr">
<label v-if="name" class="label" for="">{{name}}</label>
<div class="add-img" :style="defaultStyle">
<i class="el-icon-plus add"></i>
<p>上传照片</p>
<div :class="['upload-wrap']" :style="defaultStyle">
<img v-if="url" class="image" :src="url" alt="" />
<div v-else class="add-img">
<i class="el-icon-plus add"></i>
<p>上传照片</p>
</div>
<div class="operate" v-if="url">
<div class="btn-wrap">
<i class="el-icon-view"></i>
<i class="el-icon-delete"></i>
</div>
</div>
</div>
</div>
</template>
......@@ -18,7 +27,7 @@
},
url: {
type: String,
default: ''
default: 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/glsx/logo_menu.png'
},
key: {
type: String,
......@@ -42,8 +51,7 @@
}
</script>
<style lang="scss" scoped>
.upload-wrap{
cursor: pointer;
.upload-ctnr{
.label{
display: inline-block;
vertical-align: top;
......@@ -55,24 +63,67 @@
line-height: 20px;
box-sizing: border-box;
}
.add-img{
box-sizing: border-box;
.upload-wrap{
display: inline-flex;
border: 1px dashed #00000026;
// box-sizing: border-box;
width: 104px;
height: 104px;
background: #0000000a;
border: 1px dashed #00000026;
border-radius: 4px;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
.add {
font-size: 18px;
position: relative;
&:hover{
.operate{
display: block;
}
}
.image{
width: 100%;
height: 100%;
z-index: 2;
position: relative;
}
.add-img{
width: 100%;
height: 100%;
cursor: pointer;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
.add {
font-size: 18px;
}
p {
height: 32px;
line-height: 32px;
}
}
p {
height: 32px;
line-height: 32px;
.operate{
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 4px;
z-index: 5;
.btn-wrap{
color: #fff;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
i{
font-size: 16px;
cursor: pointer;
&:first-child{
margin-right: 12px;
}
}
}
}
}
}
......
......@@ -5,26 +5,18 @@
<div class="edit-bar">
<FoldFrame name="Logo区域">
<div class="bar-content">
<Upload name="Logo图:" :defaultStyle="{width:'208px'}"></Upload>
<Upload class="upload" name="Logo图:" :defaultStyle="{width:'208px'}"></Upload>
<span class="upload-tip">建议高度:48px</span>
</div>
</FoldFrame>
<FoldFrame name="合同介绍区域">
<div class="bar-content">
<label for="" class="content-label">标题和介绍:</label>
<div class="editor">
<quill-editor ref="myQuillEditor" class="quill" v-model="serviceContent" :options="editorOption"></quill-editor>
<div class="extend-bar">
<i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i>
</div>
</div>
</div>
<Editor label="标题和介绍:" :content="obj" key="content"></Editor>
</FoldFrame>
</div>
<div class="preview-area">
<div v-html="serviceContent"></div>
<div v-html="obj.content"></div>
</div>
<button @click="cons">dasdasdas</button>
</div>
</div>
</template>
......@@ -32,51 +24,29 @@
<script>
import FoldFrame from './components/FoldFrame'
import Upload from '@/components/Upload'
import { quillEditor, Quill } from 'vue-quill-editor'
import Label from '@/util/quillTool'
Quill.register(Label, true)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import Editor from '@/components/Editor'
export default {
name: 'AddTmpl',
components:{
quillEditor,
Editor,
Upload,
FoldFrame
},
data() {
return {
serviceContent: '',
editorOption: {
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
// [{ list: 'ordered' }],
// [{ script: 'sub' }, { script: 'super' }],
[{ color: [] }, { background: [] }],
[{'indent': '-1'}, {'indent': '+1'}],
[{ align: [] }],
[{ size: ['small', false, 'large', 'huge'] }],
// ['clean']
// ['link', 'image']
],
}
}
},
obj: {
content: ''
}
}
},
mounted() {
},
methods: {
insertContent(){
let quill = this.$refs.myQuillEditor.quill;
let length = quill.selection.savedRange.index;
quill.insertEmbed(length, 'label', 132);
quill.setSelection(length + 1);
cons(){
console.log(this.obj.content)
}
}
}
......@@ -92,54 +62,7 @@ export default {
background: #F9F9F9;
padding: 20px;
margin-bottom: 10px;
.content-label{
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
.editor{
display: inline-block;
background-color: #fff;
.quill{
background-color: #fff;
display: inline-block;
border-color: #E5E5E5;
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
}
/deep/ .ql-label{
color: #26a2ff;
}
}
.extend-bar{
width: 100%;
height: 40px;
padding: 0 20px;
line-height: 40px;
margin-top: -1px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
.extend-icon{
cursor: pointer;
&::before{
// font-size: 16px;
margin-right: 5px;
}
font-size: 14px;
color: #666;
}
}
}
.upload-wrap{
.upload{
display: inline-block;
}
.upload-tip{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!