@@ -18,7 +18,8 @@ import { FormOptEnum } from "@/enums"; | |||
//接口 | |||
interface Props { | |||
/** 操作 */ | |||
opt?: FormOptEnum; | |||
// opt?: FormOptEnum; | |||
opt?: any; | |||
/** 前缀 */ | |||
prefix?: string; | |||
/** 标题 */ | |||
@@ -29,6 +29,7 @@ declare namespace FormProps { | |||
inline?: boolean; | |||
// 树数据 | |||
treeAllData?: Array<any>; | |||
records: Array<any>; | |||
/** 表单布局 */ | |||
successful?: () => void; | |||
} | |||
@@ -50,7 +50,7 @@ const dictStore = useDictStore(); //字典仓库 | |||
const statusOptions = dictStore.getDictList(SysDictEnum.COMMON_STATUS); | |||
// 表单参数 | |||
const orgProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
const orgProps = reactive<FormProps.Base<any>>({ | |||
opt: FormOptEnum.ADD, | |||
record: {}, | |||
disabled: false | |||
@@ -41,7 +41,7 @@ const dictStore = useDictStore(); //字典仓库 | |||
const statusOptions = dictStore.getDictList(SysDictEnum.COMMON_STATUS); | |||
// 表单参数 | |||
const orgProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
const orgProps = reactive<FormProps.Base<any>>({ | |||
opt: FormOptEnum.ADD, | |||
record: {}, | |||
disabled: false, | |||
@@ -57,7 +57,7 @@ const rules = reactive({ | |||
* 打开表单 | |||
* @param props 表单参数 | |||
*/ | |||
function omMove(props: FormProps.Base<SysOrg.SysOrgInfo>) { | |||
function omMove(props: FormProps.Base<any>) { | |||
// 合并参数 | |||
Object.assign(orgProps, props); //合并参数 | |||
if (orgProps.opt == FormOptEnum.ADD) { | |||
@@ -15,7 +15,7 @@ | |||
label-width="auto" | |||
label-suffix=" :" | |||
> | |||
<s-form-item label="指定分组推送人" prop="userId"> | |||
<s-form-item label="指定推送人" prop="userId"> | |||
<el-button link type="primary" @click="showSelector">选择</el-button> | |||
<el-tag v-if="liveUserProps.record.userId" class="ml-3px" type="warning" closable @close="removeDirector">{{ | |||
liveUserProps.record.userInfo?.name | |||
@@ -43,7 +43,7 @@ const visible = ref(false); //是否显示表单 | |||
const dictStore = useDictStore(); //字典仓库 | |||
// 表单参数 | |||
const liveUserProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
const liveUserProps = reactive<FormProps.Base<any>>({ | |||
opt: FormOptEnum.ADD, | |||
record: {}, | |||
disabled: false | |||
@@ -51,25 +51,27 @@ const liveUserProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
// 表单验证规则 | |||
const rules = reactive({ | |||
userId: [required("请选择指定分组推送人")] | |||
userId: [required("请选择指定推送人")] | |||
}); | |||
/** | |||
* 打开表单 | |||
* @param props 表单参数 | |||
*/ | |||
function onOpen(props: FormProps.Base<SysOrg.SysOrgInfo>) { | |||
function onOpen(props: FormProps.Base<any>) { | |||
Object.assign(liveUserProps, props); //合并参数 | |||
if (props.opt == FormOptEnum.ADD) { | |||
//如果是新增,设置默认值 | |||
} | |||
visible.value = true; //显示表单 | |||
// if (props.record.id) { | |||
// //如果传了id,就去请求api获取record | |||
// sysOrgApi.detail({ id: props.record.id }).then(res => { | |||
// liveUserProps.record = res.data; | |||
// }); | |||
// } | |||
if (props.record.pushUserId) { | |||
//如果传了id,就去请求api获取record | |||
liveUserProps.record.userId = props.record.pushUserId; | |||
liveUserProps.record.userInfo = props.record.sysUserItem; | |||
// sysOrgApi.detail({ id: props.record.id }).then(res => { | |||
// liveUserProps.record.userId = res.data; | |||
// }); | |||
} | |||
} | |||
// 提交数据(新增/编辑) | |||
@@ -118,6 +120,8 @@ async function handleSubmit() { | |||
/** 关闭表单*/ | |||
function onClose() { | |||
visible.value = false; | |||
liveUserProps.record.userId = null; | |||
liveUserProps.record.userInfo = null; | |||
} | |||
const userSelectorRef = ref<UserSelectorInstance>(); //用户选择器引用 | |||
@@ -126,9 +126,27 @@ import { useDictStore } from "@/stores/modules"; | |||
import Form from "./components/form.vue"; | |||
import userForm from "./components/userForm.vue"; | |||
import moveForm from "./components/moveForm.vue"; | |||
import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; | |||
// import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; | |||
// import './aliyun-rts-sdk.js' | |||
import "./ali.js"; | |||
enum FormOptEnum { | |||
/** 新增 */ | |||
ADD = "新增", | |||
/** 编辑 */ | |||
EDIT = "编辑", | |||
/** 查看 */ | |||
VIEW = "查看", | |||
/** 删除 */ | |||
DELETE = "删除", | |||
// 分组推送人 | |||
GroupPushPerson = "分组推送人", | |||
// 视频推送人 | |||
VideoPushPerson = "视频推送人", | |||
// 移动 | |||
MOVE = "移动", | |||
// 分组 | |||
GROUP = "分组" | |||
} | |||
// 分组字段配置 | |||
const defaultProps = { | |||
children: "children", | |||
@@ -231,8 +249,6 @@ const filterNode = (value: string, data: Tree) => { | |||
}; | |||
const handleNodeClick = (data: Tree) => { | |||
console.log(data); | |||
// personSetId.value = val | |||
proTable.value!.pageable.pageNum = 1; | |||
proTable.value!.searchParam.groupId = data.id; | |||
proTable.value!.search(); | |||
@@ -432,7 +448,7 @@ function getvideo2() { | |||
player.value.on("error", function (event:any) { | |||
console.log("[EVENT]error", event.paramData); | |||
}); | |||
player.value.setVolume(0) | |||
// 当RTS拉流成功时触发,通过订阅该事件,可以获取到RTS TraceId | |||
player.value.on("rtsTraceId", function (data:any) { | |||
console.log("[EVENT]rtsTraceId", data.paramData); | |||
@@ -15,7 +15,7 @@ | |||
label-width="auto" | |||
label-suffix=" :" | |||
> | |||
<s-form-item label="指定分组推送人" prop="userId"> | |||
<s-form-item label="指定推送人" prop="userId"> | |||
<el-button link type="primary" @click="showSelector">选择</el-button> | |||
<el-tag v-if="liveUserProps.record.userId" class="ml-3px" type="warning" closable @close="removeDirector">{{ | |||
liveUserProps.record.userInfo?.name | |||
@@ -43,7 +43,7 @@ const visible = ref(false); //是否显示表单 | |||
const dictStore = useDictStore(); //字典仓库 | |||
// 表单参数 | |||
const liveUserProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
const liveUserProps = reactive<FormProps.Base<any>>({ | |||
opt: FormOptEnum.ADD, | |||
record: {}, | |||
disabled: false | |||
@@ -51,25 +51,27 @@ const liveUserProps = reactive<FormProps.Base<SysOrg.SysOrgInfo>>({ | |||
// 表单验证规则 | |||
const rules = reactive({ | |||
userId: [required("请选择指定分组推送人")] | |||
userId: [required("请选择指定推送人")] | |||
}); | |||
/** | |||
* 打开表单 | |||
* @param props 表单参数 | |||
*/ | |||
function onOpen(props: FormProps.Base<SysOrg.SysOrgInfo>) { | |||
function onOpen(props: FormProps.Base<any>) { | |||
Object.assign(liveUserProps, props); //合并参数 | |||
if (props.opt == FormOptEnum.ADD) { | |||
//如果是新增,设置默认值 | |||
} | |||
visible.value = true; //显示表单 | |||
// if (props.record.id) { | |||
// //如果传了id,就去请求api获取record | |||
// sysOrgApi.detail({ id: props.record.id }).then(res => { | |||
// liveUserProps.record = res.data; | |||
// }); | |||
// } | |||
if (props.record.pushUserId) { | |||
//如果传了id,就去请求api获取record | |||
liveUserProps.record.userId = props.record.pushUserId; | |||
liveUserProps.record.userInfo = props.record.sysUserItem; | |||
// sysOrgApi.detail({ id: props.record.id }).then(res => { | |||
// liveUserProps.record.userId = res.data; | |||
// }); | |||
} | |||
} | |||
// 提交数据(新增/编辑) | |||
@@ -78,27 +80,13 @@ const userFormRef = ref<FormInstance>(); | |||
async function handleSubmit() { | |||
userFormRef.value?.validate(async valid => { | |||
if (!valid) return; //表单验证失败 | |||
console.log(liveUserProps, 888); | |||
let params: any = { | |||
groupId: "", | |||
userId: "", | |||
ids: [] | |||
warnCode: "", | |||
userId: "" | |||
}; | |||
if (liveUserProps.opt == "分组推送人") { | |||
params.groupId = liveUserProps.record.id; | |||
params.userId = liveUserProps.record.userId; | |||
//提交表单 | |||
await monitorLIVEApi | |||
.setPushPerson(params) | |||
.then(() => { | |||
liveUserProps.successful!(); //调用父组件的successful方法 | |||
}) | |||
.finally(() => { | |||
onClose(); | |||
}); | |||
} else { | |||
if (liveUserProps.opt == "预警推送人") { | |||
params.warnCode = liveUserProps.record.warnCode; | |||
params.userId = liveUserProps.record.userId; | |||
params.warnCode = liveUserProps.record.code; | |||
//提交表单 | |||
await monitorLIVEApi | |||
.setWarningPushPerson(params) | |||
@@ -108,16 +96,15 @@ async function handleSubmit() { | |||
.finally(() => { | |||
onClose(); | |||
}); | |||
// delete params. | |||
} | |||
// console.log(params); | |||
// return; | |||
}); | |||
} | |||
/** 关闭表单*/ | |||
function onClose() { | |||
visible.value = false; | |||
liveUserProps.record.userId = null; | |||
liveUserProps.record.userInfo = null; | |||
} | |||
const userSelectorRef = ref<UserSelectorInstance>(); //用户选择器引用 | |||
@@ -45,7 +45,7 @@ | |||
</div> | |||
</div> --> | |||
<el-row :gutter="20"> | |||
<el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="6" v-for="(v, index) in item.subset" :key="v.code"> | |||
<el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="6" v-for="v in item.subset" :key="v.code"> | |||
<div class="contentinfo"> | |||
<div class="modellabel">{{ v.name }}</div> | |||
@@ -64,15 +64,32 @@ | |||
</div> | |||
</template> | |||
<script setup lang="tsx" name="sysSpa"> | |||
<script setup lang="tsx" name="ability"> | |||
import { ref, watch, provide, onMounted, unref, computed, reactive } from "vue"; | |||
import TreeFilter from "@/components/TreeFilter/index.vue"; | |||
import { ElMessage } from "element-plus"; | |||
import { abilityApi, userManageClassManageApi, monitorLIVEApi } from "@/api"; | |||
import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; | |||
// import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; | |||
import userForm from "./components/userForm.vue"; | |||
const value = ref(true); | |||
enum FormOptEnum { | |||
/** 新增 */ | |||
ADD = "新增", | |||
/** 编辑 */ | |||
EDIT = "编辑", | |||
/** 查看 */ | |||
VIEW = "查看", | |||
/** 删除 */ | |||
DELETE = "删除", | |||
// 分组推送人 | |||
GroupPushPerson = "分组推送人", | |||
// 视频推送人 | |||
VideoPushPerson = "视频推送人", | |||
// 移动 | |||
MOVE = "移动", | |||
// 分组 | |||
GROUP = "分组" | |||
} | |||
onMounted(() => { | |||
// 在这里执行其他需要在组件挂载后运行的代码 | |||
getwarnGroup(); | |||
@@ -81,11 +98,6 @@ onMounted(() => { | |||
const treeFilter = ref<InstanceType<typeof TreeFilter> | null>(null); | |||
const treeFilters = ref<InstanceType<typeof TreeFilter> | null>(null); | |||
function changeGroup(val: number | string) { | |||
console.log(val) | |||
// personSetId.value = val | |||
// proTable.value!.pageable.pageNum = 1; | |||
// proTable.value!.searchParam.personSetId = val; | |||
// proTable.value!.search(); | |||
getVideoList(val) | |||
} | |||
const videoList = ref<any>(); | |||
@@ -108,10 +120,10 @@ function changeVideo(val: number | string) { | |||
// 获取配置树 | |||
// 获取配置树 | |||
let warnGroupList = ref([]); | |||
let warnGroupList = ref<any>([]); | |||
function getwarnGroup() { | |||
setTimeout(async () => { | |||
await abilityApi.warnGroup({}).then(res => { | |||
await abilityApi.warnGroup({}).then((res:any) => { | |||
let { code, data } = res; | |||
if (code == 200) { | |||
warnGroupList.value = data; | |||
@@ -128,7 +140,7 @@ function pushPerson(opt: FormOptEnum, record: {} | SysOrg.SysOrgInfo = {}) { | |||
function stateChange() { | |||
let params: string = JSON.stringify(warnGroupList.value); | |||
setTimeout(async () => { | |||
await abilityApi.setWarnGroup({ configJson: params }).then(res => { | |||
await abilityApi.setWarnGroup({ configJson: params }).then((res:any) => { | |||
let { code, data, msg } = res; | |||
if (code == 200 && data) { | |||
// warnGroupList.value = data; | |||
@@ -60,7 +60,7 @@ | |||
<!-- 预览头像 --> | |||
<el-dialog v-model="visible" title="查看头像" width="830px" :before-close="handleClose"> | |||
<div style="display: flex; align-items: center; justify-content: center"> | |||
<img style="max-width: 100%" class="detailpic" :src="faceUrl" alt="" /> | |||
<img style="max-width: 100%; max-height: 600px" class="detailpic" :src="faceUrl" alt="" /> | |||
</div> | |||
<template #footer> | |||
<div class="dialog-footer"> | |||
@@ -57,7 +57,7 @@ | |||
<!-- 预览头像 --> | |||
<el-dialog v-model="visible" title="查看头像" width="830px" :before-close="handleClose"> | |||
<div style="display: flex; align-items: center; justify-content: center"> | |||
<img class="detailpic" :src="faceUrl" alt="" style="max-width: 100%" /> | |||
<img class="detailpic" :src="faceUrl" alt="" style="max-width: 100%; max-height: 600px" /> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
@@ -109,7 +109,7 @@ | |||
<!-- 预览头像 --> | |||
<el-dialog v-model="visible" title="查看头像" width="830px" :before-close="handleClose"> | |||
<div style="display: flex; align-items: center; justify-content: center"> | |||
<img class="detailpic" :src="faceUrl" alt="" /> | |||
<img style="max-width: 100%; max-height: 600px" class="detailpic" :src="faceUrl" alt="" /> | |||
</div> | |||
</el-dialog> | |||
</div> | |||