audit-model-logic.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <a-modal v-model="isShow" :footer="null" :title="title" @cancel="cancel">
  3. <table>
  4. <tr>
  5. <sd-quill-editor v-model="data" :options="editorOption" @onreset="() => onKey++" />
  6. </tr>
  7. </table>
  8. </a-modal>
  9. </template>
  10. <script>
  11. import components from './_import-components/audit-model-logic-import'
  12. export default {
  13. name: 'AuditModelLogic',
  14. metaInfo: {
  15. title: 'AuditModelLogic',
  16. },
  17. components,
  18. // 是否显示
  19. model: {
  20. prop: 'value',
  21. event: 'input',
  22. },
  23. props: {
  24. title: {
  25. type: String,
  26. default: '模型逻辑',
  27. },
  28. // 内容
  29. content: {
  30. type: String,
  31. default: '',
  32. },
  33. value: {
  34. type: Boolean,
  35. default: false,
  36. },
  37. },
  38. data() {
  39. return {
  40. data: '',
  41. onKey: 0,
  42. // 富文本
  43. editorOption: {
  44. modules: {
  45. toolbar: {
  46. container: [
  47. ['bold', 'italic', 'underline', 'strike'], // toggled buttons
  48. ['blockquote', 'code-block'],
  49. [{ header: 1 }, { header: 2 }], // custom button values
  50. [{ list: 'ordered' }, { list: 'bullet' }],
  51. [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
  52. [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
  53. [{ direction: 'rtl' }], // text direction
  54. [{ size: ['small', false, 'large', 'huge'] }], // custom dropdown
  55. [{ header: [1, 2, 3, 4, 5, 6, false] }],
  56. [{ color: [] }, { background: [] }], // dropdown with defaults from theme
  57. [{ font: [] }],
  58. [{ align: [] }],
  59. ['clean'], // remove formatting button
  60. ['link', 'image'], // link and image, video
  61. ],
  62. },
  63. },
  64. },
  65. isShow: false,
  66. }
  67. },
  68. watch: {
  69. value(val) {
  70. this.isShow = val
  71. if (val) {
  72. this.data = this.content
  73. }
  74. },
  75. },
  76. created() {
  77. this.isShow = this.value
  78. },
  79. methods: {
  80. // 取消
  81. cancel() {
  82. this.isShow = false
  83. this.$emit('input', false)
  84. },
  85. },
  86. }
  87. </script>
  88. <style module lang="scss">
  89. @use '@/common/design' as *;
  90. </style>