|
|
@ -15,6 +15,9 @@
|
|
|
|
<template #sqlModel="{ model }">
|
|
|
|
<template #sqlModel="{ model }">
|
|
|
|
<a-button key="submit" type="primary" :loading="loading" @click="sqlPrint(model)">sql模版打印</a-button>
|
|
|
|
<a-button key="submit" type="primary" :loading="loading" @click="sqlPrint(model)">sql模版打印</a-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #downModel="{ model }">
|
|
|
|
|
|
|
|
<a-button key="submit" type="primary" :loading="loading" @click="sqlDownLoad(model)">下载sql打印源文件</a-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</BasicForm>
|
|
|
|
</BasicForm>
|
|
|
|
<!--右下角按钮-->
|
|
|
|
<!--右下角按钮-->
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
@ -57,7 +60,7 @@
|
|
|
|
// 表单字段数据
|
|
|
|
// 表单字段数据
|
|
|
|
import { temFormSchema } from '../columns'
|
|
|
|
import { temFormSchema } from '../columns'
|
|
|
|
// 相关接口
|
|
|
|
// 相关接口
|
|
|
|
import { EditSysPrintTemplate, GetSysPrintTemplateInfo, GetOpenSqlPrintInfo } from '../api'
|
|
|
|
import { EditSysPrintTemplate, GetSysPrintTemplateInfo, GetOpenSqlPrintInfo, DownLoadSqlPrintFile } from '../api'
|
|
|
|
// 提示消息混入
|
|
|
|
// 提示消息混入
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
// 声明Emits
|
|
|
|
// 声明Emits
|
|
|
@ -93,10 +96,26 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// 下载打印源文件
|
|
|
|
|
|
|
|
const sqlDownLoad = (model) => {
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
|
|
if (!model.inParamColumn) {
|
|
|
|
|
|
|
|
return createMessage.warning('请先填写入口参数!')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const postData = {
|
|
|
|
|
|
|
|
"tenantId": userStore.getUserInfo.tenantId,
|
|
|
|
|
|
|
|
"templateId": model.id,
|
|
|
|
|
|
|
|
"paramJsonStr": model.inParamColumn,
|
|
|
|
|
|
|
|
"printType": "1"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DownLoadSqlPrintFile(postData).then(res => {
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
// sql模版打印
|
|
|
|
// sql模版打印
|
|
|
|
const sqlPrint = (model) => {
|
|
|
|
const sqlPrint = (model) => {
|
|
|
|
console.log(model)
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
if (!model.inParamColumn) {
|
|
|
|
if (!model.inParamColumn) {
|
|
|
|
return createMessage.warning('请先填写入口参数!')
|
|
|
|
return createMessage.warning('请先填写入口参数!')
|
|
|
@ -109,6 +128,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetOpenSqlPrintInfo(postData).then(res => {
|
|
|
|
GetOpenSqlPrintInfo(postData).then(res => {
|
|
|
|
if (res.succeeded) {
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
window.open(`http://118.190.144.189:3008/printtempfile/${res.data}`)
|
|
|
|
return createMessage.success('打印成功!')
|
|
|
|
return createMessage.success('打印成功!')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|