Commit bffb04cf by 王志慧

Merge branch 'v3.24.0' of http://192.168.3.233:8090/saas/outbound into v3.24.0

2 parents 0e0d7765 dc67ecab
...@@ -293,7 +293,10 @@ ...@@ -293,7 +293,10 @@
@focus="handleTextBoxFocus(item)" @focus="handleTextBoxFocus(item)"
:boxHeight="item.boxHeight" :boxHeight="item.boxHeight"
:style="{ width: item.width || defaultWidth }" :style="{ width: item.width || defaultWidth }"
></textBox> :class="{'text-box-disabled':item.isDisabled}"
:disabled="item.isDisabled"
>
</textBox>
<!-- 地图 --> <!-- 地图 -->
<div <div
v-else-if="item.type === 'map'" v-else-if="item.type === 'map'"
...@@ -534,7 +537,7 @@ export default { ...@@ -534,7 +537,7 @@ export default {
this.formObj[targetItem.name] = val this.formObj[targetItem.name] = val
}, },
handleTextBoxFocus (targetItem) { handleTextBoxFocus (targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name]) if (this.formObj[targetItem.name]) this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
}, },
// 禁用富文本 // 禁用富文本
forbidEdit (targetItem) { forbidEdit (targetItem) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import E from 'wangeditor' import E from 'wangeditor'
export default { export default {
name: 'textBox', name: 'textBox',
data() { data () {
return { return {
editor: '', editor: '',
content: '', content: '',
...@@ -23,15 +23,22 @@ export default { ...@@ -23,15 +23,22 @@ export default {
boxHeight: { boxHeight: {
type: Number, type: Number,
default: 240 default: 240
} },
disabled: Boolean
}, },
mounted() { mounted () {
this.getEdit() this.getEdit()
}, },
watch: {
'disabled' (n) {
if (n) this.forbidEdit()
}
},
methods: { methods: {
getEdit() { getEdit () {
const _this = this const _this = this
this.editor = new E('#div-demo') this.editor = new E('#div-demo')
this.editor.config.focus = false
this.editor.config.uploadImgShowBase64 = true this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down' this.editor.config.menuTooltipPosition = 'down'
...@@ -47,7 +54,7 @@ export default { ...@@ -47,7 +54,7 @@ export default {
this.$emit('focus') this.$emit('focus')
} }
// 上传图片 // 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) { this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -73,7 +80,7 @@ export default { ...@@ -73,7 +80,7 @@ export default {
} }
} }
// 上传视频 // 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) { this.editor.config.customUploadVideo = function (resultFiles, insertVideoFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -101,12 +108,12 @@ export default { ...@@ -101,12 +108,12 @@ export default {
this.editor.config.onchangeTimeout = 5000 this.editor.config.onchangeTimeout = 5000
this.editor.create() this.editor.create()
}, },
setEdit(html) { setEdit (html) {
this.$nextTick(() => { this.$nextTick(() => {
this.editor.txt.html(html) this.editor.txt.html(html)
}) })
}, },
forbidEdit() { forbidEdit () {
// this.editor.$textElem.attr('contenteditable', false) // this.editor.$textElem.attr('contenteditable', false)
this.editor.disable() this.editor.disable()
} }
......
...@@ -198,7 +198,7 @@ export default { ...@@ -198,7 +198,7 @@ export default {
console.log(data) console.log(data)
this.formData.map(e => { this.formData.map(e => {
e.isDisabled = disabled e.isDisabled = disabled
if (disabled && e.name == 'description') this.$refs.formRef.forbidEdit(e) // if (disabled && e.name == 'description') this.$refs.formRef.forbidEdit(e)
if (e.name == 'merchantId') e.optionList = [{ if (e.name == 'merchantId') e.optionList = [{
confId: data.merchantId, confId: data.merchantId,
confName: data.merchantName confName: data.merchantName
...@@ -369,6 +369,17 @@ export default { ...@@ -369,6 +369,17 @@ export default {
border-color: #f56c6c !important; border-color: #f56c6c !important;
} }
} }
/deep/.text-box-disabled{
.w-e-toolbar,
.w-e-text-container{
background-color: #eee !important;
border-color: #e4e7ed !important;
&:hover{
cursor: not-allowed;
}
}
color: #c0c4cc;
}
} }
} }
.title { .title {
......
...@@ -191,6 +191,9 @@ export default { ...@@ -191,6 +191,9 @@ export default {
/deep/.el-tabs__item.is-active { /deep/.el-tabs__item.is-active {
font-weight: 700; font-weight: 700;
} }
/deep/.el-tabs__item.is-disabled{
cursor: not-allowed;
}
/deep/.el-pager { /deep/.el-pager {
line-height: 28px; line-height: 28px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!