@xfu0401/form-generator 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/.eslintrc.js +0 -48
- package/@xfu0401/form-generator/package.json +0 -62
- package/LICENSE +0 -127
- package/README.md +0 -268
- package/babel.config.js +0 -22
- package/public/favicon.ico +0 -0
- package/public/img/show/PixPin_2024-07-17_16-25-59.gif +0 -0
- package/public/img/show/PixPin_2024-07-17_16-33-51.png +0 -0
- package/public/img/show/file.png +0 -0
- package/public/img/show/image.png +0 -0
- package/public/img/show/pc/347/253/257/346/270/262/346/237/223.png +0 -0
- package/public/img/show/pc/347/253/257/350/257/246/346/203/205.png +0 -0
- package/public/img/show//344/272/213/344/273/266.png +0 -0
- package/public/img/show//345/205/250/345/261/200/344/272/213/344/273/266.png +0 -0
- package/public/img/show//345/205/250/345/261/200/346/240/267/345/274/217.png +0 -0
- package/public/img/show//346/240/267/345/274/217/345/261/236/346/200/247.png +0 -0
- package/public/img/show//347/247/273/345/212/250/347/253/257/346/270/262/346/237/223.png +0 -0
- package/public/img/show//347/247/273/345/212/250/347/253/257/350/257/246/346/203/205.png +0 -0
- package/public/img/show//347/274/226/350/276/221/345/231/2502.png +0 -0
- package/public/img/show//347/274/226/350/276/221/345/231/2503.png +0 -0
- package/public/img/show//347/274/226/350/276/221/345/231/2504.png +0 -0
- package/public/img/temp//344/270/273/344/273/216/350/241/250/345/215/225.jpg +0 -0
- package/public/img/temp//345/210/206/347/273/204/350/241/250/345/215/225.jpg +0 -0
- package/public/img/temp//345/215/225/345/210/227/350/241/250/345/215/225.jpg +0 -0
- package/public/img/temp//345/233/272/345/256/232/350/241/250/346/240/274/350/241/250/345/215/225.jpg +0 -0
- package/public/img/temp//345/244/232/345/210/227/350/241/250/345/215/225.jpg +0 -0
- package/public/img/temp//346/240/207/347/255/276/351/241/265/350/241/250/345/215/225.jpg +0 -0
- package/public/index.html +0 -25
- package/public/static/js/config.js +0 -2
- package/src/App.vue +0 -18
- package/src/api/data.js +0 -52
- package/src/components/Layout/Layout.vue +0 -28
- package/src/components/Layout/LeftMenu.vue +0 -46
- package/src/components/SvgIcon/index.vue +0 -43
- package/src/components/code/Code.vue +0 -98
- package/src/components/common/FGDialog.vue +0 -100
- package/src/components/editor/CodeDialog.vue +0 -68
- package/src/components/editor/CodeEditor.vue +0 -191
- package/src/components/editor/CodeJson.vue +0 -130
- package/src/components/editor/CssEditor.vue +0 -84
- package/src/components/editor/EventEditor.vue +0 -84
- package/src/components/editor/JsonDialog.vue +0 -55
- package/src/components/editor/JsonEditor.vue +0 -58
- package/src/components/editor/components/EditorLeft.vue +0 -138
- package/src/components/fileComs/ExportExcel.vue +0 -49
- package/src/components/fileComs/ExportJson.vue +0 -52
- package/src/components/fileComs/ImportExcel.vue +0 -96
- package/src/components/fileComs/ImportJson.vue +0 -65
- package/src/components/formGenerator/components/formExport.vue +0 -52
- package/src/components/formGenerator/components/formGeneratorAttrField.vue +0 -1113
- package/src/components/formGenerator/components/formGeneratorAttrForm.vue +0 -98
- package/src/components/formGenerator/components/formGeneratorCom.vue +0 -108
- package/src/components/formGenerator/components/formGeneratorOutline.vue +0 -159
- package/src/components/formGenerator/components/formGeneratorTemp.vue +0 -77
- package/src/components/formGenerator/components/formImport.vue +0 -62
- package/src/components/formGenerator/components/formPreview.vue +0 -102
- package/src/components/formGenerator/configComponents/DataConfig.vue +0 -156
- package/src/components/formGenerator/configComponents/DataDialog.vue +0 -188
- package/src/components/formGenerator/configComponents/EventConfig.vue +0 -56
- package/src/components/formGenerator/configComponents/PageConfig.vue +0 -55
- package/src/components/formGenerator/configComponents/RegConfig.vue +0 -105
- package/src/components/formGenerator/configComponents/ShadowConfig.vue +0 -95
- package/src/components/formGenerator/configComponents/SpaceConfig.vue +0 -187
- package/src/components/formGenerator/configComponents/StyleConfig.vue +0 -258
- package/src/components/formGenerator/configComponents/TableConfig.vue +0 -75
- package/src/components/formGenerator/configComponents/TableHead.vue +0 -141
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formButton.vue +0 -25
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formDivider.vue +0 -49
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formHtml.vue +0 -37
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formLink.vue +0 -26
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formNotice.vue +0 -118
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formRemark.vue +0 -29
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formSwipe.vue +0 -39
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formTable.vue +0 -130
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formTableExport.vue +0 -311
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formTag.vue +0 -30
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formText.vue +0 -27
- package/src/components/formGenerator/formComponents/pcComponents/assistComs/formTree.vue +0 -47
- package/src/components/formGenerator/formComponents/pcComponents/components/emptyTips.vue +0 -24
- package/src/components/formGenerator/formComponents/pcComponents/components/esignDialog.vue +0 -86
- package/src/components/formGenerator/formComponents/pcComponents/components/filesShow.vue +0 -121
- package/src/components/formGenerator/formComponents/pcComponents/components/imageShow.vue +0 -148
- package/src/components/formGenerator/formComponents/pcComponents/components/nameShow.vue +0 -54
- package/src/components/formGenerator/formComponents/pcComponents/components/tableOptions.vue +0 -56
- package/src/components/formGenerator/formComponents/pcComponents/components/tableStyle.vue +0 -58
- package/src/components/formGenerator/formComponents/pcComponents/components/userPicker.vue +0 -440
- package/src/components/formGenerator/formComponents/pcComponents/inputComs/formAutocomplete.vue +0 -79
- package/src/components/formGenerator/formComponents/pcComponents/inputComs/formInput.vue +0 -56
- package/src/components/formGenerator/formComponents/pcComponents/inputComs/formInputNumber.vue +0 -51
- package/src/components/formGenerator/formComponents/pcComponents/inputComs/formRichText.vue +0 -138
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formCard.vue +0 -35
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formCollapse.vue +0 -79
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formRowContainer.vue +0 -337
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formSteps.vue +0 -90
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formSub.vue +0 -219
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formTableContainer.vue +0 -277
- package/src/components/formGenerator/formComponents/pcComponents/layoutComs/formTabsContainer.vue +0 -65
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formCascader.vue +0 -62
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formCheckboxGroup.vue +0 -70
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formColorPicker.vue +0 -39
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formDatePicker.vue +0 -43
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formDaterangePicker.vue +0 -40
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formImage.vue +0 -235
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formOrgPicker.vue +0 -131
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formRadioGroup.vue +0 -59
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formRate.vue +0 -50
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSelect.vue +0 -62
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSelectHis.vue +0 -66
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSelectProject.vue +0 -62
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSignature.vue +0 -98
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSlider.vue +0 -46
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSwitch.vue +0 -37
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formTimePicker.vue +0 -41
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formTimerangePicker.vue +0 -40
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formUpload.vue +0 -253
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formUploadTemp.vue +0 -82
- package/src/components/formGenerator/formComponents/pcComponents/selectComs/formUserPicker.vue +0 -142
- package/src/components/formGenerator/formComponents/pcForm.vue +0 -155
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formButton.vue +0 -36
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formDivider.vue +0 -41
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formHtml.vue +0 -37
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formLink.vue +0 -49
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formNotice.vue +0 -43
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formRemark.vue +0 -39
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formSwipe.vue +0 -34
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formTable.vue +0 -132
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formTableExport.vue +0 -268
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formTag.vue +0 -147
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formText.vue +0 -27
- package/src/components/formGenerator/formComponents/phoneComponents/assistComs/formTree.vue +0 -21
- package/src/components/formGenerator/formComponents/phoneComponents/components/cascaderPicker.vue +0 -81
- package/src/components/formGenerator/formComponents/phoneComponents/components/datePicker.vue +0 -101
- package/src/components/formGenerator/formComponents/phoneComponents/components/esignDialog.vue +0 -156
- package/src/components/formGenerator/formComponents/phoneComponents/components/filesShow.vue +0 -128
- package/src/components/formGenerator/formComponents/phoneComponents/components/imageShow.vue +0 -123
- package/src/components/formGenerator/formComponents/phoneComponents/components/nameShow.vue +0 -84
- package/src/components/formGenerator/formComponents/phoneComponents/components/orgPicker.vue +0 -343
- package/src/components/formGenerator/formComponents/phoneComponents/components/tableShow.vue +0 -149
- package/src/components/formGenerator/formComponents/phoneComponents/components/textShow.vue +0 -25
- package/src/components/formGenerator/formComponents/phoneComponents/components/timePicker.vue +0 -90
- package/src/components/formGenerator/formComponents/phoneComponents/inputComs/formAutocomplete.vue +0 -163
- package/src/components/formGenerator/formComponents/phoneComponents/inputComs/formInput.vue +0 -111
- package/src/components/formGenerator/formComponents/phoneComponents/inputComs/formInputNumber.vue +0 -65
- package/src/components/formGenerator/formComponents/phoneComponents/inputComs/formRichText.vue +0 -147
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formCard.vue +0 -59
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formCollapse.vue +0 -71
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formRowContainer.vue +0 -94
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formSteps.vue +0 -112
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formSub.vue +0 -130
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formTableContainer.vue +0 -93
- package/src/components/formGenerator/formComponents/phoneComponents/layoutComs/formTabsContainer.vue +0 -64
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formCascader.vue +0 -210
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formCheckboxGroup.vue +0 -86
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formColorPicker.vue +0 -63
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formDatePicker.vue +0 -100
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formDateRangePicker.vue +0 -136
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formImage.vue +0 -278
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formOrgPicker.vue +0 -107
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formRadioGroup.vue +0 -93
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formRate.vue +0 -85
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSelect.vue +0 -138
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSelectHis.vue +0 -142
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSelectProject.vue +0 -138
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSignature.vue +0 -108
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSlider.vue +0 -79
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formSwitch.vue +0 -88
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formTimePicker.vue +0 -112
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formTimeRangePicker.vue +0 -155
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formUpload.vue +0 -310
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formUploadTemp.vue +0 -81
- package/src/components/formGenerator/formComponents/phoneComponents/selectComs/formUserPicker.vue +0 -114
- package/src/components/formGenerator/formComponents/phoneForm.vue +0 -134
- package/src/components/formGenerator/formGenerator.vue +0 -401
- package/src/components/formGenerator/styles/generator.scss +0 -271
- package/src/components/formGenerator/styles/index.scss +0 -136
- package/src/components/formGenerator/styles/left-coms.scss +0 -57
- package/src/components/formGenerator/styles/phone.scss +0 -269
- package/src/components/formGenerator/styles/theme.scss +0 -5
- package/src/components/formGenerator/utils/attribute.js +0 -107
- package/src/components/formGenerator/utils/comMixins.js +0 -148
- package/src/components/formGenerator/utils/component.js +0 -26
- package/src/components/formGenerator/utils/config.js +0 -1730
- package/src/components/formGenerator/utils/event.js +0 -82
- package/src/components/formGenerator/utils/formEvent.js +0 -43
- package/src/components/formGenerator/utils/index.js +0 -666
- package/src/components/formGenerator/utils/rules.js +0 -17
- package/src/components/formGenerator/utils/style.js +0 -75
- package/src/components/formGenerator/utils/table.js +0 -317
- package/src/components/formGenerator/utils/temps.js +0 -15303
- package/src/components/huComponents/FGBreadNav.vue +0 -86
- package/src/components/huComponents/FGCheckCell.vue +0 -107
- package/src/components/huComponents/FGCheckList.vue +0 -318
- package/src/components/huComponents/FGCheckPopUp.vue +0 -164
- package/src/components/huComponents/FGIconsDialog.vue +0 -124
- package/src/components/huComponents/FGNameImg.vue +0 -147
- package/src/components/huComponents/FGOptions.vue +0 -118
- package/src/components/huComponents/FGSelect.vue +0 -46
- package/src/components/huComponents/FGTreeNode.vue +0 -103
- package/src/components/huComponents/FGTreeNodeDialog.vue +0 -89
- package/src/components/huComponents/InputColor.vue +0 -117
- package/src/components/huComponents/InputNumber.vue +0 -78
- package/src/components/huComponents/LayoutTree.vue +0 -67
- package/src/components/huComponents/MenuButton.vue +0 -57
- package/src/components/index.js +0 -14
- package/src/icons/index.js +0 -10
- package/src/icons/svg/active.svg +0 -1
- package/src/icons/svg/addSold.svg +0 -1
- package/src/icons/svg/analyse.svg +0 -1
- package/src/icons/svg/button.svg +0 -1
- package/src/icons/svg/card.svg +0 -1
- package/src/icons/svg/cascader.svg +0 -1
- package/src/icons/svg/checkbox.svg +0 -1
- package/src/icons/svg/collapse.svg +0 -1
- package/src/icons/svg/color.svg +0 -1
- package/src/icons/svg/component.svg +0 -1
- package/src/icons/svg/date-range.svg +0 -1
- package/src/icons/svg/date.svg +0 -1
- package/src/icons/svg/default-dept.svg +0 -9
- package/src/icons/svg/default-role.svg +0 -5
- package/src/icons/svg/default-user.svg +0 -16
- package/src/icons/svg/dept.svg +0 -1
- package/src/icons/svg/divider.svg +0 -1
- package/src/icons/svg/ellipsis.svg +0 -2
- package/src/icons/svg/html.svg +0 -1
- package/src/icons/svg/image.svg +0 -1
- package/src/icons/svg/input.svg +0 -1
- package/src/icons/svg/link.svg +0 -1
- package/src/icons/svg/mp4.svg +0 -19
- package/src/icons/svg/notice.svg +0 -1
- package/src/icons/svg/noview.svg +0 -1
- package/src/icons/svg/number.svg +0 -1
- package/src/icons/svg/password.svg +0 -1
- package/src/icons/svg/pdf.svg +0 -18
- package/src/icons/svg/person.svg +0 -1
- package/src/icons/svg/png.svg +0 -18
- package/src/icons/svg/ppt.svg +0 -19
- package/src/icons/svg/process.svg +0 -1
- package/src/icons/svg/radio.svg +0 -1
- package/src/icons/svg/rate.svg +0 -1
- package/src/icons/svg/remark.svg +0 -1
- package/src/icons/svg/rich-text.svg +0 -1
- package/src/icons/svg/row.svg +0 -1
- package/src/icons/svg/select.svg +0 -1
- package/src/icons/svg/signature.svg +0 -1
- package/src/icons/svg/slider.svg +0 -1
- package/src/icons/svg/steps.svg +0 -1
- package/src/icons/svg/sub.svg +0 -1
- package/src/icons/svg/swipe.svg +0 -1
- package/src/icons/svg/switch.svg +0 -1
- package/src/icons/svg/table-edit.svg +0 -1
- package/src/icons/svg/table.svg +0 -1
- package/src/icons/svg/table2.svg +0 -1
- package/src/icons/svg/table3.svg +0 -1
- package/src/icons/svg/tabs.svg +0 -1
- package/src/icons/svg/tag.svg +0 -1
- package/src/icons/svg/text.svg +0 -1
- package/src/icons/svg/textarea.svg +0 -1
- package/src/icons/svg/time-range.svg +0 -1
- package/src/icons/svg/time.svg +0 -1
- package/src/icons/svg/tree.svg +0 -1
- package/src/icons/svg/unknow.svg +0 -20
- package/src/icons/svg/upload.svg +0 -1
- package/src/icons/svg/view.svg +0 -1
- package/src/icons/svg/word.svg +0 -20
- package/src/icons/svg/xlsx.svg +0 -18
- package/src/icons/svg/zip.svg +0 -20
- package/src/images/phone_bg.png +0 -0
- package/src/main.js +0 -26
- package/src/package/FGDesigner.vue +0 -114
- package/src/package/FGPcForm.vue +0 -100
- package/src/package/FGPcShow.vue +0 -69
- package/src/package/FGPhoneForm.vue +0 -106
- package/src/package/FGPhoneShow.vue +0 -69
- package/src/package/common/init.js +0 -23
- package/src/package/common/initPc.js +0 -26
- package/src/package/common/initPhone.js +0 -28
- package/src/package/common/mixins.js +0 -57
- package/src/package/index.js +0 -40
- package/src/plugins/richEditor/richEditorPc.vue +0 -478
- package/src/plugins/richEditor/richEditorPhone.vue +0 -520
- package/src/plugins/voiceTxtarea/voiceTxtarea.vue +0 -115
- package/src/router.js +0 -111
- package/src/store/index.js +0 -14
- package/src/store/modules/app.js +0 -54
- package/src/store/modules/user.js +0 -23
- package/src/style/color.scss +0 -10
- package/src/style/main.scss +0 -78
- package/src/utils/comsData.js +0 -279
- package/src/utils/defaultValue.js +0 -2288
- package/src/utils/drawingDefalut.js +0 -2749
- package/src/utils/iconData.js +0 -283
- package/src/utils/index.js +0 -6
- package/src/utils/progress.js +0 -96
- package/src/utils/request.js +0 -41
- package/src/views/coms/components/Attributes.vue +0 -28
- package/src/views/coms/components/ELink.vue +0 -23
- package/src/views/coms/components/Events.vue +0 -20
- package/src/views/coms/components/Example.vue +0 -42
- package/src/views/coms/components/Methods.vue +0 -20
- package/src/views/coms/components/VLink.vue +0 -23
- package/src/views/coms/comsDesiger.vue +0 -224
- package/src/views/coms/comsFormPc.vue +0 -76
- package/src/views/coms/comsFormPhone.vue +0 -103
- package/src/views/coms/comsShowPc.vue +0 -56
- package/src/views/coms/comsShowPhone.vue +0 -89
- package/src/views/config/components/configCell.vue +0 -111
- package/src/views/config/config.vue +0 -84
- package/src/views/demo/demo.vue +0 -235
- package/src/views/demo/demo2.vue +0 -131
- package/src/views/demo/table.js +0 -321
- package/src/views/document/index.vue +0 -140
- package/src/views/form/create.vue +0 -44
- package/vue.config.js +0 -72
- /package/{@xfu0401/form-generator/demo.html → demo.html} +0 -0
- /package/{@xfu0401/form-generator/form-generator.common.js → form-generator.common.js} +0 -0
- /package/{@xfu0401/form-generator/form-generator.common.js.map → form-generator.common.js.map} +0 -0
- /package/{@xfu0401/form-generator/form-generator.css → form-generator.css} +0 -0
- /package/{@xfu0401/form-generator/form-generator.umd.js → form-generator.umd.js} +0 -0
- /package/{@xfu0401/form-generator/form-generator.umd.js.map → form-generator.umd.js.map} +0 -0
- /package/{@xfu0401/form-generator/form-generator.umd.min.js → form-generator.umd.min.js} +0 -0
- /package/{@xfu0401/form-generator/form-generator.umd.min.js.map → form-generator.umd.min.js.map} +0 -0
- /package/{@xfu0401/form-generator/static → static}/fonts/element-icons.535877f5.woff +0 -0
- /package/{@xfu0401/form-generator/static → static}/fonts/element-icons.732389de.ttf +0 -0
- /package/{@xfu0401/form-generator/static → static}/img/phone_bg.7ead1463.png +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="Fg-code-json">
|
|
3
|
-
<textarea ref="codemirror" />
|
|
4
|
-
<slot></slot>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
// 引入CodeMirror和基础样式
|
|
10
|
-
import CodeMirror from "codemirror";
|
|
11
|
-
import "codemirror/lib/codemirror.css";
|
|
12
|
-
// JSON代码高亮需要由JavaScript插件支持
|
|
13
|
-
import "codemirror/mode/javascript/javascript.js";
|
|
14
|
-
// 选择IDEA主题样式,还有其他很多主题可选
|
|
15
|
-
import "codemirror/theme/idea.css";
|
|
16
|
-
// 支持使用Sublime快捷键
|
|
17
|
-
import "codemirror/keymap/sublime.js";
|
|
18
|
-
// 搜索功能的依赖
|
|
19
|
-
import "codemirror/addon/dialog/dialog.js";
|
|
20
|
-
import "codemirror/addon/dialog/dialog.css";
|
|
21
|
-
// 支持搜索功能
|
|
22
|
-
import "codemirror/addon/search/search";
|
|
23
|
-
import "codemirror/addon/search/searchcursor.js";
|
|
24
|
-
// 支持各种代码折叠
|
|
25
|
-
import "codemirror/addon/fold/foldgutter.css";
|
|
26
|
-
import "codemirror/addon/fold/foldcode.js";
|
|
27
|
-
import "codemirror/addon/fold/foldgutter.js";
|
|
28
|
-
import "codemirror/addon/fold/brace-fold.js";
|
|
29
|
-
import "codemirror/addon/fold/comment-fold.js";
|
|
30
|
-
// 支持代码区域全屏功能
|
|
31
|
-
import "codemirror/addon/display/fullscreen.css";
|
|
32
|
-
import "codemirror/addon/display/fullscreen.js";
|
|
33
|
-
// 支持括号自动匹配
|
|
34
|
-
import "codemirror/addon/edit/matchbrackets.js";
|
|
35
|
-
import "codemirror/addon/edit/closebrackets.js";
|
|
36
|
-
// 支持代码自动补全
|
|
37
|
-
import "codemirror/addon/hint/show-hint.css";
|
|
38
|
-
import "codemirror/addon/hint/show-hint.js";
|
|
39
|
-
import "codemirror/addon/hint/anyword-hint.js";
|
|
40
|
-
// 行注释
|
|
41
|
-
import "codemirror/addon/comment/comment.js";
|
|
42
|
-
// JSON错误检查
|
|
43
|
-
import "codemirror/addon/lint/lint.css";
|
|
44
|
-
import "codemirror/addon/lint/lint.js";
|
|
45
|
-
// 需要依赖全局的jsonlint,不是很优雅
|
|
46
|
-
import "codemirror/addon/lint/json-lint.js";
|
|
47
|
-
//及时自动更新,配置里面也需要设置autoRefresh为true
|
|
48
|
-
import "codemirror/addon/display/autorefresh";
|
|
49
|
-
// 引入jsonlint
|
|
50
|
-
import jsonlint from "jsonlint";
|
|
51
|
-
window.jsonlint = jsonlint;
|
|
52
|
-
|
|
53
|
-
export default {
|
|
54
|
-
name: "CodeEditor",
|
|
55
|
-
/* eslint-disable vue/require-prop-types */
|
|
56
|
-
props: {
|
|
57
|
-
value: [String, Number, Object, Array],
|
|
58
|
-
readonly: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
jsonEditor: false,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
// 监听是否数据改变,随时更新json数据
|
|
69
|
-
watch: {
|
|
70
|
-
value(value) {
|
|
71
|
-
// console.log(value);
|
|
72
|
-
const editorValue = this.jsonEditor.getValue();
|
|
73
|
-
if (value !== editorValue) {
|
|
74
|
-
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2));
|
|
75
|
-
}
|
|
76
|
-
this.jsonEditor.refresh();
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
mounted() {
|
|
80
|
-
// CodeMirror的配置项,搜官网看这里的配置项配置
|
|
81
|
-
this.jsonEditor = CodeMirror.fromTextArea(this.$refs.codemirror, {
|
|
82
|
-
mode: "application/json", // 接受的类型,json xml....
|
|
83
|
-
smartIndent: true, // 是否智能缩进
|
|
84
|
-
styleActiveLine: true, // 当前行高亮
|
|
85
|
-
lineNumbers: true, // 是否显示行数
|
|
86
|
-
indentUnit: 2, // 缩进单位,默认2
|
|
87
|
-
gutters: [
|
|
88
|
-
"CodeMirror-linenumbers",
|
|
89
|
-
"CodeMirror-foldgutter",
|
|
90
|
-
"CodeMirror-lint-markers", // CodeMirror-lint-markers是实现语法报错功能
|
|
91
|
-
],
|
|
92
|
-
lint: true,
|
|
93
|
-
//lineWrapping: true, // 自动换行
|
|
94
|
-
matchBrackets: true, // 括号匹配显示
|
|
95
|
-
autoCloseBrackets: true, // 输入和退格时成对
|
|
96
|
-
readonly: this.readonly, // 只读
|
|
97
|
-
foldGutter: true,
|
|
98
|
-
autoRefresh: true,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2));
|
|
102
|
-
this.jsonEditor.on("change", (cm) => {
|
|
103
|
-
this.$emit("changed", cm.getValue());
|
|
104
|
-
this.$emit("input", cm.getValue());
|
|
105
|
-
// 编辑json框里面的内容可以时刻监听到值,通过cm.getValue()获取到
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
methods: {
|
|
109
|
-
getValue() {
|
|
110
|
-
return this.jsonEditor.getValue();
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<style scoped>
|
|
117
|
-
.Fg-code-json {
|
|
118
|
-
height: 100%;
|
|
119
|
-
position: relative;
|
|
120
|
-
overflow: auto;
|
|
121
|
-
}
|
|
122
|
-
.Fg-code-json >>> .CodeMirror {
|
|
123
|
-
height: 100%;
|
|
124
|
-
min-height: 300px;
|
|
125
|
-
}
|
|
126
|
-
.Fg-code-json >>> .CodeMirror-scroll {
|
|
127
|
-
height: 100%;
|
|
128
|
-
min-height: 300px;
|
|
129
|
-
}
|
|
130
|
-
</style>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FGDialog
|
|
3
|
-
class="Fg-Editor-Dialog"
|
|
4
|
-
ref="FGDialog"
|
|
5
|
-
width="900px"
|
|
6
|
-
title="全局样式"
|
|
7
|
-
top="10vh"
|
|
8
|
-
@confirm="onConfirm"
|
|
9
|
-
>
|
|
10
|
-
<el-row>
|
|
11
|
-
<el-col :span="8" :style="{padding:'0 16px'}">
|
|
12
|
-
<EditorLeft v-model="active" :list.sync="list" />
|
|
13
|
-
</el-col>
|
|
14
|
-
<el-col :span="16">
|
|
15
|
-
<template v-for="(item,i) in list">
|
|
16
|
-
<CodeEditor
|
|
17
|
-
v-if="active==i && list[active]"
|
|
18
|
-
:key="i"
|
|
19
|
-
v-model="list[active].code"
|
|
20
|
-
:name="list[active].name"
|
|
21
|
-
mode="text/css"
|
|
22
|
-
placeholder="// 你的初始代码,如color:red"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
</el-col>
|
|
26
|
-
</el-row>
|
|
27
|
-
</FGDialog>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import CodeEditor from "./CodeEditor";
|
|
32
|
-
import EditorLeft from "./components/EditorLeft.vue";
|
|
33
|
-
import store from "@/store";
|
|
34
|
-
import { deepClone } from "../formGenerator/utils";
|
|
35
|
-
export default {
|
|
36
|
-
components: {
|
|
37
|
-
CodeEditor,
|
|
38
|
-
EditorLeft,
|
|
39
|
-
},
|
|
40
|
-
props: {
|
|
41
|
-
value: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: () => [],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
active: this.value.length ? 0 : "",
|
|
50
|
-
list: deepClone(this.value),
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
methods: {
|
|
55
|
-
open() {
|
|
56
|
-
this.$refs.FGDialog.open();
|
|
57
|
-
this.list = deepClone(this.value);
|
|
58
|
-
store.commit("SET_CSSLIST", this.list);
|
|
59
|
-
},
|
|
60
|
-
onConfirm() {
|
|
61
|
-
this.$refs.FGDialog.close();
|
|
62
|
-
this.$emit("input", this.list);
|
|
63
|
-
this.$emit("confirm", this.list);
|
|
64
|
-
store.commit("SET_CSSLIST", this.list);
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<style lang="scss" >
|
|
71
|
-
@import "@/components/formGenerator/styles/generator.scss";
|
|
72
|
-
.Fg-Editor-Dialog {
|
|
73
|
-
.el-row {
|
|
74
|
-
height: 100%;
|
|
75
|
-
border: 1px solid $borderColor;
|
|
76
|
-
.el-col {
|
|
77
|
-
height: 100%;
|
|
78
|
-
}
|
|
79
|
-
.el-col:first-child {
|
|
80
|
-
border-right: 1px solid $borderColor;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FGDialog
|
|
3
|
-
class="Fg-Editor-Dialog"
|
|
4
|
-
ref="FGDialog"
|
|
5
|
-
width="900px"
|
|
6
|
-
title="全局事件"
|
|
7
|
-
top="10vh"
|
|
8
|
-
@confirm="onConfirm"
|
|
9
|
-
>
|
|
10
|
-
<el-row>
|
|
11
|
-
<el-col :span="8" :style="{padding:'0 16px'}">
|
|
12
|
-
<EditorLeft v-model="active" :list.sync="list" disabled />
|
|
13
|
-
</el-col>
|
|
14
|
-
<el-col :span="16">
|
|
15
|
-
<template v-for="(item,i) in list">
|
|
16
|
-
<CodeEditor
|
|
17
|
-
v-if="active==i && list[active]"
|
|
18
|
-
:key="i"
|
|
19
|
-
v-model="list[active].code"
|
|
20
|
-
:name="list[active].name"
|
|
21
|
-
mode="text/javascript"
|
|
22
|
-
:placeholder="item.placeholder"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
</el-col>
|
|
26
|
-
</el-row>
|
|
27
|
-
</FGDialog>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import CodeEditor from "./CodeEditor";
|
|
32
|
-
import EditorLeft from "./components/EditorLeft.vue";
|
|
33
|
-
import store from "@/store";
|
|
34
|
-
import { deepClone } from "../formGenerator/utils";
|
|
35
|
-
export default {
|
|
36
|
-
components: {
|
|
37
|
-
CodeEditor,
|
|
38
|
-
EditorLeft,
|
|
39
|
-
},
|
|
40
|
-
props: {
|
|
41
|
-
value: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: () => [],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
active: this.value.length ? 0 : "",
|
|
50
|
-
list: deepClone(this.value),
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
methods: {
|
|
55
|
-
open() {
|
|
56
|
-
this.$refs.FGDialog.open();
|
|
57
|
-
this.list = deepClone(this.value);
|
|
58
|
-
store.commit("SET_EVENTLIST", this.list);
|
|
59
|
-
},
|
|
60
|
-
onConfirm() {
|
|
61
|
-
this.$refs.FGDialog.close();
|
|
62
|
-
this.$emit("input", this.list);
|
|
63
|
-
this.$emit("confirm", this.list);
|
|
64
|
-
store.commit("SET_EVENTLIST", this.list);
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<style lang="scss" >
|
|
71
|
-
@import "@/components/formGenerator/styles/generator.scss";
|
|
72
|
-
.Fg-Editor-Dialog {
|
|
73
|
-
.el-row {
|
|
74
|
-
height: 100%;
|
|
75
|
-
border: 1px solid $borderColor;
|
|
76
|
-
.el-col {
|
|
77
|
-
height: 100%;
|
|
78
|
-
}
|
|
79
|
-
.el-col:first-child {
|
|
80
|
-
border-right: 1px solid $borderColor;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FGDialog ref="FGDialog" top="8vh" width="900px" :title="title" @confirm="confirm">
|
|
3
|
-
<!-- <JsonEditor v-model="jsonContent" /> -->
|
|
4
|
-
<CodeJson v-model="jsonContent" />
|
|
5
|
-
<template slot="footer">
|
|
6
|
-
<slot name="footer"></slot>
|
|
7
|
-
</template>
|
|
8
|
-
</FGDialog>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
// import JsonEditor from "./JsonEditor";
|
|
13
|
-
import CodeJson from "./CodeJson.vue";
|
|
14
|
-
export default {
|
|
15
|
-
name: "JsonDialog",
|
|
16
|
-
components: {
|
|
17
|
-
// JsonEditor,
|
|
18
|
-
CodeJson,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
value: {},
|
|
22
|
-
title: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "编辑数据",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
jsonContent: {},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
open() {
|
|
34
|
-
this.jsonContent = this.value;
|
|
35
|
-
this.$refs.FGDialog.open();
|
|
36
|
-
},
|
|
37
|
-
close() {
|
|
38
|
-
this.$refs.FGDialog.close();
|
|
39
|
-
},
|
|
40
|
-
confirm(cb) {
|
|
41
|
-
let value = this.jsonContent;
|
|
42
|
-
try {
|
|
43
|
-
value = JSON.parse(this.jsonContent || "{}");
|
|
44
|
-
} catch (error) {}
|
|
45
|
-
if (cb) cb(value);
|
|
46
|
-
this.$emit("input", value);
|
|
47
|
-
this.$emit("confirm", value);
|
|
48
|
-
this.$refs.FGDialog.close();
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style lang="scss" >
|
|
55
|
-
</style>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vue-json-editor
|
|
3
|
-
class="Fg-Json-Editor"
|
|
4
|
-
v-model="jsonContent"
|
|
5
|
-
:showBtns="false"
|
|
6
|
-
mode="code"
|
|
7
|
-
lang="zh"
|
|
8
|
-
:expanded-on-start="true"
|
|
9
|
-
@json-change="onJsonChange"
|
|
10
|
-
@json-save="onJsonSave"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
// import vueJsonEditor from "vue-json-editor";
|
|
16
|
-
export default {
|
|
17
|
-
name: "JsonEditor",
|
|
18
|
-
components: {
|
|
19
|
-
vueJsonEditor: () => import("vue-json-editor"),
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
value: {},
|
|
23
|
-
},
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
jsonContent: this.value || {},
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
// async mounted() {
|
|
30
|
-
// const vueJsonEditor = await import("vue-json-editor");
|
|
31
|
-
// },
|
|
32
|
-
watch: {
|
|
33
|
-
jsonContent() {
|
|
34
|
-
this.$emit("input", this.jsonContent);
|
|
35
|
-
this.$emit("change", this.jsonContent);
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
onJsonChange() {
|
|
40
|
-
// console.log("jsonContent", this.jsonContent);
|
|
41
|
-
},
|
|
42
|
-
onJsonSave(value) {
|
|
43
|
-
this.jsonContent = value;
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<style lang="scss" >
|
|
50
|
-
.Fg-Json-Editor {
|
|
51
|
-
width: 100%;
|
|
52
|
-
height: 100%;
|
|
53
|
-
.jsoneditor-vue {
|
|
54
|
-
width: 100%;
|
|
55
|
-
height: 100%;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="Fg-ED-left" :style="{'--themeColor':themeColor,'--selectedColor':selectedColor,}">
|
|
3
|
-
<div v-if="!disabled">
|
|
4
|
-
<el-button type="text" icon="el-icon-plus" @click="onAdd">创建{{title}}</el-button>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="FG-ED-list">
|
|
7
|
-
<div
|
|
8
|
-
class="FG-ED-item"
|
|
9
|
-
:class="value==i?'FG-ED-item--active':''"
|
|
10
|
-
v-for="(item,i) in list"
|
|
11
|
-
:key="i"
|
|
12
|
-
@click="onClick(i)"
|
|
13
|
-
>
|
|
14
|
-
<span :style="{color:themeColor}">
|
|
15
|
-
<span style="color:#9d238c">{{preText}}</span>
|
|
16
|
-
<span>{{item.name}}</span>
|
|
17
|
-
</span>
|
|
18
|
-
<div class="FG-ED-button" v-if="!disabled">
|
|
19
|
-
<i class="el-icon-delete" style="margin-left:5px;color:#f56c6c" @click="onDelete(i)"></i>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div class="FG-ED-item" v-if="cell">
|
|
24
|
-
<el-input v-model="cell.name" size="mini"></el-input>
|
|
25
|
-
<div class="FG-ED-button">
|
|
26
|
-
<i class="el-icon-check" :style="{color:themeColor}" @click="onSave"></i>
|
|
27
|
-
<i class="el-icon-delete" style="margin-left:5px;color:#f56c6c" @click="cell=null"></i>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { getUuiKey } from "@/components/formGenerator/utils";
|
|
36
|
-
import store from "@/store";
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
props: {
|
|
40
|
-
value: {
|
|
41
|
-
type: [String, Number],
|
|
42
|
-
default: "",
|
|
43
|
-
},
|
|
44
|
-
title: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: "",
|
|
47
|
-
},
|
|
48
|
-
list: {
|
|
49
|
-
type: Array,
|
|
50
|
-
default: () => [],
|
|
51
|
-
},
|
|
52
|
-
preText: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: "",
|
|
55
|
-
},
|
|
56
|
-
disabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
data() {
|
|
62
|
-
return {
|
|
63
|
-
cell: null,
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
computed: {
|
|
67
|
-
themeColor() {
|
|
68
|
-
return store.state.app.themeColor;
|
|
69
|
-
},
|
|
70
|
-
selectedColor() {
|
|
71
|
-
return store.state.app.selectedColor;
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
onAdd() {
|
|
76
|
-
if (this.cell) return;
|
|
77
|
-
this.cell = { name: getUuiKey(), code: "" };
|
|
78
|
-
},
|
|
79
|
-
onSave() {
|
|
80
|
-
if (!this.cell.name) return;
|
|
81
|
-
this.list.push(this.cell);
|
|
82
|
-
this.cell = null;
|
|
83
|
-
this.onEmit(this.list.length - 1);
|
|
84
|
-
this.$emit("update:list", this.list);
|
|
85
|
-
this.$emit("onList", this.list);
|
|
86
|
-
},
|
|
87
|
-
onClick(i) {
|
|
88
|
-
this.onEmit(i);
|
|
89
|
-
},
|
|
90
|
-
onDelete(i) {
|
|
91
|
-
this.list.splice(i, i + 1);
|
|
92
|
-
if (this.value == i) this.onEmit(0);
|
|
93
|
-
if (this.list.length == 0) this.onEmit("");
|
|
94
|
-
},
|
|
95
|
-
onEmit(i) {
|
|
96
|
-
this.$emit("input", i);
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<style lang="scss" scoped>
|
|
103
|
-
.Fg-ED-left {
|
|
104
|
-
height: 100%;
|
|
105
|
-
overflow: auto;
|
|
106
|
-
}
|
|
107
|
-
.FG-ED-list {
|
|
108
|
-
.FG-ED-item {
|
|
109
|
-
border: 1px solid var(--selectedColor);
|
|
110
|
-
border-radius: 5px;
|
|
111
|
-
// color: var(--themeColor);
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
padding: 10px 16px;
|
|
114
|
-
margin: 10px 0;
|
|
115
|
-
padding-right: 60px;
|
|
116
|
-
&:hover {
|
|
117
|
-
background: var(--selectedColor);
|
|
118
|
-
}
|
|
119
|
-
position: relative;
|
|
120
|
-
.FG-ED-button {
|
|
121
|
-
position: absolute;
|
|
122
|
-
right: 14px;
|
|
123
|
-
top: 0;
|
|
124
|
-
bottom: 0;
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
font-size: 16px;
|
|
129
|
-
}
|
|
130
|
-
.el-input__inner {
|
|
131
|
-
border: none;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
.FG-ED-item--active {
|
|
135
|
-
background: var(--selectedColor);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
</style>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 导出excel -->
|
|
3
|
-
<el-button type="primary" size="small" @click="exportToExcel">{{btnText}}</el-button>
|
|
4
|
-
</template>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
import { utils, write } from "xlsx";
|
|
8
|
-
import { saveAs } from "file-saver";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
props: {
|
|
12
|
-
name: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: "EXCEL",
|
|
15
|
-
},
|
|
16
|
-
data: {
|
|
17
|
-
type: Array,
|
|
18
|
-
default: () => [],
|
|
19
|
-
},
|
|
20
|
-
btnText: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: "导出Excel",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
methods: {
|
|
26
|
-
exportToExcel() {
|
|
27
|
-
if (!this.data.length) return this.$message.error("没有可以导出的数据!");
|
|
28
|
-
// 将数据转换为工作表
|
|
29
|
-
const worksheet = utils.aoa_to_sheet(this.data);
|
|
30
|
-
// 创建工作簿并添加工作表
|
|
31
|
-
const workbook = utils.book_new();
|
|
32
|
-
utils.book_append_sheet(workbook, worksheet, "Sheet1");
|
|
33
|
-
|
|
34
|
-
// 生成Excel文件
|
|
35
|
-
const excelBuffer = write(workbook, {
|
|
36
|
-
bookType: "xlsx",
|
|
37
|
-
type: "array",
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// 使用blob和FileReader创建一个URL然后下载
|
|
41
|
-
const dataBlob = new Blob([excelBuffer], {
|
|
42
|
-
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
|
|
43
|
-
});
|
|
44
|
-
const name = (this.name || "文件下载") + ".xlsx";
|
|
45
|
-
saveAs(dataBlob, name);
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 导出json -->
|
|
3
|
-
<el-button type="primary" size="small" @click="exportToJson">{{btnText}}</el-button>
|
|
4
|
-
</template>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
import { saveAs } from "file-saver";
|
|
8
|
-
import { MessageBox } from "element-ui";
|
|
9
|
-
export default {
|
|
10
|
-
props: {
|
|
11
|
-
name: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: "",
|
|
14
|
-
},
|
|
15
|
-
data: {
|
|
16
|
-
type: [Array, Object],
|
|
17
|
-
default: () => {},
|
|
18
|
-
},
|
|
19
|
-
btnText: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "导出Json",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
exportToJson() {
|
|
26
|
-
if (!this.data) return this.$message.error("没有可以导出的数据!");
|
|
27
|
-
|
|
28
|
-
const handleExport = (name) => {
|
|
29
|
-
// 将数据转换为JSON字符串
|
|
30
|
-
const data = JSON.stringify(this.data, null, 2);
|
|
31
|
-
// 创建Blob对象
|
|
32
|
-
const blob = new Blob([data], { type: "application/json" });
|
|
33
|
-
// 使用saveAs保存文件
|
|
34
|
-
saveAs(blob, name + ".json");
|
|
35
|
-
};
|
|
36
|
-
if (!this.name) {
|
|
37
|
-
MessageBox.prompt("请输入文件名", "保存为文件", {
|
|
38
|
-
confirmButtonText: "确定",
|
|
39
|
-
cancelButtonText: "取消",
|
|
40
|
-
inputPattern: /.+/,
|
|
41
|
-
inputErrorMessage: "文件名不能为空",
|
|
42
|
-
}).then(({ value }) => {
|
|
43
|
-
if (!value) return this.$message.error("文件名不能为空");
|
|
44
|
-
handleExport(value);
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
handleExport(this.name);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
</script>
|