tOperatingLogForm.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. var lib = new DirewolfLibrary()
  2. // eslint-disable-next-line no-new
  3. new window.Vue({
  4. el: '#app',
  5. data: function () {
  6. return {
  7. /**
  8. * 微服务配置
  9. */
  10. msConfig: window.__CONTRACT_CONFIG__,
  11. formLoading: true,
  12. /**
  13. * 实体对象数据
  14. */
  15. entity: {
  16. /**
  17. * 主键
  18. */
  19. id: lib.$$utils.getQueryString('id') || '',
  20. /**
  21. * 操作日期
  22. */
  23. operTime: '',
  24. /**
  25. * 操作日期区间,格式参考['2018-10-01', '2018-10-30']
  26. */
  27. operTimeRange: [],
  28. /**
  29. * 操作人员账号
  30. */
  31. operPerAccount: '',
  32. /**
  33. * 操作模块
  34. */
  35. operModule: '',
  36. /**
  37. * 操作动作
  38. */
  39. operAction: '',
  40. /**
  41. * 运维人员
  42. */
  43. operMaintenPer: '',
  44. /**
  45. * URL
  46. */
  47. operUrl: '',
  48. /**
  49. * 合同编号
  50. */
  51. operContractCode: '',
  52. /**
  53. * 采购申请号
  54. */
  55. operPurchaseApplyCode: '',
  56. /**
  57. * 订单编号
  58. */
  59. operOrderCode: '',
  60. /**
  61. * 提交次数
  62. */
  63. operSubmitCount: null,
  64. /**
  65. * 备注
  66. */
  67. operRemark: '',
  68. },
  69. /**
  70. * 页面编辑类型,控制页面组件是否可用
  71. */
  72. editType: lib.$$utils.getQueryString('editType'),
  73. /**
  74. * 校验规则,对应页面el-form-item的prop属性值
  75. */
  76. rules: {
  77. operTime: [
  78. ],
  79. operPerAccount: [
  80. { max: 60, message: '长度不能超过 60 个字符', trigger: 'change' },
  81. ],
  82. operModule: [
  83. { max: 100, message: '长度不能超过 100 个字符', trigger: 'change' },
  84. ],
  85. operAction: [
  86. { max: 100, message: '长度不能超过 100 个字符', trigger: 'change' },
  87. ],
  88. operMaintenPer: [
  89. { max: 50, message: '长度不能超过 50 个字符', trigger: 'change' },
  90. ],
  91. operUrl: [
  92. { max: 500, message: '长度不能超过 500 个字符', trigger: 'change' },
  93. ],
  94. operContractCode: [
  95. { max: 1000, message: '长度不能超过 1000 个字符', trigger: 'change' },
  96. ],
  97. operPurchaseApplyCode: [
  98. { max: 3000, message: '长度不能超过 3000 个字符', trigger: 'change' },
  99. ],
  100. operOrderCode: [
  101. { max: 1000, message: '长度不能超过 1000 个字符', trigger: 'change' },
  102. ],
  103. operSubmitCount: [
  104. { validator: lib.$$utils.validator.checkNumber, max: 10, precision: 0, name: '提交次数', trigger: 'change' },
  105. ],
  106. },
  107. }
  108. },
  109. computed: {
  110. /**
  111. * 页面是否处于查看模式
  112. */
  113. inViewMode: function () {
  114. return this.editType === 'view'
  115. },
  116. /**
  117. * 页面请求前缀
  118. */
  119. urlPrefix: function () {
  120. return this.msConfig['gatewayRoute'] + this.msConfig['direwolfAdmin'] + '/contract/common/tOperatingLog'
  121. },
  122. },
  123. methods: {
  124. /**
  125. * 初始化表单数据
  126. */
  127. initFormData: function () {
  128. var vm = this
  129. var pkValue = vm.entity.id
  130. if (pkValue) {
  131. vm.$$utils.axiosRequest(vm.urlPrefix + '/getEntity?id=' + pkValue,
  132. '获取日志信息信息')
  133. .then(function (result) {
  134. vm.formLoading = false
  135. vm.entity = result.data
  136. })
  137. } else {
  138. vm.formLoading = false
  139. }
  140. },
  141. /**
  142. * 保存数据
  143. *
  144. * @param {function} success 成功回调
  145. */
  146. save (success) {
  147. this.$$utils.eleFormSubmit({
  148. vueIns: this,
  149. saveUrl: this.urlPrefix + '/save',
  150. formRef: 'tOperatingLogForm',
  151. info: '保存日志信息',
  152. success,
  153. })
  154. },
  155. },
  156. created: function () {
  157. var vm = this
  158. vm.$$utils.permission.checkPagePermission(vm.urlPrefix + '/checkTOperatingLogFormPermission')
  159. .then(function (hasPermission) {
  160. vm.initFormData()
  161. })
  162. },
  163. })