Lufaneng 6 months ago
parent ec08826665
commit b372181064

@ -110,7 +110,7 @@
border="bottom"
:placeholderStyle="{ color: '#666778' }"
:placeholder="item.type === 'number' ? `范围:${item.min} - ${item.max === 0 ? '不限' : item.max}` : (item.name === '土建图号'
? '将根据土建图型号自动生成'
? '自动生成'
: '请输入')"
></uv-input>
<!-- 数字范围提示 -->
@ -199,7 +199,8 @@ import {
} from "@dcloudio/uni-app";
import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request";
import { usePermission } from "@/hooks/usePermission";
import { usePermission } from "@/hooks/usePermission";
import dayjs from 'dayjs'
const authStore = useAuthStore();
const userStore = useUserStore();
@ -289,11 +290,11 @@ const confirm = (val) => {
console.log(val);
currentParams.value.value = val.value[0];
//
if (currentParams.value.name === "土建图型号") {
nextTick(() => {
generateDrawingNumber();
});
}
// if (currentParams.value.name === "") {
// nextTick(() => {
// generateDrawingNumber();
// });
// }
};
//
@ -344,11 +345,11 @@ const cancelApply = () => {
//
const handleInputChange = (item) => {
//
if (item.name === "土建图型号") {
nextTick(() => {
generateDrawingNumber();
});
}
// if (item.name === "") {
// nextTick(() => {
// generateDrawingNumber();
// });
// }
};
//
@ -394,21 +395,21 @@ const generateDrawingNumber = () => {
if (!params) return;
//
const modelParam = params.find((p) => p.name === "土建图型号");
// const modelParam = params.find((p) => p.name === "");
const numberParam = params.find((p) => p.name === "土建图号");
if (!modelParam || !numberParam || !modelParam.value) return;
if (!numberParam) return;
//
const now = new Date();
const year = now.getFullYear().toString().slice(-2); //
const month = (now.getMonth() + 1).toString().padStart(2, "0"); //
// const now = new Date();
// const year = now.getFullYear().toString().slice(-2); //
// const month = (now.getMonth() + 1).toString().padStart(2, "0"); //
// 4+
const randomPart = generateRandomCode();
// GSE400-V25-10-0002A
numberParam.value = `${modelParam.value}-V${year}${month}-${randomPart}`;
numberParam.value = dayjs().format('YYYYMMDDHHmmss') + randomPart;
};
// 4+1
@ -418,7 +419,7 @@ const generateRandomCode = () => {
.padStart(4, "0");
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const letter = letters.charAt(Math.floor(Math.random() * letters.length));
return numbers + letter;
return numbers;
};
const generating = ref(false);
@ -477,7 +478,8 @@ const getList = () => {
has_access.value = true;
RPC.post("/template/detail", { id: currentTemplate.value.id })
.then((res) => {
currentTemplate.value.params = res?.params;
currentTemplate.value.params = res?.params;
generateDrawingNumber()
})
.finally(() => {
params_loading.value = false;

@ -3,17 +3,18 @@
<!-- 生成记录列表 -->
<view class="record-list">
<uv-swipe-action>
<uv-swipe-action-item @click="delItem(record)" :options="options" v-for="record in list"
:key="record.ID">
<uv-swipe-action-item @click="index => controlItem(index,record)" :options="options"
v-for="record in list" :key="record.ID">
<view class="record-item">
<!-- 记录信息 -->
<view class="record-info">
<view class="record-title">{{ record.file_name || record.order_no || record.plannedNo }}</view>
<view class="record-title">{{ record.file_name || record.order_no || record.plannedNo }}
</view>
<view class="record-time">
生成时间:
{{
record.CreatedAt
? dayjs(record.CreatedAt).format("YYYY-MM-DD")
? dayjs(record.CreatedAt).format("YYYY-MM-DD HH:mm:ss")
: ""
}}
</view>
@ -22,10 +23,12 @@
<!-- 状态标签 -->
<view class="status-tag" :class="{
completed: record.status == 4,
failed: record.status == 5,
failed: record.status == 5,
waitting:record.status == 1
}">
<span v-if="record.status == 4"></span>
<span v-else-if="record.status == 5">生成失败</span>
<span v-else-if="record.status == 5">生成失败</span>
<span v-else-if="record.status == 1">等待生成</span>
<span v-else></span>
</view>
@ -54,6 +57,21 @@
<!-- 加载更多 -->
<uv-load-more v-else :status="loadingStatus" @loadmore="loadmore" />
<!-- 参数展示弹窗 -->
<uv-modal ref="paramsModalRef" title="生成参数" :showCancelButton="false" confirmText="确定">
<view class="params-modal-content">
<view v-if="currentParams.length === 0" class="no-params">
暂无参数信息
</view>
<view v-else class="params-list">
<view v-for="param in currentParams" :key="param.name" class="param-item">
<view class="param-name">{{ param.name }}</view>
<view class="param-value">{{ param.value || '未设置' }}</view>
</view>
</view>
</view>
</uv-modal>
</view>
</template>
@ -71,14 +89,41 @@
} from "@dcloudio/uni-app";
const options = ref([{
text: "参数",
style: {
backgroundColor: "#6eb0ea",
},
}, {
text: "删除",
style: {
backgroundColor: "#f56c6c",
},
}, ]);
const delItem = (item) => {
console.log(item);
deleteRecord(item);
}]);
const currentParams = ref([])
const showParamsModal = ref(false)
const paramsModalRef = ref(null)
const controlItem = (index, item) => {
console.log(index, item);
if (index.index === 0) {
//
showParams(item);
} else {
deleteRecord(item);
}
};
//
const showParams = (item) => {
if (item.template_data) {
currentParams.value = Object.entries(item.template_data).map(([key, value]) => ({
name: key,
value: value
}));
} else {
currentParams.value = [];
}
paramsModalRef.value.open();
};
//
const loading = ref(false);
@ -86,7 +131,6 @@
const page = ref(1);
const list = ref([]);
const count = ref(0);
//
const downloadRecord = (record) => {
uni.showLoading({
@ -102,12 +146,38 @@
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// downloadA(record.result_url, (record.file_name || record.plannedNo))
uni.hideLoading();
uni.showToast({
title: "开始下载",
icon: "success",
});
// uni.request({
// url:'/api/proxyDownload',
// data:{"name":record.file_name || record.plannedNo,url:record.result_url},
// method:'POST',
// responseType: 'arraybuffer',
// success:res => {
// const blob = new Blob([res.data], {
// type: 'application/pdf'
// })
// const base64 = res.data
// const iframe = document.createElement('iframe')
// iframe.style.display = 'none'
// iframe.src = `data:application/pdf;base64,${base64}`
// document.body.appendChild(iframe)
// // const url = URL.createObjectURL(blob)
// // const a = document.createElement('a')
// // a.href = url
// // a.download = record.file_name
// // a.click()
// // URL.revokeObjectURL(url)
// },
// complete:() => {
// uni.hideLoading();
// }
// })
// #endif
// #ifdef MP-WEIXIN
// App使uni.downloadFile
@ -274,8 +344,8 @@
color: #333;
font-weight: 500;
margin-bottom: 6px;
word-wrap: break-word;
white-space: normal;
word-wrap: break-word;
white-space: normal;
}
.record-time {
@ -306,6 +376,10 @@
&.processing {
background: #fff7e6;
color: #fa8c16;
}
&.waitting {
background: #fff7e6;
color: #4ad6f1;
}
}
@ -335,4 +409,47 @@
padding: 20px;
text-align: center;
}
.params-modal-content {
padding: 20px 0;
max-height: 400px;
overflow-y: auto;
.no-params {
text-align: center;
color: #999;
font-size: 14px;
padding: 20px 0;
}
.params-list {
.param-item {
display: flex;
align-items: flex-start;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.param-name {
flex-shrink: 0;
font-weight: 500;
color: #333;
font-size: 14px;
min-width: 80px;
margin-right: 12px;
}
.param-value {
flex: 1;
color: #666;
font-size: 14px;
word-wrap: break-word;
white-space: normal;
}
}
}
}
</style>

@ -14,7 +14,7 @@
<!-- 操作按钮 -->
<view class="record-actions">
<uv-button type="primary" size="small" v-if="record.access_status == 'rejected' || record.access_status == 'none'"
<uv-button type="primary" size="small" v-if="record.access_status == 'revoked' || record.access_status == 'rejected' || record.access_status == 'none'"
@click="openApplyModal(record)">
申请权限
</uv-button>
@ -22,8 +22,8 @@
<!-- 状态标签 -->
<view class="status-tag" :class="{
completed: record.access_status == 'approved',
failed: record.access_status == 'rejected',
completed: record.access_status == 'approved',
failed: record.access_status == 'rejected' || record.access_status == 'revoked',
waitting: record.access_status == 'pending',
}">
{{get_access_status(record.access_status)}}
@ -111,6 +111,8 @@ const get_access_status = (access_status) => {
str = "待审批";
} else if (access_status === "rejected") {
str = "已拒绝";
} else if (access_status === "revoked") {
str = "已撤回";
} else if (access_status === "approved") {
str = "已通过";
} else {

@ -28,7 +28,14 @@ export default defineConfig(({ mode }) => {
proxy: {
['/jsonrpc']: {
changeOrigin: true,
target: 'https://lift-drawing-h5.ruixininfo.com',
// target: 'https://lift-drawing-h5.ruixininfo.com',
target: 'https://lift-h5.shulinelev.com',
// target: 'https://lift-drawing.ruixininfo.com',
},
['/api/proxyDownload']: {
changeOrigin: true,
// target: 'https://lift-drawing-h5.ruixininfo.com',
target: 'https://lift-h5.shulinelev.com',
// target: 'https://lift-drawing.ruixininfo.com',
},
},

Loading…
Cancel
Save