阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.7 KiB

  1. <template>
  2. <!--新增 / 编辑 表单组件-->
  3. <el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
  4. <span class="dialog-right-top" />
  5. <span class="dialog-left-bottom" />
  6. <div class="setting-dialog">
  7. <!-- form -->
  8. <!-- @emitTableList="getTableList" -->
  9. <PreviewForm ref="previewForm" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" :is-disabled="isDisabled" :is-has-code="isHasCode" />
  10. <div slot="footer" class="dialog-footer">
  11. <!-- :loading="crud.status.cu === 2" -->
  12. <el-button type="text" @click="formVisible = false">取消</el-button>
  13. <el-button type="primary" @click="formVisible = false">确定</el-button>
  14. </div>
  15. </div>
  16. </el-dialog>
  17. </template>
  18. <script>
  19. import PreviewForm from '@/views/components/category/PreviewForm'
  20. import addJson from './add.json'
  21. export default {
  22. components: { PreviewForm },
  23. data() {
  24. return {
  25. formVisible: false,
  26. formTitle: '新增文件',
  27. loading: false,
  28. formPreviewData: null,
  29. selectedCategory: null,
  30. parentsId: null,
  31. arcId: null,
  32. isDesFormType: 'arcives',
  33. isDisabled: true,
  34. isHasCode: false
  35. }
  36. },
  37. created() {
  38. this.formPreviewData = addJson
  39. },
  40. methods: {
  41. handleClose(done) {
  42. done()
  43. this.formVisible = false
  44. },
  45. save() {
  46. // this.loading = true
  47. // if (this.title === '新增文件') {
  48. // const addData = this.formData.fields.map((item) => {
  49. // return {
  50. // dictionaryId: item.id,
  51. // fieldName: item.fieldName,
  52. // fieldCnName: item.fieldCnName,
  53. // connector: item.connector,
  54. // categoryId: item.categoryId
  55. // }
  56. // })
  57. // add(addData).then((res) => {
  58. // this.$message({
  59. // message: '保存成功',
  60. // type: 'success',
  61. // duration: 2500
  62. // })
  63. // this.cuDialogVisible = false
  64. // this.loading = false
  65. // this.$emit('refresh')
  66. // })
  67. // } else {
  68. // edit(this.formData.fields).then((res) => {
  69. // this.$message({
  70. // message: '保存成功',
  71. // type: 'success',
  72. // duration: 2500
  73. // })
  74. // this.cuDialogVisible = false
  75. // this.loading = false
  76. // this.$emit('refresh')
  77. // })
  78. // }
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. </style>