Bladeren bron

[FE]更改视频监控组件以及用户管理界面新增用户弹出框

xiayu3 4 jaren geleden
bovenliggende
commit
5cb880c67a

+ 1 - 1
security-protection-platform/src/api/videoSurveillance/index.js

@ -15,7 +15,7 @@ const api = {
15 15
  getDepartments () {
16 16
    return $default.get('/sp/workEmployee/queryAllOrganize')
17 17
  },
18
  // 获取s部门对应场景列表
18
  // 获取部门对应场景列表
19 19
  getMonitorScene (orgId) {
20 20
    return $default.get(`/sp/monitorSceneManagement/queryPageMonitorScene?orgId=${orgId}`)
21 21
  },

+ 1 - 18
security-protection-platform/src/modules/aialarm/index.vue

@ -229,24 +229,7 @@ export default {
229 229
      // 判断是详情还是处理
230 230
      clickdetail: 0,
231 231
      // 一页的数据
232
      data: [{
233
        'workTaskId': '202012031206570506796', //
234
        'status': 'INI', // 状态
235
        'statusTime': '2020-12-03T04:06:58.000+0000', // 状态时间
236
        'processMemo': null, // 处理详情
237
        'alarmTypeCode': 'HAT', // 报警类型
238
        'alarmMemo': '没戴安全帽', // 报警描述
239
        'resourceToolName': null, // 设备名称
240
        'resourceToolCode': null, // 设备编号
241
        'monitorSceneName': '一号工地', // 设备位置
242
        'aiIdenTime': '2020-12-03T04:06:58.000+0000', // 报警时间l
243
        'targetEmployeeRoleId': '1001',
244
        'workEmployeeRoleId': '90001', // 处理人
245
        'processTime': '', // 处理时间
246
        'idenPictureUrl': 'http://pic/2970', // 图片url
247
        'idenVideoUrl': 'http://video/8989' // 视频url
248
      }
249
      ],
232
      data: [],
250 233
      // 页数
251 234
      page: 1,
252 235
      limit: 10,

+ 74 - 39
security-protection-platform/src/modules/usermana/components/modal/addUser.vue

@ -1,40 +1,44 @@
1 1
<template>
2
  <div>
3
    <t-modal :visibled="visible">
4
      <t-form :model="addUserModal" :rules="addUserModalRules" label-position="right">
5
        <t-form-item label="姓名:" prop="name">
6
          <t-input v-model="addUserModal.name" placeholder="请输入姓名"></t-input>
7
        </t-form-item>
8
        <t-form-item label="员工编号:" prop="code">
9
          <t-input v-model="addUserModal.code" placeholder="请输入员工编号"></t-input>
10
        </t-form-item>
11
        <t-form-item label="公司:" prop="field4">
12
          <t-select v-model="addUserModal.field4" placeholder="请选择公司" clearable>
13
            <t-option v-for="(item,index) in dataList" :value="item.field4" :key="index">{{ item.name }}</t-option>
14
          </t-select>
15
        </t-form-item>
16
        <t-form-item label="部门:" prop="organizeCode">
17
          <t-select v-model="addUserModal.organizeCode" placeholder="请选择部门" clearable>
18
            <t-option v-for="(item,index) in dataList" :value="item.value" :key="index">{{ item.name }}</t-option>
19
          </t-select>
20
        </t-form-item>
21
        <t-form-item label="职务:" prop="mainJobPosition">
22
          <t-select v-model="addUserModal.mainJobPosition" placeholder="请选择职务" clearable>
23
            <t-option v-for="(item,index) in dataList" :value="item.value" :key="index">{{ item.name }}</t-option>
24
          </t-select>
25
        </t-form-item>
26
        <t-form-item label="年龄:" prop="birthday">
27
          <t-date-picker v-model="addUserModal.birthday" placeholder="请输入年龄" @date-change="startPickerDateChange"></t-date-picker>
28
        </t-form-item>
29
        <t-form-item label="手机:" prop="mainWirelessCall">
30
          <t-input v-model="addUserModal.mainWirelessCall" placeholder="请输入11位手机号"></t-input>
31
        </t-form-item>
32
        <t-form-item label="人脸图片:" prop="facePicture">
33
          <t-input v-model="addUserModal.facePicture" placeholder="请输入手机号"></t-input>
34
        </t-form-item>
35
      </t-form>
36
    </t-modal>
37
  </div>
2
  <t-modal :visibled.sync="visibled" :mask-closable="false">
3
    <template slot="header">
4
      <div class="device-modal-title">{{ isEdit?'用户编辑':'新增用户' }}</div>
5
    </template>
6
    <t-form :model="addUserModal" :rules="addUserModalRules" label-position="right">
7
      <t-form-item label="姓名:" prop="name">
8
        <t-input v-model="addUserModal.name" placeholder="请输入姓名"></t-input>
9
      </t-form-item>
10
      <t-form-item label="员工编号:" prop="code">
11
        <t-input v-model="addUserModal.code" placeholder="请输入员工编号"></t-input>
12
      </t-form-item>
13
      <t-form-item label="公司:" prop="apartments">
14
        <t-select v-model="addUserModal.apartments" placeholder="请选择公司" clearable>
15
          <t-option v-for="(item,index) in companyList" :value="item.id" :key="index">{{ item.name }}</t-option>
16
        </t-select>
17
      </t-form-item>
18
      <t-form-item v-if="addUserModal.apartments!==''" label="部门:" prop="organizeCode">
19
        <t-select-tree v-model="addUserModal.organizeCode" :node-data="departmentTypesList" width="200px" node-key="id"></t-select-tree>
20
      </t-form-item>
21
      <t-form-item label="职务:" prop="mainJobPosition">
22
        <t-select v-model="addUserModal.mainJobPosition" placeholder="请选择职务" clearable>
23
          <t-option v-for="(item,index) in dataList" :value="item.value" :key="index">{{ item.name }}</t-option>
24
        </t-select>
25
      </t-form-item>
26
      <t-form-item label="年龄:" prop="birthday">
27
        <t-date-picker v-model="addUserModal.birthday" placeholder="请输入年龄" @date-change="startPickerDateChange"></t-date-picker>
28
      </t-form-item>
29
      <t-form-item label="手机:" prop="mainWirelessCall">
30
        <t-input v-model="addUserModal.mainWirelessCall" placeholder="请输入11位手机号"></t-input>
31
      </t-form-item>
32
      <t-form-item label="人脸图片:" prop="facePicture">
33
        <t-input v-model="addUserModal.facePicture" placeholder="请输入手机号"></t-input>
34
      </t-form-item>
35
    </t-form>
36
    <template slot="footer">
37
      <t-button @click="resetModalData">取消</t-button>
38
      <t-button v-if="isEdit" :loading="loadingSubmit" color="primary" @click="submitModalData">修改</t-button>
39
      <t-button v-else :loading="loadingSubmit" color="primary" @click="submitModalData">提交</t-button>
40
    </template>
41
  </t-modal>
38 42
</template>
39 43
40 44
<script>
@ -44,13 +48,21 @@ export default {
44 48
      type: Boolean,
45 49
      default: false
46 50
    },
47
    value: {
48
      type: Object,
49
      dafault: () => []
51
    // 公司列表
52
    companyList: {
53
      type: Array,
54
      default: () => []
55
    },
56
    // 公司对应部门列表
57
    departmentTypesList: {
58
      type: Array,
59
      default: () => []
50 60
    }
51 61
  },
52 62
  data() {
53 63
    return {
64
      // 是否为编辑状态
65
      isEdit: false,
54 66
      dataList: [
55 67
        {
56 68
          name: '数据一',
@ -105,7 +117,30 @@ export default {
105 117
      }
106 118
    }
107 119
  },
120
  computed: {
121
    // 显示/隐藏对话框
122
    visibled: {
123
      set(val) {
124
        this.$emit('visibled', val)
125
      },
126
      get() {
127
        return this.visible
128
      }
129
    }
130
  },
108 131
  methods: {
132
    // 确认新增用户
133
    submitModalData() {
134
      this.visible = false
135
      console.log(this.visibled)
136
      console.log(this.visible);
137
    },
138
    // 重置表单数据
139
    resetModalData () {
140
      // this.$refs['activityForm'].resetFields()
141
      this.imgUrl = ''
142
      this.visibled = false
143
    }
109 144
  }
110 145
}
111 146
</script>

+ 2 - 1
security-protection-platform/src/modules/usermana/index.vue

@ -64,7 +64,7 @@
64 64
        </t-pager>
65 65
      </div>
66 66
    </t-card>
67
    <add-user-modal :visible="addDeviceModal"></add-user-modal>
67
    <add-user-modal :department-types-list="departmentTypesList" :company-list="companyTypesList" :visible.sync="addDeviceModal"></add-user-modal>
68 68
    <auditModal :auditshow.sync="auditshow" :auditid="auditid" :company-name="companyName" @refeshUserList="getUserList"></auditModal>
69 69
  </div>
70 70
</template>
@ -306,6 +306,7 @@ export default {
306 306
    // 显示新增设备对话框
307 307
    showAddDeviceModal () {
308 308
      this.addDeviceModal = true
309
      console.log(this.addDeviceModal)
309 310
    },
310 311
    async editDeviceData (id) {
311 312
      const res = await sysapi.getDeviceInfo(id)

+ 38 - 1
security-protection-platform/src/modules/videoSurveillance/index.vue

@ -13,7 +13,13 @@
13 13
    </div>
14 14
    <div class="page-bottom">
15 15
      <div v-for="(item,index) in videoList" :key="index" :value="item.resourceToolId" style="width:400px;margin:24px 0px 0 24px;">
16
        <rtmp-video :list="getVideoPlayList(item)" @goDistinguishRecord="goDistinguishRecord(item.resourceToolId)" @videoReplay="handleReview"></rtmp-video>
16
        <videoPlayer
17
          ref="videoPlayer"
18
          :options="videoOptions"
19
          :playsinline="true"
20
          class="vjs-custom-skin videoPlayer"
21
        />
22
        <!-- <rtmp-video :list="getVideoPlayList(item)" @goDistinguishRecord="goDistinguishRecord(item.resourceToolId)" @videoReplay="handleReview"></rtmp-video> -->
17 23
      </div>
18 24
    </div>
19 25
    <t-pager :page-size="videoPageSize" :current="videoCurrent" :total="videoTotal" :sizer-range="[ 5, 10, 20, 30 ]" class="pager" show-elevator @on-change="onChangeGate"></t-pager>
@ -47,6 +53,37 @@ export default {
47 53
  },
48 54
  data () {
49 55
    return {
56
      videoOptions: {
57
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
58
        autoplay: true, // 如果true,浏览器准备好时开始回放。
59
        muted: true, // 默认情况下将会消除任何音频。
60
        loop: false, // 导致视频一结束就重新开始。
61
        preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
62
        language: 'zh-CN',
63
        aspectRatio: '13:10', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
64
        // fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
65
        // 是否流体自适应容器宽高
66
        fluid: true,
67
        // // 设置视频播放器的显示宽度(以像素为单位)
68
        // width: '100px',
69
        // // 设置视频播放器的显示高度(以像素为单位)
70
        // height: '300px',
71
        sources: [{
72
          withCredentials: false,
73
          type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
74
          src: 'http://10.19.90.34:1080/live/1.m3u8' // url地址
75
        }],
76
        flash: { hls: { withCredentials: false } },
77
        html5: { hls: { withCredentials: false } },
78
        notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
79
        controlBar: {
80
          timeDivider: false,
81
          // durationDisplay: true,
82
          remainingTimeDisplay: false,
83
          fullscreenToggle: true, // 全屏按钮,
84
          pictureInPictureToggle: false
85
        }
86
      },
50 87
      videoCurrent: 1, // 大门分页数据
51 88
      videoPageSize: 10, // 大门分页数据
52 89
      videoTotal: 100, // 大门分页总数