|
@@ -2059,38 +2059,42 @@ export default {
|
|
let startPos = node.selectionStart; // input 第0个字符到选中的字符
|
|
let startPos = node.selectionStart; // input 第0个字符到选中的字符
|
|
let endPos = node.selectionEnd; // 选中的字符到最后的字符
|
|
let endPos = node.selectionEnd; // 选中的字符到最后的字符
|
|
let txt = node.value;
|
|
let txt = node.value;
|
|
- let finallyLenList = this.handleJudgeExec(txt);
|
|
|
|
- if (finallyLenList.length >= 2) {
|
|
|
|
- this.$message.error('最多选择两个词包');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (startPos === 0 || endPos === 0) {
|
|
|
|
- txt += '{{' + item + '}}';
|
|
|
|
- this.examinForm.setFieldsValue({[field]: txt});
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '{{' + item + '}}' + txt.substring(endPos)});
|
|
|
|
- node.selectionStart = startPos + item.length + 6;
|
|
|
|
- node.selectionEnd = startPos + item.length + 6;
|
|
|
|
- }
|
|
|
|
- node.focus();
|
|
|
|
- node.blur();
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ let finallyLenList = this.handleJudgeExec(txt);
|
|
|
|
+ let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
|
|
|
|
+ if (updateFinallyResult.length >= 2) {
|
|
|
|
+ this.$message.error('最多选择两个词包');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (startPos === 0 || endPos === 0) {
|
|
|
|
+ txt += '{{' + item + '}}';
|
|
|
|
+ this.examinForm.setFieldsValue({[field]: txt});
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '{{' + item + '}}' + txt.substring(endPos)});
|
|
|
|
+ node.selectionStart = startPos + item.length + 6;
|
|
|
|
+ node.selectionEnd = startPos + item.length + 6;
|
|
|
|
+ }
|
|
|
|
+ node.focus();
|
|
|
|
+ node.blur();
|
|
|
|
+ });
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
const dynamicWordPackIds = [];
|
|
const dynamicWordPackIds = [];
|
|
- let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
|
|
|
|
+ let changeData = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
|
|
+ let updateChangeData = this.adNameTags.filter(item => changeData.includes(item.name)).map(val => val.name);
|
|
const inputDefaultLen = this.examinForm.getFieldsValue()[field].length;
|
|
const inputDefaultLen = this.examinForm.getFieldsValue()[field].length;
|
|
- let tagsLen = finallyLenList.length * 4;
|
|
|
|
|
|
+ let tagsLen = updateChangeData.length * 4;
|
|
let tagsSureLen = 0;
|
|
let tagsSureLen = 0;
|
|
let resultSelectSize = 0;
|
|
let resultSelectSize = 0;
|
|
this.adNameTags.forEach(item => {
|
|
this.adNameTags.forEach(item => {
|
|
- finallyLenList.forEach(val => {
|
|
|
|
|
|
+ updateChangeData.forEach(val => {
|
|
if (item.name === val) {
|
|
if (item.name === val) {
|
|
tagsSureLen += item.maxWordLen;
|
|
tagsSureLen += item.maxWordLen;
|
|
dynamicWordPackIds.push(item.creativeWordId);
|
|
dynamicWordPackIds.push(item.creativeWordId);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- finallyLenList.forEach(item => {
|
|
|
|
|
|
+ updateChangeData.forEach(item => {
|
|
tagsLen += item.length;
|
|
tagsLen += item.length;
|
|
});
|
|
});
|
|
resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
|
|
resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
|
|
@@ -2298,19 +2302,20 @@ export default {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
const dynamicWordPackIds = [];
|
|
const dynamicWordPackIds = [];
|
|
let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
|
|
+ let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
|
|
const inputDefaultLen = this.defaultFormList.filter(item => item.id === formId)[0].value.length;
|
|
const inputDefaultLen = this.defaultFormList.filter(item => item.id === formId)[0].value.length;
|
|
- let tagsLen = finallyLenList.length * 4;
|
|
|
|
|
|
+ let tagsLen = updateFinallyResult.length * 4;
|
|
let tagsSureLen = 0;
|
|
let tagsSureLen = 0;
|
|
let resultSelectSize = 0;
|
|
let resultSelectSize = 0;
|
|
this.adNameTags.forEach(item => {
|
|
this.adNameTags.forEach(item => {
|
|
- finallyLenList.forEach(val => {
|
|
|
|
|
|
+ updateFinallyResult.forEach(val => {
|
|
if (item.name === val) {
|
|
if (item.name === val) {
|
|
tagsSureLen += item.maxWordLen;
|
|
tagsSureLen += item.maxWordLen;
|
|
dynamicWordPackIds.push(item.creativeWordId);
|
|
dynamicWordPackIds.push(item.creativeWordId);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- finallyLenList.forEach(item => {
|
|
|
|
|
|
+ updateFinallyResult.forEach(item => {
|
|
tagsLen += item.length;
|
|
tagsLen += item.length;
|
|
});
|
|
});
|
|
resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
|
|
resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
|
|
@@ -2424,19 +2429,40 @@ export default {
|
|
if (res.success) {
|
|
if (res.success) {
|
|
if (res.result.slogans.length) {
|
|
if (res.result.slogans.length) {
|
|
res.result.slogans.forEach(item => {
|
|
res.result.slogans.forEach(item => {
|
|
|
|
+ let finallyLenList = this.handleJudgeExec(item.slogan);
|
|
|
|
+ let resultSelectSize = 0;
|
|
|
|
+ if (finallyLenList.length) {
|
|
|
|
+ const inputDefaultLen = item.slogan.length;
|
|
|
|
+ let tagsLen = finallyLenList.length * 4;
|
|
|
|
+ let tagsSureLen = 0;
|
|
|
|
+ this.adNameTags.forEach(item => {
|
|
|
|
+ finallyLenList.forEach(val => {
|
|
|
|
+ if (item.name === val) {
|
|
|
|
+ tagsSureLen += item.maxWordLen;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
|
+ tagsLen += item.length;
|
|
|
|
+ });
|
|
|
|
+ resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ resultSelectSize = item.slogan.length;
|
|
|
|
+ }
|
|
item.name = 'username' + item.id;
|
|
item.name = 'username' + item.id;
|
|
item.value = item.slogan;
|
|
item.value = item.slogan;
|
|
- item.lenSize = item.slogan.length,
|
|
|
|
|
|
+ item.lenSize = resultSelectSize;
|
|
item.tabStatus = 'alone';
|
|
item.tabStatus = 'alone';
|
|
item.defaultTagsList = this.adNameTags;
|
|
item.defaultTagsList = this.adNameTags;
|
|
item.updateTagsList = this.adNameTags.slice(0, 4);
|
|
item.updateTagsList = this.adNameTags.slice(0, 4);
|
|
});
|
|
});
|
|
this.defaultFormList = res.result.slogans;
|
|
this.defaultFormList = res.result.slogans;
|
|
- this.$nextTick(() => {
|
|
|
|
- this.defaultFormList.forEach(item => {
|
|
|
|
- this.defaultFormList.setFieldsValue({[item.name]: item.slogan});
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // this.defaultFormList.forEach(item => {
|
|
|
|
+ // this.defaultFormList.setFieldsValue({[item.name]: item.slogan});
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
for (let i = 0; i < 3; i++) {
|
|
for (let i = 0; i < 3; i++) {
|
|
@@ -2462,6 +2488,7 @@ export default {
|
|
this.causeVisible = true;
|
|
this.causeVisible = true;
|
|
this.recommendVisible = false;
|
|
this.recommendVisible = false;
|
|
this.titleResult = [];
|
|
this.titleResult = [];
|
|
|
|
+ this.checkArr = [];
|
|
},
|
|
},
|
|
handleCauseCancel() {
|
|
handleCauseCancel() {
|
|
this.causeVisible = false;
|
|
this.causeVisible = false;
|