2025-09-22 14:50:02 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="dialog" v-if="dialogForm">
|
|
|
|
|
<div class="head_box">
|
2025-09-22 17:16:42 +08:00
|
|
|
<span class="title">保安视频库{{ title }}</span>
|
2025-09-22 14:50:02 +08:00
|
|
|
<div>
|
|
|
|
|
<el-button size="small" v-if="openType != 'detail'" @click="save" type="primary" :loading="loading">保存</el-button>
|
|
|
|
|
<el-button size="small" @click="close">关闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cntinfo">
|
|
|
|
|
<FormMessage ref="FormRef" v-model="listQuery" :disabled="openType == 'detail'" :rules="rules" :formList="formList">
|
|
|
|
|
</FormMessage>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { qcckPost , qcckGet} from "@/api/qcckApi.js";
|
|
|
|
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
2025-09-22 17:16:42 +08:00
|
|
|
import { ref, reactive,defineEmits,getCurrentInstance } from 'vue';
|
2025-09-22 14:50:02 +08:00
|
|
|
const emit = defineEmits(["refresh"]);
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
const dialogForm = ref(false);
|
|
|
|
|
const title = ref('');
|
|
|
|
|
const FormRef = ref();
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const listQuery = ref({});
|
|
|
|
|
const openType = ref("")
|
|
|
|
|
const rules = reactive({
|
2025-09-22 17:16:42 +08:00
|
|
|
spbt: [{ required: true, message: "请输入视频标题", trigger: "blur" }],
|
2025-09-22 14:50:02 +08:00
|
|
|
});
|
|
|
|
|
const formList = reactive([
|
|
|
|
|
[
|
2025-09-22 17:16:42 +08:00
|
|
|
{ label: "视频标题", prop: "spbt", type: "input" },
|
2025-09-22 14:50:02 +08:00
|
|
|
],
|
|
|
|
|
[
|
2025-09-22 17:16:42 +08:00
|
|
|
{ label: "附件", prop: "fjdz", type: "upload"},
|
2025-09-22 14:50:02 +08:00
|
|
|
],
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化数据
|
|
|
|
|
const init = (type, id,) => {
|
|
|
|
|
dialogForm.value = true;
|
|
|
|
|
openType.value = type;
|
|
|
|
|
title.value = type == "add" ? "新增" : "编辑";
|
|
|
|
|
if(id) getDateById(id)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const save = () => {
|
|
|
|
|
FormRef.value.submit(()=>{
|
2025-09-22 17:16:42 +08:00
|
|
|
// loading.value = true;
|
|
|
|
|
// let url = title.value == '新增' ? `/mosty-jbld/jbldzsd/add` : `/mosty-jbld/jbldzsd/update`;
|
|
|
|
|
// qcckPost(listQuery.value, url).then(() => {
|
|
|
|
|
// loading.value = false;
|
2025-09-22 14:50:02 +08:00
|
|
|
proxy.$message.success("保存成功");
|
2025-09-22 17:16:42 +08:00
|
|
|
// emit("refresh");
|
2025-09-22 14:50:02 +08:00
|
|
|
close();
|
2025-09-22 17:16:42 +08:00
|
|
|
// }).catch(() => {
|
|
|
|
|
// loading.value = false;
|
|
|
|
|
// })
|
2025-09-22 14:50:02 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
const close = () => {
|
|
|
|
|
dialogForm.value = false;
|
|
|
|
|
FormRef.value.reset()
|
|
|
|
|
};;
|
|
|
|
|
|
|
|
|
|
defineExpose({init})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import "@/assets/css/layout.scss";
|
|
|
|
|
.mapBox{
|
|
|
|
|
width: calc(100% - 24rem);
|
|
|
|
|
height:500px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
margin: 0 12rem;
|
|
|
|
|
}
|
|
|
|
|
</style>
|