|
|
|
@ -12,6 +12,9 @@
|
|
|
|
|
<template #isUseDataSource="{ model, field }">
|
|
|
|
|
<a-switch v-model:checked="model[field]" /> <span class="switch-tex">{{ model[field] ? '是' : '否' }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #sqlModel="{ model }">
|
|
|
|
|
<a-button key="submit" type="primary" :loading="loading" @click="sqlPrint(model)">sql模版打印</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicForm>
|
|
|
|
|
<!--右下角按钮-->
|
|
|
|
|
<template #footer>
|
|
|
|
@ -50,10 +53,11 @@
|
|
|
|
|
// 弹窗组件
|
|
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'
|
|
|
|
|
// 表单字段数据
|
|
|
|
|
import { temFormSchema } from '../columns'
|
|
|
|
|
// 相关接口
|
|
|
|
|
import { EditSysPrintTemplate, GetSysPrintTemplateInfo } from '../api'
|
|
|
|
|
import { EditSysPrintTemplate, GetSysPrintTemplateInfo, GetOpenSqlPrintInfo } from '../api'
|
|
|
|
|
// 提示消息混入
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
// 声明Emits
|
|
|
|
@ -90,6 +94,25 @@
|
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// sql模版打印
|
|
|
|
|
const sqlPrint = (model) => {
|
|
|
|
|
console.log(model)
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
if (!model.inParamColumn) {
|
|
|
|
|
return createMessage.warning('请先填写入口参数!')
|
|
|
|
|
}
|
|
|
|
|
const postData = {
|
|
|
|
|
"tenantId": userStore.getUserInfo.tenantId,
|
|
|
|
|
"templateId": model.id,
|
|
|
|
|
"paramJsonStr": model.inParamColumn,
|
|
|
|
|
"printType": "1"
|
|
|
|
|
}
|
|
|
|
|
GetOpenSqlPrintInfo(postData).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
return createMessage.success('打印成功!')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
|
|
|
|
|
|
|
|
|
|
async function handleSave(exit) {
|
|
|
|
|