|
@@ -460,11 +460,13 @@
|
|
</p>
|
|
</p>
|
|
<!-- </p> -->
|
|
<!-- </p> -->
|
|
<em>
|
|
<em>
|
|
- <!-- {{item.content}} -->
|
|
|
|
<p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
|
|
<p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
|
|
- {{item.content.msg1}}
|
|
|
|
- <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
|
|
|
|
- {{item.content.msg3}}
|
|
|
|
|
|
+ <template v-for="listItem in item.newContent">
|
|
|
|
+ <template v-if="listItem.type == 'user'">
|
|
|
|
+ <ww-open-data type='userName' :openid='listItem.value'></ww-open-data>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="listItem.type == 'text'">{{ listItem.value }}</template>
|
|
|
|
+ </template>
|
|
</p>
|
|
</p>
|
|
<p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
|
|
<p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
|
|
<!-- 重启原因和责任人 -->
|
|
<!-- 重启原因和责任人 -->
|
|
@@ -1172,25 +1174,26 @@ export default {
|
|
this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
|
|
this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
- for(var i in res.data) {
|
|
|
|
- if(res.data[i].content.indexOf('$userName=') != '-1') {
|
|
|
|
- let obj = {
|
|
|
|
- msg1: res.data[i].content.split('$')[0],
|
|
|
|
- msg2: res.data[i].content.split('$')[1].split('=')[1],
|
|
|
|
- msg3: res.data[i].content.split('$')[2]
|
|
|
|
- }
|
|
|
|
- res.data[i].content = obj
|
|
|
|
- } else {
|
|
|
|
- if(this.user.userNameNeedTranslate == 1) {
|
|
|
|
- let obj = {
|
|
|
|
- msg1: res.data[i].content,
|
|
|
|
- msg2: '',
|
|
|
|
- msg3: ''
|
|
|
|
|
|
+ if(this.user.userNameNeedTranslate == 1) {
|
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
|
+ const originalString = res.data[i].content;
|
|
|
|
+ const regex = /\$userName=[^$]*\$|[^$]+/g;
|
|
|
|
+ const parts = originalString.match(regex);
|
|
|
|
+ console.log(parts);
|
|
|
|
+ let newArrList = [];
|
|
|
|
+ for (let j = 0; j < parts.length; j++) {
|
|
|
|
+ const newStr = parts[j];
|
|
|
|
+ if (newStr.startsWith('$userName=')) {
|
|
|
|
+ const userName = newStr.slice(10, -1);
|
|
|
|
+ newArrList.push({ type: 'user', value: userName });
|
|
|
|
+ } else {
|
|
|
|
+ newArrList.push({ type: 'text', value: newStr });
|
|
}
|
|
}
|
|
- res.data[i].content = obj
|
|
|
|
}
|
|
}
|
|
|
|
+ res.data[i].newContent = newArrList;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(res.data, '<==== 看看看看')
|
|
this.commentList = res.data
|
|
this.commentList = res.data
|
|
this.sppk(this.commentList) // 获取参与人的方法
|
|
this.sppk(this.commentList) // 获取参与人的方法
|
|
this.contRoll()
|
|
this.contRoll()
|