|
@@ -110,6 +110,13 @@
|
|
|
:page-size="pageSize"
|
|
:page-size="pageSize"
|
|
|
/>
|
|
/>
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ :disabled="runLoading || takePictureLoading"
|
|
|
|
|
+ @click="handleImportImage"
|
|
|
|
|
+ v-log="{ describe: { action: '导入图片' } }"
|
|
|
|
|
+ >
|
|
|
|
|
+ 导入图片
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
:disabled="selectedGoods.size === 0 || runLoading || takePictureLoading"
|
|
:disabled="selectedGoods.size === 0 || runLoading || takePictureLoading"
|
|
|
@click="deleteSelected"
|
|
@click="deleteSelected"
|
|
|
v-log="{ describe: { action: '删除选中货号' } }"
|
|
v-log="{ describe: { action: '删除选中货号' } }"
|
|
@@ -117,6 +124,14 @@
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ :disabled="!goodsList.length || runLoading || takePictureLoading"
|
|
|
|
|
+ @click="handleDeleteAll"
|
|
|
|
|
+ style="color: #FF4C00"
|
|
|
|
|
+ v-log="{ describe: { action: '删除所有货号' } }"
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除所有
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:disabled="!goodsList.length || runLoading || takePictureLoading"
|
|
:disabled="!goodsList.length || runLoading || takePictureLoading"
|
|
|
@click="openPhotographyDetail()"
|
|
@click="openPhotographyDetail()"
|
|
@@ -141,8 +156,12 @@ import usePhotography from './mixin/usePhotography'
|
|
|
import { useThumbnails } from './composables/useThumbnails'
|
|
import { useThumbnails } from './composables/useThumbnails'
|
|
|
import generate from '@/utils/menus/generate'
|
|
import generate from '@/utils/menus/generate'
|
|
|
import { ElMessageBox } from 'element-plus'
|
|
import { ElMessageBox } from 'element-plus'
|
|
|
|
|
+import client from "@/stores/modules/client";
|
|
|
|
|
+import icpList from '@/utils/ipc'
|
|
|
// logging helpers not needed here
|
|
// logging helpers not needed here
|
|
|
|
|
|
|
|
|
|
+const clientStore = client();
|
|
|
|
|
+
|
|
|
const {
|
|
const {
|
|
|
loading,
|
|
loading,
|
|
|
runLoading,
|
|
runLoading,
|
|
@@ -162,6 +181,8 @@ const {
|
|
|
pageSize,
|
|
pageSize,
|
|
|
currentPage,
|
|
currentPage,
|
|
|
totalPages,
|
|
totalPages,
|
|
|
|
|
+ importDirs,
|
|
|
|
|
+ deleteAllGoods,
|
|
|
} = usePhotography()
|
|
} = usePhotography()
|
|
|
|
|
|
|
|
// thumbnails
|
|
// thumbnails
|
|
@@ -301,6 +322,35 @@ const getPreviewIndex = (item: any, currentIndex: number) => {
|
|
|
return previewIndex
|
|
return previewIndex
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 打开目录选择器并导入图片
|
|
|
|
|
+const handleImportImage = () => {
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
+ clientStore.ipc.send(icpList.utils.openDirectory);
|
|
|
|
|
+ clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ importDirs(result);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 删除所有货号
|
|
|
|
|
+const handleDeleteAll = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await ElMessageBox.confirm(
|
|
|
|
|
+ '确定要删除所有货号的拍摄数据吗?',
|
|
|
|
|
+ '提示',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ deleteAllGoods()
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ // 用户取消
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getPhotoRecords()
|
|
await getPhotoRecords()
|
|
|
initEventListeners()
|
|
initEventListeners()
|