Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
02681ef715
|
@ -1,22 +1,28 @@
|
||||||
name: Build Docker Image and Push
|
name: Build Docker Image and Push
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1*
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v1*
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
name: Build Docker Image and Push
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: nelonoel/branch-name@v1.0.1
|
- name: Inject slug/short variables
|
||||||
|
uses: rlespinasse/github-slug-action@v3.x
|
||||||
- name: Cache node modules
|
- name: Cache node modules
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
env:
|
env:
|
||||||
cache-name: cache-node-modules
|
cache-name: cache-node-modules
|
||||||
with:
|
with:
|
||||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
|
@ -24,18 +30,13 @@ jobs:
|
||||||
${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache maven dependencies
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
env:
|
|
||||||
cache-name: cache-maven-deps
|
|
||||||
with:
|
with:
|
||||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
path: ~/.m2/repository
|
||||||
path: ~/.m2
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ runner.os }}-maven-
|
||||||
${{ runner.os }}-build-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK 1.8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
|
@ -47,17 +48,11 @@ jobs:
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B package --file pom.xml
|
||||||
|
|
||||||
- name: Docker Setup Buildx
|
- name: Push to Docker Hub
|
||||||
uses: docker/setup-buildx-action@v1.0.3
|
uses: docker/build-push-action@v1
|
||||||
|
|
||||||
- name: Docker Login
|
|
||||||
uses: docker/login-action@v1.6.0
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: metersphere
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
repository: metersphere/metersphere
|
||||||
- name: Build Docker Image
|
tag_with_ref: true
|
||||||
uses: docker/build-push-action@v2.2.0
|
build_args: MS_VERSION=${{ env.GITHUB_REF_SLUG }}-${{ env.GITHUB_SHA_SHORT }}
|
||||||
with:
|
|
||||||
build-args: MS_VERSION=${BRANCH_NAME}-b${GITHUB_RUN_NUMBER}
|
|
||||||
tags: metersphere/metersphere:${BRANCH_NAME}
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM registry.fit2cloud.com/metersphere/fabric8-java-alpine-openjdk8-jre
|
FROM metersphere/fabric8-java-alpine-openjdk8-jre
|
||||||
|
|
||||||
MAINTAINER FIT2CLOUD <support@fit2cloud.com>
|
MAINTAINER FIT2CLOUD <support@fit2cloud.com>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('schedule.task_notification')" name="second">
|
<el-tab-pane :label="$t('schedule.task_notification')" name="second">
|
||||||
<schedule-task-notification :is-tester-permission="isTesterPermission" :test-id="testId" :schedule-receiver-options="scheduleReceiverOptions"></schedule-task-notification>
|
<schedule-task-notification :is-tester-permission="isTesterPermission" :test-id="testId"
|
||||||
|
:schedule-receiver-options="scheduleReceiverOptions"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,20 +41,19 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getCurrentUser} from "@/common/js/utils";
|
import {checkoutTestManagerOrTestUser, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||||
import Crontab from "../cron/Crontab";
|
import Crontab from "../cron/Crontab";
|
||||||
import CrontabResult from "../cron/CrontabResult";
|
import CrontabResult from "../cron/CrontabResult";
|
||||||
import {cronValidate} from "@/common/js/cron";
|
import {cronValidate} from "@/common/js/cron";
|
||||||
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
|
||||||
import ScheduleTaskNotification from "../../settings/organization/components/ScheduleTaskNotification";
|
import ScheduleTaskNotification from "../../settings/organization/components/ScheduleTaskNotification";
|
||||||
import {checkoutTestManagerOrTestUser} from "../../../../common/js/utils";
|
|
||||||
function defaultCustomValidate() {
|
function defaultCustomValidate() {
|
||||||
return {pass: true};
|
return {pass: true};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsScheduleEdit",
|
name: "MsScheduleEdit",
|
||||||
components: {CrontabResult, Crontab,ScheduleTaskNotification},
|
components: {CrontabResult, Crontab, ScheduleTaskNotification},
|
||||||
props: {
|
props: {
|
||||||
testId: String,
|
testId: String,
|
||||||
save: Function,
|
save: Function,
|
||||||
|
@ -92,7 +92,7 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
scheduleReceiverOptions:[],
|
scheduleReceiverOptions: [],
|
||||||
operation: true,
|
operation: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
showCron: false,
|
showCron: false,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.defectTask"
|
:data="defectTask"
|
||||||
class="tb-edit"
|
class="tb-edit"
|
||||||
border
|
border
|
||||||
:cell-style="rowClass"
|
:cell-style="rowClass"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
v-show="scope.row.isSet"
|
v-show="scope.row.isSet"
|
||||||
@click.native.prevent="removeRowTask(scope.$index,form.defectTask)"
|
@click.native.prevent="removeRowTask(scope.$index,defectTask)"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -113,7 +113,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
|
||||||
defectTask: [{
|
defectTask: [{
|
||||||
taskType: "defectTask",
|
taskType: "defectTask",
|
||||||
event: "",
|
event: "",
|
||||||
|
@ -124,7 +123,6 @@ export default {
|
||||||
identification: "",
|
identification: "",
|
||||||
isReadOnly: false,
|
isReadOnly: false,
|
||||||
}],
|
}],
|
||||||
},
|
|
||||||
defectEventOptions: [
|
defectEventOptions: [
|
||||||
{value: 'CREATE', label: this.$t('commons.create')},
|
{value: 'CREATE', label: this.$t('commons.create')},
|
||||||
],
|
],
|
||||||
|
@ -141,7 +139,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
initForm() {
|
initForm() {
|
||||||
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
||||||
this.form.defectTask = response.data;
|
this.defectTask = response.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEdit(index, data) {
|
handleEdit(index, data) {
|
||||||
|
@ -169,7 +167,7 @@ export default {
|
||||||
Task.isSet = true;
|
Task.isSet = true;
|
||||||
Task.identification = '';
|
Task.identification = '';
|
||||||
Task.taskType = TASK_TYPE
|
Task.taskType = TASK_TYPE
|
||||||
this.form.defectTask.push(Task)
|
this.defectTask.push(Task)
|
||||||
},
|
},
|
||||||
handleAddTask(index, data) {
|
handleAddTask(index, data) {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.jenkinsTask"
|
:data="jenkinsTask"
|
||||||
class="tb-edit"
|
class="tb-edit"
|
||||||
border
|
border
|
||||||
:cell-style="rowClass"
|
:cell-style="rowClass"
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
v-show="scope.row.isSet"
|
v-show="scope.row.isSet"
|
||||||
@click.native.prevent="removeRowTask(scope.$index,form.jenkinsTask)"
|
@click.native.prevent="removeRowTask(scope.$index,jenkinsTask)"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -115,7 +115,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
|
||||||
jenkinsTask: [{
|
jenkinsTask: [{
|
||||||
taskType: "jenkinsTask",
|
taskType: "jenkinsTask",
|
||||||
event: "",
|
event: "",
|
||||||
|
@ -126,7 +125,6 @@ export default {
|
||||||
identification: "",
|
identification: "",
|
||||||
isReadOnly: false,
|
isReadOnly: false,
|
||||||
}],
|
}],
|
||||||
},
|
|
||||||
jenkinsEventOptions: [
|
jenkinsEventOptions: [
|
||||||
{value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')},
|
{value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')},
|
||||||
{value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')}
|
{value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')}
|
||||||
|
@ -144,7 +142,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
initForm() {
|
initForm() {
|
||||||
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
||||||
this.form.jenkinsTask = response.data;
|
this.jenkinsTask = response.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEdit(index, data) {
|
handleEdit(index, data) {
|
||||||
|
@ -163,7 +161,7 @@ export default {
|
||||||
Task.isSet = true;
|
Task.isSet = true;
|
||||||
Task.identification = '';
|
Task.identification = '';
|
||||||
Task.taskType = TASK_TYPE
|
Task.taskType = TASK_TYPE
|
||||||
this.form.jenkinsTask.push(Task)
|
this.jenkinsTask.push(Task)
|
||||||
},
|
},
|
||||||
handleAddTask(index, data) {
|
handleAddTask(index, data) {
|
||||||
if (data.event && data.userIds.length > 0 && data.type) {
|
if (data.event && data.userIds.length > 0 && data.type) {
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<div>
|
<div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-button :disabled="!isTesterPermission" icon="el-icon-circle-plus-outline" plain size="mini" @click="handleAddTaskModel('scheduleTask')">
|
<el-button :disabled="!isTesterPermission" icon="el-icon-circle-plus-outline" plain size="mini"
|
||||||
|
@click="handleAddTaskModel">
|
||||||
{{ $t('organization.message.create_new_notification') }}
|
{{ $t('organization.message.create_new_notification') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.scheduleTask"
|
:data="scheduleTask"
|
||||||
class="tb-edit"
|
class="tb-edit"
|
||||||
border
|
border
|
||||||
size="mini"
|
size="mini"
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
v-show="scope.row.isSet"
|
v-show="scope.row.isSet"
|
||||||
:disabled="!isTesterPermission"
|
:disabled="!isTesterPermission"
|
||||||
@click.native.prevent="removeRowTask(scope.$index,form.scheduleTask)"
|
@click.native.prevent="removeRowTask(scope.$index,scheduleTask)"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -86,7 +87,8 @@
|
||||||
v-show="!scope.row.isSet"
|
v-show="!scope.row.isSet"
|
||||||
:disabled="!isTesterPermission"
|
:disabled="!isTesterPermission"
|
||||||
@click="handleEditTask(scope.$index,scope.row)"
|
@click="handleEditTask(scope.$index,scope.row)"
|
||||||
>{{ $t('commons.edit') }}</el-button>
|
>{{ $t('commons.edit') }}
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
|
@ -108,8 +110,8 @@
|
||||||
export default {
|
export default {
|
||||||
name: "ScheduleTaskNotification",
|
name: "ScheduleTaskNotification",
|
||||||
props: {
|
props: {
|
||||||
testId:String,
|
testId: String,
|
||||||
scheduleReceiverOptions:Array,
|
scheduleReceiverOptions: Array,
|
||||||
isTesterPermission: {
|
isTesterPermission: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
@ -117,7 +119,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
|
||||||
scheduleTask: [{
|
scheduleTask: [{
|
||||||
taskType: "scheduleTask",
|
taskType: "scheduleTask",
|
||||||
event: "",
|
event: "",
|
||||||
|
@ -127,9 +129,8 @@ export default {
|
||||||
isSet: true,
|
isSet: true,
|
||||||
identification: "",
|
identification: "",
|
||||||
isReadOnly: false,
|
isReadOnly: false,
|
||||||
testId:this.testId,
|
testId: this.testId,
|
||||||
}],
|
}],
|
||||||
},
|
|
||||||
scheduleEventOptions: [
|
scheduleEventOptions: [
|
||||||
{value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')},
|
{value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')},
|
||||||
{value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')}
|
{value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')}
|
||||||
|
@ -141,14 +142,14 @@ export default {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted() {
|
||||||
this.initForm()
|
this.initForm()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initForm(){
|
initForm() {
|
||||||
this.result = this.$get('/notice/search/message/'+this.testId, response => {
|
this.result = this.$get('/notice/search/message/' + this.testId, response => {
|
||||||
// console.log(response.data);
|
// console.log(response.data);
|
||||||
this.form.scheduleTask = response.data;
|
this.scheduleTask = response.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEdit(index, data) {
|
handleEdit(index, data) {
|
||||||
|
@ -158,7 +159,7 @@ export default {
|
||||||
data.webhook = '';
|
data.webhook = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAddTaskModel(type) {
|
handleAddTaskModel() {
|
||||||
let Task = {};
|
let Task = {};
|
||||||
Task.event = [];
|
Task.event = [];
|
||||||
Task.userIds = [];
|
Task.userIds = [];
|
||||||
|
@ -166,13 +167,11 @@ export default {
|
||||||
Task.webhook = '';
|
Task.webhook = '';
|
||||||
Task.isSet = true;
|
Task.isSet = true;
|
||||||
Task.identification = '';
|
Task.identification = '';
|
||||||
if (type === 'scheduleTask') {
|
|
||||||
Task.taskType = 'SCHEDULE_TASK';
|
Task.taskType = 'SCHEDULE_TASK';
|
||||||
Task.testId=this.testId;
|
Task.testId = this.testId;
|
||||||
this.form.scheduleTask.push(Task);
|
this.scheduleTask.push(Task);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleEditTask(index,data) {
|
handleEditTask(index, data) {
|
||||||
data.isSet = true;
|
data.isSet = true;
|
||||||
data.testId = this.testId;
|
data.testId = this.testId;
|
||||||
if (data.type === 'EMAIL') {
|
if (data.type === 'EMAIL') {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.testCasePlanTask"
|
:data="testCasePlanTask"
|
||||||
class="tb-edit"
|
class="tb-edit"
|
||||||
border
|
border
|
||||||
:cell-style="rowClass"
|
:cell-style="rowClass"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
v-show="scope.row.isSet"
|
v-show="scope.row.isSet"
|
||||||
@click.native.prevent="removeRowTask(scope.$index,form.testCasePlanTask)"
|
@click.native.prevent="removeRowTask(scope.$index,testCasePlanTask)"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -114,7 +114,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
|
||||||
testCasePlanTask: [{
|
testCasePlanTask: [{
|
||||||
taskType: "testPlanTask",
|
taskType: "testPlanTask",
|
||||||
event: "",
|
event: "",
|
||||||
|
@ -125,7 +124,6 @@ export default {
|
||||||
identification: "",
|
identification: "",
|
||||||
isReadOnly: false,
|
isReadOnly: false,
|
||||||
}],
|
}],
|
||||||
},
|
|
||||||
otherEventOptions: [
|
otherEventOptions: [
|
||||||
{value: 'CREATE', label: this.$t('commons.create')},
|
{value: 'CREATE', label: this.$t('commons.create')},
|
||||||
{value: 'UPDATE', label: this.$t('commons.update')},
|
{value: 'UPDATE', label: this.$t('commons.update')},
|
||||||
|
@ -138,14 +136,11 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
activated() {
|
|
||||||
this.initForm()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
initForm() {
|
initForm() {
|
||||||
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
||||||
this.form.testCasePlanTask = response.data;
|
this.testCasePlanTask = response.data;
|
||||||
this.form.testCasePlanTask.forEach(planTask => {
|
this.testCasePlanTask.forEach(planTask => {
|
||||||
this.handleTestPlanReceivers(planTask);
|
this.handleTestPlanReceivers(planTask);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -175,7 +170,7 @@ export default {
|
||||||
Task.isSet = true;
|
Task.isSet = true;
|
||||||
Task.identification = '';
|
Task.identification = '';
|
||||||
Task.taskType = TASK_TYPE
|
Task.taskType = TASK_TYPE
|
||||||
this.form.testCasePlanTask.push(Task)
|
this.testCasePlanTask.push(Task)
|
||||||
},
|
},
|
||||||
handleAddTask(index, data) {
|
handleAddTask(index, data) {
|
||||||
|
|
||||||
|
@ -236,6 +231,13 @@ export default {
|
||||||
}
|
}
|
||||||
row.testPlanReceiverOptions = testPlanReceivers;
|
row.testPlanReceiverOptions = testPlanReceivers;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
testPlanReceiverOptions(value) {
|
||||||
|
if (value && value.length > 0) {
|
||||||
|
this.initForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.reviewTask"
|
:data="reviewTask"
|
||||||
class="tb-edit"
|
class="tb-edit"
|
||||||
border
|
border
|
||||||
:cell-style="rowClass"
|
:cell-style="rowClass"
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
v-show="scope.row.isSet"
|
v-show="scope.row.isSet"
|
||||||
@click.native.prevent="removeRowTask(scope.$index,form.reviewTask)"
|
@click.native.prevent="removeRowTask(scope.$index,reviewTask)"
|
||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -114,7 +114,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
|
||||||
reviewTask: [{
|
reviewTask: [{
|
||||||
taskType: "reviewTask",
|
taskType: "reviewTask",
|
||||||
event: "",
|
event: "",
|
||||||
|
@ -125,7 +124,6 @@ export default {
|
||||||
identification: "",
|
identification: "",
|
||||||
isReadOnly: false,
|
isReadOnly: false,
|
||||||
}],
|
}],
|
||||||
},
|
|
||||||
reviewTaskEventOptions: [
|
reviewTaskEventOptions: [
|
||||||
{value: 'CREATE', label: this.$t('commons.create')},
|
{value: 'CREATE', label: this.$t('commons.create')},
|
||||||
{value: 'UPDATE', label: this.$t('commons.update')},
|
{value: 'UPDATE', label: this.$t('commons.update')},
|
||||||
|
@ -139,14 +137,11 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
activated() {
|
|
||||||
this.initForm()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
initForm() {
|
initForm() {
|
||||||
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
this.result = this.$get('/notice/search/message/type/' + TASK_TYPE, response => {
|
||||||
this.form.reviewTask = response.data;
|
this.reviewTask = response.data;
|
||||||
this.form.reviewTask.forEach(planTask => {
|
this.reviewTask.forEach(planTask => {
|
||||||
this.handleReviewReceivers(planTask);
|
this.handleReviewReceivers(planTask);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -176,7 +171,7 @@ export default {
|
||||||
Task.isSet = true;
|
Task.isSet = true;
|
||||||
Task.identification = '';
|
Task.identification = '';
|
||||||
Task.taskType = TASK_TYPE
|
Task.taskType = TASK_TYPE
|
||||||
this.form.reviewTask.push(Task)
|
this.reviewTask.push(Task)
|
||||||
},
|
},
|
||||||
handleAddTask(index, data) {
|
handleAddTask(index, data) {
|
||||||
|
|
||||||
|
@ -242,6 +237,13 @@ export default {
|
||||||
}
|
}
|
||||||
row.reviewReceiverOptions = reviewReceiverOptions;
|
row.reviewReceiverOptions = reviewReceiverOptions;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
reviewReceiverOptions(value) {
|
||||||
|
if (value && value.length > 0) {
|
||||||
|
this.initForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue