|
|
@@ -128,7 +128,12 @@ import { onMounted, onBeforeUnmount, ref, computed } from 'vue'
|
|
|
import HardwareCheck from '@/components/check/index.vue'
|
|
|
import usePhotography from './mixin/usePhotography'
|
|
|
import generate from '@/utils/menus/generate'
|
|
|
-import { ElMessageBox } from 'element-plus'
|
|
|
+import { ElMessage,ElMessageBox } from 'element-plus'
|
|
|
+import { clickLog, setLogInfo } from '@/utils/log'
|
|
|
+import {useRoute, useRouter} from "vue-router";
|
|
|
+import client from "@/stores/modules/client";
|
|
|
+import icpList from '@/utils/ipc'
|
|
|
+import { getFilePath, getRouterUrl } from '@/utils/appfun'
|
|
|
|
|
|
const {
|
|
|
loading,
|
|
|
@@ -141,12 +146,46 @@ const {
|
|
|
getFilePath,
|
|
|
getPhotoRecords,
|
|
|
delGoods,
|
|
|
- openPhotographyDetail,
|
|
|
onGenerateCLick,
|
|
|
initEventListeners,
|
|
|
cleanupEventListeners,
|
|
|
} = usePhotography()
|
|
|
|
|
|
+
|
|
|
+const Router = useRouter()
|
|
|
+const route = useRoute();
|
|
|
+const clientStore = client();
|
|
|
+// 覆盖 openPhotographyDetail 方法,只传递选中的货号
|
|
|
+const openPhotographyDetail = () => {
|
|
|
+
|
|
|
+ if (selectedGoods.value.size === 0) {
|
|
|
+ ElMessage.error('请选择要生成的货号')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 埋点:开始生成
|
|
|
+ clickLog({ describe: { action: '开始生成', goods_count: selectedGoods.value.size, goods_art_nos: Array.from(selectedGoods.value) } }, route);
|
|
|
+ console.log(Array.from(selectedGoods.value));
|
|
|
+ console.log(selectedGoods.value);
|
|
|
+
|
|
|
+ const { href } = Router.resolve({
|
|
|
+ name: 'PhotographyDetail',
|
|
|
+ query: {
|
|
|
+ goods_art_nos: Array.from(selectedGoods.value),
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.openMain);
|
|
|
+ let params = {
|
|
|
+ title: '主图与详情生成',
|
|
|
+ width: 3840,
|
|
|
+ height: 2160,
|
|
|
+ frame: true,
|
|
|
+ id: "PhotographyDetail",
|
|
|
+ url: getRouterUrl(href)
|
|
|
+ }
|
|
|
+ clientStore.ipc.send(icpList.utils.openMain, params);
|
|
|
+}
|
|
|
+
|
|
|
// 选中的货号列表
|
|
|
const selectedGoods = ref<Set<string>>(new Set())
|
|
|
|