Commit f4d4e8d6 by chenwq

图文编辑器

1 parent 4ec5a9de
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
</template> </template>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</template> </template>
<!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @forbid="forbidEdit"></textBox>
</el-form-item> </el-form-item>
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
...@@ -114,6 +116,7 @@ ...@@ -114,6 +116,7 @@
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common' import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default { export default {
name: 'glsx-combi-form', name: 'glsx-combi-form',
...@@ -180,6 +183,10 @@ export default { ...@@ -180,6 +183,10 @@ export default {
} }
}, },
components: {
textBox
},
mounted() { }, mounted() { },
methods: { methods: {
...@@ -255,6 +262,10 @@ export default { ...@@ -255,6 +262,10 @@ export default {
url: src, url: src,
uploadType: targetItem.uploadType || 'img' uploadType: targetItem.uploadType || 'img'
} }
},
// 获取富文本框内容
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
} }
} }
} }
......
...@@ -173,7 +173,8 @@ export default { ...@@ -173,7 +173,8 @@ export default {
customerServiceFlag: 1, customerServiceFlag: 1,
sponsorName: '', sponsorName: '',
activityBigImg: '', activityBigImg: '',
activityVideo: [] activityVideo: [],
activityDetail: ''
}, },
//商品列表 //商品列表
tableParams: { tableParams: {
...@@ -383,7 +384,9 @@ export default { ...@@ -383,7 +384,9 @@ export default {
}, },
{ {
label: '活动详情', label: '活动详情',
tips: '展示活动的详细内容' name: 'activityDetail',
tips: '展示活动的详细内容',
type: 'textBox'
}, },
{ {
label: '音乐文件', label: '音乐文件',
...@@ -655,6 +658,11 @@ export default { ...@@ -655,6 +658,11 @@ export default {
form.activityPrice = (info.activityPrice / 100).toFixed(2) form.activityPrice = (info.activityPrice / 100).toFixed(2)
form.goodsStock = info.goodsStock form.goodsStock = info.goodsStock
} }
// 活动详情
if (info.activityDetail) {
form.activityDetail = decodeURIComponent(info.activityDetail)
this.$refs.configEditFormRef.$refs.activityDetailTextBox.setEdit(info.activityDetail)
}
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
...@@ -701,20 +709,18 @@ export default { ...@@ -701,20 +709,18 @@ export default {
param.specificationDetailList.push(obj) param.specificationDetailList.push(obj)
}) })
} }
// 活动详情
if (this.editForm.activityDetail) {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
}
return param return param
}, },
handleConfirm() { handleConfirm() {
console.log(this.editForm)
this.validateRules() this.validateRules()
var flag = true var flag = true
// if(JSON.stringify(this.selectedProInfo) == '{}'){
// this.$message({
// message: '未选择商品',
// type: 'error'
// })
// flag = false
// }
if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) { if (this.nameToValSpecsList && this.nameToValSpecsList.length > 0) {
var list = this.nameToValSpecsList var list = this.nameToValSpecsList
for (var key = 0; key < list.length; key++) { for (var key = 0; key < list.length; key++) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!