@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
package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSelectHis.vue
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="newStyle">
|
|
3
|
-
<el-link v-if="$attrs.onlyShow" type="primary" @click="showDetail">{{getOptionsText(value, resData, props)}}</el-link>
|
|
4
|
-
<el-select
|
|
5
|
-
v-else
|
|
6
|
-
v-model="formValue"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
style="width:100%"
|
|
9
|
-
@blur="onBlur"
|
|
10
|
-
@focus="onFocus"
|
|
11
|
-
@clear="onClear"
|
|
12
|
-
>
|
|
13
|
-
<el-option
|
|
14
|
-
v-for="item in resData"
|
|
15
|
-
:key="item[props.value]"
|
|
16
|
-
:label="item[props.label]"
|
|
17
|
-
:value="item[props.value]"
|
|
18
|
-
></el-option>
|
|
19
|
-
</el-select>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
import { getOptionsText } from "../../../utils";
|
|
25
|
-
|
|
26
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
27
|
-
export default {
|
|
28
|
-
mixins: [comMixin],
|
|
29
|
-
name: "form-select-his",
|
|
30
|
-
model: {
|
|
31
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
32
|
-
event: "update",
|
|
33
|
-
},
|
|
34
|
-
props: {
|
|
35
|
-
value: {
|
|
36
|
-
type: [String, Number, Array],
|
|
37
|
-
default: "",
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
computed: {
|
|
41
|
-
formValue: {
|
|
42
|
-
get() {
|
|
43
|
-
return this.$attrs.multiple
|
|
44
|
-
? this.value
|
|
45
|
-
? this.value.split(",")
|
|
46
|
-
: []
|
|
47
|
-
: this.value;
|
|
48
|
-
},
|
|
49
|
-
set(val) {
|
|
50
|
-
const value = this.$attrs.multiple ? (val ? val.join(",") : "") : val;
|
|
51
|
-
this.$emit("update", value);
|
|
52
|
-
this.onChange(value);
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
methods: {
|
|
57
|
-
getOptionsText,
|
|
58
|
-
showDetail() {
|
|
59
|
-
this.$emit("selectHis", this.value)
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
</script>
|
|
64
|
-
|
|
65
|
-
<style lang="scss" scoped>
|
|
66
|
-
</style>
|
package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSelectProject.vue
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="newStyle">
|
|
3
|
-
<span v-if="$attrs.onlyShow">{{getOptionsText(value,resData,props)}}</span>
|
|
4
|
-
|
|
5
|
-
<el-select
|
|
6
|
-
v-else
|
|
7
|
-
v-model="formValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
style="width:100%"
|
|
10
|
-
@blur="onBlur"
|
|
11
|
-
@focus="onFocus"
|
|
12
|
-
@clear="onClear"
|
|
13
|
-
>
|
|
14
|
-
<el-option
|
|
15
|
-
v-for="item in resData"
|
|
16
|
-
:key="item[props.value]"
|
|
17
|
-
:label="item[props.label]"
|
|
18
|
-
:value="item[props.value]"
|
|
19
|
-
></el-option>
|
|
20
|
-
</el-select>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import { getOptionsText } from "../../../utils";
|
|
26
|
-
|
|
27
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
28
|
-
export default {
|
|
29
|
-
mixins: [comMixin],
|
|
30
|
-
name: "form-select-project",
|
|
31
|
-
model: {
|
|
32
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
33
|
-
event: "update",
|
|
34
|
-
},
|
|
35
|
-
props: {
|
|
36
|
-
value: {
|
|
37
|
-
type: [String, Number, Array],
|
|
38
|
-
default: "",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
computed: {
|
|
42
|
-
formValue: {
|
|
43
|
-
get() {
|
|
44
|
-
return this.$attrs.multiple
|
|
45
|
-
? this.value
|
|
46
|
-
? this.value.split(",")
|
|
47
|
-
: []
|
|
48
|
-
: this.value;
|
|
49
|
-
},
|
|
50
|
-
set(val) {
|
|
51
|
-
const value = this.$attrs.multiple ? (val ? val.join(",") : "") : val;
|
|
52
|
-
this.$emit("update", value);
|
|
53
|
-
this.onChange(value);
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
methods: { getOptionsText },
|
|
58
|
-
};
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<style lang="scss" scoped>
|
|
62
|
-
</style>
|
package/src/components/formGenerator/formComponents/pcComponents/selectComs/formSignature.vue
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-signature form-components" :style="newStyle">
|
|
3
|
-
<template v-if="!$attrs.onlyShow">
|
|
4
|
-
<div v-if="readonly" class="form-readonly"></div>
|
|
5
|
-
<div v-if="disabled" class="form-disabled"></div>
|
|
6
|
-
<div class="form-signature-img" @click="handleOpen">
|
|
7
|
-
<!--用来预览签字图片的地方 -->
|
|
8
|
-
<el-image v-if="value" :src="value" />
|
|
9
|
-
<div class="form-signature-empty" v-else>{{$attrs.placeholder}}</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
<div v-else class="sign-show">
|
|
13
|
-
<img :src="value" />
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<EsignDialog ref="EsignDialog" v-bind="$attrs" @update="callBack" />
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import EsignDialog from "../components/esignDialog.vue";
|
|
22
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
23
|
-
export default {
|
|
24
|
-
mixins: [comMixin],
|
|
25
|
-
name: "form-signature",
|
|
26
|
-
components: {
|
|
27
|
-
EsignDialog,
|
|
28
|
-
},
|
|
29
|
-
props: {
|
|
30
|
-
value: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: "",
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
readonly: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false,
|
|
38
|
-
},
|
|
39
|
-
disabled: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false,
|
|
42
|
-
},
|
|
43
|
-
width: {
|
|
44
|
-
type: Number,
|
|
45
|
-
default: 800,
|
|
46
|
-
},
|
|
47
|
-
// height: {
|
|
48
|
-
// type: Number,
|
|
49
|
-
// default: 300
|
|
50
|
-
// }
|
|
51
|
-
},
|
|
52
|
-
data() {
|
|
53
|
-
return {};
|
|
54
|
-
},
|
|
55
|
-
methods: {
|
|
56
|
-
handleOpen() {
|
|
57
|
-
if (this.readonly || this.disabled) return;
|
|
58
|
-
this.$refs.EsignDialog.open();
|
|
59
|
-
},
|
|
60
|
-
callBack(value) {
|
|
61
|
-
this.$emit("input", value);
|
|
62
|
-
this.$emit("confirm", value);
|
|
63
|
-
this.onConfirm(value);
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<style lang="scss" scoped>
|
|
70
|
-
@import "../../../styles/generator.scss";
|
|
71
|
-
|
|
72
|
-
.form-signature-empty {
|
|
73
|
-
&:hover {
|
|
74
|
-
border-color: $themeColor;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
.form-signature-img {
|
|
78
|
-
// max-width: 400px;
|
|
79
|
-
max-width: 100%;
|
|
80
|
-
aspect-ratio: 8/3;
|
|
81
|
-
.el-image {
|
|
82
|
-
width: 100%;
|
|
83
|
-
height: 100%;
|
|
84
|
-
overflow: visible;
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
&:hover {
|
|
87
|
-
border: 1px dashed $themeColor;
|
|
88
|
-
border-radius: 6px;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
.sign-show {
|
|
93
|
-
max-width: 400px;
|
|
94
|
-
img {
|
|
95
|
-
width: 100%;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="newStyle">
|
|
3
|
-
<span v-if="$attrs.onlyShow">{{value}}</span>
|
|
4
|
-
<el-slider v-else class="form-slider" v-model="formValue" v-bind="$attrs" @change="onChange" />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
10
|
-
export default {
|
|
11
|
-
mixins: [comMixin],
|
|
12
|
-
name: "form-slider",
|
|
13
|
-
model: {
|
|
14
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
15
|
-
event: "update",
|
|
16
|
-
},
|
|
17
|
-
props: ["value"], // 这里的值存在多种类型
|
|
18
|
-
computed: {
|
|
19
|
-
formValue: {
|
|
20
|
-
get() {
|
|
21
|
-
if (this.$attrs.range) {
|
|
22
|
-
let arr = [0, 0];
|
|
23
|
-
if (this.value) arr = this.value.split(",");
|
|
24
|
-
return arr.map((item) => parseInt(item));
|
|
25
|
-
}
|
|
26
|
-
return parseInt(this.value || 0);
|
|
27
|
-
},
|
|
28
|
-
set(value) {
|
|
29
|
-
if (this.$attrs.range) {
|
|
30
|
-
this.$emit("update", value.length ? value.join(",") : "");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
this.$emit("update", value + "");
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style lang="scss">
|
|
41
|
-
.form-slider {
|
|
42
|
-
.el-slider__button-wrapper {
|
|
43
|
-
z-index: 1;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-components" :style="newStyle">
|
|
3
|
-
<div v-if="$attrs.readonly || $attrs.onlyShow" class="form-readonly" />
|
|
4
|
-
<el-switch v-model="formValue" v-bind="$attrs" @change="onChange" />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
10
|
-
export default {
|
|
11
|
-
mixins: [comMixin],
|
|
12
|
-
name: "form-switch",
|
|
13
|
-
model: {
|
|
14
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
15
|
-
event: "update",
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
value: {
|
|
19
|
-
type: [Boolean, String, Number],
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
computed: {
|
|
24
|
-
formValue: {
|
|
25
|
-
get() {
|
|
26
|
-
return this.value;
|
|
27
|
-
},
|
|
28
|
-
set(val) {
|
|
29
|
-
this.$emit("update", val);
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<style lang="scss" scoped>
|
|
37
|
-
</style>
|
package/src/components/formGenerator/formComponents/pcComponents/selectComs/formTimePicker.vue
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="newStyle">
|
|
3
|
-
<span v-if="$attrs.onlyShow">{{value}}</span>
|
|
4
|
-
<el-time-picker
|
|
5
|
-
style="width:100%"
|
|
6
|
-
v-else
|
|
7
|
-
v-model="formValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
@blur="onBlur"
|
|
10
|
-
@focus="onFocus"
|
|
11
|
-
@change="onChange"
|
|
12
|
-
@clear="onClear"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
19
|
-
export default {
|
|
20
|
-
mixins: [comMixin],
|
|
21
|
-
name: "form-time-picker",
|
|
22
|
-
model: {
|
|
23
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
24
|
-
event: "update",
|
|
25
|
-
},
|
|
26
|
-
props: ["value"],
|
|
27
|
-
computed: {
|
|
28
|
-
formValue: {
|
|
29
|
-
get() {
|
|
30
|
-
return this.value;
|
|
31
|
-
},
|
|
32
|
-
set(val) {
|
|
33
|
-
this.$emit("update", val);
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style lang="scss" scoped>
|
|
41
|
-
</style>
|
package/src/components/formGenerator/formComponents/pcComponents/selectComs/formTimerangePicker.vue
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="newStyle">
|
|
3
|
-
<span v-if="$attrs.onlyShow">{{$utils.getDateText($attrs)}}</span>
|
|
4
|
-
<el-time-picker
|
|
5
|
-
style="width:100%"
|
|
6
|
-
v-else
|
|
7
|
-
v-model="formValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
@blur="onBlur"
|
|
10
|
-
@focus="onFocus"
|
|
11
|
-
@change="onChange"
|
|
12
|
-
@clear="onClear"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
19
|
-
export default {
|
|
20
|
-
mixins: [comMixin],
|
|
21
|
-
name: "form-timerange-picker",
|
|
22
|
-
model: {
|
|
23
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
24
|
-
event: "update",
|
|
25
|
-
},
|
|
26
|
-
props: ["value"],
|
|
27
|
-
computed: {
|
|
28
|
-
formValue: {
|
|
29
|
-
get() {
|
|
30
|
-
return this.value;
|
|
31
|
-
},
|
|
32
|
-
set(val) {
|
|
33
|
-
this.$emit("update", val);
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 附件上传控件 -->
|
|
3
|
-
<div>
|
|
4
|
-
<div class="form-components" v-if="!$attrs.onlyShow">
|
|
5
|
-
<div v-if="readonly" class="form-readonly"></div>
|
|
6
|
-
<el-upload
|
|
7
|
-
class="upload-demo"
|
|
8
|
-
action="#"
|
|
9
|
-
:download="download"
|
|
10
|
-
:multiple="multiple"
|
|
11
|
-
:name="name"
|
|
12
|
-
:accept="acceptStr"
|
|
13
|
-
:limit="limit"
|
|
14
|
-
:file-list="fileList"
|
|
15
|
-
:http-request="uploadFile"
|
|
16
|
-
:before-upload="beforeUpload"
|
|
17
|
-
:show-file-list="false"
|
|
18
|
-
:style="newStyle"
|
|
19
|
-
>
|
|
20
|
-
<el-button size="small" type="primary" :disabled="disabled" :loading="loading">点击上传</el-button>
|
|
21
|
-
<div
|
|
22
|
-
v-if="__config__?.showTip"
|
|
23
|
-
slot="tip"
|
|
24
|
-
class="Fg-upload-tips"
|
|
25
|
-
:style="newStyle?.font"
|
|
26
|
-
>*{{ tips }}</div>
|
|
27
|
-
</el-upload>
|
|
28
|
-
</div>
|
|
29
|
-
<FilesShow
|
|
30
|
-
v-if="fileList.length"
|
|
31
|
-
:value.sync="fileList"
|
|
32
|
-
:onlyShow="$attrs.onlyShow"
|
|
33
|
-
:readonly="readonly || disabled"
|
|
34
|
-
:dName="dName"
|
|
35
|
-
:download="download"
|
|
36
|
-
@change="handleChange"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
<script>
|
|
41
|
-
import FilesShow from "../components/filesShow";
|
|
42
|
-
import { requestPost2 } from "@/api/data";
|
|
43
|
-
import { comMixin } from "../../../utils/comMixins";
|
|
44
|
-
export default {
|
|
45
|
-
mixins: [comMixin],
|
|
46
|
-
name: "form-upload",
|
|
47
|
-
model: {
|
|
48
|
-
prop: "value", // 绑定的值,通过父组件传递
|
|
49
|
-
event: "update",
|
|
50
|
-
},
|
|
51
|
-
components: {
|
|
52
|
-
FilesShow,
|
|
53
|
-
},
|
|
54
|
-
props: {
|
|
55
|
-
// 绑定的输入值
|
|
56
|
-
value: {
|
|
57
|
-
type: [String, Number],
|
|
58
|
-
default: "",
|
|
59
|
-
},
|
|
60
|
-
// 是否只读
|
|
61
|
-
readonly: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false,
|
|
64
|
-
},
|
|
65
|
-
// 是否禁用
|
|
66
|
-
disabled: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: false,
|
|
69
|
-
},
|
|
70
|
-
// 表单属性
|
|
71
|
-
__config__: {
|
|
72
|
-
type: Object,
|
|
73
|
-
default: () => {},
|
|
74
|
-
},
|
|
75
|
-
// 文件类型
|
|
76
|
-
accept: {
|
|
77
|
-
type: [String, Array],
|
|
78
|
-
default: "",
|
|
79
|
-
},
|
|
80
|
-
// 文件上传地址
|
|
81
|
-
action: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: "",
|
|
84
|
-
},
|
|
85
|
-
// 文件下载地址
|
|
86
|
-
download: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: "",
|
|
89
|
-
},
|
|
90
|
-
// 是否多选
|
|
91
|
-
multiple: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: false,
|
|
94
|
-
},
|
|
95
|
-
// 上传的文件字段名
|
|
96
|
-
name: {
|
|
97
|
-
type: String,
|
|
98
|
-
default: "",
|
|
99
|
-
},
|
|
100
|
-
// 下载的文件字段名
|
|
101
|
-
dName: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: "",
|
|
104
|
-
},
|
|
105
|
-
// 最大允许上传个数
|
|
106
|
-
limit: {
|
|
107
|
-
type: Number,
|
|
108
|
-
default: 10,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
computed: {
|
|
112
|
-
tips() {
|
|
113
|
-
// 最大上传文件+单位
|
|
114
|
-
const sizeUnit = this.__config__.fileSize + this.__config__.sizeUnit;
|
|
115
|
-
if (this.accept) {
|
|
116
|
-
return `只能上传${this.accept}文件,且不超过${sizeUnit}的文件${
|
|
117
|
-
this.$attrs.remark || ""
|
|
118
|
-
}`;
|
|
119
|
-
}
|
|
120
|
-
return `只能上传不超过${sizeUnit}的文件${this.$attrs.remark || ""}`;
|
|
121
|
-
},
|
|
122
|
-
acceptStr() {
|
|
123
|
-
if (!this.accept) return "";
|
|
124
|
-
return this.accept?.join(",");
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
data() {
|
|
128
|
-
return {
|
|
129
|
-
fileList: [
|
|
130
|
-
// {
|
|
131
|
-
// name: "food.jpeg",
|
|
132
|
-
// url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
|
|
133
|
-
// },
|
|
134
|
-
// {
|
|
135
|
-
// name: "food2.jpeg",
|
|
136
|
-
// url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
|
|
137
|
-
// },
|
|
138
|
-
],
|
|
139
|
-
loading: false,
|
|
140
|
-
};
|
|
141
|
-
},
|
|
142
|
-
watch: {
|
|
143
|
-
value: {
|
|
144
|
-
immediate: true,
|
|
145
|
-
deep: true,
|
|
146
|
-
handler: function (nd, od) {
|
|
147
|
-
try {
|
|
148
|
-
// 回显
|
|
149
|
-
this.fileList = JSON.parse(nd || "[]");
|
|
150
|
-
} catch (error) {
|
|
151
|
-
console.log("error", error);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
methods: {
|
|
157
|
-
beforeUpload(file) {
|
|
158
|
-
if (this.fileList.length >= this.limit) {
|
|
159
|
-
this.$message({
|
|
160
|
-
message: `最多允许上传${this.limit}个文件`,
|
|
161
|
-
type: "info",
|
|
162
|
-
});
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
const fileSize = this.__config__.fileSize; // 文件大小
|
|
166
|
-
const fileUnit = this.__config__.sizeUnit; // 文件单位
|
|
167
|
-
// 实际上传的文件大小单位为B,需要将文件大小限制的单位转换为B
|
|
168
|
-
const maxSize =
|
|
169
|
-
fileSize *
|
|
170
|
-
{ KB: 1024, MB: Math.pow(1024, 2), GB: Math.pow(1024, 3) }[fileUnit];
|
|
171
|
-
let isLt = file.size < maxSize; // 判断是否超过文件大小
|
|
172
|
-
if (!isLt) {
|
|
173
|
-
this.$message({
|
|
174
|
-
message: `请上传小于${fileSize + fileUnit}的文件!`,
|
|
175
|
-
type: "info",
|
|
176
|
-
});
|
|
177
|
-
return false;
|
|
178
|
-
} else {
|
|
179
|
-
this.loading = true;
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
// 自定义文件上传
|
|
185
|
-
uploadFile(file) {
|
|
186
|
-
let formData = new FormData();
|
|
187
|
-
if (Array.isArray(file)) {
|
|
188
|
-
// 选择多个文件
|
|
189
|
-
file.forEach((item) => {
|
|
190
|
-
formData.append(this.name, item.file);
|
|
191
|
-
});
|
|
192
|
-
} else {
|
|
193
|
-
// 选择单个文件
|
|
194
|
-
formData.append(this.name, file.file);
|
|
195
|
-
}
|
|
196
|
-
this.loading = true;
|
|
197
|
-
requestPost2(this.action, formData)
|
|
198
|
-
.then((res) => {
|
|
199
|
-
// 只能上传一个文件,将原文件清空再添加
|
|
200
|
-
if (!this.multiple) {
|
|
201
|
-
this.fileList = [];
|
|
202
|
-
}
|
|
203
|
-
this.onSuccess(res);
|
|
204
|
-
})
|
|
205
|
-
.catch((err) => {
|
|
206
|
-
this.onError(err);
|
|
207
|
-
});
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
// 上传成功
|
|
211
|
-
onSuccess(res) {
|
|
212
|
-
if (res.code == 1) {
|
|
213
|
-
try {
|
|
214
|
-
res.result.mFilePath.forEach((path, index) => {
|
|
215
|
-
this.fileList.push({
|
|
216
|
-
id: res.result.idList[index],
|
|
217
|
-
name: res.result.mFileName[index],
|
|
218
|
-
url: path,
|
|
219
|
-
size: res.result.fileLengths[index] || "", // 文件大小
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
this.handleChange(this.fileList);
|
|
223
|
-
this.$message({
|
|
224
|
-
message: `上传成功!`,
|
|
225
|
-
type: "success",
|
|
226
|
-
});
|
|
227
|
-
this.loading = false;
|
|
228
|
-
} catch (error) {
|
|
229
|
-
console.log(error);
|
|
230
|
-
this.onError(error);
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
this.onError(res);
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
// 上传失败
|
|
237
|
-
onError(err) {
|
|
238
|
-
this.$message({
|
|
239
|
-
message: err.msg || `上传失败!`,
|
|
240
|
-
type: "error",
|
|
241
|
-
});
|
|
242
|
-
this.loading = false;
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
handleChange(fileArr) {
|
|
246
|
-
let value = fileArr.length ? JSON.stringify(fileArr) : null;
|
|
247
|
-
this.$emit("update", value);
|
|
248
|
-
this.$emit("change", value);
|
|
249
|
-
this.onChange(value);
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
};
|
|
253
|
-
</script>
|