Commit 12f2ed43 by 刘泽志

文档上传

parent bb8f553e
......@@ -332,6 +332,44 @@ export function uploadExcel(data) {
}
/**
* 下载模板
* @param excelId
* @returns {*}
*/
export function downloadTemplate(excelId) {
return request({
url: `${prefix}/template/download`,
method: 'get',
params:{excelId},
headers: { "Content-Type": "application/x-www-form-urlencoded" },
responseType: "blob",
})
}
/**
* 下载模板
* @param excelId
* @returns {*}
*/
export function getTemplateFileName(excelId) {
return request({
url: `${prefix}/template/download/filename`,
method: 'get',
params:{excelId}
})
}
export async function blobValidate(data) {
try {
const text = await data.text();
JSON.parse(text);
return false;
} catch (error) {
return true;
}
}
/**
* 根据基础模板重置字段
* @param excelId
* @returns {*}
......@@ -344,3 +382,29 @@ export function resetField(excelId){
})
}
/**
* 创建物理表
* @param tableName
* @param templateId
* @returns {*}
*/
export function createTable(tableName,templateId){
return request({
url: `${prefix}/table/create`,
method: 'get',
params:{tableName,templateId}
})
}
/**
* 数据分析并导出
* @param templateId
* @returns {*}
*/
export function analyzeExport(templateId){
return request({
url: `${prefix}/analyze/export`,
method: 'get',
params:{templateId}
})
}
<template>
<el-dialog :close-on-click-modal="false"
:show-close="false"
:visible="loading" :width="width"
append-to-body center
class="dialog-loading"
custom-class="dialog-loading-custom"
>
<div v-loading="loading"
:element-loading-text="content"
:style="{height: height}"
element-loading-spinner="el-icon-loading"
></div>
</el-dialog>
</template>
<script>
export default {
name: 'AutoLoading',
props: {
loading: {
type: Boolean,
default: false
},
content: {
type: String,
default: ''
},
width: {
type: String,
default: '300px'
},
height: {
type: String,
default: '200px'
}
}
}
</script>
<style lang="scss" scoped>
.dialog-loading {
::v-deep {
.el-dialog__header {
display: none;
}
.el-loading-mask {
border-radius: 16px;
background-color: transparent;
}
.dialog-loading-custom {
border-radius: 16px;
background-color: rgba(255, 255, 255,0.5);
}
.el-dialog__body {
padding: 0;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment