km-atom-table.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <table :class="$style.table">
  3. <colgroup>
  4. <col :class="$style.label" />
  5. <col :class="$style.input" />
  6. </colgroup>
  7. <tr>
  8. <sd-form-item-td name="category" :input-props="{ defaultValue: defaultCategory }">
  9. <template v-slot:read-and-edit="{ editable }">
  10. <km-tree-select
  11. v-model="model.category"
  12. :editable="editable"
  13. tree-data-url="api/xcoa-mobile/v1/km-knowledge-category/knowledge-category-tree?pageId=kmKnowledge"
  14. ></km-tree-select>
  15. </template> </sd-form-item-td
  16. ></tr>
  17. <tr>
  18. <sd-form-item-td name="title"></sd-form-item-td>
  19. </tr>
  20. <tr>
  21. <sd-form-item-td name="label">
  22. <km-tag-picker v-model="model.label" />
  23. </sd-form-item-td>
  24. </tr>
  25. <tr>
  26. <sd-form-item-td name="content">
  27. <sd-quill-editor v-model="model.content" :options="editorOption" :class="$style.editor" />
  28. </sd-form-item-td>
  29. </tr>
  30. <tr>
  31. <sd-form-item-td name="source" :input-props="{ defaultValue: '创建' }"></sd-form-item-td>
  32. </tr>
  33. <tr>
  34. <sd-form-item-td name="creatorName"></sd-form-item-td>
  35. </tr>
  36. <tr>
  37. <sd-form-item-td name="createDeptName"></sd-form-item-td>
  38. </tr>
  39. <tr>
  40. <sd-form-item-td name="atomState" :hidden="true" />
  41. </tr>
  42. <tr>
  43. <sd-form-item-td name="type" :input-props="{ defaultValue: 1 }" :hidden="true" />
  44. </tr>
  45. </table>
  46. </template>
  47. <script>
  48. import components from './_import-components/km-atom-table-import'
  49. export default {
  50. name: 'KmAtomTable',
  51. components,
  52. props: {
  53. model: {
  54. type: Object,
  55. default: () => {},
  56. },
  57. defaultCategory: {
  58. type: [Array, String],
  59. default: undefined,
  60. },
  61. },
  62. data() {
  63. return {
  64. editorOption: {
  65. placeholder: '请从此处开始输入文本...',
  66. },
  67. }
  68. },
  69. methods: {},
  70. }
  71. </script>
  72. <style module lang="scss">
  73. @use '@/common/design' as *;
  74. .table {
  75. .label {
  76. width: 15%;
  77. }
  78. .input {
  79. width: 85%;
  80. }
  81. }
  82. .editor {
  83. margin: 0 auto;
  84. :global(.ql-editor) {
  85. min-height: 300px;
  86. line-height: 1.5;
  87. }
  88. }
  89. </style>