command.vue 915 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div>
  3. <el-button size="mini" type="primary" icon="el-icon-edit" circle @click="handleEdit"></el-button>
  4. <el-button size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete()"></el-button>
  5. </div>
  6. </template>
  7. <script>
  8. import Vue from 'vue'
  9. export default Vue.extend({
  10. data () {
  11. return {
  12. tableHeight: 1
  13. }
  14. },
  15. methods: {
  16. handleEdit () {
  17. let id = this.params.data['Id']
  18. this.params.context.page.handleEdit(id)
  19. },
  20. handleDelete () {
  21. let id = this.params.data['Id']
  22. let _this = this
  23. _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  24. confirmButtonText: '确定',
  25. cancelButtonText: '取消',
  26. type: 'warning'
  27. }).then(() => {
  28. this.params.context.page.handleDelete(id)
  29. }).catch(() => { })
  30. }
  31. }
  32. })
  33. </script>
  34. <style scoped>
  35. </style>