iam-dm-datatranslog-form.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <audit-form-top-banner :form-data="mode">
  3. <sd-detail-form
  4. ref="docform"
  5. form-id="iamFinDataTransformLog"
  6. page-id="dm/datatransLog/iamFinDataTransformLog"
  7. :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
  8. :class="$style.form"
  9. :read-only="true"
  10. @close="close(true)"
  11. @sdFormReady="sdFormReady"
  12. >
  13. <template v-slot="{ model, fields }">
  14. <table>
  15. <tr>
  16. <td style="padding-left:5px;border:none">
  17. <audit-advanced-group
  18. :expand="basicExpand"
  19. :expand-str="'basicExpand'"
  20. :group-label="'基本信息'"
  21. tablestyle="''"
  22. @changedClick="changedClick"
  23. ></audit-advanced-group>
  24. </td>
  25. </tr>
  26. </table>
  27. <table v-show="basicExpand">
  28. <tr>
  29. <!-- 任务编号 -->
  30. <sd-form-item-td name="taskId" />
  31. <sd-form-item-td name="ftpFileName" />
  32. </tr>
  33. <tr>
  34. <!-- 最后采集的XX平台单位编码 -->
  35. <sd-form-item-td name="lastUnitCode" label="XX单位编码" />
  36. <!-- 任务执行状态 -->
  37. <sd-form-item-td name="taskStatus" label="任务执行状态" />
  38. </tr>
  39. <tr>
  40. <!-- 任务开始时间 -->
  41. <sd-form-item-td name="beginTime" />
  42. <!-- 任务结束时间 -->
  43. <sd-form-item-td name="endTime" />
  44. </tr>
  45. <tr>
  46. <!-- 转换过程中是否发生错误 -->
  47. <sd-form-item-td
  48. name="hasError"
  49. :colspan="3"
  50. label="是否发生错误"
  51. :input-props="{ defaultValue: model.hasError === 1 ? '是' : '否' }"
  52. />
  53. </tr>
  54. <tr>
  55. <!-- 请求参数 -->
  56. <sd-form-item-td name="urlParameters" :colspan="3" />
  57. </tr>
  58. <tr>
  59. <!-- 定时管理ID -->
  60. <sd-form-item-td name="jobId" :colspan="3" />
  61. </tr>
  62. </table>
  63. <table>
  64. <tr
  65. ><td :colspan="4">
  66. <sd-form-item name="iamFinDataTransDetailLogEntities" :label="null">
  67. <template v-slot:read-and-edit="{ editable }">
  68. <audit-advanced-group
  69. :expand="contactExpand"
  70. :expand-str="'contactExpand'"
  71. :group-label="'日志详情'"
  72. @changedClick="changedClick"
  73. >
  74. <template>
  75. <xm-child-table
  76. v-if="contactExpand"
  77. ref="tabaData"
  78. v-model="model.iamFinDataTransDetailLogEntities"
  79. :class="$style.deptPlanChild"
  80. label="日志详情"
  81. :read-only="!editable"
  82. :fields="Array.from(fields.iamFinDataTransDetailLogEntities.attr.dync)"
  83. :columns="contactColumns"
  84. >
  85. <!-- input-form 表示这部分是子表组件的form插槽 -->
  86. <template v-slot:input-form="{ model }"> </template>
  87. </xm-child-table>
  88. </template>
  89. </audit-advanced-group>
  90. </template> </sd-form-item
  91. ></td>
  92. </tr>
  93. </table>
  94. </template>
  95. </sd-detail-form>
  96. </audit-form-top-banner>
  97. </template>
  98. <script>
  99. import axios from '@/common/services/axios-instance'
  100. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  101. import { message } from '@/common/one-ui'
  102. import auditFormTopBanner from '@product/iam/components/audit-form-top-banner'
  103. import auditAdvancedGroup from '@product/iam/components/audit-advanced-group'
  104. import auditAdvancedGroupMixins from '@product/iam/components/audit-advanced-group-mixins'
  105. import components from './_import-components/iam-dm-datatranslog-form-import'
  106. import 'element-ui/lib/theme-chalk/index.css'
  107. export default {
  108. name: 'IamDmDatatranslogForm',
  109. metaInfo: {
  110. title: '定时采集配置',
  111. },
  112. components: {
  113. ...components,
  114. auditAdvancedGroup,
  115. auditFormTopBanner,
  116. },
  117. mixins: [auditAdvancedGroupMixins],
  118. data() {
  119. return {
  120. configOptions: [], // 转换配置列表
  121. croninput: '',
  122. showCron: false,
  123. mode: null,
  124. saveFlag: true,
  125. basicExpand: true,
  126. contactExpand: true,
  127. etlConfigOptions: [],
  128. contactColumns: [
  129. {
  130. title: '序号',
  131. dataIndex: 'taskIndex',
  132. width: '80px',
  133. customRender: (text, record, index) => `${index + 1}`,
  134. },
  135. ],
  136. }
  137. },
  138. mounted() {},
  139. methods: {
  140. fnShowCron() {
  141. this.showCron = true
  142. },
  143. handleCancel(e) {
  144. this.showCron = !this.showCron
  145. },
  146. crontabFill(value) {
  147. // 确定后回传的值
  148. this.croninput = value
  149. this.$refs.docform.setFieldValue('jobCron', value)
  150. },
  151. configChange(val, option) {
  152. this.$refs.docform.setFieldValue('configId', Number(option.data.key))
  153. },
  154. // 页面加载完成后
  155. sdFormReady() {
  156. this.mode = this.$refs.docform.formData.mode
  157. this.croninput = this.$refs.docform.getFieldValue('jobCron')
  158. },
  159. // 保存
  160. saveForm() {
  161. this.$refs.docform.validateFields().then(() => {
  162. message.success('保存成功').then(() => {
  163. this.$refs.docform.saveBtnClick()
  164. })
  165. })
  166. // this.$refs.docform.saveBtnClick()
  167. },
  168. saved() {
  169. this.close(true)
  170. },
  171. close(flag) {
  172. crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
  173. window.close()
  174. },
  175. },
  176. }
  177. </script>
  178. <style module lang="scss">
  179. @use '@/common/design' as *;
  180. @import '@/webflow/sd-flow-form.scss';
  181. .connect-btn {
  182. float: right;
  183. font-weight: 400;
  184. font-size: 16px;
  185. top: 8px;
  186. cursor: pointer;
  187. margin-right: 10px;
  188. }
  189. .first-td {
  190. border: none !important;
  191. padding: 0;
  192. }
  193. </style>