Lufaneng 6 months ago
parent ec08826665
commit b372181064

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

@ -3,17 +3,18 @@
<!-- 生成记录列表 --> <!-- 生成记录列表 -->
<view class="record-list"> <view class="record-list">
<uv-swipe-action> <uv-swipe-action>
<uv-swipe-action-item @click="delItem(record)" :options="options" v-for="record in list" <uv-swipe-action-item @click="index => controlItem(index,record)" :options="options"
:key="record.ID"> v-for="record in list" :key="record.ID">
<view class="record-item"> <view class="record-item">
<!-- 记录信息 --> <!-- 记录信息 -->
<view class="record-info"> <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"> <view class="record-time">
生成时间: 生成时间:
{{ {{
record.CreatedAt record.CreatedAt
? dayjs(record.CreatedAt).format("YYYY-MM-DD") ? dayjs(record.CreatedAt).format("YYYY-MM-DD HH:mm:ss")
: "" : ""
}} }}
</view> </view>
@ -23,9 +24,11 @@
<view class="status-tag" :class="{ <view class="status-tag" :class="{
completed: record.status == 4, 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-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> <span v-else></span>
</view> </view>
@ -54,6 +57,21 @@
<!-- 加载更多 --> <!-- 加载更多 -->
<uv-load-more v-else :status="loadingStatus" @loadmore="loadmore" /> <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> </view>
</template> </template>
@ -71,14 +89,41 @@
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
const options = ref([{ const options = ref([{
text: "参数",
style: {
backgroundColor: "#6eb0ea",
},
}, {
text: "删除", text: "删除",
style: { style: {
backgroundColor: "#f56c6c", backgroundColor: "#f56c6c",
}, },
}, ]); }]);
const delItem = (item) => { const currentParams = ref([])
console.log(item); 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); 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); const loading = ref(false);
@ -86,7 +131,6 @@
const page = ref(1); const page = ref(1);
const list = ref([]); const list = ref([]);
const count = ref(0); const count = ref(0);
// //
const downloadRecord = (record) => { const downloadRecord = (record) => {
uni.showLoading({ uni.showLoading({
@ -102,12 +146,38 @@
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
// downloadA(record.result_url, (record.file_name || record.plannedNo))
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: "开始下载", title: "开始下载",
icon: "success", 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 // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// App使uni.downloadFile // App使uni.downloadFile
@ -307,6 +377,10 @@
background: #fff7e6; background: #fff7e6;
color: #fa8c16; color: #fa8c16;
} }
&.waitting {
background: #fff7e6;
color: #4ad6f1;
}
} }
.record-actions { .record-actions {
@ -335,4 +409,47 @@
padding: 20px; padding: 20px;
text-align: center; 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> </style>

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

@ -28,7 +28,14 @@ export default defineConfig(({ mode }) => {
proxy: { proxy: {
['/jsonrpc']: { ['/jsonrpc']: {
changeOrigin: true, 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', // target: 'https://lift-drawing.ruixininfo.com',
}, },
}, },

Loading…
Cancel
Save