d50637ea539fb9a7655b3cc6a01b038c285d4912.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-item label="表名">
  9. <a-input placeholder="请输入表名" v-model="queryParam.dataTable"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="数据ID">
  14. <a-input placeholder="请输入ID" v-model="queryParam.dataId"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  18. <a-col :md="6" :sm="24">
  19. <a-button type="primary" @click="searchQuery">查询</a-button>
  20. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  21. </a-col>
  22. </span>
  23. </a-row>
  24. </a-form>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleCompare()" type="primary" icon="plus">数据比较</a-button>
  29. </div>
  30. <!--table区 -->
  31. <div>
  32. <!--已选择的清空 -->
  33. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  34. <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  35. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  36. </div>
  37. <a-table
  38. ref="table"
  39. size="middle"
  40. bordered
  41. rowKey="id"
  42. :columns="columns"
  43. :dataSource="dataSource"
  44. :pagination="ipagination"
  45. :loading="loading"
  46. :rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
  47. @change="handleTableChange"
  48. >
  49. <!-- 字符串超长截取省略号显示-->
  50. <span slot="dataContent" slot-scope="text, record">
  51. <j-ellipsis :value="text" :length="80" />
  52. </span>
  53. </a-table>
  54. </div>
  55. <data-log-modal ref="modalForm" @ok="modalFormOk"></data-log-modal>
  56. </a-card>
  57. </template>
  58. <script>
  59. import DataLogModal from './modules/DataLogModal'
  60. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  61. import JEllipsis from "@/components/jeecg/JEllipsis";
  62. export default {
  63. name: 'DataLogList',
  64. mixins: [JeecgListMixin],
  65. components: {
  66. JEllipsis,
  67. DataLogModal
  68. },
  69. data() {
  70. return {
  71. description: '数据日志管理页面',
  72. //表头
  73. columns: [
  74. {
  75. title: '表名',
  76. align: 'center',
  77. dataIndex: 'dataTable',
  78. width: "120"
  79. }, {
  80. title: '数据ID',
  81. align: 'center',
  82. dataIndex: 'dataId',
  83. width: "120"
  84. }, {
  85. title: '版本号',
  86. align: 'center',
  87. dataIndex: 'dataVersion',
  88. width: "50"
  89. }, {
  90. title: '数据内容',
  91. align: 'center',
  92. dataIndex: 'dataContent',
  93. width: "150",
  94. scopedSlots: {customRender: 'dataContent'},
  95. }, {
  96. title: '创建人',
  97. align: 'center',
  98. dataIndex: 'createBy',
  99. width: "100"
  100. },
  101. ],
  102. url: {
  103. list: "/sys/dataLog/list",
  104. },
  105. }
  106. },
  107. methods: {
  108. handleCompare: function () {
  109. if (!this.selectionRows || this.selectionRows.length != 2) {
  110. this.openNotifIcon('请选择两条数据');
  111. return false;
  112. } else if (this.selectionRows[0].dataId != this.selectionRows[1].dataId) {
  113. this.openNotifIcon('请选择相同的数据库表和数据ID进行比较');
  114. return false;
  115. } else {
  116. this.$refs.modalForm.addModal(this.selectionRows);
  117. this.$refs.modalForm.title = "数据比较";
  118. }
  119. },
  120. openNotifIcon(msg) {
  121. this.$notification['warning']({
  122. message: '提示信息',
  123. description: msg,
  124. });
  125. },
  126. }
  127. }
  128. </script>
  129. <style scoped>
  130. @import '~@assets/less/common.less'
  131. </style>