refactor: 发送站内通知, 页面修改

This commit is contained in:
Captain.B 2021-08-19 18:36:49 +08:00 committed by 刘瑞斌
parent fae8ff5f8c
commit 4453b0018a
12 changed files with 435 additions and 359 deletions

View File

@ -288,23 +288,36 @@ export default {
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i = row.userIds.indexOf('FOLLOW_PEOPLE'); let i = row.userIds.indexOf('FOLLOW_PEOPLE');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CREATE":
if (i2 > -1) {
row.userIds.splice(i2, 1);
}
if (i > -1) {
row.userIds.splice(i, 1);
}
break;
case "UPDATE": case "UPDATE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
} row.userIds.unshift('CREATOR');
if (row.userIds.indexOf('FOLLOW_PEOPLE') < 0) { }
row.userIds.unshift('FOLLOW_PEOPLE'); if (i < 0) {
row.userIds.unshift('FOLLOW_PEOPLE');
}
} }
break; break;
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
if (i > -1) { if (i > -1) {
row.userIds.splice(i, 1); row.userIds.splice(i, 1);

View File

@ -206,7 +206,7 @@ export default {
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => { this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
this.defectTask = response.data; this.defectTask = response.data;
// //
this.$emit("noticeSize", {module: 'api', data: this.defectTask, taskType:TASK_TYPE}); this.$emit("noticeSize", {module: 'api', data: this.defectTask, taskType: TASK_TYPE});
this.defectTask.forEach(planTask => { this.defectTask.forEach(planTask => {
this.handleReceivers(planTask); this.handleReceivers(planTask);
}); });
@ -291,15 +291,17 @@ export default {
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i = row.userIds.indexOf('FOLLOW_PEOPLE'); let i = row.userIds.indexOf('FOLLOW_PEOPLE');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "UPDATE": case "UPDATE":
case "CASE_UPDATE": case "CASE_UPDATE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (i2 < 0) {
row.userIds.unshift('CREATOR'); row.userIds.unshift('CREATOR');
} }
if (row.userIds.indexOf('FOLLOW_PEOPLE') < 0) { if (i < 0) {
row.userIds.unshift('FOLLOW_PEOPLE'); row.userIds.unshift('FOLLOW_PEOPLE');
} }
break; break;
@ -307,7 +309,7 @@ export default {
case "CASE_DELETE": case "CASE_DELETE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (i2 < 0) {
row.userIds.unshift('CREATOR'); row.userIds.unshift('CREATOR');
} }
if (i > -1) { if (i > -1) {

View File

@ -289,11 +289,15 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CLOSE_SCHEDULE": case "CLOSE_SCHEDULE":
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -285,11 +285,15 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -201,7 +201,7 @@ export default {
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => { this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
this.defectTask = response.data; this.defectTask = response.data;
// //
this.$emit("noticeSize", {module: 'performance', data: this.defectTask, taskType:TASK_TYPE}); this.$emit("noticeSize", {module: 'performance', data: this.defectTask, taskType: TASK_TYPE});
this.defectTask.forEach(planTask => { this.defectTask.forEach(planTask => {
this.handleReceivers(planTask); this.handleReceivers(planTask);
}); });
@ -285,11 +285,14 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -288,23 +288,35 @@ export default {
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i = row.userIds.indexOf('FOLLOW_PEOPLE'); let i = row.userIds.indexOf('FOLLOW_PEOPLE');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CREATE":
if (i2 > -1) {
row.userIds.splice(i2, 1);
}
if (i > -1) {
row.userIds.splice(i, 1);
}
break;
case "UPDATE": case "UPDATE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
} row.userIds.unshift('CREATOR');
if (row.userIds.indexOf('FOLLOW_PEOPLE') < 0) { }
row.userIds.unshift('FOLLOW_PEOPLE'); if (i < 0) {
row.userIds.unshift('FOLLOW_PEOPLE');
}
} }
break; break;
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
if (i > -1) { if (i > -1) {
row.userIds.splice(i, 1); row.userIds.splice(i, 1);

View File

@ -8,21 +8,21 @@
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="600" width="600"
trigger="click"> trigger="click">
<ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/> <ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.mail_template_example') }} {{ $t('organization.message.mail_template_example') }}
</el-button> </el-button>
</el-popover> </el-popover>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="400" width="400"
trigger="click" trigger="click"
:content="robotTitle"> :content="robotTitle">
<ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/> <ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.robot_template') }} {{ $t('organization.message.robot_template') }}
@ -33,11 +33,11 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table <el-table
:data="defectTask" :data="defectTask"
class="tb-edit" class="tb-edit"
border border
:cell-style="rowClass" :cell-style="rowClass"
:header-cell-style="headClass" :header-cell-style="headClass"
> >
<el-table-column :label="$t('schedule.event')" min-width="15%" prop="events"> <el-table-column :label="$t('schedule.event')" min-width="15%" prop="events">
<template slot-scope="scope"> <template slot-scope="scope">
@ -45,10 +45,10 @@
@change="handleReceivers(scope.row)" @change="handleReceivers(scope.row)"
prop="event" :disabled="!scope.row.isSet"> prop="event" :disabled="!scope.row.isSet">
<el-option <el-option
v-for="item in defectEventOptions" v-for="item in defectEventOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -59,10 +59,10 @@
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
style="width: 100%;" :disabled="!row.isSet"> style="width: 100%;" :disabled="!row.isSet">
<el-option <el-option
v-for="item in row.defectReceiverOptions" v-for="item in row.defectReceiverOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -73,10 +73,10 @@
size="mini" size="mini"
:disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)"> :disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)">
<el-option <el-option
v-for="item in receiveTypeOptions" v-for="item in receiveTypeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -90,48 +90,48 @@
<el-table-column :label="$t('commons.operating')" min-width="25%" prop="result"> <el-table-column :label="$t('commons.operating')" min-width="25%" prop="result">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tip-button <ms-tip-button
circle circle
type="success" type="success"
size="mini" size="mini"
v-if="scope.row.isSet" v-if="scope.row.isSet"
v-xpack v-xpack
@click="handleTemplate(scope.$index,scope.row)" @click="handleTemplate(scope.$index,scope.row)"
:tip="$t('organization.message.template')" :tip="$t('organization.message.template')"
icon="el-icon-tickets"/> icon="el-icon-tickets"/>
<ms-tip-button <ms-tip-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="handleAddTask(scope.$index,scope.row)" @click="handleAddTask(scope.$index,scope.row)"
:tip="$t('commons.add')" :tip="$t('commons.add')"
icon="el-icon-check"/> icon="el-icon-check"/>
<ms-tip-button <ms-tip-button
circle circle
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="removeRowTask(scope.$index,defectTask)" @click="removeRowTask(scope.$index,defectTask)"
:tip="$t('commons.cancel')" :tip="$t('commons.cancel')"
icon="el-icon-refresh-left"/> icon="el-icon-refresh-left"/>
<ms-tip-button <ms-tip-button
el-button el-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -169,17 +169,17 @@ export default {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" + title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
" <meta charset=\"UTF-8\">\n" + " <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" + " <title>MeterSphere</title>\n" +
"</head>\n" + "</head>\n" +
"<body>\n" + "<body>\n" +
"<div>\n" + "<div>\n" +
" <p>${creator}发起了一个缺陷:${issuesName},请跟进</p>\n" + " <p>${creator}发起了一个缺陷:${issuesName},请跟进</p>\n" +
"</div>\n" + "</div>\n" +
"</body>\n" + "</body>\n" +
"</html>", "</html>",
robotTitle: "【任务通知】:${creator}发起了一个缺陷:${issuesName},请跟进", robotTitle: "【任务通知】:${creator}发起了一个缺陷:${issuesName},请跟进",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -287,22 +287,39 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let testPlanReceivers = JSON.parse(JSON.stringify(this.defectReceiverOptions)); let testPlanReceivers = JSON.parse(JSON.stringify(this.defectReceiverOptions));
let i = row.userIds.indexOf('PROCESSOR');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CREATE":
if (i2 > -1) {
row.userIds.splice(i2, 1);
}
if (i > -1) {
row.userIds.splice(i, 1);
}
break;
case "UPDATE": case "UPDATE":
case "STATUS_CHANGE": case "STATUS_CHANGE":
testPlanReceivers.unshift({id: 'PROCESSOR', name: '处理人'}); testPlanReceivers.unshift({id: 'PROCESSOR', name: '处理人'});
testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
} row.userIds.unshift('CREATOR');
if (row.userIds.indexOf('PROCESSOR') < 0) { }
row.userIds.unshift('PROCESSOR'); if (i < 0) {
row.userIds.unshift('PROCESSOR');
}
} }
break; break;
case "DELETE": case "DELETE":
testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
}
if (i > -1) {
row.userIds.splice(i, 1);
} }
break; break;
default: default:

View File

@ -8,21 +8,21 @@
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="600" width="600"
trigger="click"> trigger="click">
<ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/> <ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.mail_template_example') }} {{ $t('organization.message.mail_template_example') }}
</el-button> </el-button>
</el-popover> </el-popover>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="400" width="400"
trigger="click" trigger="click"
:content="robotTitle"> :content="robotTitle">
<ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/> <ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.robot_template') }} {{ $t('organization.message.robot_template') }}
@ -33,11 +33,11 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table <el-table
:data="defectTask" :data="defectTask"
class="tb-edit" class="tb-edit"
border border
:cell-style="rowClass" :cell-style="rowClass"
:header-cell-style="headClass" :header-cell-style="headClass"
> >
<el-table-column :label="$t('schedule.event')" min-width="15%" prop="events"> <el-table-column :label="$t('schedule.event')" min-width="15%" prop="events">
<template slot-scope="scope"> <template slot-scope="scope">
@ -45,10 +45,10 @@
@change="handleReceivers(scope.row)" @change="handleReceivers(scope.row)"
prop="event" :disabled="!scope.row.isSet"> prop="event" :disabled="!scope.row.isSet">
<el-option <el-option
v-for="item in eventOptions" v-for="item in eventOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -59,10 +59,10 @@
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
style="width: 100%;" :disabled="!row.isSet"> style="width: 100%;" :disabled="!row.isSet">
<el-option <el-option
v-for="item in row.receiverOptions" v-for="item in row.receiverOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -73,10 +73,10 @@
size="mini" size="mini"
:disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)"> :disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)">
<el-option <el-option
v-for="item in receiveTypeOptions" v-for="item in receiveTypeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -90,48 +90,48 @@
<el-table-column :label="$t('commons.operating')" min-width="25%" prop="result"> <el-table-column :label="$t('commons.operating')" min-width="25%" prop="result">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tip-button <ms-tip-button
circle circle
type="success" type="success"
size="mini" size="mini"
v-if="scope.row.isSet" v-if="scope.row.isSet"
v-xpack v-xpack
@click="handleTemplate(scope.$index,scope.row)" @click="handleTemplate(scope.$index,scope.row)"
:tip="$t('organization.message.template')" :tip="$t('organization.message.template')"
icon="el-icon-tickets"/> icon="el-icon-tickets"/>
<ms-tip-button <ms-tip-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="handleAddTask(scope.$index,scope.row)" @click="handleAddTask(scope.$index,scope.row)"
:tip="$t('commons.add')" :tip="$t('commons.add')"
icon="el-icon-check"/> icon="el-icon-check"/>
<ms-tip-button <ms-tip-button
circle circle
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="removeRowTask(scope.$index,defectTask)" @click="removeRowTask(scope.$index,defectTask)"
:tip="$t('commons.cancel')" :tip="$t('commons.cancel')"
icon="el-icon-refresh-left"/> icon="el-icon-refresh-left"/>
<ms-tip-button <ms-tip-button
el-button el-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -169,17 +169,17 @@ export default {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" + title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
" <meta charset=\"UTF-8\">\n" + " <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" + " <title>MeterSphere</title>\n" +
"</head>\n" + "</head>\n" +
"<body>\n" + "<body>\n" +
"<div>\n" + "<div>\n" +
" <p>${creator}创建了测试用例</p>\n" + " <p>${creator}创建了测试用例</p>\n" +
"</div>\n" + "</div>\n" +
"</body>\n" + "</body>\n" +
"</html>", "</html>",
robotTitle: "【任务通知】:${creator}创建了测试用例", robotTitle: "【任务通知】:${creator}创建了测试用例",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -289,24 +289,29 @@ export default {
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i = row.userIds.indexOf('FOLLOW_PEOPLE'); let i = row.userIds.indexOf('FOLLOW_PEOPLE');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "UPDATE": case "UPDATE":
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
} row.userIds.unshift('CREATOR');
if (i < 0) { }
row.userIds.unshift('FOLLOW_PEOPLE'); if (i < 0) {
row.userIds.unshift('FOLLOW_PEOPLE');
}
} }
break; break;
case "COMMENT": case "COMMENT":
receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')}); receiverOptions.unshift({id: 'FOLLOW_PEOPLE', name: this.$t('api_test.automation.follow_people')});
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
if (i > -1) { if (i > -1) {
row.userIds.splice(i, 1); row.userIds.splice(i, 1);

View File

@ -291,6 +291,7 @@ export default {
}, },
handleTestPlanReceivers(row) { handleTestPlanReceivers(row) {
let testPlanReceivers = JSON.parse(JSON.stringify(this.testPlanReceiverOptions)); let testPlanReceivers = JSON.parse(JSON.stringify(this.testPlanReceiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CREATE": case "CREATE":
testPlanReceivers.unshift({id: 'EXECUTOR', name: this.$t('test_track.plan_view.executor')}); testPlanReceivers.unshift({id: 'EXECUTOR', name: this.$t('test_track.plan_view.executor')});
@ -300,8 +301,10 @@ export default {
case "COMMENT": case "COMMENT":
case "COMPLETE": case "COMPLETE":
testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); testPlanReceivers.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -8,20 +8,20 @@
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="600" width="600"
trigger="click"> trigger="click">
<ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/> <ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.mail_template_example') }} {{ $t('organization.message.mail_template_example') }}
</el-button> </el-button>
</el-popover> </el-popover>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="600" width="600"
trigger="click"> trigger="click">
<ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/> <ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.robot_template') }} {{ $t('organization.message.robot_template') }}
@ -32,11 +32,11 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table <el-table
:data="reviewTask" :data="reviewTask"
class="tb-edit" class="tb-edit"
border border
:cell-style="rowClass" :cell-style="rowClass"
:header-cell-style="headClass" :header-cell-style="headClass"
> >
<el-table-column :label="$t('schedule.event')" min-width="15%" prop="events"> <el-table-column :label="$t('schedule.event')" min-width="15%" prop="events">
<template slot-scope="scope"> <template slot-scope="scope">
@ -44,10 +44,10 @@
@change="handleReviewReceivers(scope.row)" @change="handleReviewReceivers(scope.row)"
prop="event" :disabled="!scope.row.isSet"> prop="event" :disabled="!scope.row.isSet">
<el-option <el-option
v-for="item in reviewTaskEventOptions" v-for="item in reviewTaskEventOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -58,10 +58,10 @@
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
style="width: 100%;" :disabled="!row.isSet"> style="width: 100%;" :disabled="!row.isSet">
<el-option <el-option
v-for="item in row.reviewReceiverOptions" v-for="item in row.reviewReceiverOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -72,10 +72,10 @@
size="mini" size="mini"
:disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)"> :disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)">
<el-option <el-option
v-for="item in receiveTypeOptions" v-for="item in receiveTypeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -89,48 +89,48 @@
<el-table-column :label="$t('commons.operating')" min-width="25%" prop="result"> <el-table-column :label="$t('commons.operating')" min-width="25%" prop="result">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tip-button <ms-tip-button
circle circle
type="success" type="success"
size="mini" size="mini"
v-if="scope.row.isSet" v-if="scope.row.isSet"
v-xpack v-xpack
@click="handleTemplate(scope.$index,scope.row)" @click="handleTemplate(scope.$index,scope.row)"
:tip="$t('organization.message.template')" :tip="$t('organization.message.template')"
icon="el-icon-tickets"/> icon="el-icon-tickets"/>
<ms-tip-button <ms-tip-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="handleAddTask(scope.$index,scope.row)" @click="handleAddTask(scope.$index,scope.row)"
:tip="$t('commons.add')" :tip="$t('commons.add')"
icon="el-icon-check"/> icon="el-icon-check"/>
<ms-tip-button <ms-tip-button
circle circle
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="removeRowTask(scope.$index,reviewTask)" @click="removeRowTask(scope.$index,reviewTask)"
:tip="$t('commons.cancel')" :tip="$t('commons.cancel')"
icon="el-icon-refresh-left"/> icon="el-icon-refresh-left"/>
<ms-tip-button <ms-tip-button
el-button el-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -168,25 +168,25 @@ export default {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" + title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
" <meta charset=\"UTF-8\">\n" + " <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" + " <title>MeterSphere</title>\n" +
"</head>\n" + "</head>\n" +
"<body>\n" + "<body>\n" +
"<div>\n" + "<div>\n" +
" <p style=\"text-align: left\">${creator} 创建的:<br>\n" + " <p style=\"text-align: left\">${creator} 创建的:<br>\n" +
" ${reviewName}待开始<br>\n" + " ${reviewName}待开始<br>\n" +
" 计划开始时间是:${start}<br>\n" + " 计划开始时间是:${start}<br>\n" +
" 计划结束时间为:${end}<br>\n" + " 计划结束时间为:${end}<br>\n" +
" 请跟进!/${status}<br>\n" + " 请跟进!/${status}<br>\n" +
" 点击下面链接进入评审页面进行审核</p>\n" + " 点击下面链接进入评审页面进行审核</p>\n" +
" <a href=\"${url}/#/track/review/view/${id}\">${url}/#/track/review/view/${id}</a>\n" + " <a href=\"${url}/#/track/review/view/${id}\">${url}/#/track/review/view/${id}</a>\n" +
"</div>\n" + "</div>\n" +
"</body>\n" + "</body>\n" +
"</html>", "</html>",
robotTitle: "【任务通知】:${creator} 创建的:${reviewName}待开始,计划开始时间是:${start}," + robotTitle: "【任务通知】:${creator} 创建的:${reviewName}待开始,计划开始时间是:${start}," +
"计划结束时间是:${end}请跟进!/ ${status}!点击下面链接进入测试评审页面${url}/#/track/review/view/${id}", "计划结束时间是:${end}请跟进!/ ${status}!点击下面链接进入测试评审页面${url}/#/track/review/view/${id}",
reviewTask: [{ reviewTask: [{
taskType: "reviewTask", taskType: "reviewTask",
event: "", event: "",
@ -289,21 +289,26 @@ export default {
}, },
handleReviewReceivers(row) { handleReviewReceivers(row) {
let reviewReceiverOptions = JSON.parse(JSON.stringify(this.reviewReceiverOptions)); let reviewReceiverOptions = JSON.parse(JSON.stringify(this.reviewReceiverOptions));
let i = row.userIds.indexOf('FOLLOW_PEOPLE');
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CREATE": case "CREATE":
reviewReceiverOptions.unshift({id: 'EXECUTOR', name: this.$t('test_track.review.reviewer')}); reviewReceiverOptions.unshift({id: 'EXECUTOR', name: this.$t('test_track.review.reviewer')});
break; break;
case "UPDATE": case "UPDATE":
reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
case "DELETE": case "DELETE":
reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
case "COMMENT": case "COMMENT":
@ -311,8 +316,10 @@ export default {
break; break;
case "COMPLETE": case "COMPLETE":
reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); reviewReceiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -8,21 +8,21 @@
{{ $t('organization.message.create_new_notification') }} {{ $t('organization.message.create_new_notification') }}
</el-button> </el-button>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="600" width="600"
trigger="click"> trigger="click">
<ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/> <ms-code-edit :read-only="true" height="400px" :data.sync="title" :modes="modes" :mode="'html'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.mail_template_example') }} {{ $t('organization.message.mail_template_example') }}
</el-button> </el-button>
</el-popover> </el-popover>
<el-popover <el-popover
placement="right-end" placement="right-end"
title="示例" title="示例"
width="400" width="400"
trigger="click" trigger="click"
:content="robotTitle"> :content="robotTitle">
<ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/> <ms-code-edit :read-only="true" height="200px" :data.sync="robotTitle" :modes="modes" :mode="'text'"/>
<el-button icon="el-icon-warning" plain size="mini" slot="reference"> <el-button icon="el-icon-warning" plain size="mini" slot="reference">
{{ $t('organization.message.robot_template') }} {{ $t('organization.message.robot_template') }}
@ -33,11 +33,11 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table <el-table
:data="defectTask" :data="defectTask"
class="tb-edit" class="tb-edit"
border border
:cell-style="rowClass" :cell-style="rowClass"
:header-cell-style="headClass" :header-cell-style="headClass"
> >
<el-table-column :label="$t('schedule.event')" min-width="15%" prop="events"> <el-table-column :label="$t('schedule.event')" min-width="15%" prop="events">
<template slot-scope="scope"> <template slot-scope="scope">
@ -45,10 +45,10 @@
@change="handleReceivers(scope.row)" @change="handleReceivers(scope.row)"
prop="event" :disabled="!scope.row.isSet"> prop="event" :disabled="!scope.row.isSet">
<el-option <el-option
v-for="item in eventOptions" v-for="item in eventOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -59,10 +59,10 @@
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
style="width: 100%;" :disabled="!row.isSet"> style="width: 100%;" :disabled="!row.isSet">
<el-option <el-option
v-for="item in row.receiverOptions" v-for="item in row.receiverOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -73,10 +73,10 @@
size="mini" size="mini"
:disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)"> :disabled="!scope.row.isSet" @change="handleEdit(scope.$index, scope.row)">
<el-option <el-option
v-for="item in receiveTypeOptions" v-for="item in receiveTypeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -90,48 +90,48 @@
<el-table-column :label="$t('commons.operating')" min-width="25%" prop="result"> <el-table-column :label="$t('commons.operating')" min-width="25%" prop="result">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tip-button <ms-tip-button
circle circle
type="success" type="success"
size="mini" size="mini"
v-if="scope.row.isSet" v-if="scope.row.isSet"
v-xpack v-xpack
@click="handleTemplate(scope.$index,scope.row)" @click="handleTemplate(scope.$index,scope.row)"
:tip="$t('organization.message.template')" :tip="$t('organization.message.template')"
icon="el-icon-tickets"/> icon="el-icon-tickets"/>
<ms-tip-button <ms-tip-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="handleAddTask(scope.$index,scope.row)" @click="handleAddTask(scope.$index,scope.row)"
:tip="$t('commons.add')" :tip="$t('commons.add')"
icon="el-icon-check"/> icon="el-icon-check"/>
<ms-tip-button <ms-tip-button
circle circle
size="mini" size="mini"
v-show="scope.row.isSet" v-show="scope.row.isSet"
@click="removeRowTask(scope.$index,defectTask)" @click="removeRowTask(scope.$index,defectTask)"
:tip="$t('commons.cancel')" :tip="$t('commons.cancel')"
icon="el-icon-refresh-left"/> icon="el-icon-refresh-left"/>
<ms-tip-button <ms-tip-button
el-button el-button
circle circle
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-edit"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
:tip="$t('commons.edit')" :tip="$t('commons.edit')"
@click="handleEditTask(scope.$index,scope.row)" @click="handleEditTask(scope.$index,scope.row)"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
<ms-tip-button <ms-tip-button
circle circle
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
v-show="!scope.row.isSet" v-show="!scope.row.isSet"
@click="deleteRowTask(scope.$index,scope.row)" @click="deleteRowTask(scope.$index,scope.row)"
:tip="$t('commons.delete')" :tip="$t('commons.delete')"
v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/> v-permission="['ORGANIZATION_MESSAGE:READ+EDIT']"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -169,17 +169,17 @@ export default {
return { return {
modes: ['text', 'html'], modes: ['text', 'html'],
title: "<!DOCTYPE html>\n" + title: "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
" <meta charset=\"UTF-8\">\n" + " <meta charset=\"UTF-8\">\n" +
" <title>MeterSphere</title>\n" + " <title>MeterSphere</title>\n" +
"</head>\n" + "</head>\n" +
"<body>\n" + "<body>\n" +
"<div>\n" + "<div>\n" +
" <p>${operator}关闭了定时任务</p>\n" + " <p>${operator}关闭了定时任务</p>\n" +
"</div>\n" + "</div>\n" +
"</body>\n" + "</body>\n" +
"</html>", "</html>",
robotTitle: "【任务通知】:${operator}发起了一个缺陷:${name},请跟进", robotTitle: "【任务通知】:${operator}发起了一个缺陷:${name},请跟进",
defectTask: [{ defectTask: [{
taskType: "defectTask", taskType: "defectTask",
@ -289,11 +289,14 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "CLOSE_SCHEDULE": case "CLOSE_SCHEDULE":
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default:

View File

@ -285,11 +285,14 @@ export default {
}, },
handleReceivers(row) { handleReceivers(row) {
let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions)); let receiverOptions = JSON.parse(JSON.stringify(this.receiverOptions));
let i2 = row.userIds.indexOf('CREATOR');
switch (row.event) { switch (row.event) {
case "DELETE": case "DELETE":
receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')}); receiverOptions.unshift({id: 'CREATOR', name: this.$t('commons.create_user')});
if (row.userIds.indexOf('CREATOR') < 0) { if (row.isSet) {
row.userIds.unshift('CREATOR'); if (i2 < 0) {
row.userIds.unshift('CREATOR');
}
} }
break; break;
default: default: