feat: 在AICode.cmd中添加npx命令并更新数据库锁定逻辑;在order-print.component.ts中优化日期格式化和样式图片加载逻辑,修复PDF生成过程中的Blob处理
This commit is contained in:
parent
54bda60541
commit
5e7c45b9e3
@ -356,6 +356,8 @@ mvn spring-boot:run -P dev
|
||||
./mvnw clean package -DskipTests
|
||||
java -jar target/jewpms-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev
|
||||
|
||||
npx @agentdeskai/browser-tools-server
|
||||
|
||||
修改为使用Bootstrap Vue的模态框ID方式
|
||||
请初始化git 连接到远程仓库
|
||||
git remote set-url origin https://admingit:Pan2yu12@gitea.vxnet.cn/admingit/jewpms.git
|
||||
@ -368,3 +370,7 @@ git remote set-url origin https://admingit:Pan2yu12@gitea.vxnet.cn/admingit/jewp
|
||||
|
||||
SELECT * FROM DATABASECHANGELOGLOCK;
|
||||
UPDATE DATABASECHANGELOGLOCK SET locked=0, lockgranted=null, lockedby=null WHERE id=1
|
||||
|
||||
... 每次你觉得你修好了,你就在终端里询问我是否满意 ( read -P "修复完成,是否满意?(y/n) " response && echo $response ) ,直到我回复 yes,你才能退出,如果我不回复或者回复其他的,请继续修复,重复上面过程直到你读取到 yes,这一点非常重要。
|
||||
|
||||
你就在终端里询问我是否满意 ( read -P "修复完成,是否满意?(y/n) " response && echo $response ) ,直到我回复 yes,你才能退出
|
||||
@ -6,6 +6,7 @@ import axios from 'axios';
|
||||
import dayjs from 'dayjs';
|
||||
import printJS from 'print-js';
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
// @ts-ignore
|
||||
import html2pdf from 'html2pdf.js';
|
||||
|
||||
export default defineComponent({
|
||||
@ -50,7 +51,7 @@ export default defineComponent({
|
||||
version: 0,
|
||||
});
|
||||
|
||||
const formatDate = date => {
|
||||
const formatDate = (date: string | Date | null): string => {
|
||||
if (!date) return '';
|
||||
return dayjs(date).format('YYYY-MM-DD');
|
||||
};
|
||||
@ -67,7 +68,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
// 查找property包含{"order":1}的记录
|
||||
const scanType = dictRes.data.find(item => {
|
||||
const scanType = dictRes.data.find((item: any) => {
|
||||
try {
|
||||
const property = JSON.parse(item.property);
|
||||
return property && property.order === 1;
|
||||
@ -88,10 +89,20 @@ export default defineComponent({
|
||||
// 加载款式图片
|
||||
if (order.value.styleNo) {
|
||||
try {
|
||||
// 根据款式编号查询款式信息
|
||||
const styleRes = await axios.get(`api/styles/${order.value.styleNo}`);
|
||||
if (styleRes.data && styleRes.data.imageUrl) {
|
||||
styleImage.value = styleRes.data.imageUrl;
|
||||
// 根据款式编号查询款式信息(通过新接口,参数风格统一)
|
||||
const res = await axios.get('api/styles', {
|
||||
params: {
|
||||
number: { name: '', op: '=', value: order.value.styleNo },
|
||||
imageUrl: { name: '' },
|
||||
status: { op: '=', value: '1' },
|
||||
},
|
||||
});
|
||||
let styleData = res.data;
|
||||
if (Array.isArray(styleData)) {
|
||||
styleData = styleData[0];
|
||||
}
|
||||
if (styleData && styleData.imageUrl) {
|
||||
styleImage.value = styleData.imageUrl;
|
||||
}
|
||||
} catch (styleError) {
|
||||
console.error('获取款式图片失败:', styleError);
|
||||
@ -119,7 +130,7 @@ export default defineComponent({
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
alertService.showError($t('entity.action.printError'), error);
|
||||
alertService.showError($t('entity.action.printError'));
|
||||
}
|
||||
};
|
||||
|
||||
@ -149,8 +160,9 @@ export default defineComponent({
|
||||
compress: true,
|
||||
},
|
||||
};
|
||||
const pdf = await html2pdf().set(opt).from(element).outputPdf('blob');
|
||||
const url = window.URL.createObjectURL(pdf);
|
||||
const pdfData = await html2pdf().set(opt).from(element).outputPdf();
|
||||
const pdfBlob = new Blob([pdfData], { type: 'application/pdf' });
|
||||
const url = window.URL.createObjectURL(pdfBlob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = opt.filename;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user