Commit 1c103ff7 by 徐忆琳

Merge branch 'xuyl_dev_v3.12.0' into 'v3.12.0'

优化代码

See merge request !489
2 parents 15ac9be6 c73c0375
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
</template> </template>
</div> </div>
</template> </template>
<template v-else-if="!hasAttTypeOne && previewList.length==2 &&(previewList[0].attType==4 ||previewList[0].attType==6 || previewList[0].attType==7) && (previewList[1].attType==4 ||previewList[1].attType==6 || previewList[1].attType==7)">
<template v-else-if="(this.hasSevenType || this.hasFourType) && this.hasSixType && previewList.length==2">
<div <div
class="preview-info"> class="preview-info">
<img class="avatar" <img class="avatar"
...@@ -48,12 +49,6 @@ ...@@ -48,12 +49,6 @@
alt/> alt/>
<div class="preview-text text" v-html="textContent"></div> <div class="preview-text text" v-html="textContent"></div>
</template> </template>
<template v-if="!hasAttTypeOne && (item.attType == 4 || item.attType == 6 || item.attType == 7) || (item.attType == 6 &&(item.attType == 4||item.attType == 7))">
<img class="avatar"
src="@/assets/guestCustom/default-customer.png"
alt/>
<div class="preview-text text">https//dwz.cn/Fk9vs7ri</div>
</template>
</template> </template>
<template v-else-if="item.attType == 2"> <template v-else-if="item.attType == 2">
<img class="avatar" <img class="avatar"
...@@ -92,19 +87,18 @@ export default { ...@@ -92,19 +87,18 @@ export default {
currentTime: '', currentTime: '',
hasSixType: false, hasSixType: false,
hasSevenType: false, hasSevenType: false,
hasAttTypeOne: false hasFourType: false
} }
}, },
watch: { watch: {
previewList(val) { previewList(val) {
if (val.length) { if (val.length) {
let str = ''
this.hasSixType = val.some(item => item.attType == 6) this.hasSixType = val.some(item => item.attType == 6)
this.hasSevenType = val.some(item => item.attType == 7) this.hasSevenType = val.some(item => item.attType == 7)
this.hasFourType = val.some(item => item.attType == 4) this.hasFourType = val.some(item => item.attType == 4)
val.forEach(item => { val.forEach(item => {
console.log(item)
if (item.attType == 1) { if (item.attType == 1) {
this.hasAttTypeOne = true
const attContent = item.attContent const attContent = item.attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
...@@ -119,7 +113,7 @@ export default { ...@@ -119,7 +113,7 @@ export default {
}) })
this.textContent = htm this.textContent = htm
} else if (item.attType == 4 || item.attType == 6 || item.attType == 7) { } else if (item.attType == 4 || item.attType == 6 || item.attType == 7) {
let str = 'https//dwz.cn/Fk9vs7ri' str = 'https//dwz.cn/Fk9vs7ri'
this.textContent = this.textContent ? this.textContent + str : str this.textContent = this.textContent ? this.textContent + str : str
} }
}) })
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<!-- :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData"--> <!-- :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData"-->
<!-- :formRules="editRule"></glsx-combi-form>--> <!-- :formRules="editRule"></glsx-combi-form>-->
<glsx-combi-form ref="editFormRefDate" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefDate" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px"
:formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule"> :formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule">
<div slot="eventStartDate" slot-scope="scope"> <div slot="eventStartDate" slot-scope="scope">
<el-date-picker class="m-r-20" <el-date-picker class="m-r-20"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!