Lufaneng 11 months ago
parent 0abb3ae117
commit c452b83a66

@ -50,7 +50,7 @@
<view class="form" v-else> <view class="form" v-else>
<uv-form labelAlign="left" labelWidth="auto" labelPosition="left" :model="formField" :rules="rules" <uv-form labelAlign="left" labelWidth="auto" labelPosition="left" :model="formField" :rules="rules"
ref="form"> ref="form">
<uv-form-item :prop="item.key" :label="item.name + ''" v-for="item in currentTemplate.params"> <uv-form-item :prop="item.key" :label="item.name + ''" v-for="item in (currentTemplate.params?.filter(item => item.enabled) || [])">
<uv-input :type="item.type === 'number' ? 'digit' : 'text'" v-model="item.value" color="#000" <uv-input :type="item.type === 'number' ? 'digit' : 'text'" v-model="item.value" color="#000"
border="bottom" :placeholderStyle="{ color: '#666778' }" placeholder="请输入"></uv-input> border="bottom" :placeholderStyle="{ color: '#666778' }" placeholder="请输入"></uv-input>
</uv-form-item> </uv-form-item>
@ -152,7 +152,7 @@
const modalRef = ref(null) const modalRef = ref(null)
const confirmGenerate = () => { const confirmGenerate = () => {
const params = {} const params = {}
currentTemplate.value.params.forEach(item => { currentTemplate.value.params?.filter(item => item.enabled).forEach(item => {
params[item.name] = item.value params[item.name] = item.value
}) })
RPC.post('/template_create_task', {template_id:currentTemplate.value.id,template_data:params}).then(() => { RPC.post('/template_create_task', {template_id:currentTemplate.value.id,template_data:params}).then(() => {
@ -177,8 +177,8 @@
page: 1, page: 1,
limit: -1 limit: -1
}).then(res => { }).then(res => {
templateList.value = res.rows || [] templateList.value = (res.rows || []).filter(item => item.enabled)
currentTemplate.value = res.rows[0] ? JSON.parse(JSON.stringify(res.rows[0])) : {} currentTemplate.value = templateList.value[0] ? JSON.parse(JSON.stringify(templateList.value[0])) : {}
}).finally(() => { }).finally(() => {
loading.value = false loading.value = false
}) })

File diff suppressed because it is too large Load Diff

@ -83,7 +83,9 @@
}); });
uni.downloadFile({ uni.downloadFile({
url: record.result_url, url: record.result_url,
// url:'https://ksdt-1255846884.cos.ap-shanghai.myqcloud.com/lift-result/2025/09/24/d6180add4cd94875a1854a4febce8966.pdf',
success: (res) => { success: (res) => {
console.log(res)
if (res.statusCode === 200) { if (res.statusCode === 200) {
uni.saveFile({ uni.saveFile({
tempFilePath: res.tempFilePath, tempFilePath: res.tempFilePath,

@ -262,9 +262,13 @@ $uv.http.interceptors.response.use(
console.log(response) console.log(response)
/* 对响应错误做点什么 */ /* 对响应错误做点什么 */
const codeMsg = { const codeMsg = {
401:"登录过期",
404: "您所请求的资源无法找到", 404: "您所请求的资源无法找到",
500: "服务器内部错误,无法完成请求", 500: "服务器内部错误,无法完成请求",
}; };
if(response.statusCode == '401') {
redirectToLoginPage()
}
const errMsg = codeMsg[response.statusCode] ?? "异常错误"; const errMsg = codeMsg[response.statusCode] ?? "异常错误";
$uv.toast(errMsg); $uv.toast(errMsg);
return Promise.reject(new Error(errMsg)); return Promise.reject(new Error(errMsg));

Loading…
Cancel
Save