|
@@ -4,7 +4,8 @@
|
4
|
4
|
@confirm="confirmEvent"
|
5
|
5
|
@close="closeEvent"
|
6
|
6
|
width="800px"
|
7
|
|
- minheight="360px"
|
|
7
|
+ height="420px"
|
|
8
|
+ minheight="400px"
|
8
|
9
|
:dialog-title="title">
|
9
|
10
|
<template v-slot:content>
|
10
|
11
|
<div class="dialogBox" v-loading="loading">
|
|
@@ -27,8 +28,9 @@
|
27
|
28
|
</div>
|
28
|
29
|
</div>
|
29
|
30
|
<div class="tips">系统会根据您填写的文案长度,自动设配不同要求的创意形式,添加多个文案请换行</div>
|
30
|
|
- <el-input id="emojiInput" v-model="text_textarea" resize="none" :rows="12" type="textarea" style="width: 100%;"/>
|
|
31
|
+ <el-input id="emojiInput" v-model="text_textarea" resize="none" :rows="12" type="textarea" :class="[errFlag?'errInput':'']" style="width: 100%;"/>
|
31
|
32
|
</div>
|
|
33
|
+ <p class="errHint" v-if="errFlag">仅支持编辑单条文案</p>
|
32
|
34
|
</div>
|
33
|
35
|
</template>
|
34
|
36
|
</Dialog>
|
|
@@ -83,6 +85,7 @@ const appendText = (val:any) => {
|
83
|
85
|
//添加文案-确定
|
84
|
86
|
const loading = ref<boolean>(false)
|
85
|
87
|
const text_textarea = ref<string>('')
|
|
88
|
+const errFlag = ref(false)
|
86
|
89
|
// 提交前判断是否为空
|
87
|
90
|
//关闭
|
88
|
91
|
const closeEvent = () => {
|
|
@@ -96,7 +99,9 @@ const confirmEvent = async ()=>{
|
96
|
99
|
} else if(text_textarea.value == ''){
|
97
|
100
|
ElMessage.error('请输入文案')
|
98
|
101
|
return
|
99
|
|
- } else {
|
|
102
|
+ } else if(errFlag.value){
|
|
103
|
+ return
|
|
104
|
+ }else{
|
100
|
105
|
if(typeof typeRef.value!.textVal == 'number'){}else{
|
101
|
106
|
await typeRef.value!.add_type()
|
102
|
107
|
}
|
|
@@ -130,6 +135,11 @@ const getRows = ()=>{
|
130
|
135
|
count++
|
131
|
136
|
}
|
132
|
137
|
})
|
|
138
|
+ if(count>1 && props.title == '编辑文案'){
|
|
139
|
+ errFlag.value = true
|
|
140
|
+ }else{
|
|
141
|
+ errFlag.value = false
|
|
142
|
+ }
|
133
|
143
|
return count
|
134
|
144
|
}
|
135
|
145
|
|
|
@@ -208,4 +218,12 @@ onMounted(()=>{
|
208
|
218
|
font-size: 12px;
|
209
|
219
|
}
|
210
|
220
|
}
|
|
221
|
+.errInput{
|
|
222
|
+ border: 1px solid red;
|
|
223
|
+}
|
|
224
|
+.errHint{
|
|
225
|
+ color: red;
|
|
226
|
+ font-size: 12px;
|
|
227
|
+ line-height: 20px;
|
|
228
|
+}
|
211
|
229
|
</style>
|