修改按钮和提示

This commit is contained in:
shiziyuan9527 2020-05-26 17:06:28 +08:00
parent c8be28e2aa
commit a882fa0afc
6 changed files with 27 additions and 31 deletions

View File

@ -1,13 +1,10 @@
<template>
<span>
<slot name="front"></slot>
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="editClick" @click.stop="editClickStop"/>
<ms-table-operator-button :tip="tip1" icon="el-icon-edit" @exec="editClick" @click.stop="editClickStop"/>
<slot name="middle"></slot>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger" @exec="deleteClick" @click.stop="deleteClickStop"/>
<ms-table-operator-button :tip="tip2" icon="el-icon-delete" type="danger" @exec="deleteClick" @click.stop="deleteClickStop"/>
<slot name="behind"></slot>
<!--
<ms-table-operator-button :tip="$t('commons.remove')" icon="el-icon-s-fold" type="danger" @exec="removeClick" @click.stop="removeClickStop"/>
-->
</span>
</template>
@ -17,6 +14,20 @@
export default {
name: "MsTableOperator",
components: {MsTableOperatorButton},
props: {
tip1: {
type: String,
default() {
return this.$t('commons.edit');
}
},
tip2: {
type: String,
default() {
return this.$t('commons.delete');
}
}
},
methods: {
editClick() {
this.$emit('editClick');

View File

@ -16,7 +16,7 @@
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -191,17 +191,17 @@
});
},
del(row) {
this.$confirm(this.$t('member.delete_confirm'), '', {
this.$confirm(this.$t('member.remove_member'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get('/user/org/member/delete/' + this.currentUser().lastOrganizationId + '/' + row.id, () => {
this.$success(this.$t('commons.delete_success'));
this.$success(this.$t('commons.remove_success'));
this.initTableData();
});
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'))
this.$info(this.$t('commons.remove_cancel'))
});
},
create() {

View File

@ -56,11 +56,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>-->
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="editMember(scope.row)"/>
<ms-table-operator-button :tip="$t('commons.remove')" icon="el-icon-delete" type="danger"
@exec="delMember(scope.row)"/>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>

View File

@ -42,15 +42,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>-->
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="editMember(scope.row)"/>
<ms-table-operator-button :tip="$t('commons.remove')" icon="el-icon-delete" type="danger"
@exec="delMember(scope.row)"/>
<!--<el-tooltip class="item" effect="dark" :content="$t('commons.remove')" placement="bottom">
<el-button :icon="el-icon-remove-outline">下边</el-button>
</el-tooltip>-->
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>

View File

@ -100,10 +100,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>-->
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="editMember(scope.row)"/>
<ms-table-operator-button :tip="$t('commons.remove')" icon="el-icon-delete" type="danger"
@exec="delMember(scope.row)"/>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
</template>
</el-table-column>
</el-table>

View File

@ -16,7 +16,7 @@
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"
<ms-table-operator :tip2="$t('commons.remove')" @editClick="edit(scope.row)" @deleteClick="del(scope.row)"
v-permission="['test_manager']"/>
</template>
</el-table-column>
@ -174,17 +174,17 @@
this.form = {};
},
del(row) {
this.$confirm(this.$t('member.delete_confirm'), '', {
this.$confirm(this.$t('member.remove_member'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get('/user/ws/member/delete/' + this.currentUser().lastWorkspaceId + '/' + row.id,() => {
this.$success(this.$t('commons.delete_success'));
this.$success(this.$t('commons.remove_success'));
this.initTableData();
});
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
this.$info(this.$t('commons.remove_cancel'));
});
},
edit(row) {