八项作业添加监控播放

pull/1/head
chenxinying 2024-01-15 10:09:11 +08:00
parent f9b2c57e26
commit b3055a31fd
3 changed files with 126 additions and 90 deletions

View File

@ -52,17 +52,18 @@
</template> </template>
<script setup> <script setup>
import { serialNumber } from "@/assets/js/utils"; import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData"; import useListData from "@/assets/js/useListData";
import { import {
getVideoManagerList, setEightWorkVideoManagerDelete, getVideoManagerList,
setEightWorkVideoManagerDelete,
setEightWorkVideoManagerList, setEightWorkVideoManagerList,
setVideoManagerList setVideoManagerList,
} from "@/request/eightwork_videomanager"; } from "@/request/eightwork_videomanager";
import {useVModel} from "@vueuse/core"; import { useVModel } from "@vueuse/core";
import {debounce} from "throttle-debounce"; import { debounce } from "throttle-debounce";
import {ElMessage, ElMessageBox} from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
required: true, required: true,
@ -71,27 +72,33 @@
checkNo: { checkNo: {
type: String, type: String,
required: true, required: true,
default: '', default: "",
}, },
}); });
const emits = defineEmits(["update:visible",'get-data']); const emits = defineEmits(["update:visible", "get-data"]);
const visible = useVModel(props, "visible", emits); const visible = useVModel(props, "visible", emits);
const { list, pagination,searchForm, fnGetData, fnResetPagination } = const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getVideoManagerList); useListData(getVideoManagerList);
const fnSubmit = debounce( const fnSubmit = debounce(
1000, 1000,
async (row) => { async (row) => {
const resData = await setVideoManagerList({VIDEOMANAGER_ID:row.VIDEOMANAGER_ID}) const resData = await setVideoManagerList({
if(resData.pd){ VIDEOMANAGER_ID: row.VIDEOMANAGER_ID,
await setEightWorkVideoManagerDelete({EIGHTWORKVIDEOMANAGER_ID:resData.pd.EIGHTWORKVIDEOMANAGER_ID}) });
await ElMessageBox.confirm("该监控已绑定其他作业,是否更改?", { type: "warning" }); if (resData.pd) {
await setEightWorkVideoManagerDelete({
EIGHTWORKVIDEOMANAGER_ID: resData.pd.EIGHTWORKVIDEOMANAGER_ID,
});
await ElMessageBox.confirm("该监控已绑定其他作业,是否更改?", {
type: "warning",
});
} }
await setEightWorkVideoManagerList({...row, CHECK_NO: props.checkNo}) await setEightWorkVideoManagerList({ ...row, CHECK_NO: props.checkNo });
ElMessage.success("操作成功"); ElMessage.success("操作成功");
emits('get-data') emits("get-data");
}, },
{ atBegin: true } { atBegin: true }
); );
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@ -0,0 +1,29 @@
<template>
<el-dialog v-model="visible" title="播放视频">
<iframe :src="src" style="width: 100%; height: 500px" />
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModel } from "@vueuse/core";
const prosp = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
src: {
type: String,
required: true,
default: "",
},
});
const emits = defineEmits(["update:visible"]);
const visible = useVModel(prosp, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -57,16 +57,16 @@
<el-button type="primary" @click="fnAdd"> </el-button> <el-button type="primary" @click="fnAdd"> </el-button>
</template> </template>
</layout-table> </layout-table>
<layout-video
:src="data.videoDialog.src"
v-model:visible="data.videoDialog.visible"
/>
</layout-card> </layout-card>
<add <add
v-model:visible="data.addDialog.Visible" v-model:visible="data.addDialog.Visible"
:check-no="data.addDialog.checkNo" :check-no="data.addDialog.checkNo"
@get-data="fnResetPagination" @get-data="fnResetPagination"
/> />
<video-view
v-model:visible="data.videoDialog.visible"
:src="data.videoDialog.src"
/>
</div> </div>
</template> </template>
@ -81,10 +81,10 @@ import { reactive } from "vue";
import Add from "./components/add.vue"; import Add from "./components/add.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
import LayoutVideo from "@/components/video/index.vue"; import VideoView from "./components/video.vue";
const route = useRoute(); const route = useRoute();
const { CHECK_NO } = route.query; const { CHECK_NO } = route.query;
const { list, pagination, searchForm, fnGetData, fnResetPagination } = const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getEightWorkVideoManagerList, { useListData(getEightWorkVideoManagerList, {
otherParams: { CHECK_NO }, otherParams: { CHECK_NO },