| | |
| | | </span> |
| | | </a-form-model-item> |
| | | |
| | | |
| | | <a-form-model-item label="日志文件" v-show="!form.online"> |
| | | <!-- <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76" |
| | | :default-file-list="form.blogFileList"> |
| | | <a-button> |
| | | <a-icon type="upload" /> 限 markdown/html |
| | | </a-button> |
| | | </a-upload> --> |
| | | |
| | | <a-upload :customRequest="customRequest" name="file" :showUploadList="true" @change="handleChange" |
| | | :default-file-list="form.blogFileList" :beforeUpload="beforeUpload"> |
| | | :default-file-list="form.blogFileList" :beforeUpload="beforeUpload" |
| | | :data="{'fileType':fileTypeMarkDown}"> |
| | | |
| | | <a-button> |
| | | <a-icon type="upload" />限 markdown/html |
| | |
| | | <a-form-model-item label=" 日志类型"> |
| | | <a-select v-model="form.blogType" mode="default" placeholder="" |
| | | :getPopupContainer="getCalendarContainer()"> |
| | | <a-select-option value="1"> |
| | | <a-select-option value="1"> |
| | | markdown |
| | | </a-select-option> |
| | | <a-select-option value="2"> |
| | | <a-select-option value="2"> |
| | | html |
| | | </a-select-option> |
| | | <a-select-option value="5"> |
| | | <a-select-option value="3"> |
| | | video |
| | | </a-select-option> |
| | | <a-select-option value="5"> |
| | | fast(闪念) |
| | | </a-select-option> |
| | | </a-select> |
| | |
| | | |
| | | |
| | | <a-form-model-item label="封面"> |
| | | <!-- <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76" list-type="picture" |
| | | :default-file-list="form.coverFileList" class="upload-list-inline"> |
| | | <a-button> |
| | | <a-icon type="upload" /> jpg/png/jpeg.. |
| | | </a-button> |
| | | </a-upload> --> |
| | | |
| | | <a-upload :customRequest="customRequest" name="file" :showUploadList="true" list-type="picture" |
| | | @change="handleChangeCoverFile" |
| | | :default-file-list="form.coverFileList"> |
| | | @change="handleChangeCoverFile" :default-file-list="form.coverFileList" |
| | | :beforeUpload="beforeUploadCover" :data="{'fileType':fileTypeCover}"> |
| | | <a-button> |
| | | <a-icon type="upload" />jpg/png/jpeg.. |
| | | </a-button> |
| | |
| | | <script> |
| | | import moment from "moment"; |
| | | import { |
| | | sysFileInfoUpload |
| | | sysFileInfoUpload, |
| | | myFileInfoUpload |
| | | } from '../../api/fileManage.js'; |
| | | |
| | | import { |
| | | queryBlogArticleType |
| | | } from '../../api/blogArticleType.js' |
| | | |
| | | import myConstant from "../../config/myConstant.js" |
| | | |
| | | export default { |
| | | beforeMount() { |
| | |
| | | }; |
| | | |
| | | return { |
| | | fileTypeMarkDown: myConstant.fileTypeMarkDown, |
| | | fileTypeCover: myConstant.fileTypeCover, |
| | | blogArticleType: [], |
| | | tags: [], |
| | | inputVisible: false, |
| | |
| | | publishDate: "", |
| | | lock: false, |
| | | top: false, |
| | | sliderValue:50, |
| | | sliderValue: 50, |
| | | auth: 1, |
| | | password: "", |
| | | fileId: null, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | |
| | | beforeUploadCover(file, fileList) { |
| | | if (this.form.coverFileList.length > 1) { |
| | | this.$message.error('这里最多上传一个文件'); |
| | | return false; |
| | | } |
| | | }, |
| | | beforeUpload(file, fileList) { |
| | | return new Promise((resolve, reject) => { |
| | | if (this.form.fileId != null) { |
| | |
| | | customRequest(option) { |
| | | const formData = new FormData() |
| | | formData.append('file', option.file) |
| | | sysFileInfoUpload(formData).then((res) => { |
| | | formData.append('fileType', option.data.fileType) |
| | | formData.append('authCode', this.form.secret) |
| | | myFileInfoUpload(formData).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('上传成功') |
| | | |