diff --git a/components.d.ts b/components.d.ts
index ee82309..3f8a8c5 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -11,6 +11,7 @@ declare module '@vue/runtime-core' {
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
ATree: typeof import('ant-design-vue/es')['Tree']
+ Model: typeof import('./src/components/model.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
diff --git a/src/utils/popup.ts b/src/utils/popup.ts
new file mode 100644
index 0000000..6740734
--- /dev/null
+++ b/src/utils/popup.ts
@@ -0,0 +1,97 @@
+import { Button, notification } from "ant-design-vue";
+import { CloseSquareTwoTone } from "@ant-design/icons-vue";
+import { h, VNode } from "vue";
+/**
+ * 消息弹窗组件 Notification
+ * @param {string} title 标题
+ * @param {string} content 内容
+ * @param {string} id 唯一标识
+ * @param {number} duration 持续时间: 默认不关闭(单位:秒)
+ * @param {string} btnAText 按钮1 名称
+ * @param {string} btnBText 按钮2 名称
+ * @param {Event} btnAEvent 按钮1 事件
+ * @param {Event} btnBEvent 按钮2 事件
+ */
+export default function popup(
+ title = "标题",
+ content: VNode[] | string = "请输入内容",
+ id = "",
+ duration = 0,
+ btnAText = "", btnBText = "",
+ btnAEvent = () => {/* do nothing.*/ },
+ btnBEvent = () => {/* do nothing.*/ }
+): void {
+ const key = id === "" ? `id-${Date.now()}` : id;
+ notification.open({
+ key,
+ duration: duration,
+ message: h(
+ "h2",
+ {
+ style: { color: "#fff",
+ textAlign: "center"
+ },
+ },
+ title
+ ),
+ description: h(
+ "div",
+ {
+ style: { color: "#fff" },
+ },
+ content
+ ),
+ placement: 'topLeft',
+ style: {
+ width: "540px",
+ // height: "600px",
+ // marginLeft: `-200px`,
+ /**right导致页面重排,不流畅,但目前mac和Windows通过效果
+ */
+ top: "50%",
+ left: `50%`,
+ transform: 'translate(-50%,-50%)',
+ backgroundColor: "rgba(0 ,64 ,64 , 0.8)",
+ userSelect: "none",
+ //boxShadow: "inset 0 0 15px 4px #56ffff",
+ // boxShadow: "inset 0 0 4px 2px #56ffff",
+ borderRadius:"5px",
+ border:"2px solid #56ffff88",
+ color: "white",
+ position: 'fixed',
+ },
+ btn: h("div", null, [
+ btnAText == "" ? null : h(
+ Button,
+ {
+ type: "primary",
+ size: "small",
+ danger: true,
+ onClick: btnAEvent,
+ },
+ btnAText
+ ),
+ btnBText == "" ? null : h(
+ Button,
+ {
+ type: "primary",
+ size: "small",
+ style: {
+ marginLeft: "7px",
+ },
+ danger: true,
+ onClick: btnBEvent,
+ },
+ btnBText
+ ),
+ ]),
+ closeIcon: h(CloseSquareTwoTone, {
+ style: {
+ display:"none"
+ },
+ }) ,
+ onClose: () => {
+ notification.close(key);
+ },
+ });
+}
diff --git a/src/views/page/Aside/cameraRightMenu.vue b/src/views/page/Aside/cameraRightMenu.vue
new file mode 100644
index 0000000..3af8189
--- /dev/null
+++ b/src/views/page/Aside/cameraRightMenu.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/page/aside/cameraLeftMenu.vue b/src/views/page/aside/cameraLeftMenu.vue
index efa5655..7b16830 100644
--- a/src/views/page/aside/cameraLeftMenu.vue
+++ b/src/views/page/aside/cameraLeftMenu.vue
@@ -18,8 +18,9 @@
{{ title }}
onContextMenuClick(treeKey, menuKey)">
- 打开
- 删除
+ 打开
+ 关闭
+ 删除
@@ -53,6 +54,20 @@ const treeData = ref([
]);
const onContextMenuClick = (treeKey: string, menuKey: string) => {
console.log(`treeKey: ${treeKey}, menuKey: ${menuKey}`);
+ //防止添加多个key值,再次点击不能关闭。数组去重
+ if(menuKey=="open"){
+ let arr=[...expandedKeys.value]
+ arr.push(treeKey)
+ arr=[...new Set(arr)]
+ expandedKeys.value=arr
+ }else if(menuKey=="close"){
+ expandedKeys.value=expandedKeys.value.filter((item:any)=>{
+ return item != treeKey
+ })
+ }else if(menuKey=="delete"){
+
+ }
+
};
let searchStr = ref('');
const expandedKeys = ref([]);
@@ -60,6 +75,7 @@ const expandedKeys = ref([]);
onMounted(() => {
loadTreeData()
})
+//模糊查询
watch(searchStr, (newVal, oldVal) => {
let expandedKeyArr: any[] = []
if (newVal.length == 0) return
@@ -74,11 +90,13 @@ watch(searchStr, (newVal, oldVal) => {
});
expandedKeys.value = expandedKeyArr
})
+// 选中相机
function selectCamera(e: any) {
if (e.length && !isNaN(parseInt(e[0]))) {
piniaStore.updateCurSelectKey(e[0].toString())
}
}
+//模糊查询递归
function searchFn(newVal: string, arr: any[]): any {
let expandedKeyArr: any[] = []
arr.forEach(element => {
diff --git a/src/views/page/cameraCenter.vue b/src/views/page/cameraCenter.vue
index 621ff9a..bca4591 100644
--- a/src/views/page/cameraCenter.vue
+++ b/src/views/page/cameraCenter.vue
@@ -9,54 +9,50 @@
-
-
-
-
{{ item.name }}
-
+
+
+
+
+
{{ item.name }}
+
+
+ onContextMenuClick(item.id, menuKey)">
+ 编辑
+ 删除
+
+
+
+
1
+
-
+
+
+