| | |
| | | |
| | | <script> |
| | | |
| | | import { getShuohuangDepartTree, getOrganizeTree, getMemberList, updateMemberInfo, addMember, updateUnit, uploadMemberPic, uploadDirectory, uploadFile,downloadFile } from '@/api/shuohuang' |
| | | import { getShuohuangDepartTree, getOrganizeTree, getMemberList, updateMemberInfo, addMember, updateUnit, uploadMemberPic, uploadDirectory, uploadFile, downloadFile } from '@/api/shuohuang' |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | publicPath: process.env.BASE_URL, |
| | | CLIP: 'http://192.168.20.113/', |
| | |
| | | menuLeft: 0, |
| | | keyword: '', |
| | | gender: '', |
| | | genders: [{id:'g3',name:'全部'},{ name: '男', id: 'g0' }, { name: '女', id: 'g1' }], |
| | | genders: [{ id: 'g3', name: '全部' }, { name: '男', id: 'g0' }, { name: '女', id: 'g1' }], |
| | | tableData: [], |
| | | multipleTableSelection: [], |
| | | PageIndex: 1, |
| | |
| | | PageSize: 8, |
| | | organizeData: [], |
| | | checkedOrgID: '', |
| | | checkedOrgName:"", |
| | | checkedOrgName: "", |
| | | organizeKeyword: '', |
| | | memberEditDialogVisible: false, |
| | | toggleOrganizeDialogVisible: false, |
| | |
| | | batchImportTableData: [], |
| | | } |
| | | }, |
| | | mounted () { |
| | | mounted() { |
| | | this.searchLeftTreeData(); |
| | | this.getOrganizeTreeData(); |
| | | //this.renderMemberTable(); |
| | | |
| | | }, |
| | | methods: { |
| | | resetFilter(){ |
| | | resetFilter() { |
| | | this.keyword = ''; |
| | | this.gender = ''; |
| | | this.renderMemberTable(); |
| | | }, |
| | | isPhone (rule, value, callback) { |
| | | isPhone(rule, value, callback) { |
| | | if (!value) { |
| | | return callback() |
| | | } else if (value.trim()) { |
| | | var pattern = /^1[345789]\d{9}$/ |
| | | var pattern = /^1[345789]\d{9}$/ |
| | | if (pattern.test(value)) { |
| | | return callback() |
| | | } |
| | |
| | | // return callback(new Error('输入的手机号错误')) |
| | | // } |
| | | }, |
| | | nodeContextMenu (e, data, node, comp) { |
| | | nodeContextMenu(e, data, node, comp) { |
| | | this.showMenu = true; |
| | | this.menuTop = e.pageY; |
| | | this.menuLeft = e.pageX; |
| | | }, |
| | | checkOrgNode (a, b, c) { |
| | | checkOrgNode(a, b, c) { |
| | | this.checkedOrgID = a.id |
| | | this.checkedOrgName = a.label |
| | | }, |
| | | downloadExcel(){ |
| | | downloadExcel() { |
| | | downloadFile().then(function (res) { |
| | | // debugger |
| | | console.log(res); |
| | | console.log(res); |
| | | }) |
| | | }, |
| | | updateOrg () { |
| | | updateOrg() { |
| | | let ids = this.multipleTableSelection.map(row => { |
| | | return row.ID |
| | | }); |
| | | let params = { |
| | | DeptID: this.checkedOrgID, |
| | | DeptName:this.checkedOrgName, |
| | | DeptName: this.checkedOrgName, |
| | | Users: ids.join(',') |
| | | } |
| | | updateUnit(params).then(res => { |
| | |
| | | }) |
| | | |
| | | }, |
| | | tableSelection (val) { |
| | | tableSelection(val) { |
| | | this.multipleTableSelection = val; |
| | | }, |
| | | memberSave () { |
| | | memberSave() { |
| | | this.$refs['memberForm'].validate((valid) => { |
| | | if (valid) { |
| | | let params = Object.assign({ DeptID: this.curLeftTreeNode.id }, this.memberEditForm); |
| | |
| | | } |
| | | }) |
| | | }, |
| | | delMember (member) { |
| | | delMember(member) { |
| | | member.IsDel = '1'; |
| | | this.memberUpdate(member); |
| | | }, |
| | | editMember (member) { |
| | | editMember(member) { |
| | | this.memberEditDialogVisible = true; |
| | | this.memberEditForm = member; |
| | | }, |
| | | memberUpdate (member) { |
| | | memberUpdate(member) { |
| | | updateMemberInfo(member).then(res => { |
| | | if (res.success) { |
| | | this.$notify({ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | checkNode (a, b, c) { |
| | | checkNode(a, b, c) { |
| | | if (a.hasOwnProperty('children')) { |
| | | this.curLeftTreeNode = a; |
| | | this.deptId = a.id; |
| | | this.renderMemberTable(); |
| | | } |
| | | }, |
| | | handleTableSizeChange (size) { |
| | | handleTableSizeChange(size) { |
| | | this.PageSize = size; |
| | | this.renderMemberTable(); |
| | | }, |
| | | renderMemberTable () { |
| | | renderMemberTable() { |
| | | let _this = this; |
| | | let params = { |
| | | DeptID: this.deptId, |
| | |
| | | _this.tableTotal = res.total; |
| | | }) |
| | | }, |
| | | uploadPic () { |
| | | uploadPic() { |
| | | |
| | | }, |
| | | uploadDirectoryTrigger () { |
| | | uploadDirectoryTrigger() { |
| | | this.$refs['directoryInput'].click(); |
| | | }, |
| | | importDirectory () { |
| | | importDirectory() { |
| | | let _this = this; |
| | | //this.$refs['directoryInput'].files //文件夹map |
| | | let formData = new FormData; |
| | |
| | | }) |
| | | }, |
| | | |
| | | handleRemove () { |
| | | handleRemove() { |
| | | |
| | | }, |
| | | handleExceed () { |
| | | handleExceed() { |
| | | |
| | | }, |
| | | batchImport () { |
| | | batchImport() { |
| | | this.batchImportDialogVisible = true; |
| | | }, |
| | | toggleOrganize () { |
| | | toggleOrganize() { |
| | | this.toggleOrganizeDialogVisible = true; |
| | | }, |
| | | uploadMemberPicture (params) { |
| | | uploadMemberPicture(params) { |
| | | let param = new FormData(); |
| | | param.append('file', params.file) |
| | | uploadMemberPic(param).then(res => { |
| | |
| | | }) |
| | | }, |
| | | |
| | | deepNodeChildren (node) { |
| | | deepNodeChildren(node) { |
| | | var arr1 = []; |
| | | var arr2 = []; |
| | | if (node.ChildDept && node.ChildDept.length > 0) { |
| | |
| | | } |
| | | return arr1.concat(arr2) |
| | | }, |
| | | getOrganizeTreeData () { |
| | | getOrganizeTreeData() { |
| | | let _this = this; |
| | | getOrganizeTree().then(res => { |
| | | _this.organizeData = res.data.map(item => { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | searchLeftTreeData () { |
| | | searchLeftTreeData() { |
| | | let _this = this; |
| | | getShuohuangDepartTree().then(res => { |
| | | _this.treeData = res.data.map(item => { |
| | |
| | | return obj |
| | | }); |
| | | this.$nextTick(() => { |
| | | |
| | | if (!Object.keys(_this.curLeftTreeNode).length) { |
| | | _this.curLeftTreeNode = _this.treeData[0]; |
| | | _this.$refs['leftTreeNodes'].setCurrentNode(_this.treeData[0]); |
| | | if (_this.treeData.length) { |
| | | _this.curLeftTreeNode = _this.treeData[0]; |
| | | _this.$refs['leftTreeNodes'].setCurrentNode(_this.treeData[0]); |
| | | } |
| | | } else { |
| | | _this.$refs['leftTreeNodes'].setCurrentNode(_this.curLeftTreeNode); |
| | | } |
| | |
| | | |
| | | }) |
| | | }, |
| | | addMember () { |
| | | addMember() { |
| | | this.memberEditDialogVisible = true; |
| | | this.memberEditForm = {}; |
| | | }, |
| | |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="大小" prop="VideoSize" sortable> |
| | | <template slot-scope="scope" style="cursor: pointer"> |
| | | <template slot-scope="scope" style="cursor: pointer"> |
| | | <div>{{ Math.round((+scope.row.VideoSize) / (1024*1024)) + " MB" }}</div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | <el-table-column label="视频时间" prop="VideoDate" sortable></el-table-column> |
| | | <!-- <el-table-column label="创建日期" prop="VideoCreateDate" sortable></el-table-column> --> |
| | |
| | | config.showMore = false; |
| | | } |
| | | }); |
| | | console.log(this.optionalConfigs); |
| | | // console.log(this.optionalConfigs); |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item |
| | | v-for="(item, index) in popDownArr" |
| | | v-for="(item, index) in videoArrs" |
| | | :key="index" |
| | | :command="item" |
| | | >{{ item.CameraPosition }}</el-dropdown-item |
| | | > |
| | | >{{ item.CameraPosition }}</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | |
| | |
| | | <div |
| | | class="video-name" |
| | | :class="{ current: curVideo.GroupID == video.GroupID }" |
| | | @click="checkVideo(video, index)" |
| | | @click="checkVideo(video)" |
| | | v-for="(video, index) in curRoomVideos" |
| | | :key="video.id" |
| | | :key="index" |
| | | > |
| | | <i class="el-icon-film"></i> |
| | | <span>{{ video.VideoDate }}</span> |
| | |
| | | class="video-item" |
| | | :ref="`gridVideoItem_${index}`" |
| | | v-for="(item, index) in videoWrapArr" |
| | | :key="index" |
| | | :key="item.id" |
| | | > |
| | | <div style="display: none"></div> |
| | | <div class="currentPlayer"> |
| | |
| | | class="video-item" |
| | | :ref="`gridVideoItem_${index}`" |
| | | v-for="(item, index) in videoWrapArr" |
| | | :key="index" |
| | | :key="item.id" |
| | | @click="checkCurVideo(index)" |
| | | style="position: relative" |
| | | @mouseenter.stop.prevent="videoMouseEnter($event)" |
| | |
| | | <el-tooltip |
| | | placement="top" |
| | | v-for="(item, index) in eventMarks" |
| | | :key="index" |
| | | :key="item.offset + index" |
| | | > |
| | | <div slot="content"> |
| | | {{ getTimeStr(item.offset) }} |
| | |
| | | @click="dotJump(item.offset)" |
| | | ></div> |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | placement="top" |
| | | v-for="(item, index) in labelMarks" |
| | | :key="index" |
| | | > |
| | | <el-tooltip placement="top" v-for="(item, index) in labelMarks" :key="index"> |
| | | <div slot="content"> |
| | | {{ getTimeStr(item.offset) }} |
| | | <br /> |
| | |
| | | v-show="isUnusual == 1" |
| | | type="primary" |
| | | @click="addLabel(curVideo)" |
| | | >添加标注</el-button |
| | | > |
| | | >添加标注</el-button> |
| | | </div> |
| | | <div class="flex-box fixed-height-box"> |
| | | <label v-if="!showTable">标注信息:</label> |
| | | <div class="mark-list" v-if="!showTable"> |
| | | <div |
| | | class="mark" |
| | | v-for="mark in curVideo.LableLst" |
| | | :key="mark.ID" |
| | | > |
| | | <div class="mark" v-for="mark in curVideo.LableLst" :key="mark.ID"> |
| | | <div class="time"> |
| | | <span> |
| | | {{ pad0(Math.floor(mark.Time / 60)) }}:{{ |
| | | pad0(mark.Time % 60) |
| | | }} |
| | | </span> |
| | | <span>{{ pad0(Math.floor(mark.Time / 60)) }}:{{ pad0(mark.Time % 60) }}</span> |
| | | <i class="el-icon-edit" @click="editCurLabel(mark)"></i> |
| | | <i class="el-icon-delete" @click="removeCurLabel(mark)"></i> |
| | | </div> |
| | |
| | | <div class="label-check"> |
| | | <p class="label">隐患问题:</p> |
| | | <el-checkbox-group v-model="labelCheckedList"> |
| | | <el-checkbox |
| | | v-for="item in labelOptions" |
| | | :key="item.ID" |
| | | :label="item.ID" |
| | | >{{ item.Name }}</el-checkbox |
| | | > |
| | | <el-checkbox v-for="item in labelOptions" :key="item.ID" :label="item.ID">{{ item.Name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | <div class="btns"> |
| | | <el-button @click="cancelLabelChecked" size="small">取消</el-button> |
| | | <el-button @click="submitLabelChecked" size="small" type="primary" |
| | | >确定</el-button |
| | | > |
| | | <el-button @click="submitLabelChecked" size="small" type="primary">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | setLabelTime: 0, |
| | | isCheckAllVideo: 1, |
| | | curRoomVideos: [], |
| | | popDownArr: [], |
| | | curCamera: "", |
| | | showTable: false, |
| | | showLocChoise: true, |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | |
| | | this.renderLabelOpts(); |
| | | |
| | | this.setGuid(1); |
| | | |
| | | this.getCurVideos(this.videoDetails); |
| | | |
| | | this.getRelatedVideos(this.videoDetails); |
| | | }, |
| | | destroyed() { |
| | |
| | | } |
| | | }, |
| | | handleCommand(cmd) { |
| | | console.log(cmd) |
| | | console.log(this.$refs) |
| | | |
| | | let _this = this; |
| | | _this.curVideo = cmd; |
| | | _this.curCamera = _this.curVideo.CameraPosition; |
| | | _this.$nextTick(() => { |
| | | const a = _this.$refs[`player_${_this.curVideo.id}`] |
| | | const b = _this.$refs[`player_${_this.curVideo.id}`][0] |
| | | console.log(_this.$refs) |
| | | _this.$refs[`player_${_this.curVideo.id}`][0].init(); |
| | | }); |
| | | }, |
| | |
| | | item.marks = _this.mergeMarks(item); |
| | | }); |
| | | |
| | | _this.allCurVideos = res.data; |
| | | |
| | | _this.curVideo = res.data.find((item) => item.id == v.id); |
| | | |
| | | _this.refreshCurVideoLabel(_this.curVideo) |
| | | |
| | | // 设置下拉菜单选中项 |
| | | _this.curCamera = _this.curVideo.CameraPosition; |
| | |
| | | _this.maxVideoTime = _this.curVideo.VideoTime; |
| | | } |
| | | |
| | | _this.videoArrs = res.data.filter((item) => v.GroupID == item.GroupID); |
| | | _this.allCurVideos = res.data; |
| | | console.log(_this.allCurVideos); |
| | | _this.curRoomVideos = _this.allCurVideos.filter((item) => { |
| | | return item.IsCab == "0"; |
| | | }); |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | getRelatedVideos(video) { |
| | | let _this = this; |
| | | getRelatedVideoInfo({ GroupID: video.GroupID }).then((res) => { |
| | | res.data.forEach((item) => { |
| | | _this.popDownArr.push(item); |
| | | }); |
| | | // _this.popDownArr = res.data |
| | | if (_this.popDownArr.length) { |
| | | _this.curCamera = _this.popDownArr[0].CameraPosition; |
| | | } |
| | | }); |
| | | }, |
| | | renderLabelOpts() { |
| | | let _this = this; |
| | | getLabelMap().then((res) => { |
| | |
| | | }); |
| | | }, |
| | | refreshCurVideoLabel(video) { |
| | | let _this = this; |
| | | _this.popDownArr = []; |
| | | getRelatedVideoInfo({ GroupID: video.GroupID }).then((res) => { |
| | | res.data.forEach((item) => { |
| | | _this.popDownArr.push(item); |
| | | if (item.ID === video.ID) { |
| | | video.LableLst = item.LableLst; |
| | | } |
| | | }); |
| | | }); |
| | | let arr = [video] |
| | | this.videoArrs = arr.concat(this.allCurVideos.filter(v => { |
| | | return v.GroupID == video.GroupID && v.id != video.id |
| | | })) |
| | | }, |
| | | checkVideo(video, index) { |
| | | checkVideo(video) { |
| | | console.log(video) |
| | | this.refreshCurVideoLabel(video); |
| | | this.curVideo = video; |
| | | this.eventMarks = [] |
| | | this.labelMarks = [] |
| | | video.marks.forEach((item) => { |
| | | if (item.type == 0) { |
| | | if (item.type == 0) { |
| | | this.eventMarks.push(item); |
| | | } else { |
| | | this.labelMarks.push(item); |
| | | } |
| | | }) |
| | | |
| | | this.videoArrs = this.allCurVideos.filter( |
| | | (item) => video.GroupID == item.GroupID |
| | | ); |
| | | this.$nextTick(() => { |
| | | const a = this.$refs[`player_${this.curVideo.id}`] |
| | | this.$refs[`player_${this.curVideo.id}`][0].init(); |
| | | console.log(this.$refs) |
| | | }); |
| | | }, |
| | | setGuid(guid) { |
| | |
| | | this.videoWrapArr = Math.pow(guid, 2); |
| | | this.$nextTick(() => { |
| | | for (var i = 0; i < Math.pow(guid, 2); i++) { |
| | | console.log(`calc(` + 100 / guid + `% -10px)`); |
| | | this.$refs[`gridVideoItem_${i}`][0].style.width = |
| | | `calc(` + 100 / guid + `%)`; |
| | | this.$refs[`gridVideoItem_${i}`][0].style.height = |