修改按钮和提示

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> <template>
<span> <span>
<slot name="front"></slot> <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> <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> <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> </span>
</template> </template>
@ -17,6 +14,20 @@
export default { export default {
name: "MsTableOperator", name: "MsTableOperator",
components: {MsTableOperatorButton}, components: {MsTableOperatorButton},
props: {
tip1: {
type: String,
default() {
return this.$t('commons.edit');
}
},
tip2: {
type: String,
default() {
return this.$t('commons.delete');
}
}
},
methods: { methods: {
editClick() { editClick() {
this.$emit('editClick'); this.$emit('editClick');

View File

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

View File

@ -56,11 +56,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>--> <ms-table-operator :tip2="$t('commons.remove')" @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)"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -42,15 +42,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>--> <ms-table-operator :tip2="$t('commons.remove')" @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>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -100,10 +100,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<!--<ms-table-operator @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>--> <ms-table-operator :tip2="$t('commons.remove')" @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)"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

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