| | |
| | | .append(percentEncodedFileName);
|
| | |
|
| | | response.setHeader("Content-disposition", contentDispositionValue.toString());
|
| | | response.setHeader("download-filename", percentEncodedFileName);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | "/**/*.js",
|
| | | "/profile/**"
|
| | | ).permitAll()
|
| | | .antMatchers("/common/download**").anonymous()
|
| | | .antMatchers("/common/download/resource**").anonymous()
|
| | | .antMatchers("/swagger-ui.html").anonymous()
|
| | | .antMatchers("/swagger-resources/**").anonymous()
|
| | | .antMatchers("/webjars/**").anonymous()
|
| | |
| | | this.exportLoading = true;
|
| | | return export${BusinessName}(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | this.#[[$download]]#.name(response.msg);
|
| | | this.exportLoading = false;
|
| | | }).catch(() => {});
|
| | | }
|
| | |
| | | import './permission' // permission control
|
| | | import { getDicts } from "@/api/system/dict/data";
|
| | | import { getConfigKey } from "@/api/system/config";
|
| | | import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
|
| | | import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
|
| | | // 分页组件
|
| | | import Pagination from "@/components/Pagination";
|
| | | // 自定义表格工具组件
|
| | |
| | | Vue.prototype.addDateRange = addDateRange
|
| | | Vue.prototype.selectDictLabel = selectDictLabel
|
| | | Vue.prototype.selectDictLabels = selectDictLabels
|
| | | Vue.prototype.download = download
|
| | | Vue.prototype.handleTree = handleTree
|
| | |
|
| | | // 全局组件挂载
|
对比新文件 |
| | |
| | | import { saveAs } from 'file-saver' |
| | | import axios from 'axios' |
| | | import { getToken } from '@/utils/auth' |
| | | |
| | | const baseURL = process.env.VUE_APP_BASE_API |
| | | |
| | | export default { |
| | | name(name, isDelete = true) { |
| | | var url = baseURL + "/common/download?fileName=" + encodeURI(name) + "&delete=" + isDelete |
| | | axios({ |
| | | method: 'get', |
| | | url: url, |
| | | responseType: 'blob', |
| | | headers: { 'Authorization': 'Bearer ' + getToken() } |
| | | }).then(res => { |
| | | const blob = new Blob([res.data]) |
| | | this.saveAs(blob, decodeURI(res.headers['download-filename'])) |
| | | }) |
| | | }, |
| | | resource(resource) { |
| | | var url = baseURL + "/common/download/resource?resource=" + encodeURI(resource); |
| | | axios({ |
| | | method: 'get', |
| | | url: url, |
| | | responseType: 'blob', |
| | | headers: { 'Authorization': 'Bearer ' + getToken() } |
| | | }).then(res => { |
| | | const blob = new Blob([res.data]) |
| | | this.saveAs(blob, decodeURI(res.headers['download-filename'])) |
| | | }) |
| | | }, |
| | | zip(url, name) { |
| | | var url = baseURL + url |
| | | axios({ |
| | | method: 'get', |
| | | url: url, |
| | | responseType: 'blob', |
| | | headers: { 'Authorization': 'Bearer ' + getToken() } |
| | | }).then(res => { |
| | | const blob = new Blob([res.data], { type: 'application/zip' }) |
| | | this.saveAs(blob, name) |
| | | }) |
| | | }, |
| | | saveAs(text, name, opts) { |
| | | saveAs(text, name, opts); |
| | | } |
| | | } |
| | | |
| | |
| | | import cache from './cache'
|
| | | import modal from './modal'
|
| | | import download from './download'
|
| | |
|
| | | export default {
|
| | | install(Vue) {
|
| | |
| | | Vue.prototype.$cache = cache
|
| | | // 模态框对象
|
| | | Vue.prototype.$modal = modal
|
| | | // 下载文件
|
| | | Vue.prototype.$download = download
|
| | | }
|
| | | }
|
| | |
| | | * Copyright (c) 2019 ruoyi |
| | | */ |
| | | |
| | | const baseURL = process.env.VUE_APP_BASE_API |
| | | |
| | | // 日期格式化 |
| | | export function parseTime(time, pattern) { |
| | | if (arguments.length === 0 || !time) { |
| | |
| | | }) |
| | | }) |
| | | return actions.join('').substring(0, actions.join('').length - 1); |
| | | } |
| | | |
| | | // 通用下载方法 |
| | | export function download(fileName) { |
| | | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; |
| | | } |
| | | |
| | | // 字符串格式化(%s ) |
| | |
| | | this.exportLoading = true; |
| | | return exportJob(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | this.exportLoading = true; |
| | | return exportJobLog(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | this.exportLoading = true; |
| | | return exportLogininfor(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | this.exportLoading = true; |
| | | return exportOperlog(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | this.exportLoading = true; |
| | | return exportConfig(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | }, |
| | |
| | | this.exportLoading = true;
|
| | | return exportData(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | this.$download.name(response.msg);
|
| | | this.exportLoading = false;
|
| | | }).catch(() => {});
|
| | | }
|
| | |
| | | this.exportLoading = true;
|
| | | return exportType(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | this.$download.name(response.msg);
|
| | | this.exportLoading = false;
|
| | | }).catch(() => {});
|
| | | },
|
| | |
| | | this.exportLoading = true; |
| | | return exportPost(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | this.exportLoading = true;
|
| | | return exportRole(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | this.$download.name(response.msg);
|
| | | this.exportLoading = false;
|
| | | }).catch(() => {});
|
| | | }
|
| | |
| | | this.exportLoading = true;
|
| | | return exportUser(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | this.$download.name(response.msg);
|
| | | this.exportLoading = false;
|
| | | }).catch(() => {});
|
| | | },
|
| | |
| | | /** 下载模板操作 */
|
| | | importTemplate() {
|
| | | importTemplate().then(response => {
|
| | | this.download(response.msg);
|
| | | this.$download.name(response.msg);
|
| | | });
|
| | | },
|
| | | // 文件上传中处理
|
| | |
| | |
|
| | | <script>
|
| | | import draggable from 'vuedraggable'
|
| | | import { saveAs } from 'file-saver'
|
| | | import beautifier from 'js-beautify'
|
| | | import ClipboardJS from 'clipboard'
|
| | | import render from '@/utils/generator/render'
|
| | | import RightPanel from './RightPanel'
|
| | | import {
|
| | | inputComponents,
|
| | | selectComponents,
|
| | | layoutComponents,
|
| | | formConf
|
| | | } from '@/utils/generator/config'
|
| | | import {
|
| | | exportDefault, beautifierConf, isNumberStr, titleCase
|
| | | } from '@/utils/index'
|
| | | import {
|
| | | makeUpHtml, vueTemplate, vueScript, cssStyle
|
| | | } from '@/utils/generator/html'
|
| | | import { inputComponents, selectComponents, layoutComponents, formConf } from '@/utils/generator/config'
|
| | | import { beautifierConf, titleCase } from '@/utils/index'
|
| | | import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
|
| | | import { makeUpJs } from '@/utils/generator/js'
|
| | | import { makeUpCss } from '@/utils/generator/css'
|
| | | import drawingDefalut from '@/utils/generator/drawingDefalut'
|
| | |
| | | import CodeTypeDialog from './CodeTypeDialog'
|
| | | import DraggableItem from './DraggableItem'
|
| | |
|
| | | const emptyActiveData = { style: {}, autosize: {} }
|
| | | let oldActiveId
|
| | | let tempActiveData
|
| | |
|
| | |
| | | execDownload(data) {
|
| | | const codeStr = this.generateCode()
|
| | | const blob = new Blob([codeStr], { type: 'text/plain;charset=utf-8' })
|
| | | saveAs(blob, data.fileName)
|
| | | this.$download.saveAs(blob, data.fileName)
|
| | | },
|
| | | execCopy(data) {
|
| | | document.getElementById('copyNode').click()
|
| | |
| | | <script> |
| | | import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; |
| | | import importTable from "./importTable"; |
| | | import { downLoadZip } from "@/utils/zipdownload"; |
| | | import hljs from "highlight.js/lib/highlight"; |
| | | import "highlight.js/styles/github-gist.css"; |
| | | hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); |
| | |
| | | this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath); |
| | | }); |
| | | } else { |
| | | downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); |
| | | this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); |
| | | } |
| | | }, |
| | | /** 同步数据库操作 */ |