Rap 原分销系统代码Web
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

94 wiersze
3.0KB

  1. <template>
  2. <div class="app-container">
  3. <!--工具栏-->
  4. <div class="head-container">
  5. <div v-if="crud.props.searchToggle">
  6. <!-- 搜索 -->
  7. <el-input v-model="query.blurry" clearable placeholder="输入搜索内容" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
  8. <date-range-picker v-model="query.deployDate" class="date-item" />
  9. <rrOperation />
  10. </div>
  11. <crudOperation :permission="permission" />
  12. </div>
  13. <!--表格渲染-->
  14. <el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
  15. <el-table-column type="selection" width="55" />
  16. <el-table-column prop="appName" label="应用名称" />
  17. <el-table-column prop="ip" label="部署IP" />
  18. <el-table-column prop="deployUser" label="部署人员" />
  19. <el-table-column prop="deployDate" label="部署时间" />
  20. <el-table-column v-if="checkPer(['admin','deployHistory:del'])" label="操作" width="100px" align="center">
  21. <template slot-scope="scope">
  22. <el-popover
  23. :ref="scope.row.id"
  24. v-permission="['admin','deployHistory:del']"
  25. placement="top"
  26. width="180"
  27. >
  28. <p>确定删除本条数据吗?</p>
  29. <div style="text-align: right; margin: 0">
  30. <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
  31. <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
  32. </div>
  33. <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
  34. </el-popover>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <!--分页组件-->
  39. <pagination />
  40. </div>
  41. </template>
  42. <script>
  43. import { del } from '@/api/mnt/deployHistory'
  44. import CRUD, { presenter, header } from '@crud/crud'
  45. import rrOperation from '@crud/RR.operation'
  46. import crudOperation from '@crud/CRUD.operation'
  47. import pagination from '@crud/Pagination'
  48. import DateRangePicker from '@/components/DateRangePicker'
  49. export default {
  50. name: 'DeployHistory',
  51. components: { pagination, crudOperation, rrOperation, DateRangePicker },
  52. cruds() {
  53. return CRUD({ title: '部署历史', url: 'api/deployHistory', crudMethod: { del }})
  54. },
  55. mixins: [presenter(), header()],
  56. data() {
  57. return {
  58. delLoading: false,
  59. permission: {
  60. del: ['admin', 'deployHistory:del']
  61. }
  62. }
  63. },
  64. created() {
  65. this.crud.optShow = {
  66. add: false,
  67. edit: false,
  68. del: true,
  69. download: true
  70. }
  71. },
  72. methods: {
  73. delMethod(id) {
  74. this.delLoading = true
  75. del([id]).then(() => {
  76. this.delLoading = false
  77. this.$refs[id].doClose()
  78. this.crud.dleChangePage(1)
  79. this.crud.delSuccessNotify()
  80. this.crud.toQuery()
  81. }).catch(() => {
  82. this.delLoading = false
  83. this.$refs[id].doClose()
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped>
  90. </style>