4f71f214a4fa0ff25aed05231853821364422502.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div>
  3. <a-modal
  4. :width="modalWidth"
  5. :visible="visible"
  6. title="数据对比窗口"
  7. :confirmLoading="confirmLoading"
  8. @ok="handleOk"
  9. @cancel="handleCancel"
  10. cancelText="取消">
  11. <a-spin :spinning="confirmLoading">
  12. <a-form @submit="handleSubmit" :form="form" class="form">
  13. <a-row class="form-row" :gutter="24">
  14. <a-col :md="12" :sm="8">
  15. <a-form-item label="数据库表名" :label-col="{ span: 6 }" :wrapper-col="{ span: 15 }">
  16. <a-input placeholder="请输入数据库表名" v-decorator="[ 'dataTale', {}]" @blur="handleTableBlur" disabled/>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="12" :sm="8">
  20. <a-form-item label="数据ID" :label-col="{ span: 5 }" :wrapper-col="{ span: 15 }">
  21. <a-input placeholder="请输入数据ID" v-decorator="[ 'dataId', {}]" @blur="handleIdBlur" disabled/>
  22. </a-form-item>
  23. </a-col>
  24. </a-row>
  25. <a-row class="form-row" :gutter="24">
  26. <a-col :md="12" :sm="8">
  27. <a-form-item label="版本号1" :label-col="{ span: 6 }" :wrapper-col="{ span: 15 }">
  28. <a-select placeholder="请选择版本号" v-decorator="[ 'dataVersion1', {}]" @change="handleChange1">
  29. <a-select-option v-for="(log,logindex) in DataVersionList" :key="logindex.toString()" :value="log.id">
  30. {{ log.dataVersion }}
  31. </a-select-option>
  32. </a-select>
  33. </a-form-item>
  34. </a-col>
  35. <a-col :md="12" :sm="8">
  36. <a-form-item label="版本号2" :label-col="{ span: 5 }" :wrapper-col="{ span: 15 }">
  37. <a-select placeholder="请选择版本号" v-decorator="[ 'dataVersion2', {}]" @change="handleChange2">
  38. <a-select-option v-for="(log,logindex) in DataVersionList" :key="logindex.toString()" :value="log.id">
  39. {{ log.dataVersion }}
  40. </a-select-option>
  41. </a-select>
  42. </a-form-item>
  43. </a-col>
  44. </a-row>
  45. </a-form>
  46. </a-spin>
  47. <data-log-compare-modal ref="modal" @ok="modalFormOk" ></data-log-compare-modal>
  48. </a-modal>
  49. </div>
  50. </template>
  51. <script>
  52. import { getAction } from '@/api/manage'
  53. import DataLogCompareModal from './DataLogCompareModal'
  54. export default {
  55. name: 'DataLogModal',
  56. components: { DataLogCompareModal },
  57. dataId1:'',
  58. dataId2: '',
  59. dataTable1:'',
  60. dataID3:'',
  61. data () {
  62. return {
  63. modalWidth:700,
  64. modaltoggleFlag:true,
  65. confirmDirty: false,
  66. title:"操作",
  67. visible: false,
  68. model: {},
  69. confirmLoading: false,
  70. headers:{},
  71. form:this.$form.createForm(this),
  72. url: {
  73. queryDataVerListUrl:"/sys/dataLog/queryDataVerList",
  74. },
  75. DataVersionList:[],
  76. }
  77. },
  78. created () {
  79. },
  80. methods: {
  81. addModal(records){
  82. const dataTable = records[0].dataTable
  83. const dataId = records[0].dataId;
  84. const dataVersion1 = records[0].dataVersion;
  85. const dataVersion2 = records[1].dataVersion;
  86. this.dataId1 = records[0].id;
  87. this.dataId2 = records[1].id;
  88. this.dataTable1 = records[0].dataTable
  89. this.dataID3 = records[0].dataId
  90. this.initDataVersionList();
  91. this.form.resetFields();
  92. this.visible = true;
  93. this.$nextTick(() => {
  94. this.form.setFieldsValue({dataTale:dataTable,dataId:dataId,dataVersion1:dataVersion1,dataVersion2:dataVersion2});
  95. });
  96. },
  97. handleOk () {
  98. this.close();
  99. this.$refs.modal.compareModal(this.dataId1 ,this.dataId2);
  100. this.$refs.modal.title="数据比较";
  101. },
  102. handleCancel(){
  103. this.close()
  104. },
  105. handleSubmit(){
  106. },
  107. close () {
  108. this.$emit('close');
  109. this.visible = false;
  110. this.disableSubmit = false;
  111. },
  112. modalFormOk () {
  113. },
  114. initDataVersionList(){
  115. let that = this;
  116. getAction(that.url.queryDataVerListUrl,{dataTable:this.dataTable1,dataId:this.dataID3}).then((res)=>{
  117. if(res.success){
  118. this.DataVersionList = res.result;
  119. }else{
  120. this.DataVersionList=[];
  121. this.dataId1 = '',
  122. this.dataId2='',
  123. console.log(res.message);
  124. }
  125. });
  126. },
  127. handleChange1(value) {
  128. this.dataId1 = value;
  129. },
  130. handleChange2(value) {
  131. this.dataId2 = value;
  132. },
  133. handleTableBlur(e){
  134. this.dataTable1 = e.target.value;
  135. this.initDataVersionList();
  136. },
  137. handleIdBlur(e){
  138. this.dataID3 = e.target.value;
  139. this.initDataVersionList();
  140. }
  141. }
  142. }
  143. </script>
  144. <style scoped>
  145. </style>