|
|
@@ -42,13 +42,13 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { ElDialog, ElSelect, ElOption, ElButton, ElMessage } from 'element-plus';
|
|
|
- import { ref, watch } from 'vue';
|
|
|
+ import { ref, onMounted } from 'vue';
|
|
|
import useCameraAlgoStore from '../../store/useCameraAlgoStore';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { createCameraAlgoApi } from '@/api/camera/camera-preview';
|
|
|
import useCameraDetailStore from '../../store/useCameraDetailStore';
|
|
|
import AlgoAddBtn from '../AlgoSwitchCard/AlgoAddBtn.vue';
|
|
|
- import { AlgoItem, getAlgosByCameraCode, getAlgosByCameraId } from '@/api/camera/camera-preview';
|
|
|
+ import { AlgoDetail, queryAlgoInfoAll } from '@/api/algo/algo';
|
|
|
|
|
|
const selectedIds = ref<number[]>([]);
|
|
|
const cameraAlgoStore = useCameraAlgoStore();
|
|
|
@@ -65,23 +65,13 @@
|
|
|
visible.value = false;
|
|
|
};
|
|
|
|
|
|
- const curOptionsByCode = ref<AlgoItem[]>([]);
|
|
|
- watch(
|
|
|
- () => detail.value?.id,
|
|
|
- (newId) => {
|
|
|
- if (!newId) return;
|
|
|
- // getAlgosByCameraCode(newCode).then((res) => {
|
|
|
- // curOptionsByCode.value = res;
|
|
|
- // });
|
|
|
+ const curOptionsByCode = ref<AlgoDetail[]>([]);
|
|
|
|
|
|
- getAlgosByCameraId(newId).then(res => {
|
|
|
- curOptionsByCode.value = res;
|
|
|
- });
|
|
|
- },
|
|
|
- {
|
|
|
- immediate: true,
|
|
|
- },
|
|
|
- );
|
|
|
+ onMounted(() => {
|
|
|
+ queryAlgoInfoAll().then((res) => {
|
|
|
+ curOptionsByCode.value = res;
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
const handleVisibleChange = (visible: boolean) => {
|
|
|
const t = setTimeout(() => {
|