|
@@ -34,7 +34,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <p class="error-text">capture one的导出拍照图像自动和智能拍的待处理图像自不一致,请重新选择</p>
|
|
|
|
|
|
|
+<!-- <p class="error-text">capture one的导出拍照图像自动和智能拍的待处理图像自不一致,请重新选择</p>-->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="selectBox" v-if="activeIndex === 0">
|
|
<div class="selectBox" v-if="activeIndex === 0">
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
@@ -191,15 +191,19 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
// 这里可以添加Vue组件的逻辑
|
|
// 这里可以添加Vue组件的逻辑
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
|
+import { ref, reactive } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { onMounted, watch } from 'vue';
|
|
import { onMounted, watch } from 'vue';
|
|
|
|
|
|
|
|
|
|
+import client from "@/stores/modules/client";
|
|
|
|
|
+import icpList from '@/utils/ipc'
|
|
|
|
|
+const clientStore = client();
|
|
|
|
|
+
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const folderPath = ref('');
|
|
const folderPath = ref('');
|
|
|
const activeIndex = ref(0);
|
|
const activeIndex = ref(0);
|
|
|
-const formData = ref({
|
|
|
|
|
|
|
+const formData = reactive({
|
|
|
captureOneFolder: '',
|
|
captureOneFolder: '',
|
|
|
mainImageSize: '',
|
|
mainImageSize: '',
|
|
|
imageFormat: '',
|
|
imageFormat: '',
|
|
@@ -328,37 +332,12 @@ onMounted(() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const selectFolder = () => {
|
|
const selectFolder = () => {
|
|
|
- // 这里可以添加选择文件夹的逻辑
|
|
|
|
|
- // 由于浏览器安全限制,网页应用无法直接访问本地文件系统
|
|
|
|
|
- // 这里我们可以使用一个模拟的文件选择对话框
|
|
|
|
|
-
|
|
|
|
|
- // 创建一个隐藏的input元素用于选择文件夹
|
|
|
|
|
- const input = document.createElement('input');
|
|
|
|
|
- input.type = 'file';
|
|
|
|
|
- input.webkitdirectory = true; // 允许选择文件夹而不是文件
|
|
|
|
|
- input.directory = true; // 非标准属性,某些浏览器支持
|
|
|
|
|
-
|
|
|
|
|
- // 监听文件选择事件
|
|
|
|
|
- input.onchange = (event) => {
|
|
|
|
|
- const files = event.target.files;
|
|
|
|
|
- if (files && files.length > 0) {
|
|
|
|
|
- // 获取选择的文件夹路径(仅显示第一个文件的目录)
|
|
|
|
|
- const path = files[0].webkitRelativePath.split('/')[0];
|
|
|
|
|
- folderPath.value = path;
|
|
|
|
|
-
|
|
|
|
|
- // 更新表单数据中的captureOneFolder字段
|
|
|
|
|
- formData.value.captureOneFolder = path;
|
|
|
|
|
-
|
|
|
|
|
- // 这里可以添加更新UI或发送到后端的逻辑
|
|
|
|
|
- console.log('选择的文件夹:', path);
|
|
|
|
|
-
|
|
|
|
|
- // 如果需要,可以在这里添加API调用来保存路径到后端
|
|
|
|
|
- // 例如:axios.post('/api/settings/folder', { path: folderPath.value });
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 触发文件选择对话框
|
|
|
|
|
- input.click();
|
|
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
+ clientStore.ipc.send(icpList.utils.openDirectory);
|
|
|
|
|
+ clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
|
|
|
|
|
+ formData.captureOneFolder = result
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
const saveSetting = () => {
|
|
const saveSetting = () => {
|
|
|
console.log(formData.value);
|
|
console.log(formData.value);
|
|
@@ -443,7 +422,7 @@ body {
|
|
|
.select-wrapper {
|
|
.select-wrapper {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
width: 200px;
|
|
width: 200px;
|
|
|
- :deep(.el-input__inner){
|
|
|
|
|
|
|
+ :deep(.el-input__inner){
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -493,4 +472,4 @@ body {
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
padding-bottom: 30px;
|
|
padding-bottom: 30px;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|