Преглед на файлове

修复文件格式,修复拖拽异常问题

liuchang преди 4 години
родител
ревизия
095c160e93

+ 43 - 45
security-protection-platform/src/modules/system/monitor/HomePageSettings/AreaMonitor.vue

@ -1,12 +1,12 @@
1 1
<template>
2
  <div class="p-24" ref="box">
2
  <div ref="box" class="p-24">
3 3
    <div style="min-height:280px; height:auto!important;">
4 4
      <div class="masonry__item div-float">
5 5
        <div class="card card-has-shadowed" style="height: 226px; width: 260px">
6 6
          <div
7 7
            class="card-block d-flex justify-content-center align-items-center"
8
            @click="handleCreate"
9 8
            style="cursor: pointer"
9
            @click="handleCreate"
10 10
          >
11 11
            <t-icon icon="plus-outline"></t-icon>
12 12
            <span>新增监控</span>
@ -23,7 +23,7 @@
23 23
            v-for="item in areaMonitorList"
24 24
            :key="item.areaMonitorId"
25 25
            :data="item"
26
            :itemWidth="itemWidth"
26
            :item-width="itemWidth"
27 27
            @edit="handleEdit"
28 28
            @deleted="handleDeleted"
29 29
          />
@ -37,7 +37,7 @@
37 37
        :page-size="limit"
38 38
        show-elevator
39 39
        @on-change="onChange"
40
        >>
40
      >>
41 41
      </t-pager>
42 42
    </div>
43 43
@ -48,13 +48,11 @@
48 48
  </div>
49 49
</template>
50 50
51
52 51
<script>
53
import CameraCard from "./Card";
54
import sysapi from "@/api/system";
55
import ShiftCameraDialog from "./ShiftCameraDialog";
56
import Vue from "vue";
57
import draggable from "vuedraggable";
52
import CameraCard from './Card'
53
import sysapi from '@/api/system'
54
import ShiftCameraDialog from './ShiftCameraDialog'
55
import draggable from 'vuedraggable'
58 56
59 57
export default {
60 58
  components: { CameraCard, ShiftCameraDialog, draggable },
@ -62,29 +60,29 @@ export default {
62 60
    return {
63 61
      areaMonitorList: [
64 62
        {
65
          title: "摄像头001",
66
          cameraId: "001",
67
          areaMonitorId: "001",
63
          title: '摄像头001',
64
          cameraId: '001',
65
          areaMonitorId: '001',
68 66
          sortOrder: 0,
69 67
          imgsrc:
70
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
68
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
71 69
        },
72 70
        {
73
          title: "摄像头002",
74
          cameraId: "002",
75
          areaMonitorId: "002",
71
          title: '摄像头002',
72
          cameraId: '002',
73
          areaMonitorId: '002',
76 74
          sortOrder: 1,
77 75
          imgsrc:
78
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
76
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
79 77
        },
80 78
        {
81
          title: "摄像头003",
82
          cameraId: "003",
83
          areaMonitorId: "003",
79
          title: '摄像头003',
80
          cameraId: '003',
81
          areaMonitorId: '003',
84 82
          sortOrder: 2,
85 83
          imgsrc:
86
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
87
        },
84
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
85
        }
88 86
        // {
89 87
        //   title: "摄像头004",
90 88
        //   cameraId: "004",
@ -126,22 +124,22 @@ export default {
126 124
      // 数据总数
127 125
      total: 70,
128 126
      dragging: null,
129
      itemWidth: null,
130
    };
127
      itemWidth: null
128
    }
131 129
  },
132 130
  mounted() {
133
    let dom = this.$refs.box;
134
    this.itemWidth = dom.clientWidth / 4 - 25;
131
    let dom = this.$refs.box
132
    this.itemWidth = dom.clientWidth / 4 - 25
135 133
  },
136 134
  methods: {
137 135
    getAreaMonitors() {
138 136
      sysapi.getAreaMonitors().then((resp) => {
139
        this.areaMonitorList = resp.data || [];
140
      });
137
        this.areaMonitorList = resp.data || []
138
      })
141 139
    },
142 140
    handleEdit(item) {
143
      this.dialogData = Object.assign({}, item);
144
      console.log(item.title);
141
      this.dialogData = Object.assign({}, item)
142
      console.log(item.title)
145 143
    },
146 144
    handleCreate() {
147 145
      this.dialogData = {
@ -149,32 +147,32 @@ export default {
149 147
        cameraId: null,
150 148
        areaMonitorId: null,
151 149
        sortOrder: 5,
152
        imgsrc: null,
153
      };
150
        imgsrc: null
151
      }
154 152
    },
155 153
    handleDeleted(index) {
156
      this.areaMonitorList.splice(index, 1);
154
      this.areaMonitorList.splice(index, 1)
157 155
    },
158 156
    handleCameraSubmit(data) {
159 157
      if (this.dialogData.areaMonitorId != null) {
160 158
        const target = this.areaMonitorList.find(
161 159
          (item) => item.areaMonitorId === this.dialogData.areaMonitorId
162
        );
163
        Object.assign(target, data);
160
        )
161
        Object.assign(target, data)
164 162
      } else {
165
        this.areaMonitorList.unshift(data);
163
        this.areaMonitorList.unshift(data)
166 164
      }
167 165
    },
168 166
    onChange(page) {
169
      this.page = page;
170
      this.getAreaMonitors();
167
      this.page = page
168
      this.getAreaMonitors()
171 169
    },
172 170
    datadragEnd(evt) {
173
      console.log("拖动前的索引 :" + this.areaMonitorList[evt.oldIndex].title);
174
      console.log("拖动后的索引 :" + this.areaMonitorList[evt.newIndex].title);
175
    },
176
  },
177
};
171
      console.log('拖动前的索引 :' + this.areaMonitorList[evt.oldIndex].title)
172
      console.log('拖动后的索引 :' + this.areaMonitorList[evt.newIndex].title)
173
    }
174
  }
175
}
178 176
</script>
179 177
180 178
<style lang="scss">
@ -189,4 +187,4 @@ export default {
189 187
  justify-content: flex-end;
190 188
  float: right;
191 189
}
192
</style>
190
</style>

+ 67 - 68
security-protection-platform/src/modules/system/monitor/HomePageSettings/Card.vue

@ -1,7 +1,7 @@
1 1
<template>
2
  <div class="masonry__item div-block" :class="{ active: showConfirm, lock: loadingDelete }">
3
    <div class="card card-has-shadowed" :style="{ width: gridWidth }">
4
      <div class="card-block" style="margin: 0px; padding: 0px" :style="{ height: gridHeight }">
2
  <div :class="{ active: showConfirm, lock: loadingDelete }" class="masonry__item div-block">
3
    <div :style="{ width: gridWidth }" class="card card-has-shadowed">
4
      <div :style="{ height: gridHeight }" class="card-block" style="margin: 0px; padding: 0px">
5 5
        <img :style="{ height: gridHeight, width: gridWidth }" :src="data.imgsrc" alt="" />
6 6
      </div>
7 7
      <div class="opt">
@ -18,83 +18,82 @@
18 18
        </div>
19 19
      </div>
20 20
    </div>
21
    <div class="card card-has-shadowed div-footer" :style="{ width: gridWidth }">
21
    <div :style="{ width: gridWidth }" class="card card-has-shadowed div-footer">
22 22
      <div>
23
        <update-name v-bind:name="data.title" v-on:nameSubmit="nameChange" />
23
        <update-name :name="data.title" @nameSubmit="nameChange" />
24 24
      </div>
25 25
    </div>
26 26
  </div>
27 27
</template>
28 28
29
30 29
<script>
31
  import UpdateName from "./UpdateName";
32
  export default {
33
    components: {
34
      UpdateName
30
import UpdateName from './UpdateName'
31
export default {
32
  components: {
33
    UpdateName
34
  },
35
  props: {
36
    data: {
37
      type: Object,
38
      require: true
35 39
    },
36
    props: {
37
      data: {
38
        type: Object,
39
        require: true,
40
      },
41
      itemWidth: null,
40
    itemWidth: null
41
  },
42
  data() {
43
    return {
44
      showConfirm: false,
45
      loadingDelete: false
46
    }
47
  },
48
  computed: {
49
    gridWidth: function () {
50
      return this.itemWidth - 20 + 'px'
42 51
    },
43
    data() {
44
      return {
45
        showConfirm: false,
46
        loadingDelete: false,
47
      };
52
    gridHeight: function () {
53
      return this.itemWidth * 0.9 - 20 - 6 - 32 + 'px'
54
    }
55
  },
56
  mounted() {
57
58
  },
59
  methods: {
60
    nameChange: function (name) {
61
      // 修改名称
62
      alert(name)
48 63
    },
49
    computed: {
50
      gridWidth: function () {
51
        return this.itemWidth - 20 + "px";
52
      },
53
      gridHeight: function () {
54
        return this.itemWidth * 0.9 - 20 - 6 - 32 + "px";
55
      },
64
    handleDelete() {
65
      this.showConfirm = true
56 66
    },
57
    mounted() {
58
67
    handleConfirm() {},
68
    handleCancelDelete() {
69
      this.showConfirm = false
59 70
    },
60
    methods: {
61
      nameChange: function (name) {
62
        //修改名称
63
        alert(name);
64
      },
65
      handleDelete() {
66
        this.showConfirm = true;
67
      },
68
      handleConfirm() {},
69
      handleCancelDelete() {
70
        this.showConfirm = false;
71
      },
72
      handleConfirmDelete() {
73
        //this.loadingDelete = true;
74
        //把事件抛出去,保持控件的干净
75
        this.$emit("deleted", this.data);
76
        //   sysapi
77
        //     .deleteSchedule(this.data.scheduleId)
78
        //     .then(
79
        //       (resp) => {
80
        //         console.log(resp);
81
        //         this.$emit("deleted", this.data);
82
        //       },
83
        //       (err) => {
84
        //         console.log(err);
85
        //         this.$Message.danger("删除失败,请稍后再试!", 3);
86
        //       }
87
        //     )
88
        //     .finally(() => {
89
        //       this.loadingDelete = false;
90
        //       this.showConfirm = false;
91
        //     });
92
      },
93
      handleEdit() {
94
        this.$emit("edit", this.data);
95
      },
71
    handleConfirmDelete() {
72
      // this.loadingDelete = true;
73
      // 把事件抛出去,保持控件的干净
74
      this.$emit('deleted', this.data)
75
      //   sysapi
76
      //     .deleteSchedule(this.data.scheduleId)
77
      //     .then(
78
      //       (resp) => {
79
      //         console.log(resp);
80
      //         this.$emit("deleted", this.data);
81
      //       },
82
      //       (err) => {
83
      //         console.log(err);
84
      //         this.$Message.danger("删除失败,请稍后再试!", 3);
85
      //       }
86
      //     )
87
      //     .finally(() => {
88
      //       this.loadingDelete = false;
89
      //       this.showConfirm = false;
90
      //     });
96 91
    },
97
  };
92
    handleEdit() {
93
      this.$emit('edit', this.data)
94
    }
95
  }
96
}
98 97
</script>
99 98
100 99
<style lang="scss">
@ -185,4 +184,4 @@
185 184
    height: 32px;
186 185
    margin-top: 6px;
187 186
  }
188
</style>
187
</style>

+ 60 - 63
security-protection-platform/src/modules/system/monitor/HomePageSettings/PersonnelAccess.vue

@ -1,12 +1,12 @@
1 1
<template>
2
  <div class="p-24" ref="box">
2
  <div ref="box" class="p-24">
3 3
    <div style="min-height:280px; height:auto!important;">
4 4
      <div class="masonry__item div-float">
5 5
        <div class="card card-has-shadowed" style="height: 226px; width: 260px">
6 6
          <div
7 7
            class="card-block d-flex justify-content-center align-items-center"
8
            @click="handleCreate"
9 8
            style="cursor: pointer"
9
            @click="handleCreate"
10 10
          >
11 11
            <t-icon icon="plus-outline"></t-icon>
12 12
            <span>新增人脸终端</span>
@ -22,7 +22,7 @@
22 22
            v-for="item in identificationTerminalList"
23 23
            :key="item.identificationTerminalId"
24 24
            :data="item"
25
            :itemWidth="itemWidth"
25
            :item-width="itemWidth"
26 26
            @edit="handleEdit"
27 27
            @deleted="handleDeleted"
28 28
          />
@ -36,7 +36,7 @@
36 36
        :page-size="limit"
37 37
        show-elevator
38 38
        @on-change="onChange"
39
        >>
39
      >>
40 40
      </t-pager>
41 41
    </div>
42 42
@ -44,13 +44,11 @@
44 44
  </div>
45 45
</template>
46 46
47
48 47
<script>
49
import TerminalCard from "./Card";
50
import sysapi from "@/api/system";
51
import ShiftTerminalDialog from "./ShiftTerminalDialog";
52
import Vue from "vue";
53
import draggable from "vuedraggable";
48
import TerminalCard from './Card'
49
import sysapi from '@/api/system'
50
import ShiftTerminalDialog from './ShiftTerminalDialog'
51
import draggable from 'vuedraggable'
54 52
55 53
export default {
56 54
  components: { TerminalCard, ShiftTerminalDialog, draggable },
@ -58,61 +56,61 @@ export default {
58 56
    return {
59 57
      identificationTerminalList: [
60 58
        {
61
          title: "终端001",
62
          terminalId: "001",
63
          identificationTerminalId: "001",
59
          title: '终端001',
60
          terminalId: '001',
61
          identificationTerminalId: '001',
64 62
          sortOrder: 0,
65 63
          imgsrc:
66
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
64
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
67 65
        },
68 66
        {
69
          title: "终端002",
70
          terminalId: "002",
71
          identificationTerminalId: "002",
67
          title: '终端002',
68
          terminalId: '002',
69
          identificationTerminalId: '002',
72 70
          sortOrder: 1,
73 71
          imgsrc:
74
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
72
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
75 73
        },
76 74
        {
77
          title: "终端003",
78
          terminalId: "003",
79
          identificationTerminalId: "003",
75
          title: '终端003',
76
          terminalId: '003',
77
          identificationTerminalId: '003',
80 78
          sortOrder: 2,
81 79
          imgsrc:
82
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
80
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
83 81
        },
84 82
        {
85
          title: "终端004",
86
          terminalId: "004",
87
          identificationTerminalId: "004",
83
          title: '终端004',
84
          terminalId: '004',
85
          identificationTerminalId: '004',
88 86
          sortOrder: 3,
89 87
          imgsrc:
90
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
88
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
91 89
        },
92 90
        {
93
          title: "终端005",
94
          terminalId: "005",
95
          identificationTerminalId: "005",
91
          title: '终端005',
92
          terminalId: '005',
93
          identificationTerminalId: '005',
96 94
          sortOrder: 4,
97 95
          imgsrc:
98
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
96
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
99 97
        },
100 98
        {
101
          title: "终端006",
102
          terminalId: "006",
103
          identificationTerminalId: "006",
99
          title: '终端006',
100
          terminalId: '006',
101
          identificationTerminalId: '006',
104 102
          sortOrder: 5,
105 103
          imgsrc:
106
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
104
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
107 105
        },
108 106
        {
109
          title: "终端007",
110
          terminalId: "007",
111
          identificationTerminalId: "007",
107
          title: '终端007',
108
          terminalId: '007',
109
          identificationTerminalId: '007',
112 110
          sortOrder: 6,
113 111
          imgsrc:
114
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
115
        },
112
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
113
        }
116 114
      ],
117 115
      dialogData: {},
118 116
      // 当前页
@ -122,22 +120,22 @@ export default {
122 120
      // 数据总数
123 121
      total: 70,
124 122
      dragging: null,
125
      itemWidth: null,
126
    };
123
      itemWidth: null
124
    }
127 125
  },
128 126
  mounted() {
129
    let dom = this.$refs.box;
130
    this.itemWidth = dom.clientWidth / 4 - 25;
127
    let dom = this.$refs.box
128
    this.itemWidth = dom.clientWidth / 4 - 25
131 129
  },
132 130
  methods: {
133 131
    getIdentificationTerminals() {
134 132
      sysapi.getIdentificationTerminals().then((resp) => {
135
        this.identificationTerminalList = resp.data || [];
136
      });
133
        this.identificationTerminalList = resp.data || []
134
      })
137 135
    },
138 136
    handleEdit(item) {
139
      this.dialogData = Object.assign({}, item);
140
      console.log(item.title);
137
      this.dialogData = Object.assign({}, item)
138
      console.log(item.title)
141 139
    },
142 140
    handleCreate() {
143 141
      this.dialogData = {
@ -145,11 +143,11 @@ export default {
145 143
        terminalId: null,
146 144
        identificationTerminalId: null,
147 145
        sortOrder: 5,
148
        imgsrc: null,
149
      };
146
        imgsrc: null
147
      }
150 148
    },
151 149
    handleDeleted(index) {
152
      this.identificationTerminalList.splice(index, 1);
150
      this.identificationTerminalList.splice(index, 1)
153 151
    },
154 152
    handleterminalSubmit(data) {
155 153
      if (this.dialogData.identificationTerminalId != null) {
@ -157,25 +155,24 @@ export default {
157 155
          (item) =>
158 156
            item.identificationTerminalId ===
159 157
            this.dialogData.identificationTerminalId
160
        );
161
        Object.assign(target, data);
158
        )
159
        Object.assign(target, data)
162 160
      } else {
163
        this.identificationTerminalList.unshift(data);
161
        this.identificationTerminalList.unshift(data)
164 162
      }
165 163
    },
166 164
    onChange(page) {
167
      this.page = page;
168
      this.getIdentificationTerminals();
165
      this.page = page
166
      this.getIdentificationTerminals()
169 167
    },
170
     datadragEnd(evt) {
171
      console.log("拖动前的索引 :" + this.identificationTerminalList[evt.oldIndex].title);
172
      console.log("拖动后的索引 :" + this.identificationTerminalList[evt.newIndex].title);
173
    },
174
  },
175
};
168
    datadragEnd(evt) {
169
      console.log('拖动前的索引 :' + this.identificationTerminalList[evt.oldIndex].title)
170
      console.log('拖动后的索引 :' + this.identificationTerminalList[evt.newIndex].title)
171
    }
172
  }
173
}
176 174
</script>
177 175
178
179 176
<style lang="scss">
180 177
.div-float {
181 178
  float: left;
@ -188,4 +185,4 @@ export default {
188 185
  justify-content: flex-end;
189 186
  float: right;
190 187
}
191
</style>
188
</style>

+ 61 - 61
security-protection-platform/src/modules/system/monitor/HomePageSettings/ShiftCameraDialog.vue

@ -2,10 +2,10 @@
2 2
  <t-modal
3 3
    :visibled.sync="visibled"
4 4
    :title="title"
5
    width="780px"
6
    height="590px"
7 5
    :mask-closable="false"
8 6
    :ok="handleSubmit"
7
    width="780px"
8
    height="590px"
9 9
  >
10 10
    <div>
11 11
      <div style="display: flex">
@ -20,18 +20,18 @@
20 20
        <t-button color="primary">搜索</t-button>
21 21
      </div>
22 22
      <div
23
        class="masonry__item div-float"
24 23
        v-for="item in cameraList"
25 24
        :key="item.cameraId"
26 25
        :data="item"
26
        class="masonry__item div-float"
27 27
        @click="groupClick(item)"
28 28
      >
29 29
        <div class="card-has-shadowed" style="width: 158px">
30 30
          <div>
31 31
            <img
32 32
              :class="item.cameraId == form.cameraId ? 'hover' : ''"
33
              style="height: 120px; width: 158px"
34 33
              :src="item.imgsrc"
34
              style="height: 120px; width: 158px"
35 35
              alt=""
36 36
            />
37 37
          </div>
@ -49,7 +49,7 @@
49 49
          :page-size="limit"
50 50
          show-elevator
51 51
          @on-change="onChange"
52
          >>
52
        >>
53 53
        </t-pager>
54 54
      </div>
55 55
    </div>
@ -57,17 +57,17 @@
57 57
</template>
58 58
59 59
<script>
60
import sysapi from "@/api/system";
60
import sysapi from '@/api/system'
61 61
62 62
export default {
63
  name: "ShiftCameraDialog",
63
  name: 'ShiftCameraDialog',
64 64
  props: {
65 65
    data: {
66 66
      type: Object,
67 67
      default() {
68
        return {};
69
      },
70
    },
68
        return {}
69
      }
70
    }
71 71
  },
72 72
  data() {
73 73
    return {
@ -83,112 +83,112 @@ export default {
83 83
      total: 70,
84 84
      cameraList: [
85 85
        {
86
          title: "摄像头001",
87
          cameraId: "001",
86
          title: '摄像头001',
87
          cameraId: '001',
88 88
          sortOrder: 0,
89 89
          imgsrc:
90
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
90
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
91 91
        },
92 92
        {
93
          title: "摄像头002",
94
          cameraId: "002",
93
          title: '摄像头002',
94
          cameraId: '002',
95 95
          sortOrder: 1,
96 96
          imgsrc:
97
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
97
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
98 98
        },
99 99
        {
100
          title: "摄像头003",
101
          cameraId: "003",
100
          title: '摄像头003',
101
          cameraId: '003',
102 102
          sortOrder: 2,
103 103
          imgsrc:
104
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
104
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
105 105
        },
106 106
        {
107
          title: "摄像头004",
108
          cameraId: "004",
107
          title: '摄像头004',
108
          cameraId: '004',
109 109
          sortOrder: 3,
110 110
          imgsrc:
111
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
111
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
112 112
        },
113 113
        {
114
          title: "摄像头005",
115
          cameraId: "005",
114
          title: '摄像头005',
115
          cameraId: '005',
116 116
          sortOrder: 4,
117 117
          imgsrc:
118
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
118
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
119 119
        },
120 120
        {
121
          title: "摄像头006",
122
          cameraId: "006",
121
          title: '摄像头006',
122
          cameraId: '006',
123 123
          sortOrder: 5,
124 124
          imgsrc:
125
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
125
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
126 126
        },
127 127
        {
128
          title: "摄像头007",
129
          cameraId: "007",
128
          title: '摄像头007',
129
          cameraId: '007',
130 130
          sortOrder: 6,
131 131
          imgsrc:
132
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
133
        },
134
      ],
135
    };
132
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
133
        }
134
      ]
135
    }
136 136
  },
137 137
  computed: {
138 138
    title() {
139
      return this.data.areaMonitorId == null ? "新增监控" : "更换监控设备";
140
    },
139
      return this.data.areaMonitorId == null ? '新增监控' : '更换监控设备'
140
    }
141 141
  },
142 142
  watch: {
143 143
    data(val) {
144
      //侦听data属性
145
      this.form = this.data;
146
      this.visibled = true;
147
    },
144
      // 侦听data属性
145
      this.form = this.data
146
      this.visibled = true
147
    }
148 148
  },
149 149
  methods: {
150 150
    getCameras() {
151 151
      sysapi.getCameras().then((resp) => {
152
        alert(11);
153
        this.cameraList = resp.data || [];
154
      });
152
        alert(11)
153
        this.cameraList = resp.data || []
154
      })
155 155
    },
156 156
    groupClick(item) {
157
      //选中更换摄像头
157
      // 选中更换摄像头
158 158
      if (this.form.title == null) {
159
        this.form.title = item.title;
159
        this.form.title = item.title
160 160
      }
161
      this.form.cameraId = item.cameraId;
162
      this.form.imgsrc = item.imgsrc;
161
      this.form.cameraId = item.cameraId
162
      this.form.imgsrc = item.imgsrc
163 163
    },
164 164
    handleSubmit() {
165
      this.loadingSubmit = true;
165
      this.loadingSubmit = true
166 166
      sysapi
167 167
        .submitSchedule(this.form)
168 168
        .then(
169 169
          (resp) => {
170 170
            if (resp.data.areaMonitorId == null) {
171
              this.form.areaMonitorId = resp.data.areaMonitorId;
171
              this.form.areaMonitorId = resp.data.areaMonitorId
172 172
            }
173
            this.$emit("submit", this.form);
174
            this.visibled = false;
175
            this.$Message.success("提交成功");
173
            this.$emit('submit', this.form)
174
            this.visibled = false
175
            this.$Message.success('提交成功')
176 176
          },
177 177
          (err) => {
178
            console.log(err);
179
            this.$Message.danger("提交失败");
178
            console.log(err)
179
            this.$Message.danger('提交失败')
180 180
          }
181 181
        )
182 182
        .finally(() => {
183
          this.loadingSubmit = false;
184
        });
183
          this.loadingSubmit = false
184
        })
185 185
    },
186 186
    onChange(page) {
187
      this.page = page;
188
      this.getAreaMonitors();
189
    },
190
  },
191
};
187
      this.page = page
188
      this.getAreaMonitors()
189
    }
190
  }
191
}
192 192
</script>
193 193
194 194
<style lang="scss">

+ 61 - 61
security-protection-platform/src/modules/system/monitor/HomePageSettings/ShiftTerminalDialog.vue

@ -2,10 +2,10 @@
2 2
  <t-modal
3 3
    :visibled.sync="visibled"
4 4
    :title="title"
5
    width="780px"
6
    height="590px"
7 5
    :mask-closable="false"
8 6
    :ok="handleSubmit"
7
    width="780px"
8
    height="590px"
9 9
  >
10 10
    <div>
11 11
      <div style="display: flex">
@ -20,18 +20,18 @@
20 20
        <t-button color="primary">搜索</t-button>
21 21
      </div>
22 22
      <div
23
        class="masonry__item div-float"
24 23
        v-for="item in terminalList"
25 24
        :key="item.terminalId"
26 25
        :data="item"
26
        class="masonry__item div-float"
27 27
        @click="groupClick(item)"
28 28
      >
29 29
        <div class="card-has-shadowed" style="width: 158px">
30 30
          <div>
31 31
            <img
32 32
              :class="item.terminalId == form.terminalId ? 'hover' : ''"
33
              style="height: 120px; width: 158px"
34 33
              :src="item.imgsrc"
34
              style="height: 120px; width: 158px"
35 35
              alt=""
36 36
            />
37 37
          </div>
@ -49,7 +49,7 @@
49 49
          :page-size="limit"
50 50
          show-elevator
51 51
          @on-change="onChange"
52
          >>
52
        >>
53 53
        </t-pager>
54 54
      </div>
55 55
    </div>
@ -57,17 +57,17 @@
57 57
</template>
58 58
59 59
<script>
60
import sysapi from "@/api/system";
60
import sysapi from '@/api/system'
61 61
62 62
export default {
63
  name: "ShiftTerminalDialog",
63
  name: 'ShiftTerminalDialog',
64 64
  props: {
65 65
    data: {
66 66
      type: Object,
67 67
      default() {
68
        return {};
69
      },
70
    },
68
        return {}
69
      }
70
    }
71 71
  },
72 72
  data() {
73 73
    return {
@ -83,112 +83,112 @@ export default {
83 83
      total: 70,
84 84
      terminalList: [
85 85
        {
86
          title: "摄像头001",
87
          terminalId: "001",
86
          title: '摄像头001',
87
          terminalId: '001',
88 88
          sortOrder: 0,
89 89
          imgsrc:
90
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
90
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
91 91
        },
92 92
        {
93
          title: "摄像头002",
94
          terminalId: "002",
93
          title: '摄像头002',
94
          terminalId: '002',
95 95
          sortOrder: 1,
96 96
          imgsrc:
97
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
97
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
98 98
        },
99 99
        {
100
          title: "摄像头003",
101
          terminalId: "003",
100
          title: '摄像头003',
101
          terminalId: '003',
102 102
          sortOrder: 2,
103 103
          imgsrc:
104
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
104
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
105 105
        },
106 106
        {
107
          title: "摄像头004",
108
          terminalId: "004",
107
          title: '摄像头004',
108
          terminalId: '004',
109 109
          sortOrder: 3,
110 110
          imgsrc:
111
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
111
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
112 112
        },
113 113
        {
114
          title: "摄像头005",
115
          terminalId: "005",
114
          title: '摄像头005',
115
          terminalId: '005',
116 116
          sortOrder: 4,
117 117
          imgsrc:
118
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
118
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
119 119
        },
120 120
        {
121
          title: "摄像头006",
122
          terminalId: "006",
121
          title: '摄像头006',
122
          terminalId: '006',
123 123
          sortOrder: 5,
124 124
          imgsrc:
125
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
125
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
126 126
        },
127 127
        {
128
          title: "摄像头007",
129
          terminalId: "007",
128
          title: '摄像头007',
129
          terminalId: '007',
130 130
          sortOrder: 6,
131 131
          imgsrc:
132
            "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
133
        },
134
      ],
135
    };
132
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
133
        }
134
      ]
135
    }
136 136
  },
137 137
  computed: {
138 138
    title() {
139
      return this.data.identificationTerminalId == null ? "新增人脸终端" : "更换人脸终端";
140
    },
139
      return this.data.identificationTerminalId == null ? '新增人脸终端' : '更换人脸终端'
140
    }
141 141
  },
142 142
  watch: {
143 143
    data(val) {
144
      //侦听data属性
145
      this.form = this.data;
146
      this.visibled = true;
147
    },
144
      // 侦听data属性
145
      this.form = this.data
146
      this.visibled = true
147
    }
148 148
  },
149 149
  methods: {
150 150
    getCameras() {
151 151
      sysapi.getCameras().then((resp) => {
152
        alert(11);
153
        this.terminalList = resp.data || [];
154
      });
152
        alert(11)
153
        this.terminalList = resp.data || []
154
      })
155 155
    },
156 156
    groupClick(item) {
157
      //选中更换摄像头
157
      // 选中更换摄像头
158 158
      if (this.form.title == null) {
159
        this.form.title = item.title;
159
        this.form.title = item.title
160 160
      }
161
      this.form.terminalId = item.terminalId;
162
      this.form.imgsrc = item.imgsrc;
161
      this.form.terminalId = item.terminalId
162
      this.form.imgsrc = item.imgsrc
163 163
    },
164 164
    handleSubmit() {
165
      this.loadingSubmit = true;
165
      this.loadingSubmit = true
166 166
      sysapi
167 167
        .submitSchedule(this.form)
168 168
        .then(
169 169
          (resp) => {
170 170
            if (resp.data.identificationTerminalId == null) {
171
              this.form.identificationTerminalId = resp.data.identificationTerminalId;
171
              this.form.identificationTerminalId = resp.data.identificationTerminalId
172 172
            }
173
            this.$emit("submit", this.form);
174
            this.visibled = false;
175
            this.$Message.success("提交成功");
173
            this.$emit('submit', this.form)
174
            this.visibled = false
175
            this.$Message.success('提交成功')
176 176
          },
177 177
          (err) => {
178
            console.log(err);
179
            this.$Message.danger("提交失败");
178
            console.log(err)
179
            this.$Message.danger('提交失败')
180 180
          }
181 181
        )
182 182
        .finally(() => {
183
          this.loadingSubmit = false;
184
        });
183
          this.loadingSubmit = false
184
        })
185 185
    },
186 186
    onChange(page) {
187
      this.page = page;
188
      this.getAreaMonitors();
189
    },
190
  },
191
};
187
      this.page = page
188
      this.getAreaMonitors()
189
    }
190
  }
191
}
192 192
</script>
193 193
194 194
<style lang="scss">

+ 19 - 20
security-protection-platform/src/modules/system/monitor/HomePageSettings/UpdateName.vue

@ -1,18 +1,18 @@
1 1
<template>
2 2
  <div class="div-base">
3 3
    <div v-if="text_tatus == 0" @mouseover="mouseOver">
4
      {{ this.name }}
4
      {{ name }}
5 5
    </div>
6 6
    <div v-else-if="text_tatus == 1" @mouseleave="mouseLeave">
7
      {{ this.name }}
7
      {{ name }}
8 8
      <div class="iconChange" @click="iconChange">
9 9
        <t-icon icon="edit-outline" size="24"> </t-icon>
10 10
      </div>
11 11
    </div>
12 12
    <div v-else @mouseleave="mouseLeave">
13 13
      <t-input
14
        size="sm"
15 14
        v-model="name"
15
        size="sm"
16 16
        icon="check-outline"
17 17
        icon-placement="right"
18 18
        @icon-click="iconSubmit"
@ -22,40 +22,39 @@
22 22
  </div>
23 23
</template>
24 24
25
26 25
<script>
27 26
export default {
28
  name: "updateName",
27
  name: 'UpdateName',
29 28
  props: {
30
    name: String,
29
    name: String
31 30
  },
32 31
  data() {
33 32
    return {
34
      text_tatus: 0,
35
    };
33
      text_tatus: 0
34
    }
36 35
  },
36
  watch: {},
37 37
  mounted() {},
38 38
  methods: {
39 39
    // 移入
40 40
    mouseOver() {
41
      this.text_tatus = 1;
41
      this.text_tatus = 1
42 42
    },
43 43
    // 移出
44 44
    mouseLeave() {
45
      this.text_tatus = 0;
45
      this.text_tatus = 0
46 46
    },
47
    //修改
47
    // 修改
48 48
    iconChange() {
49
      this.text_tatus = 2;
49
      this.text_tatus = 2
50 50
    },
51
    //提交
51
    // 提交
52 52
    iconSubmit() {
53
      this.text_tatus = 1;
54
      this.$emit("nameSubmit", this.name);
55
    },
56
  },
57
  watch: {},
58
};
53
      this.text_tatus = 1
54
      this.$emit('nameSubmit', this.name)
55
    }
56
  }
57
}
59 58
</script>
60 59
61 60
<style lang="scss">
@ -67,4 +66,4 @@ export default {
67 66
    float: right;
68 67
  }
69 68
}
70
</style>
69
</style>

+ 15 - 16
security-protection-platform/src/modules/system/monitor/HomePageSettings/index.vue

@ -2,14 +2,14 @@
2 2
  <div class="app-monitor">
3 3
    <t-button-group>
4 4
      <t-button
5
        @click="btnOnClick('areaMonitor')"
6 5
        :class="['base', btnIsClicked ? 'active' : '']"
7
        >重点区域监控</t-button
6
        @click="btnOnClick('areaMonitor')"
7
      >重点区域监控</t-button
8 8
      >
9 9
      <t-button
10
        @click="btnOnClick('personnelAccess')"
11 10
        :class="['base', btnIsClicked ? '' : 'active']"
12
        >人员进出识别</t-button
11
        @click="btnOnClick('personnelAccess')"
12
      >人员进出识别</t-button
13 13
      >
14 14
    </t-button-group>
15 15
@ -22,36 +22,35 @@
22 22
  </div>
23 23
</template>
24 24
25
26 25
<script>
27
import AreaMonitor from "./AreaMonitor";
28
import PersonnelAccess from "./PersonnelAccess";
26
import AreaMonitor from './AreaMonitor'
27
import PersonnelAccess from './PersonnelAccess'
29 28
// import sysapi from '@/api/system'
30 29
31 30
export default {
32 31
  components: { AreaMonitor, PersonnelAccess },
33 32
  data() {
34 33
    return {
35
      btnIsClicked: true,
36
    };
34
      btnIsClicked: true
35
    }
37 36
  },
38 37
  mounted() {
39 38
40 39
  },
41 40
  methods: {
42 41
    btnOnClick(tag) {
43
      if (tag == "areaMonitor") {
44
        this.btnIsClicked = true;
42
      if (tag === 'areaMonitor') {
43
        this.btnIsClicked = true
45 44
      } else {
46
        this.btnIsClicked = false;
45
        this.btnIsClicked = false
47 46
      }
48
    },
49
  },
50
};
47
    }
48
  }
49
}
51 50
</script>
52 51
53 52
<style lang="scss">
54 53
.btn-base {
55 54
  width: 116px;
56 55
}
57
</style>
56
</style>

+ 50 - 50
security-protection-platform/src/modules/system/monitor/VideoMonitor/ShiftSceneDialog.vue

@ -2,10 +2,10 @@
2 2
  <t-modal
3 3
    :visibled.sync="visibled"
4 4
    :title="title"
5
    width="500px"
6
    height="300px"
7 5
    :mask-closable="false"
8 6
    :ok="handleSubmit"
7
    width="500px"
8
    height="300px"
9 9
  >
10 10
    <div>
11 11
      <t-row>
@ -21,26 +21,26 @@
21 21
      </t-row>
22 22
      <t-row style="margin-top: 10px; margin-bottom: 10px">
23 23
        <t-col style="text-align: center" span="3"
24
          >布&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;局:</t-col
24
        >布&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;局:</t-col
25 25
        >
26 26
        <t-col span="9">
27 27
          <t-radio-group v-model="data.displayType" type="button">
28 28
            <t-radio value="1" label="1X1"></t-radio>
29 29
            <t-radio value="2" label="2X2"></t-radio>
30 30
            <t-radio value="3" label="3X3"></t-radio>
31
            <t-radio value="4" label="4X4"></t-radio> </t-radio-group
31
          <t-radio value="4" label="4X4"></t-radio> </t-radio-group
32 32
        ></t-col>
33 33
      </t-row>
34 34
      <t-row>
35 35
        <t-col span="3"></t-col>
36 36
        <t-col span="9"
37
          ><t-button
38
            ghost
39
            color="info"
40
            icon="delete-outline"
41
            @click="handleDelete"
42
            >删除场景</t-button
43
          >
37
        ><t-button
38
          ghost
39
          color="info"
40
          icon="delete-outline"
41
          @click="handleDelete"
42
        >删除场景</t-button
43
        >
44 44
          <div v-show="showConfirm" class="popover">
45 45
            <t-icon
46 46
              color="warning"
@ -54,14 +54,14 @@
54 54
                size="sm"
55 55
                color="primary"
56 56
                @click="handleConfirmDelete"
57
                >确定</t-button
57
              >确定</t-button
58 58
              >
59 59
              <t-button
60 60
                size="sm"
61 61
                color="secondary"
62 62
                style="margin-right: 8px"
63 63
                @click="handleCancelDelete"
64
                >取消</t-button
64
              >取消</t-button
65 65
              >
66 66
            </div>
67 67
          </div>
@ -72,15 +72,16 @@
72 72
</template>
73 73
74 74
<script>
75
import sysapi from '@/api/system'
75 76
export default {
76
  name: "ShiftSceneDialog",
77
  name: 'ShiftSceneDialog',
77 78
  props: {
78 79
    data: {
79 80
      type: Object,
80 81
      default() {
81
        return {};
82
      },
83
    },
82
        return {}
83
      }
84
    }
84 85
  },
85 86
  data() {
86 87
    return {
@ -89,72 +90,71 @@ export default {
89 90
      searchValue: null,
90 91
      loadingSubmit: false,
91 92
      showConfirm: false,
92
      loadingDelete: false,
93
    };
93
      loadingDelete: false
94
    }
94 95
  },
95 96
  computed: {
96 97
    title() {
97
      return this.data.id == null ? "新增场景" : "编辑场景";
98
    },
98
      return this.data.id == null ? '新增场景' : '编辑场景'
99
    }
99 100
  },
100 101
  watch: {
101 102
    data(val) {
102
      //侦听data属性
103
      this.form = this.data;
104
      this.visibled = true;
105
    },
103
      // 侦听data属性
104
      this.form = this.data
105
      this.visibled = true
106
    }
106 107
  },
107 108
  methods: {
108 109
    getCameras() {
109 110
      sysapi.getCameras().then((resp) => {
110
        alert(11);
111
        this.cameraList = resp.data || [];
112
      });
111
        this.cameraList = resp.data || []
112
      })
113 113
    },
114 114
    groupClick(item) {
115
      //选中更换摄像头
115
      // 选中更换摄像头
116 116
      if (this.form.title == null) {
117
        this.form.title = item.title;
117
        this.form.title = item.title
118 118
      }
119
      this.form.cameraId = item.cameraId;
120
      this.form.imgsrc = item.imgsrc;
119
      this.form.cameraId = item.cameraId
120
      this.form.imgsrc = item.imgsrc
121 121
    },
122 122
    handleDelete() {
123
      this.showConfirm = true;
123
      this.showConfirm = true
124 124
    },
125 125
    handleSubmit() {
126
      this.loadingSubmit = true;
126
      this.loadingSubmit = true
127 127
      sysapi
128 128
        .submitSchedule(this.form)
129 129
        .then(
130 130
          (resp) => {
131 131
            if (resp.data.areaMonitorId == null) {
132
              this.form.areaMonitorId = resp.data.areaMonitorId;
132
              this.form.areaMonitorId = resp.data.areaMonitorId
133 133
            }
134
            this.$emit("submit", this.form);
135
            this.visibled = false;
136
            this.$Message.success("提交成功");
134
            this.$emit('submit', this.form)
135
            this.visibled = false
136
            this.$Message.success('提交成功')
137 137
          },
138 138
          (err) => {
139
            console.log(err);
140
            this.$Message.danger("提交失败");
139
            console.log(err)
140
            this.$Message.danger('提交失败')
141 141
          }
142 142
        )
143 143
        .finally(() => {
144
          this.loadingSubmit = false;
145
        });
144
          this.loadingSubmit = false
145
        })
146 146
    },
147 147
    onChange(page) {
148
      this.page = page;
149
      this.getAreaMonitors();
148
      this.page = page
149
      this.getAreaMonitors()
150 150
    },
151 151
    handleCancelDelete() {
152
      this.showConfirm = false;
152
      this.showConfirm = false
153 153
    },
154 154
    handleConfirmDelete() {
155
      //this.loadingDelete = true;
155
      // this.loadingDelete = true;
156 156
157
      this.$emit("deleted", this.data);
157
      this.$emit('deleted', this.data)
158 158
      //   sysapi
159 159
      //     .deleteSchedule(this.data.scheduleId)
160 160
      //     .then(
@ -171,9 +171,9 @@ export default {
171 171
      //       this.loadingDelete = false;
172 172
      //       this.showConfirm = false;
173 173
      //     });
174
    },
175
  },
176
};
174
    }
175
  }
176
}
177 177
</script>
178 178
179 179
<style lang="scss">

+ 241 - 190
security-protection-platform/src/modules/system/monitor/VideoMonitor/index.vue

@ -1,11 +1,14 @@
1 1
<template>
2
  <div class="p-24" ref="box">
2
  <div ref="box" class="p-24">
3 3
    <div>
4 4
      <t-row>
5 5
        <t-col>
6 6
          <div style="float: left">
7 7
            <span>风场: </span>
8
            <t-select v-model="currentWindPlaceValue" style="width: 200px; height: 32px">
8
            <t-select
9
              v-model="currentWindPlaceValue"
10
              style="width: 200px; height: 32px"
11
            >
9 12
              <t-option value="1">风场1</t-option>
10 13
              <t-option value="2">风场2</t-option>
11 14
            </t-select>
@ -14,224 +17,272 @@
14 17
        <t-col>
15 18
          <div style="float: right">
16 19
            <t-button-group>
17
              <t-button @click="btnOnClick('areaMonitor')" :class="['base', btnIsClicked ? 'active' : '']">
20
              <t-button
21
                :class="['base', btnIsClicked ? 'active' : '']"
22
                @click="btnOnClick('areaMonitor')"
23
              >
18 24
                <span>大门</span>
19
                <div @click="handleSceneEdit('123')" v-if="dialogSceneData.id == '1'"
20
                  style="float: right; width: 14px; height: 14px">
25
                <div
26
                  v-if="dialogSceneData.id == '1'"
27
                  style="float: right; width: 14px; height: 14px"
28
                  @click="handleSceneEdit('123')"
29
                >
21 30
                  <t-icon icon="edit" shape="circle" class="ico"></t-icon>
22 31
                </div>
23 32
              </t-button>
24 33
25
              <t-button @click="btnOnClick('areaMonitor')" :class="['base', btnIsClicked ? 'active' : '']">
34
              <t-button
35
                :class="['base', btnIsClicked ? 'active' : '']"
36
                @click="btnOnClick('areaMonitor')"
37
              >
26 38
                <span>值班室</span>
27
                <div @click="handleSceneEdit('456')" style="float: right; width: 14px; height: 14px"
28
                  v-if="dialogSceneData.id == '456'">
39
                <div
40
                  v-if="dialogSceneData.id == '456'"
41
                  style="float: right; width: 14px; height: 14px"
42
                  @click="handleSceneEdit('456')"
43
                >
29 44
                  <t-icon icon="edit" shape="circle" class="ico"></t-icon>
30 45
                </div>
31 46
              </t-button>
32 47
            </t-button-group>
33
            <t-button @click="btnAddClick()" style="width: 48px">+</t-button>
48
            <t-button style="width: 48px" @click="btnAddClick()">+</t-button>
34 49
          </div>
35 50
        </t-col>
36 51
      </t-row>
37 52
      <t-row>
38
        <t-col style="margin-top:10px;">
39
          <t-button color="info" icon="plus-circle" @click="handleCreate">新增监控</t-button>
53
        <t-col style="margin-top: 10px">
54
          <t-button color="info" icon="plus-circle" @click="handleCreate" >新增监控</t-button
55
          >
40 56
        </t-col>
41 57
      </t-row>
42 58
      <!--header-->
43 59
    </div>
44
    <div style="min-height: 280px; height: auto !important">
45
      <draggable v-model="areaMonitorList" @update="datadragEnd">
46
        <transition-group>
47
          <div v-for="(viewArray,index) in viewDataList" :key="index">
48
            <div style="text-align: right;">
49
              <span style="width:300px">第{{index+1}}/{{viewDataList.length}}页</span>
50
            </div>
51
            <camera-card v-for="item in viewArray" :key="item.areaMonitorId" :data="item" :itemWidth="itemWidth"
52
              @edit="handleEdit" @deleted="handleDeleted" />
53
          </div>
54
        </transition-group>
55
      </draggable>
56
      <shift-scene-dialog :data="dialogSceneData" @submit="handleCameraSubmit" />
60
    <div style="min-height: 290px; height: auto !important">
61
      <!-- <draggable v-model="rows"> -->
62
      <div v-for="(row,index) in viewDataList" :key="index" @update="datadragEnd">
63
        <div style="text-align: right">
64
          <span style="width: 300px" >第{{ index + 1 }}/{{ viewDataList.length }}页</span
65
          >
66
        </div>
67
        <draggable
68
          :list="row"
69
          :group="{ name: 'row' }"
70
          @update="datadragEnd"
71
          @add="datadragEnd"
72
        >
73
          <camera-card
74
            v-for="item in row"
75
            :key="item.areaMonitorId"
76
            :data="item"
77
            :item-width="itemWidth"
78
            @edit="handleEdit"
79
            @deleted="handleDeleted"
80
          />
81
        </draggable>
82
      </div>
83
      <!-- </draggable> -->
84
      <shift-scene-dialog
85
        :data="dialogSceneData"
86
        @submit="handleCameraSubmit"
87
      />
57 88
      <shift-camera-dialog :data="dialogData" @submit="handleCameraSubmit" />
58 89
    </div>
59 90
  </div>
60 91
</template>
61 92
62
63 93
<script>
64
  import CameraCard from "../HomePageSettings/Card";
65
  import draggable from "vuedraggable";
66
  import ShiftSceneDialog from "./ShiftSceneDialog";
67
  import ShiftCameraDialog from "../HomePageSettings/ShiftCameraDialog";
68
  export default {
69
    components: {
70
      CameraCard,
71
      draggable,
72
      ShiftSceneDialog,
73
      ShiftCameraDialog
94
import CameraCard from '../HomePageSettings/Card'
95
import draggable from 'vuedraggable'
96
import ShiftSceneDialog from './ShiftSceneDialog'
97
import ShiftCameraDialog from '../HomePageSettings/ShiftCameraDialog'
98
export default {
99
  components: {
100
    CameraCard,
101
    draggable,
102
    ShiftSceneDialog,
103
    ShiftCameraDialog
104
  },
105
  data() {
106
    return {
107
      currentWindPlaceValue: '2',
108
      currentitem: {},
109
      btnIsClicked: true,
110
      dialogSceneData: {},
111
      dialogData: {},
112
      currentType: 3,
113
      itemWidth: null,
114
      sceneList: [
115
        {
116
          sceneName: '大门',
117
          id: '1',
118
          parentId: '1',
119
          displayType: '4'
120
        },
121
        {
122
          sceneName: '值班室',
123
          id: '2',
124
          parentId: '1',
125
          displayType: '3'
126
        }
127
      ],
128
      areaMonitorList: [
129
        {
130
          title: '摄像头001',
131
          cameraId: '001',
132
          areaMonitorId: '001',
133
          sceneId: '1',
134
          sortOrder: 0,
135
          imgsrc:
136
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
137
        },
138
        {
139
          title: '摄像头002',
140
          cameraId: '002',
141
          areaMonitorId: '002',
142
          sortOrder: 1,
143
          imgsrc:
144
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
145
        },
146
        {
147
          title: '摄像头003',
148
          cameraId: '003',
149
          areaMonitorId: '003',
150
          sortOrder: 2,
151
          imgsrc:
152
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
153
        },
154
        {
155
          title: '摄像头004',
156
          cameraId: '004',
157
          areaMonitorId: '004',
158
          sortOrder: 3,
159
          imgsrc:
160
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
161
        },
162
        {
163
          title: '摄像头005',
164
          cameraId: '005',
165
          areaMonitorId: '005',
166
          sortOrder: 4,
167
          imgsrc:
168
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
169
        },
170
        {
171
          title: '摄像头006',
172
          cameraId: '006',
173
          areaMonitorId: '006',
174
          sortOrder: 5,
175
          imgsrc:
176
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
177
        },
178
        {
179
          title: '摄像头007',
180
          cameraId: '007',
181
          areaMonitorId: '007',
182
          sortOrder: 6,
183
          imgsrc:
184
            'https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26'
185
        }
186
      ],
187
      rows: []
188
    }
189
  },
190
  computed: {
191
    gridWidth: function () {
192
      return this.itemWidth - 20 + 'px'
74 193
    },
75
    data() {
76
      return {
77
        currentWindPlaceValue: "2",
78
        currentitem: {},
79
        btnIsClicked: true,
80
        dialogSceneData: {},
81
        dialogData: {},
82
        currentType: 3,
83
        itemWidth: null,
84
        sceneList: [{
85
            sceneName: "大门",
86
            id: "1",
87
            parentId: "1",
88
            displayType: "4",
89
          },
90
          {
91
            sceneName: "值班室",
92
            id: "2",
93
            parentId: "1",
94
            displayType: "3",
95
          },
96
        ],
97
        areaMonitorList: [{
98
            title: "摄像头001",
99
            cameraId: "001",
100
            areaMonitorId: "001",
101
            sceneId: "1",
102
            sortOrder: 0,
103
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
104
          },
105
          {
106
            title: "摄像头002",
107
            cameraId: "002",
108
            areaMonitorId: "002",
109
            sortOrder: 1,
110
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
111
          },
112
          {
113
            title: "摄像头003",
114
            cameraId: "003",
115
            areaMonitorId: "003",
116
            sortOrder: 2,
117
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
118
          },
119
          {
120
            title: "摄像头004",
121
            cameraId: "004",
122
            areaMonitorId: "004",
123
            sortOrder: 3,
124
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
125
          },
126
          {
127
            title: "摄像头005",
128
            cameraId: "005",
129
            areaMonitorId: "005",
130
            sortOrder: 4,
131
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
132
          },
133
          {
134
            title: "摄像头006",
135
            cameraId: "006",
136
            areaMonitorId: "006",
137
            sortOrder: 5,
138
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
139
          },
140
          {
141
            title: "摄像头007",
142
            cameraId: "007",
143
            areaMonitorId: "007",
144
            sortOrder: 6,
145
            imgsrc: "https://pics4.baidu.com/feed/b17eca8065380cd7343d6b5ebb93033358828145.jpeg?token=25a11140fcaf2cdf44307a26985a6e26",
146
          },
147
        ],
148
      };
194
    gridHeight: function () {
195
      return this.itemWidth * 0.9 - 20 - 6 - 32 + 'px'
149 196
    },
150
    computed: {
151
      gridWidth: function () {
152
        return this.itemWidth - 20 + "px";
153
      },
154
      gridHeight: function () {
155
        return this.itemWidth * 0.9 - 20 - 6 - 32 + "px";
156
      },
157
      viewDataList: function () {
158
        let tempDataList = [];
159
        for (
160
          let i = 0; i < Math.ceil(this.areaMonitorList.length / this.currentType); i++
161
        ) {//this.currentType需要*this.currentType,测试减少一个组的数据
162
          
163
          tempDataList[i] = this.areaMonitorList.slice(
164
            i * this.currentType,
165
            (i + 1) * this.currentType
166
          );
167
        }
168
        return tempDataList;
169
      },
197
    viewDataList: function () {
198
      let tempDataList = []
199
      for (
200
        let i = 0;
201
        i < Math.ceil(this.areaMonitorList.length / this.currentType);
202
        i++
203
      ) {
204
        // this.currentType需要*this.currentType,测试减少一个组的数据
205
        tempDataList[i] = this.areaMonitorList.slice(
206
          i * this.currentType,
207
          (i + 1) * this.currentType
208
        )
209
      }
210
      return tempDataList
211
    }
212
  },
213
  mounted() {
214
    let dom = this.$refs.box
215
    this.itemWidth = dom.clientWidth / this.currentType - 25
216
    document.body.ondrop = function (event) {
217
      event.preventDefault()
218
      event.stopPropagation()
219
    }
220
  },
221
  methods: {
222
    handleSceneEdit(item) {
223
      alert(item)
224
      event.stopPropagation()
170 225
    },
171
    mounted() {
172
      let dom = this.$refs.box;
173
      this.itemWidth = dom.clientWidth / this.currentType - 25;
226
    btnOnClick(item) {
227
      this.dialogSceneData = item
174 228
    },
175
    methods: {
176
      handleSceneEdit(item) {
177
        alert(item);
178
        event.stopPropagation();
179
      },
180
      btnOnClick(item) {
181
        this.dialogSceneData = item;
182
      },
183
      btnAddClick() {
184
        this.dialogSceneData = {
185
          sceneName: null,
186
          id: null,
187
          parentId: this.currentWindPlaceValue,
188
          displayType: null,
189
        };
190
      },
191
      handleEdit(item) {
192
        this.dialogData = Object.assign({}, item);
193
        console.log(item.title);
194
      },
195
      handleCreate() {
196
        this.dialogData = {
197
          title: null,
198
          cameraId: null,
199
          areaMonitorId: null,
200
          sortOrder: 5,
201
          imgsrc: null,
202
        };
203
      },
204
      handleDeleted(index) {
205
        this.areaMonitorList.splice(index, 1);
206
      },
207
      datadragEnd(evt) {
208
        console.log("拖动前的索引 :" + this.areaMonitorList[evt.oldIndex].title);
209
        console.log("拖动后的索引 :" + this.areaMonitorList[evt.newIndex].title);
210
      },
211
      handleCameraSubmit(data) {
212
        if (this.dialogData.areaMonitorId != null) {
213
          const target = this.areaMonitorList.find(
214
            (item) => item.areaMonitorId === this.dialogData.areaMonitorId
215
          );
216
          Object.assign(target, data);
217
        } else {
218
          this.areaMonitorList.unshift(data);
219
        }
220
      },
229
    btnAddClick() {
230
      this.dialogSceneData = {
231
        sceneName: null,
232
        id: null,
233
        parentId: this.currentWindPlaceValue,
234
        displayType: null
235
      }
221 236
    },
222
  };
237
    handleEdit(item) {
238
      this.dialogData = Object.assign({}, item)
239
      console.log(item.title)
240
    },
241
    handleCreate() {
242
      this.dialogData = {
243
        title: null,
244
        cameraId: null,
245
        areaMonitorId: null,
246
        sortOrder: 5,
247
        imgsrc: null
248
      }
249
    },
250
    handleDeleted(index) {
251
      this.areaMonitorList.splice(index, 1)
252
    },
253
    datadragEnd(evt) {
254
      this.updateData()
255
      this.$forceUpdate()
256
    },
257
    handleCameraSubmit(data) {
258
      if (this.dialogData.areaMonitorId != null) {
259
        const target = this.areaMonitorList.find(
260
          (item) => item.areaMonitorId === this.dialogData.areaMonitorId
261
        )
262
        Object.assign(target, data)
263
      } else {
264
        this.areaMonitorList.unshift(data)
265
      }
266
    },
267
    updateData() {
268
      this.areaMonitorList = this.viewDataList.reduce((prev, next) => {
269
        return prev.concat(next)
270
      })
271
    }
272
  }
273
}
223 274
</script>
224 275
225 276
<style lang="scss">
226
  .ico {
227
    width: 14px;
228
    height: 14px;
229
    line-height: 14px !important;
230
    margin: 2px;
231
  }
277
.ico {
278
  width: 14px;
279
  height: 14px;
280
  line-height: 14px !important;
281
  margin: 2px;
282
}
232 283
233
  .table-pager {
234
    justify-content: flex-end;
235
    float: right;
236
  }
237
</style>
284
.table-pager {
285
  justify-content: flex-end;
286
  float: right;
287
}
288
</style>

+ 3 - 3
security-protection-platform/src/modules/system/monitor/index.vue

@ -1,9 +1,9 @@
1 1
<template>
2
<div class="app-monitor">
2
  <div class="app-monitor">
3 3
    <t-tabs :animated="false" class="sys-monitor__tabs">
4 4
      <t-tab-panel label="首页" panel-id="tab-1">
5 5
        <home-page-settings class="sys-attendance__page" />
6
        
6
7 7
      </t-tab-panel>
8 8
      <t-tab-panel label="视频监控" panel-id="tab-2">
9 9
        <video-monitor class="sys-attendance__page" />
@ -55,4 +55,4 @@ export default {
55 55
.sys-attendance__page {
56 56
  padding: 24px 0;
57 57
}
58
</style>
58
</style>