| | |
| | | |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | debugger |
| | | let props = {accept:''}; |
| | | if(this.sourceType == 1){ |
| | | props.accept = '.mp4'; |
| | |
| | | const isFolder = this.file.isFolder; |
| | | let type = isFolder ? "folder" : "unknown"; |
| | | const categoryMap = this.file.uploader.opts.categoryMap; |
| | | debugger |
| | | const typeMap = categoryMap || { |
| | | image: ["gif", "jpg", "jpeg", "png", "bmp", "webp"], |
| | | video: ["mp4", "m3u8", "rmvb", "avi", "swf", "3gp", "mkv", "flv"], |
| | |
| | | }, |
| | | |
| | | mounted() { |
| | | this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, this.attrs) |
| | | this.$nextTick(() => { |
| | | let props = {accept:''}; |
| | | if(this.sourceType == 1){ |
| | | props.accept = '.mp4'; |
| | | }else if(this.sourceType == 2){ |
| | | props.accept = '.jpg,.jpeg,.png'; |
| | | }else if(this.sourceType == 3){ |
| | | props.accept = '.tar,.tar.gz,.gz'; |
| | | } |
| | | this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, props) |
| | | this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, this.attrs) |
| | | }) |
| | | } |
| | | } |
| | |
| | | :options="options"
|
| | | :file-status-text="statusText"
|
| | | class="uploader-single"
|
| | | :sourceType="sourceType"
|
| | | @file-added="onFileAdded"
|
| | | @complete="onComplete"
|
| | | >
|
| | | <!-- <uploader-drop v-if="isDrag == true">
|
| | | <div class="drag-txt">拖拽文件到这里</div>
|
| | | <span class="icon iconfont" @click.stop="showUpload = false"
|
| | | ></span
|
| | | >
|
| | | <uploader-btn>选择文件</uploader-btn>
|
| | | </uploader-drop> -->
|
| | |
|
| | | <div class="up-bar" v-if="isDrag == true">
|
| | | <div class="name">{{ fileName || uploadPlaceholder }}</div>
|
| | | <uploader-btn slot="suffix">
|
| | | <uploader-btn slot="suffix" :attrs="attrs">
|
| | | <el-tooltip :content="tipWords" placement="top" v-if="tip">
|
| | | <div class="open-file-btn">
|
| | | <span class="icon iconfont"></span>
|
| | | </div>
|
| | | </el-tooltip>
|
| | | </uploader-btn>
|
| | | <!-- <div class="open-file-btn">
|
| | | <span class="icon iconfont"></span>
|
| | | </div> -->
|
| | | </div>
|
| | | <el-input
|
| | | :placeholder="uploadPlaceholder"
|
| | |
| | | :readonly="true"
|
| | | v-model="fileName"
|
| | | >
|
| | | <uploader-btn slot="suffix">
|
| | | <uploader-btn slot="suffix" :attrs="attrs">
|
| | | <el-tooltip :content="tipWords" placement="top" v-if="tip">
|
| | | <i
|
| | | class="el-icon-upload2"
|
| | |
| | | },
|
| | | data() {
|
| | | return {
|
| | | fileName: "",
|
| | | fileName: "",shouldStop:false,
|
| | | fileMd5: "",
|
| | | statusText: {
|
| | | success: "上传成功",
|
| | |
| | | },
|
| | | methods: {
|
| | | onFileAdded(file) {
|
| | | // if (this.sourceType == 3) {
|
| | | // if (
|
| | | // !file.name.endsWith(".tar") ||
|
| | | // !file.name.endsWith(".gz") ||
|
| | | // !file.name.endsWith(".tar.gz")
|
| | | // ) {
|
| | | // this.shouldStop = true
|
| | | // this.$notify.warning("仅支持.tar/.gz/.tar.gz三种格式文件");
|
| | | // return
|
| | | // }
|
| | | // }
|
| | | if (this.single) {
|
| | | this.uploader.fileList = this.uploader.fileList.slice([-1]);
|
| | | this.$emit("file-added");
|
| | |
| | | this.statusText.paused = "暂停中";
|
| | | },
|
| | | onComplete() {
|
| | | if (this.shouldStop) {
|
| | | return
|
| | | }
|
| | | this.$emit("complete", {
|
| | | filename: this.fileName,
|
| | | identifier: this.fileMd5,
|
| | |
| | | return {} |
| | | } |
| | | }, |
| | | sourceType: { |
| | | type: Number, |
| | | }, |
| | | options: { |
| | | type: Object, |
| | | default() { |
| | |
| | | } |
| | | }, |
| | | filesAdded(files, fileList) { |
| | | if (this.sourceType == 3 && files[0]) { |
| | | if ( |
| | | !files[0].name.endsWith(".tar") || |
| | | !files[0].name.endsWith(".gz") || |
| | | !files[0].name.endsWith(".tar.gz") |
| | | ) { |
| | | this.shouldStop = true |
| | | return |
| | | } |
| | | } |
| | | this.$emit(kebabCase(FILES_ADDED_EVENT), files, fileList) |
| | | if (files.ignored || fileList.ignored) { |
| | | // is ignored, filter it |
| | |
| | | this.fileList = this.uploader.fileList |
| | | }, |
| | | filesSubmitted(files, fileList) { |
| | | if (this.sourceType == 3&& files[0]) { |
| | | if ( |
| | | !files[0].name.endsWith(".tar") || |
| | | !files[0].name.endsWith(".gz") || |
| | | !files[0].name.endsWith(".tar.gz") |
| | | ) { |
| | | this.shouldStop = true |
| | | return |
| | | } |
| | | } |
| | | this.files = this.uploader.files |
| | | this.fileList = this.uploader.fileList |
| | | if (this.autoStart) { |
| | |
| | | } |
| | | }, |
| | | allEvent(...args) { |
| | | console.log(args) |
| | | const name = args[0] |
| | | const EVENTSMAP = { |
| | | [FILE_ADDED_EVENT]: true, |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | // console.log('uploader attrs',this.attrs); |
| | | // this.bindUploader(); |
| | | this.options.initialPaused = !this.autoStart |
| | | const uploader = new Uploader(this.options) |
| | |
| | | class="upload-demo"
|
| | | single
|
| | | tip
|
| | | :sourceType="3"
|
| | | :isDrag="true"
|
| | | :attrs="{accept:'.zip,.tar,.gz,.tar.gz'}"
|
| | | tipWords="点击上传"
|
| | | uploadPlaceholder="算法软件"
|
| | | url="/data/api-v/sdk/upload"
|
| | |
| | | @change="changePoll" |
| | | /> |
| | | </div> |
| | | |
| | | <div |
| | | v-if="Camera.analytics" |
| | | class="flex-box" |
| | | v-show="cameraType === 'camera'" |
| | | > |
| | | <span class="label">处理状态: {{ camStatus }}</span> |
| | | </div> |
| | | <div |
| | | v-if="Camera.analytics" |
| | | class="flex-box" |
| | |
| | | import { savePolygon } from "@/api/polygon"; |
| | | |
| | | import { pasteRules } from "@/api/task"; |
| | | |
| | | import { getCameraInfo } from "@/api/camera"; |
| | | import { saveCameraScene } from "@/api/scene"; |
| | | |
| | | import { changeRunType } from "@/api/pollConfig"; |
| | |
| | | prevEl: ".swiper-local-prev", |
| | | }, |
| | | }, |
| | | // swiperOption: { |
| | | // slidesPerView: 5, |
| | | // spaceBetween: 8, |
| | | // pagination: { |
| | | // el: ".swiper-pagination", |
| | | // clickable: true |
| | | // }, |
| | | // navigation: { |
| | | // nextEl: ".swiper-next-border", |
| | | // prevEl: ".swiper-pre-border" |
| | | // } |
| | | // }, |
| | | tableRuleList: [], |
| | | |
| | | camStatus:'', |
| | | cameraId: "", |
| | | showSysInfo: false, |
| | | showCanvas: true, |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | getStatus() { |
| | | getCameraInfo(this.Camera.cameraId).then((res) => { |
| | | if (res.success) { |
| | | switch (res.data.status) { |
| | | case 0: |
| | | this.camStatus = "未配规则"; |
| | | return |
| | | case 1: |
| | | this.camStatus = "等待轮询处理"; |
| | | return |
| | | case 2: |
| | | this.camStatus = "正在执行分析处理"; |
| | | return |
| | | case -1: |
| | | this.camStatus = "其他情况导致未处理"; |
| | | return |
| | | case -2: |
| | | this.camStatus = "故障导致未处理"; |
| | | return |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | prevClick() { |
| | | if (this.swiperIndex == 0) { |
| | | if (this.stackFilesPage > 1) { |
| | |
| | | val = -1; |
| | | } |
| | | if (this.Camera.cameraId && this.Camera.cameraId !== undefined) { |
| | | debugger; |
| | | changeRunType({ |
| | | camera_ids: [this.Camera.cameraId], |
| | | run_type: val, |
| | | }).then((rsp) => { |
| | | this.getStatus() |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | |
| | | return false; |
| | | }, |
| | | defaultBgUrl() { |
| | | if (JSON.parse(sessionStorage.getItem("userInfo"))) { |
| | | return JSON.parse(sessionStorage.getItem("userInfo")).backgroundpic; |
| | | } |
| | | return "" |
| | | }, |
| | | }, |
| | | created() { |
| | |
| | | v-show="!shengjiing && upStatus === ''"
|
| | | :http-request="uploadPkg"
|
| | | :limit="1"
|
| | | accept=".zip,.tar,.gz,.tar.gz"
|
| | | >
|
| | | <i class="el-icon-upload"></i>
|
| | | <div
|
| | |
| | | },
|
| | | "/data/api-v/app/findAllApp": {
|
| | | // target: '/',
|
| | | target: "http://localhost:8081/",
|
| | | target: "http://localhost:8080/",
|
| | | changeOrigin: true,
|
| | | pathRewrite: {
|
| | | "^/data/api-v/app/findAllApp": "apps.json",
|