km-set-km-admin.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <a-card>
  3. <sd-detail-form
  4. v-if="showForm"
  5. ref="docform"
  6. :record-id="docId"
  7. :page-id="pageId"
  8. :class="$style.docform"
  9. @saved="fwSaved"
  10. >
  11. <template>
  12. <sd-form-item name="kmAdminMember" />
  13. </template>
  14. </sd-detail-form>
  15. </a-card>
  16. </template>
  17. <script>
  18. import { Message } from 'ant-design-vue'
  19. import KmKnowledageService from '../km-knowledage-service'
  20. import components from './_import-components/km-set-km-admin-import'
  21. export default {
  22. name: 'KmSetKmAdmin',
  23. metaInfo: {
  24. title: '设置KM管理员',
  25. },
  26. components,
  27. data() {
  28. return {
  29. pageId: 'km/admin/kmAdmin',
  30. docId: null,
  31. showForm: false,
  32. }
  33. },
  34. created() {
  35. this.getFirstDocData()
  36. },
  37. methods: {
  38. // 进来的时候先调用列表接口,然后打开第一条文档,没有的话打开新建的页面
  39. getFirstDocData() {
  40. KmKnowledageService.getKmId().then((res) => {
  41. if (res.data !== -1) {
  42. this.docId = res.data
  43. this.showForm = true
  44. } else {
  45. this.docId = undefined
  46. this.showForm = true
  47. }
  48. })
  49. },
  50. fwSaved() {
  51. Message.success('保存成功')
  52. },
  53. },
  54. }
  55. </script>
  56. <style module lang="scss">
  57. @use '@/common/design' as *;
  58. .docform {
  59. width: 60%;
  60. margin: 5% auto 0;
  61. :global(.sd-form-btns-close) {
  62. display: none;
  63. }
  64. }
  65. </style>