selectTbTableInfoModal.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <a-modal
  3. title="选择展示"
  4. :visible="visible"
  5. :destroyOnClose="true"
  6. wrapClassName="code-modal-9136076486841527"
  7. style="top:20px;"
  8. width="850px"
  9. :footer="null"
  10. @cancel="handleCancel"
  11. >
  12. <a-alert message="目前该数据库表关联的表单存在多个,请选择其中一个!" type="info" banner/><br>
  13. <a-table bordered :data-source="dataSource" :columns="columns" :rowKey='record=>record.id' :pagination="false">
  14. <span slot="type" slot-scope="text, record">
  15. <a-tag color="cyan" v-if="record.type=='1'">PC端</a-tag>
  16. <a-tag color="blue" v-if="record.type=='2'">钉钉端</a-tag>
  17. </span>
  18. <template slot="operation" slot-scope="text, record">
  19. <a href="javascript:;" @click="textClick(record)">确定</a>
  20. </template>
  21. </a-table>
  22. </a-modal>
  23. </template>
  24. <script>
  25. /*
  26. * author kcz
  27. * date 2019-11-20
  28. * description 导入json Modal
  29. */
  30. export default {
  31. name: "selectTbTableInfoModal",
  32. data() {
  33. return {
  34. dataSource:[],
  35. columns:[
  36. {
  37. title: '表单名称',
  38. dataIndex: 'text',
  39. scopedSlots: { customRender: 'text' },
  40. },
  41. {
  42. title: '数据库表名',
  43. dataIndex: 'businessTable',
  44. },
  45. {
  46. title: '表单描述',
  47. dataIndex: 'stepMemo',
  48. },
  49. {
  50. title: "表单类型",
  51. dataIndex: "type",
  52. scopedSlots: { customRender: "type" }
  53. },
  54. {
  55. title: '操作',
  56. dataIndex: 'operation',
  57. scopedSlots: { customRender: 'operation' },
  58. }
  59. ],
  60. visible: false,
  61. jsonData: {},
  62. text:"",//表单标题
  63. businessTable:""//数据库表名称
  64. ,formData:{}
  65. };
  66. },
  67. methods: {
  68. handleCancel() {
  69. this.visible = false;
  70. },
  71. textClick(data){
  72. console.log(data)
  73. //获取json展示的数据
  74. this.jsonData.list = data.jsonContent.list;
  75. this.jsonData.config = data.jsonContent.config;
  76. this.jsonData.config.layout = data.jsonContent.config.layout;
  77. //当前填写数据存储,用于其他页面获取
  78. this.formData.businessTable=data.businessTable;//数据库表明
  79. this.formData.text=data.text;//表单标题
  80. this.formData.stepMemo=data.stepMemo;//表单标题
  81. this.handleCancel();
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="less" scoped>
  87. .hint-box {
  88. background: #e9e9e9;
  89. margin: 0;
  90. border-bottom: 2px solid #fff;
  91. }
  92. </style>