xm-user-config.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <a-card :class="$style.sysmangeCard">
  3. <h2 :class="$style.title">关键用户配置</h2>
  4. <sd-form
  5. v-if="formData.pageFormData"
  6. ref="form"
  7. :init-values="formData.pageFormData.pageFieldInfos"
  8. >
  9. <template>
  10. <sd-form-item name="user1" />
  11. <div :class="$style.button">
  12. <a-button type="primary" :loading="isSubmitting" @click="btnClick">
  13. 保存
  14. </a-button>
  15. </div>
  16. </template>
  17. </sd-form>
  18. </a-card>
  19. </template>
  20. <script>
  21. import { Message } from 'ant-design-vue'
  22. import TrackService from '../track-service'
  23. import components from './_import-components/xm-user-config-import'
  24. export default {
  25. name: 'XmUserConfig',
  26. metaInfo: {
  27. title: '关键用户配置',
  28. },
  29. components,
  30. data() {
  31. return {
  32. formData: {},
  33. isSubmitting: false,
  34. }
  35. },
  36. created() {
  37. this.initData()
  38. },
  39. methods: {
  40. initData() {
  41. TrackService.getMonitorConfig().then((res) => {
  42. this.formData = res.data
  43. })
  44. },
  45. btnClick() {
  46. const beanId = parseInt(this.formData.pageFormData.beanId)
  47. const newid = [{ name: 'id', value: beanId }]
  48. // 提交表单
  49. const input = newid.concat(this.$refs.form.getBackendValues())
  50. const data = {
  51. eventId: 'save',
  52. inputs: input,
  53. pageFlowId: this.formData.attrs.pageflowId,
  54. pagePath: this.formData.attrs.pagePath,
  55. }
  56. TrackService.saveMonitorConfig(data).then((res) => {
  57. if (res && res.data) {
  58. Message.success('保存成功')
  59. this.isSubmitting = false
  60. }
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style module lang="scss">
  67. @use '@/common/design' as *;
  68. .sysmange-card {
  69. .title {
  70. text-align: center;
  71. }
  72. :global(.ant-form) {
  73. :global(.ant-form-item-label) {
  74. float: left;
  75. width: 30%;
  76. }
  77. :global(.ant-form-item-control-wrapper) {
  78. float: left;
  79. width: 60%;
  80. }
  81. }
  82. .button {
  83. display: flex;
  84. justify-content: center;
  85. }
  86. .picker {
  87. min-width: 70%;
  88. max-width: 70%;
  89. margin-left: 20px;
  90. :global(.ant-select) {
  91. width: 100%;
  92. }
  93. }
  94. .span {
  95. display: flex;
  96. justify-content: center;
  97. }
  98. }
  99. </style>