| | |
| | | /* eslint-disable */ |
| | | import axios from 'axios' |
| | | import qs from 'qs' |
| | | import { Notification } from 'element-ui' |
| | | import router from '@/router' |
| | | import axios from "axios" |
| | | import qs from "qs" |
| | | import { Notification } from "element-ui" |
| | | import router from "@/router" |
| | | |
| | | const Axios = axios.create({ |
| | | responseType: 'json', |
| | | responseType: "json", |
| | | withCredentials: true // 是否允许带cookie这些 |
| | | }) |
| | | |
| | | /* //POST传参序列化(添加请求拦截器) */ |
| | | Axios.interceptors.request.use( |
| | | config => { |
| | | console.log(9898); |
| | | console.log(config); |
| | | |
| | | |
| | | if ( |
| | | config.method === "post" && |
| | | sessionStorage.getItem('clusterId') || |
| | | sessionStorage.getItem('devId') |
| | | ) { |
| | | if( !config.data ) { |
| | | (config) => { |
| | | console.log(9898) |
| | | console.log(config) |
| | | |
| | | if ((config.method === "post" && sessionStorage.getItem("clusterId")) || sessionStorage.getItem("devId")) { |
| | | if (!config.data) { |
| | | config.data = {} |
| | | } |
| | | |
| | | if(typeof config.data == 'object' ) { |
| | | config.data.clusterId = sessionStorage.getItem('clusterId') |
| | | config.data.devId = sessionStorage.getItem('devId') |
| | | if (typeof config.data == "object") { |
| | | config.data.clusterId = sessionStorage.getItem("clusterId") |
| | | config.data.devId = sessionStorage.getItem("devId") |
| | | } |
| | | |
| | | if(config.url === '/saas/api-s/camera/rule/getLinkRulesByCameraIds') { |
| | | config.data.devId = sessionStorage.getItem('cameraDevId') |
| | | if (config.url === "/saas/api-s/camera/rule/getLinkRulesByCameraIds") { |
| | | config.data.devId = sessionStorage.getItem("cameraDevId") |
| | | } |
| | | |
| | | //后门 |
| | | if(config.url === '/saas/api-d/device/userClusterInfo') { |
| | | config.data.clusterId = '' |
| | | if (config.url === "/saas/api-d/device/userClusterInfo") { |
| | | config.data.clusterId = "" |
| | | } |
| | | |
| | | if(config.url === '/saas/api-s/es/saveEsConfig') { |
| | | if (config.url === "/saas/api-s/es/saveEsConfig") { |
| | | delete config.data.clusterId |
| | | delete config.data.devId |
| | | } |
| | | |
| | | } |
| | | |
| | | // 若是有做鉴权token , 就给头部带上token |
| | | |
| | | let token = |
| | | sessionStorage.getItem('loginedInfo') && |
| | | JSON.parse(sessionStorage.getItem('loginedInfo')).access_token |
| | | |
| | | let token = sessionStorage.getItem("loginedInfo") && JSON.parse(sessionStorage.getItem("loginedInfo")).access_token |
| | | if (token != undefined) { |
| | | config.headers.Authorization = token |
| | | } |
| | | return config |
| | | }, |
| | | error => { |
| | | console.log('请求错误'); |
| | | console.log(error); |
| | | |
| | | |
| | | (error) => { |
| | | console.log("请求错误") |
| | | console.log(error) |
| | | |
| | | /* Message({ |
| | | showClose: true, |
| | | message: "提交出错,请联系管理员!", |
| | |
| | | |
| | | /* //返回状态判断(添加响应拦截器) */ |
| | | Axios.interceptors.response.use( |
| | | res => { |
| | | (res) => { |
| | | /* //对响应数据做些事 */ |
| | | if (res.data && res.statusText !== 'OK' && res.status !== 200) { |
| | | if (res.data && res.statusText !== "OK" && res.status !== 200) { |
| | | Notification({ |
| | | title: '', |
| | | title: "", |
| | | message: res.data.message, |
| | | type: 'error' |
| | | type: "error" |
| | | }) |
| | | return Promise.reject(res.data) |
| | | } |
| | |
| | | // window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true)) |
| | | // } |
| | | |
| | | var disposition = res.headers["content-disposition"]; |
| | | if(disposition) { |
| | | var fileName = disposition.substring(disposition.indexOf("=") + 1); |
| | | console.log(res); |
| | | |
| | | return { |
| | | fileName:fileName, |
| | | body:res |
| | | } |
| | | } |
| | | var disposition = res.headers["content-disposition"] |
| | | if (disposition) { |
| | | var fileName = disposition.substring(disposition.indexOf("=") + 1) |
| | | console.log(res) |
| | | |
| | | return { |
| | | fileName: fileName, |
| | | body: res |
| | | } |
| | | } |
| | | |
| | | return res.data ? res.data : {} |
| | | |
| | | |
| | | |
| | | /* //return res.data ? res.data : {}; */ |
| | | }, |
| | | error => { |
| | | console.log('响应错误'); |
| | | console.log(error); |
| | | (error) => { |
| | | console.log("响应错误") |
| | | console.log(error) |
| | | let errJson: any = { |
| | | success: false |
| | | } |
| | | if(error && error.response&&error.response.status == 404) { |
| | | if (error && error.response && error.response.status == 404) { |
| | | return |
| | | } |
| | | // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 |
| | |
| | | switch (error.response.status) { |
| | | case 400: |
| | | errJson.status = error.response.status |
| | | errJson.message = '请求错误(400)' |
| | | errJson.message = "请求错误(400)" |
| | | break |
| | | case 401: |
| | | errJson.status = error.response.status |
| | | errJson.message = '未授权,请重新登录(401)' |
| | | errJson.message = "未授权,请重新登录(401)" |
| | | router.push({ |
| | | path: '/login' |
| | | }) |
| | | path: "/login" |
| | | }) |
| | | // if (!AuthData.isLoginout) { |
| | | // Notification({ |
| | | // title:"", |
| | |
| | | break |
| | | case 403: |
| | | errJson.status = error.response.status |
| | | errJson.message = '拒绝访问(403)' |
| | | errJson.message = "拒绝访问(403)" |
| | | break |
| | | case 404: |
| | | errJson.status = error.response.status |
| | | errJson.message = '找不到请求路径(404)' |
| | | errJson.message = "找不到请求路径(404)" |
| | | break |
| | | case 408: |
| | | errJson.status = error.response.status |
| | | errJson.message = '请求超时(408)' |
| | | errJson.message = "请求超时(408)" |
| | | break |
| | | case 500: |
| | | errJson = error.response.data |
| | | break |
| | | |
| | | |
| | | default: |
| | | errJson.status = error.response.status |
| | | errJson.message = `连接出错(${error.response.status})!` |
| | | } |
| | | |
| | | } else { |
| | | errJson.message = '连接服务器失败!' |
| | | |
| | | errJson.message = "连接服务器失败!" |
| | | |
| | | // router.push({ |
| | | // path: '/login' |
| | | // }); |
| | | } |
| | | |
| | | if(error.response&&error.response.data&&!error.response.data.success ) { |
| | | errJson.message =error.response.data.msg |
| | | |
| | | if (error.response && error.response.data && !error.response.data.success) { |
| | | errJson.message = error.response.data.msg |
| | | } |
| | | |
| | | if(error.response.status == 401) { |
| | | if (error.response.status == 401) { |
| | | return |
| | | } |
| | | |
| | | Notification({ |
| | | title: '错误', |
| | | showClose: true, |
| | | message:errJson.message, |
| | | type: 'error' |
| | | }) |
| | | |
| | | Notification({ |
| | | title: "错误", |
| | | showClose: true, |
| | | message: errJson.message, |
| | | type: "error" |
| | | }) |
| | | // 返回 response 里的错误信息 |
| | | return Promise.reject(errJson) |
| | | } |
| | | ) |
| | | |
| | | Axios.defaults.timeout = 60 * 1000 |
| | | Axios.defaults.timeout = 60 * 1000 * 2 |
| | | export default Axios |
| | |
| | | <div class="close iconfont" @click="close()"></div> |
| | | |
| | | <div class="search"> |
| | | <el-input |
| | | v-model="searchContent" |
| | | placeholder="请输入集群IP/集群名称/设备IP/设备名称" |
| | | ></el-input> |
| | | <el-input v-model="searchContent" placeholder="请输入集群IP/集群名称/设备IP/设备名称"></el-input> |
| | | <div class="button" @click="searchCluster">搜索集群</div> |
| | | <div class="button" @click="searchDevice">搜索设备</div> |
| | | </div> |
| | |
| | | <div class="clusterList"> |
| | | <div class="tableList" v-if="listType == 'cluster'"> |
| | | <div class="header"> |
| | | <div |
| | | class="label" |
| | | v-for="(item, index) in clusterHeader" |
| | | :key="index" |
| | | > |
| | | <div class="label" v-for="(item, index) in clusterHeader" :key="index"> |
| | | {{ item }} |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 添加 --> |
| | | <span v-if="!item.canAdd">-</span> |
| | | <template v-else> |
| | | <span |
| | | class="iconfont option" |
| | | @click="showBox('cluster', item.clusterId)" |
| | | ></span |
| | | > |
| | | <span class="iconfont option" @click="showBox('cluster', item.clusterId)"></span> |
| | | <!-- 集群详情 --> |
| | | <span |
| | | class="iconfont option" |
| | | @click="showChildrenLIst(index, item.clusterId)" |
| | | ></span |
| | | > |
| | | <span class="iconfont option" @click="showChildrenLIst(index, item.clusterId)"></span> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="overList" |
| | | :class="{ isShow: showClusterChild == index }" |
| | | > |
| | | <el-table |
| | | :data="overList" |
| | | :fit="true" |
| | | header-row-class-name="overList-head" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | type="index" |
| | | width="146" |
| | | class-name="index " |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dev_id" |
| | | label="设备ID" |
| | | width="146" |
| | | ></el-table-column> |
| | | <div class="overList" :class="{ isShow: showClusterChild == index }"> |
| | | <el-table :data="overList" :fit="true" header-row-class-name="overList-head"> |
| | | <el-table-column label="序号" type="index" width="146" class-name="index "> </el-table-column> |
| | | <el-table-column prop="dev_id" label="设备ID"></el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="dev_ip" |
| | | label="设备IP" |
| | | width="146" |
| | | ></el-table-column> |
| | | <el-table-column prop="dev_ip" label="设备IP" width="146"></el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="dev_name" |
| | | label="设备名称" |
| | | width="240" |
| | | ></el-table-column> |
| | | <el-table-column prop="dev_name" label="设备名称" width="240"></el-table-column> |
| | | </el-table> |
| | | |
| | | <div class="iconfont" @click="showClusterChild = null"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-table |
| | | :data="equipmentList" |
| | | :fit="true" |
| | | v-if="listType == 'equipment'" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | type="index" |
| | | width="72" |
| | | class-name="index" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="devId" |
| | | label="设备ID" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="devName" |
| | | label="设备名称" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="devIp" |
| | | label="设备IP" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="clusterName" |
| | | label="所属集群" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table :data="equipmentList" :fit="true" v-if="listType == 'equipment'"> |
| | | <el-table-column label="序号" type="index" width="72" class-name="index"> </el-table-column> |
| | | <el-table-column prop="devId" label="设备ID"></el-table-column> |
| | | <el-table-column prop="devName" label="设备名称" width="107"></el-table-column> |
| | | <el-table-column prop="devIp" label="设备IP" width="107"></el-table-column> |
| | | <el-table-column prop="clusterName" label="所属集群" width="107"></el-table-column> |
| | | <el-table-column label="状态" width="107"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="!scope.row.canAdd" class="status green">已添加</div> |
| | |
| | | <div class="options" v-if="scope"> |
| | | <!-- 添加 --> |
| | | <span v-if="!scope.row.canAdd">-</span> |
| | | <span |
| | | v-else |
| | | class="iconfont option" |
| | | @click="showBox('dev', scope.row.devId, scope.row.clusterId)" |
| | | <span v-else class="iconfont option" @click="showBox('dev', scope.row.devId, scope.row.clusterId)" |
| | | ></span |
| | | > |
| | | </div> |
| | |
| | | <div class="title">申请添加设备</div> |
| | | <div class="des"> |
| | | <span class="iconfont"></span> |
| | | 如设备已加入集群,添加管理后集群下所有设备将在设备管理 |
| | | 页面显示,并支持信息查看及管理。 |
| | | 如设备已加入集群,添加管理后集群下所有设备将在设备管理 页面显示,并支持信息查看及管理。 |
| | | </div> |
| | | <div class="ask">密钥信息请询问设备管理人员</div> |
| | | <el-input v-model="auth_password"></el-input> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | findDeviceListAll, |
| | | findClustersBySearch, |
| | | getDevicesByCluster, |
| | | addCluster, |
| | | addDeviceToUser, |
| | | } from "@/api/device"; |
| | | import { findDeviceListAll, findClustersBySearch, getDevicesByCluster, addCluster, addDeviceToUser } from "@/api/device" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | equipmentList: [], |
| | | overList: [], |
| | | auth_password: "", //授权秘钥 |
| | | addObj: {}, |
| | | }; |
| | | addObj: {} |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | close() { |
| | | this.$emit("close"); |
| | | this.$emit("close") |
| | | }, |
| | | async showChildrenLIst(index, id) { |
| | | if (this.showClusterChild === index) { |
| | | this.showClusterChild = null; |
| | | return; |
| | | this.showClusterChild = null |
| | | return |
| | | } else if (!index) { |
| | | this.showClusterChild = index; |
| | | this.showClusterChild = index |
| | | } |
| | | this.showClusterChild = null; |
| | | this.showClusterChild = null |
| | | setTimeout(() => { |
| | | this.showClusterChild = index; |
| | | }, 400); |
| | | this.showClusterChild = index |
| | | }, 400) |
| | | |
| | | const res = await getDevicesByCluster({ |
| | | clusterId: id, |
| | | }); |
| | | clusterId: id |
| | | }) |
| | | if (res && res.success) { |
| | | this.overList = res.data.list; |
| | | this.overList = res.data.list |
| | | } |
| | | }, |
| | | async getCluster() { |
| | | const res = await findClustersBySearch({ |
| | | InputText: this.searchContent, |
| | | Page: 1, |
| | | Size: 10000, |
| | | }); |
| | | Size: 10000 |
| | | }) |
| | | if (res && res.success) { |
| | | this.clusterList = res.data.list; |
| | | this.clusterList = res.data.list |
| | | } |
| | | }, |
| | | |
| | |
| | | const res = await findDeviceListAll({ |
| | | InputText: this.searchContent, |
| | | Page: 1, |
| | | Size: 10000, |
| | | }); |
| | | Size: 10000 |
| | | }) |
| | | if (res && res.success) { |
| | | this.equipmentList = res.data.list; |
| | | this.equipmentList = res.data.list |
| | | } |
| | | }, |
| | | |
| | | searchCluster() { |
| | | this.getCluster(); |
| | | this.listType = "cluster"; |
| | | this.getCluster() |
| | | this.listType = "cluster" |
| | | }, |
| | | |
| | | searchDevice() { |
| | | this.getDevice(); |
| | | this.listType = "equipment"; |
| | | this.getDevice() |
| | | this.listType = "equipment" |
| | | }, |
| | | |
| | | async submit() { |
| | | let res = {}; |
| | | let res = {} |
| | | if (this.addObj.type == "cluster") { |
| | | res = await addCluster({ |
| | | authPwd: this.auth_password, |
| | | clusterId: this.addObj.id, |
| | | }); |
| | | clusterId: this.addObj.id |
| | | }) |
| | | } else { |
| | | res = await addDeviceToUser({ |
| | | authPwd: this.auth_password, |
| | | deviceId: this.addObj.id, |
| | | clusterId: this.addObj.cid, |
| | | }); |
| | | clusterId: this.addObj.cid |
| | | }) |
| | | } |
| | | |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "添加成功", |
| | | }); |
| | | this.close(); |
| | | message: "添加成功" |
| | | }) |
| | | this.close() |
| | | } |
| | | }, |
| | | showBox(type, id, cid) { |
| | | this.auth_password = ""; |
| | | this.showPasswordBox = true; |
| | | this.auth_password = "" |
| | | this.showPasswordBox = true |
| | | this.addObj = { |
| | | type, |
| | | id, |
| | | cid, |
| | | }; |
| | | }, |
| | | }, |
| | | }; |
| | | cid |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <div class="cluster"> |
| | | 所属集群 |
| | | <el-select v-model="cluster" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in clusterArr" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | <el-option v-for="item in clusterArr" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <div class="btns"> |
| | | <div class="button add" @click="isShowAdd = true"> |
| | | <span>+</span>添加设备 |
| | | </div> |
| | | <div class="button export" @click="exportFile"> |
| | | <span class="iconfont"></span>导出 |
| | | </div> |
| | | <div class="button add" @click="isShowAdd = true"><span>+</span>添加设备</div> |
| | | <div class="button export" @click="exportFile"><span class="iconfont"></span>导出</div> |
| | | </div> |
| | | |
| | | <div class="table-area"> |
| | |
| | | :stripe="true" |
| | | > |
| | | <el-table-column label="序号" width="80" class-name="index"> |
| | | <template slot-scope="scope">{{ |
| | | scope.$index + 1 + (page - 1) * size |
| | | }}</template> |
| | | <template slot-scope="scope">{{ scope.$index + 1 + (page - 1) * size }}</template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="devId" |
| | | label="设备ID" |
| | | min-width="140" |
| | | show-overflow-tooltip |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="devName" |
| | | label="设备名称" |
| | | min-width="140" |
| | | show-overflow-tooltip |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="devIp" |
| | | label="IP地址" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column prop="devId" label="设备ID" min-width="185" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="devName" label="设备名称" min-width="140" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="devIp" label="IP地址" min-width="150"></el-table-column> |
| | | <el-table-column label="安装时间" min-width="159"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.installTime.length > 1"> |
| | |
| | | <el-table-column label="操作" min-width="180"> |
| | | <template slot-scope="scope"> |
| | | <!-- 加入 --> |
| | | <el-tooltip |
| | | content="加入集群" |
| | | placement="top" |
| | | v-if="!scope.row.clusterId" |
| | | > |
| | | <el-tooltip content="加入集群" placement="top" v-if="!scope.row.clusterId"> |
| | | <span |
| | | class="iconfont option" |
| | | @click="joinCluster(scope.row)" |
| | |
| | | </el-tooltip> |
| | | <!-- 解绑 --> |
| | | <el-tooltip content="解除绑定" placement="top"> |
| | | <span |
| | | class="iconfont option" |
| | | @click="Untying(scope.row)" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | <span class="iconfont option" @click="Untying(scope.row)" :class="{ disable: scope.row.isOnline != 1 }" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | |
| | | </div> |
| | | |
| | | <!-- 解绑弹窗 --> |
| | | <UnbindBox |
| | | @close="closeUnbindBox" |
| | | v-if="isShowUnbind" |
| | | :id="unbindId" |
| | | @reflash="reflash" |
| | | ></UnbindBox> |
| | | <UnbindBox @close="closeUnbindBox" v-if="isShowUnbind" :id="unbindId" @reflash="reflash"></UnbindBox> |
| | | |
| | | <!-- 添加设备弹窗 --> |
| | | <AddBox @close="closeAddBox" v-if="isShowAdd"></AddBox> |
| | | |
| | | <!-- 退出集群弹窗 --> |
| | | <QuitClusterBox |
| | | :equipment="activeEquipment" |
| | | v-if="showQuit" |
| | | @close="showQuit = false" |
| | | ></QuitClusterBox> |
| | | <QuitClusterBox :equipment="activeEquipment" v-if="showQuit" @close="showQuit = false"></QuitClusterBox> |
| | | |
| | | <!-- 加入集群弹窗 --> |
| | | <JoinClusterBox |
| | | :equipment="activeEquipment" |
| | | v-if="showJoin" |
| | | @close="showJoin = false" |
| | | ></JoinClusterBox> |
| | | <JoinClusterBox :equipment="activeEquipment" v-if="showJoin" @close="showJoin = false"></JoinClusterBox> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | findDevList, |
| | | findClustersBySearch, |
| | | exportDevListExcel, |
| | | } from "@/api/device"; |
| | | import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox"; |
| | | import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox"; |
| | | import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox"; |
| | | import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox"; |
| | | import { findDevList, findClustersBySearch, exportDevListExcel } from "@/api/device" |
| | | import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox" |
| | | import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox" |
| | | import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox" |
| | | import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox" |
| | | |
| | | import bus from "@/plugin/bus"; |
| | | import bus from "@/plugin/bus" |
| | | |
| | | export default { |
| | | components: { |
| | | AddBox, |
| | | UnbindBox, |
| | | QuitClusterBox, |
| | | JoinClusterBox, |
| | | JoinClusterBox |
| | | }, |
| | | created() { |
| | | this.getCluster(); |
| | | this.getCluster() |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | cluster: null, //选中的集群类型 |
| | | showQuit: false, //展示退出集群的弹窗 |
| | | showJoin: false, //展示加入集群的弹窗 |
| | | activeEquipment: null, //处理中的设备 |
| | | }; |
| | | activeEquipment: null //处理中的设备 |
| | | } |
| | | }, |
| | | methods: { |
| | | async getCluster() { |
| | |
| | | InputText: "", |
| | | Page: 1, |
| | | Size: 10000, |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id, |
| | | }); |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id |
| | | }) |
| | | if (res && res.success) { |
| | | res.data.list.forEach((item) => { |
| | | this.clusterArr.push({ |
| | | label: item.clusterName, |
| | | value: item.clusterId, |
| | | }); |
| | | }); |
| | | value: item.clusterId |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 跳到设备详情 |
| | | checkDetail(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | return |
| | | } |
| | | this.$router.push({ |
| | | path: "/equipmentDetail", |
| | | query: { |
| | | id: row.devId, |
| | | }, |
| | | }); |
| | | id: row.devId |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 跳到算法详情 |
| | | algorithmDetail(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | return |
| | | } |
| | | this.$router.push({ |
| | | path: "/algorithmDetail", |
| | | query: { |
| | | id: row.devId, |
| | | }, |
| | | }); |
| | | id: row.devId |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 查询列表 |
| | | searchingBtn() { |
| | | let param = {}; |
| | | let param = {} |
| | | |
| | | if (!this.searchTime) { |
| | | param = { |
| | |
| | | startTime: "", |
| | | endTime: "", |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | inputText: this.inputText |
| | | } |
| | | } else { |
| | | param = { |
| | | page: this.page, |
| | |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | inputText: this.inputText |
| | | } |
| | | } |
| | | |
| | | findDevList(param) |
| | | .then((res) => { |
| | | this.dataList = res.data.list; |
| | | this.dataList = res.data.list |
| | | //时间分行显示 |
| | | this.dataList.forEach((item) => { |
| | | item.installTime = item.installTime.split(" "); |
| | | item.firstUseTime = item.firstUseTime.split(" "); |
| | | }); |
| | | this.total = res.data.total; |
| | | item.installTime = item.installTime.split(" ") |
| | | item.firstUseTime = item.firstUseTime.split(" ") |
| | | }) |
| | | this.total = res.data.total |
| | | if (res.data.total <= this.size) { |
| | | this.page = 1; |
| | | this.page = 1 |
| | | } |
| | | |
| | | bus.$emit("refleshNode", this.dataList); |
| | | bus.$emit("refleshNode", this.dataList) |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | |
| | | //分页功能 |
| | | handleSizeChange(size) { |
| | | this.size = size; |
| | | this.searchingBtn(); |
| | | this.size = size |
| | | this.searchingBtn() |
| | | }, |
| | | //分页功能 |
| | | refrash(page) { |
| | | this.page = page; |
| | | this.searchingBtn(); |
| | | this.page = page |
| | | this.searchingBtn() |
| | | }, |
| | | |
| | | //解绑按钮 |
| | | Untying(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | return |
| | | } |
| | | this.unbindId = row.devId; |
| | | this.isShowUnbind = true; |
| | | this.unbindId = row.devId |
| | | this.isShowUnbind = true |
| | | }, |
| | | |
| | | //获得默认时间 |
| | | getDateInit() { |
| | | // 要求 默认一个月 |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | const nowDate = new Date(); |
| | | nowDate.setHours(0); |
| | | nowDate.setMinutes(0); |
| | | nowDate.setSeconds(0); |
| | | nowDate.setMilliseconds(0); |
| | | start.setTime(nowDate.getTime() - 3600 * 1000 * 24 * 30); |
| | | end.setTime(nowDate.getTime() + 3600 * 1000 * 24 - 1); |
| | | return [ |
| | | this.$moment(start).format("YYYY-MM-DD HH:mm:ss"), |
| | | this.$moment(end).format("YYYY-MM-DD HH:mm:ss"), |
| | | ]; |
| | | const end = new Date() |
| | | const start = new Date() |
| | | const nowDate = new Date() |
| | | nowDate.setHours(0) |
| | | nowDate.setMinutes(0) |
| | | nowDate.setSeconds(0) |
| | | nowDate.setMilliseconds(0) |
| | | start.setTime(nowDate.getTime() - 3600 * 1000 * 24 * 30) |
| | | end.setTime(nowDate.getTime() + 3600 * 1000 * 24 - 1) |
| | | return [this.$moment(start).format("YYYY-MM-DD HH:mm:ss"), this.$moment(end).format("YYYY-MM-DD HH:mm:ss")] |
| | | }, |
| | | |
| | | //关闭新增弹窗 |
| | | closeAddBox() { |
| | | this.isShowAdd = false; |
| | | this.searchingBtn(); |
| | | this.isShowAdd = false |
| | | this.searchingBtn() |
| | | }, |
| | | // 关闭解绑弹窗 |
| | | closeUnbindBox() { |
| | | this.isShowUnbind = false; |
| | | this.isShowUnbind = false |
| | | }, |
| | | |
| | | //解绑成功回调 |
| | | reflash() { |
| | | this.isShowUnbind = false; |
| | | this.searchingBtn(); |
| | | this.isShowUnbind = false |
| | | this.searchingBtn() |
| | | }, |
| | | |
| | | clearSearch() { |
| | | this.searchTime = this.getDateInit(); |
| | | this.inputText = ""; |
| | | this.cluster = ""; |
| | | this.searchingBtn(); |
| | | this.searchTime = this.getDateInit() |
| | | this.inputText = "" |
| | | this.cluster = "" |
| | | this.searchingBtn() |
| | | }, |
| | | |
| | | //退出集群 |
| | | quitCluster(equipment) { |
| | | if (equipment.isOnline != 1) { |
| | | return; |
| | | return |
| | | } |
| | | this.activeEquipment = equipment; |
| | | this.showQuit = true; |
| | | this.activeEquipment = equipment |
| | | this.showQuit = true |
| | | }, |
| | | |
| | | //加入集群 |
| | | joinCluster(equipment) { |
| | | if (equipment.isOnline != 1) { |
| | | return; |
| | | return |
| | | } |
| | | this.activeEquipment = equipment; |
| | | this.showJoin = true; |
| | | this.activeEquipment = equipment |
| | | this.showJoin = true |
| | | }, |
| | | |
| | | //导出列表文件 |
| | | async exportFile() { |
| | | let param = {}; |
| | | let param = {} |
| | | |
| | | if (!this.searchTime) { |
| | | param = { |
| | |
| | | startTime: "", |
| | | endTime: "", |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | inputText: this.inputText |
| | | } |
| | | } else { |
| | | param = { |
| | | page: this.page, |
| | |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | inputText: this.inputText |
| | | } |
| | | } |
| | | const result = await exportDevListExcel(param); |
| | | const result = await exportDevListExcel(param) |
| | | |
| | | var blob = new Blob([result.body.data], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8" |
| | | }), |
| | | Temp = document.createElement("a"); |
| | | Temp = document.createElement("a") |
| | | |
| | | Temp.href = window.URL.createObjectURL(blob); |
| | | Temp.href = window.URL.createObjectURL(blob) |
| | | |
| | | console.log(result); |
| | | console.log(result.fileName); |
| | | console.log(result) |
| | | console.log(result.fileName) |
| | | |
| | | Temp.download = window.decodeURI(result.fileName); |
| | | Temp.download = window.decodeURI(result.fileName) |
| | | |
| | | Temp.setAttribute("download", result.fileName); |
| | | Temp.setAttribute("download", result.fileName) |
| | | |
| | | document.body.appendChild(Temp); |
| | | document.body.appendChild(Temp) |
| | | |
| | | Temp.click(); |
| | | Temp.click() |
| | | |
| | | document.body.removeChild(Temp); |
| | | document.body.removeChild(Temp) |
| | | |
| | | window.URL.revokeObjectURL(Temp); |
| | | }, |
| | | window.URL.revokeObjectURL(Temp) |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.searchingBtn(); |
| | | }, |
| | | }; |
| | | this.searchingBtn() |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | } |
| | | </style> |
| | | |
| | | <style > |
| | | <style> |
| | | .el-date-table td.start-date span, |
| | | .el-date-table td.end-date span { |
| | | background-color: #0065ff; |
| | |
| | | color: #0065ff; |
| | | border-color: #0065ff; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | .column-left { |
| | | position: relative; |
| | | margin-right: 24px; |
| | | height: 233vh; |
| | | height: 160vh; |
| | | overflow: auto; |
| | | background-color: #fff; |
| | | } |
| | |
| | | <div class="close iconfont" @click="close()"></div> |
| | | |
| | | <div class="search"> |
| | | <el-input |
| | | v-model="searchContent" |
| | | placeholder="请输入集群IP/集群名称/设备IP/设备名称" |
| | | ></el-input> |
| | | <el-input v-model="searchContent" placeholder="请输入集群IP/集群名称/设备IP/设备名称"></el-input> |
| | | <div class="button" @click="listType = 'cluster'">搜索集群</div> |
| | | <div class="button" @click="listType = 'equipment'">搜索设备</div> |
| | | </div> |
| | |
| | | <div class="clusterList"> |
| | | <div class="tableList" v-if="listType == 'cluster'"> |
| | | <div class="header"> |
| | | <div |
| | | class="label" |
| | | v-for="(item, index) in clusterHeader" |
| | | :key="index" |
| | | > |
| | | <div class="label" v-for="(item, index) in clusterHeader" :key="index"> |
| | | {{ item }} |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="rowItem options"> |
| | | <!-- 添加 --> |
| | | <span class="iconfont option" @click="showPasswordBox = true" |
| | | ></span |
| | | > |
| | | <span class="iconfont option" @click="showPasswordBox = true"></span> |
| | | <!-- 集群详情 --> |
| | | <span class="iconfont option" @click="showChildrenLIst(index)" |
| | | ></span |
| | | > |
| | | <span class="iconfont option" @click="showChildrenLIst(index)"></span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="overList" |
| | | :class="{ isShow: showClusterChild == index }" |
| | | > |
| | | <el-table |
| | | :data="overList" |
| | | :fit="true" |
| | | header-row-class-name="overList-head" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | type="index" |
| | | width="146" |
| | | class-name="index " |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="id" |
| | | label="设备ID" |
| | | width="146" |
| | | ></el-table-column> |
| | | <div class="overList" :class="{ isShow: showClusterChild == index }"> |
| | | <el-table :data="overList" :fit="true" header-row-class-name="overList-head"> |
| | | <el-table-column label="序号" type="index" width="146" class-name="index "> </el-table-column> |
| | | <el-table-column prop="id" label="设备ID"></el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="ip" |
| | | label="设备IP" |
| | | width="146" |
| | | ></el-table-column> |
| | | <el-table-column prop="ip" label="设备IP" width="146"></el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="name" |
| | | label="设备名称" |
| | | width="240" |
| | | ></el-table-column> |
| | | <el-table-column prop="name" label="设备名称" width="240"></el-table-column> |
| | | </el-table> |
| | | |
| | | <div class="iconfont" @click="showClusterChild = null"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-table |
| | | :data="equipmentList" |
| | | :fit="true" |
| | | v-if="listType == 'equipment'" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | type="index" |
| | | width="72" |
| | | class-name="index" |
| | | > |
| | | </el-table-column> |
| | | <el-table :data="equipmentList" :fit="true" v-if="listType == 'equipment'"> |
| | | <el-table-column label="序号" type="index" width="72" class-name="index"> </el-table-column> |
| | | <el-table-column prop="id" label="设备ID" width="107"></el-table-column> |
| | | <el-table-column |
| | | prop="name" |
| | | label="设备名称" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table-column prop="name" label="设备名称" width="107"></el-table-column> |
| | | <el-table-column prop="ip" label="设备IP" width="107"></el-table-column> |
| | | <el-table-column |
| | | prop="cluster" |
| | | label="所属集群" |
| | | width="107" |
| | | ></el-table-column> |
| | | <el-table-column prop="cluster" label="所属集群" width="107"></el-table-column> |
| | | <el-table-column label="状态" width="107"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.status == 1" class="status green">已添加</div> |
| | |
| | | <template slot-scope="scope"> |
| | | <div class="options" v-if="scope"> |
| | | <!-- 添加 --> |
| | | <span class="iconfont option" @click="showPasswordBox = true" |
| | | ></span |
| | | > |
| | | <span class="iconfont option" @click="showPasswordBox = true"></span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <div class="title">申请添加设备</div> |
| | | <div class="des"> |
| | | <span class="iconfont"></span> |
| | | 如设备已加入集群,添加管理后集群下所有设备将在设备管理 |
| | | 页面显示,并支持信息查看及管理。 |
| | | 如设备已加入集群,添加管理后集群下所有设备将在设备管理 页面显示,并支持信息查看及管理。 |
| | | </div> |
| | | <div class="ask">密钥信息请询问设备管理人员</div> |
| | | <el-input v-model="auth_password"></el-input> |
| | |
| | | { |
| | | name: "集群1", |
| | | ip: "192.168.7.45", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | name: "集群1", |
| | | ip: "192.168.7.45", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | name: "集群1", |
| | | ip: "192.168.7.45", |
| | | status: "0", |
| | | status: "0" |
| | | }, |
| | | { |
| | | name: "集群1", |
| | | ip: "192.168.7.45", |
| | | status: "0", |
| | | }, |
| | | status: "0" |
| | | } |
| | | ], |
| | | equipmentList: [ |
| | | { |
| | |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | }, |
| | | status: "1" |
| | | } |
| | | ], |
| | | overList: [ |
| | | { |
| | |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | status: "1" |
| | | }, |
| | | { |
| | | id: "BJS23123132", |
| | | name: "服务器20.10", |
| | | ip: "192.168.7.45", |
| | | cluster: "集群1", |
| | | status: "1", |
| | | }, |
| | | status: "1" |
| | | } |
| | | ], |
| | | auth_password: "", //授权秘钥 |
| | | }; |
| | | auth_password: "" //授权秘钥 |
| | | } |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit("close"); |
| | | this.$emit("close") |
| | | }, |
| | | showChildrenLIst(index) { |
| | | if (this.showClusterChild === index) { |
| | | this.showClusterChild = null; |
| | | return; |
| | | this.showClusterChild = null |
| | | return |
| | | } else if (!index) { |
| | | this.showClusterChild = index; |
| | | this.showClusterChild = index |
| | | } |
| | | this.showClusterChild = null; |
| | | this.showClusterChild = null |
| | | setTimeout(() => { |
| | | this.showClusterChild = index; |
| | | }, 400); |
| | | }, |
| | | }, |
| | | }; |
| | | this.showClusterChild = index |
| | | }, 400) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | </el-button-group> |
| | | </div> --> |
| | | |
| | | <div |
| | | class="row" |
| | | v-if="data.productBaseDetail && data.productBaseDetail.hasModulePrice" |
| | | > |
| | | <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasModulePrice"> |
| | | <div class="label">配置模块</div> |
| | | <div class="check-component"> |
| | | <div class="check-list"> |
| | |
| | | |
| | | <div class="row" v-if="data.productType == 5"> |
| | | <div class="label">请求码</div> |
| | | <el-input |
| | | type="textarea" |
| | | autosize |
| | | placeholder="请输入请求码" |
| | | v-model="cartItem.requestCode" |
| | | > |
| | | </el-input> |
| | | <el-input type="textarea" autosize placeholder="请输入请求码" v-model="cartItem.requestCode"> </el-input> |
| | | </div> |
| | | |
| | | <div |
| | | class="row" |
| | | v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice" |
| | | > |
| | | <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice"> |
| | | <div class="label">通道数量</div> |
| | | <el-input-number |
| | | v-model="cartItem.chCount" |
| | |
| | | <span class="desText">最大支持16路</span> |
| | | </div> |
| | | |
| | | <div |
| | | class="row" |
| | | v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice" |
| | | > |
| | | <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice"> |
| | | <div class="label">授权数量</div> |
| | | <el-input-number |
| | | v-model="cartItem.authCount" |
| | |
| | | class="row" |
| | | v-if=" |
| | | data.productBaseDetail && |
| | | data.productBaseDetail.hasPriceBase && |
| | | data.productType != 5 && |
| | | !isSmartCalDot && |
| | | cartItem.sdks.length > 0 |
| | | data.productBaseDetail.hasPriceBase && |
| | | data.productType != 5 && |
| | | !isSmartCalDot && |
| | | cartItem.sdks.length > 0 |
| | | " |
| | | > |
| | | <div class="label">配置算法</div> |
| | |
| | | {{ item.sdkName }} |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="checked-list" |
| | | v-if="data.productType != 3 && data.productType != 4" |
| | | > |
| | | <div class="checked-list" v-if="data.productType != 3 && data.productType != 4"> |
| | | <div class="label">已选</div> |
| | | <div class="list"> |
| | | <div |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="row" |
| | | v-if=" |
| | | data.productType != 2 && |
| | | data.productType != 1 && |
| | | data.productType != 5 |
| | | " |
| | | > |
| | | <div class="row" v-if="data.productType != 2 && data.productType != 1 && data.productType != 5"> |
| | | <div class="label">芯片架构</div> |
| | | <el-select |
| | | v-model="cartItem.targetPlatform" |
| | |
| | | " |
| | | > |
| | | <el-option |
| | | v-for="item in data.productBaseDetail && |
| | | data.productBaseDetail.platforms" |
| | | v-for="item in data.productBaseDetail && data.productBaseDetail.platforms" |
| | | style="font-size: 12px" |
| | | :key="item.id" |
| | | :label="item.id" |
| | |
| | | class="row" |
| | | v-if=" |
| | | data.productType != 2 && |
| | | data.productType != 1 && |
| | | data.productType != 5 && |
| | | data.productType == 3 && |
| | | (cartItem.targetPlatform.includes('x86') || |
| | | cartItem.targetPlatform.includes('X86')) |
| | | data.productType != 1 && |
| | | data.productType != 5 && |
| | | data.productType == 3 && |
| | | (cartItem.targetPlatform.includes('x86') || cartItem.targetPlatform.includes('X86')) |
| | | " |
| | | > |
| | | <div class="label">显卡型号</div> |
| | |
| | | placeholder="请选择显卡型号" |
| | | > |
| | | <el-option |
| | | v-for="item in data.productBaseDetail && |
| | | data.productBaseDetail.vGpus" |
| | | v-for="item in data.productBaseDetail && data.productBaseDetail.vGpus" |
| | | style="font-size: 12px" |
| | | :key="item.id" |
| | | :label="item.id" |
| | |
| | | </el-select> |
| | | </div> |
| | | |
| | | <div |
| | | class="row" |
| | | v-if=" |
| | | data.productType != 2 && |
| | | data.productType != 1 && |
| | | data.productType != 5 |
| | | " |
| | | > |
| | | <div class="row" v-if="data.productType != 2 && data.productType != 1 && data.productType != 5"> |
| | | <div class="label">设备ID</div> |
| | | |
| | | <!-- :multiple-limit="cartItem.devCount" --> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <ConfirmOrder |
| | | v-if="showOrder" |
| | | :orderId="orderId" |
| | | @close="showOrder = false" |
| | | ></ConfirmOrder> |
| | | <ConfirmOrder v-if="showOrder" :orderId="orderId" @close="showOrder = false"></ConfirmOrder> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { findDevListByUser } from "@/api/device"; |
| | | import { getReleaseProduct } from "@/api/product"; |
| | | import { resumeOrder } from "@/api/shopcart"; |
| | | import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder"; |
| | | import { resumePay } from "@/api/order"; |
| | | import { findDevListByUser } from "@/api/device" |
| | | import { getReleaseProduct } from "@/api/product" |
| | | import { resumeOrder } from "@/api/shopcart" |
| | | import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder" |
| | | import { resumePay } from "@/api/order" |
| | | |
| | | export default { |
| | | props: { |
| | | dataInfo: {}, |
| | | dataInfo: {} |
| | | }, |
| | | components: { |
| | | ConfirmOrder, |
| | | ConfirmOrder |
| | | }, |
| | | created() { |
| | | this.data = this.dataInfo.data; |
| | | this.labels = this.dataInfo.labels; |
| | | this.cartItem.id = this.data.id; |
| | | this.getDevList(); |
| | | this.data = this.dataInfo.data |
| | | this.labels = this.dataInfo.labels |
| | | this.cartItem.id = this.data.id |
| | | this.getDevList() |
| | | if (this.dataInfo.data.pics.length > 0) { |
| | | this.activeImg.url = this.dataInfo.data.pics[0].url; |
| | | this.activeImg.url = this.dataInfo.data.pics[0].url |
| | | } |
| | | this.getInfo(); |
| | | this.getInfo() |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | timeLength: 1, |
| | | totalPrice: 0, |
| | | isAdded: false, |
| | | requestCode: "", |
| | | requestCode: "" |
| | | }, |
| | | timeLength: 1, |
| | | isSmartCalDot: false, |
| | |
| | | baseProductList: [], |
| | | activeImg: { |
| | | index: 0, |
| | | url: "", |
| | | url: "" |
| | | }, |
| | | showOrder: false, |
| | | orderId: "", |
| | | }; |
| | | orderId: "" |
| | | } |
| | | }, |
| | | computed: { |
| | | totalMoney() { |
| | | let modulesPrice = 0; |
| | | let modulesPrice = 0 |
| | | this.cartItem.moduleIds.forEach((id) => { |
| | | this.data.modulePriceSet.forEach((module) => { |
| | | if (module.moduleId === id) { |
| | | modulesPrice += module.modulePrice; |
| | | modulesPrice += module.modulePrice |
| | | } |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | |
| | | let priceSingle = |
| | | this.data.priceBase + |
| | | this.data.authPrice * this.cartItem.authCount + |
| | | this.data.chUnitPrice * this.cartItem.chCount + |
| | | modulesPrice; |
| | | modulesPrice |
| | | |
| | | console.log(this.data); |
| | | console.log(this.data) |
| | | |
| | | return priceSingle * this.cartItem.devCount * this.cartItem.timeLength; |
| | | }, |
| | | return priceSingle * this.cartItem.devCount * this.cartItem.timeLength |
| | | } |
| | | }, |
| | | methods: { |
| | | getInfo() { |
| | | getReleaseProduct({ productType: this.data.productType }) |
| | | .then((res) => { |
| | | this.cartItem.id = this.data.id; |
| | | this.cartItem.productName = this.data.productName; |
| | | this.cartItem.authCount = 0; |
| | | this.cartItem.chCount = 0; |
| | | this.cartItem.devCount = 1; |
| | | this.cartItem.timeLength = 1; |
| | | this.cartItem.priceBase = this.data.priceBase; |
| | | this.cartItem.authPrice = this.data.authPrice; |
| | | this.cartItem.chUnitPrice = this.data.chUnitPrice; |
| | | this.cartItem.targetPlatform = ""; |
| | | this.cartItem.devIdList = []; |
| | | this.cartItem.totalPrice = 0; |
| | | this.cartItem.isAdded = false; |
| | | this.cartItem.modules = []; |
| | | this.cartItem.sdks = []; |
| | | this.cartItem.moduleIds = []; |
| | | this.cartItem.sdkIds = []; |
| | | this.cartItem.hasAuthPrice = false; |
| | | this.cartItem.hasChUnitPrice = false; |
| | | this.baseProductList = res.data.menus; |
| | | this.cartItem.id = this.data.id |
| | | this.cartItem.productName = this.data.productName |
| | | this.cartItem.authCount = 0 |
| | | this.cartItem.chCount = 0 |
| | | this.cartItem.devCount = 1 |
| | | this.cartItem.timeLength = 1 |
| | | this.cartItem.priceBase = this.data.priceBase |
| | | this.cartItem.authPrice = this.data.authPrice |
| | | this.cartItem.chUnitPrice = this.data.chUnitPrice |
| | | this.cartItem.targetPlatform = "" |
| | | this.cartItem.devIdList = [] |
| | | this.cartItem.totalPrice = 0 |
| | | this.cartItem.isAdded = false |
| | | this.cartItem.modules = [] |
| | | this.cartItem.sdks = [] |
| | | this.cartItem.moduleIds = [] |
| | | this.cartItem.sdkIds = [] |
| | | this.cartItem.hasAuthPrice = false |
| | | this.cartItem.hasChUnitPrice = false |
| | | this.baseProductList = res.data.menus |
| | | |
| | | let curProdObj = this.baseProductList.find( |
| | | (item) => item.id === this.data.id |
| | | ); |
| | | if (!curProdObj) return; |
| | | this.cartItem.hasAuthPrice = this.data.hasAuthPrice = |
| | | curProdObj && curProdObj.hasAuthPrice; |
| | | let curProdObj = this.baseProductList.find((item) => item.id === this.data.id) |
| | | if (!curProdObj) return |
| | | this.cartItem.hasAuthPrice = this.data.hasAuthPrice = curProdObj && curProdObj.hasAuthPrice |
| | | if (curProdObj.hasAuthPrice) { |
| | | this.cartItem.authCount = 1; |
| | | this.cartItem.authCount = 1 |
| | | } |
| | | this.cartItem.hasChUnitPrice = this.data.hasChUnitPrice = |
| | | curProdObj && curProdObj.hasChUnitPrice; |
| | | this.cartItem.hasChUnitPrice = this.data.hasChUnitPrice = curProdObj && curProdObj.hasChUnitPrice |
| | | if (curProdObj.hasChUnitPrice) { |
| | | this.cartItem.chCount = 1; |
| | | this.cartItem.chCount = 1 |
| | | } |
| | | |
| | | this.isSmartCalDot = |
| | | this.data.productBaseDetail.name == "智能计算节点"; |
| | | this.isSmartCalDot = this.data.productBaseDetail.name == "智能计算节点" |
| | | this.cartItem.modules = |
| | | curProdObj.modules && |
| | | curProdObj.modules.map((item) => ({ |
| | | id: item.id, |
| | | moduleName: item.moduleName, |
| | | modulePrice: this.data.modulePriceSet.find( |
| | | (obj) => obj.moduleId === item.id |
| | | ).modulePrice, |
| | | selected: this.isSmartCalDot, |
| | | })); |
| | | modulePrice: this.data.modulePriceSet.find((obj) => obj.moduleId === item.id).modulePrice, |
| | | selected: this.isSmartCalDot |
| | | })) |
| | | |
| | | this.cartItem.sdks = |
| | | curProdObj.sdks && |
| | | curProdObj.sdks.map((item) => ({ |
| | | id: item.id, |
| | | sdkName: item.sdkName, |
| | | selected: this.data.productType == 3 ? true : false, |
| | | })); |
| | | selected: this.data.productType == 3 ? true : false |
| | | })) |
| | | this.cartItem.sdks.forEach((sdk) => { |
| | | if (sdk.selected) { |
| | | this.cartItem.sdkIds.push(sdk.id); |
| | | this.cartItem.sdkIds.push(sdk.id) |
| | | } |
| | | }); |
| | | }) |
| | | }) |
| | | .catch((err) => { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: err, |
| | | duration: 2500, |
| | | offset: 57, |
| | | }); |
| | | }); |
| | | offset: 57 |
| | | }) |
| | | }) |
| | | }, |
| | | selectYear(year) { |
| | | this.timeLength = year; |
| | | this.cartItem.timeLength = year; |
| | | this.timeLength = year |
| | | this.cartItem.timeLength = year |
| | | }, |
| | | selectModel(index) { |
| | | if (this.isSmartCalDot) { |
| | | return; |
| | | return |
| | | } |
| | | this.cartItem.modules[index].selected = |
| | | !this.cartItem.modules[index].selected; |
| | | this.cartItem.modules[index].selected = !this.cartItem.modules[index].selected |
| | | this.cartItem.modules.forEach((item) => { |
| | | if (item.selected && this.cartItem.moduleIds.indexOf(item.id) < 0) { |
| | | this.cartItem.moduleIds.push(item.id); |
| | | this.cartItem.moduleIds.push(item.id) |
| | | } |
| | | if (!item.selected && this.cartItem.moduleIds.indexOf(item.id) >= 0) { |
| | | this.cartItem.moduleIds.splice( |
| | | this.cartItem.moduleIds.indexOf(item.id), |
| | | 1 |
| | | ); |
| | | this.cartItem.moduleIds.splice(this.cartItem.moduleIds.indexOf(item.id), 1) |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | handleChangeCh() { |
| | | if (this.cartItem.authCount < this.cartItem.chCount) { |
| | | this.cartItem.authCount = this.cartItem.chCount; |
| | | this.cartItem.authCount = this.cartItem.chCount |
| | | } |
| | | }, |
| | | selectAlgorithm(index) { |
| | | this.cartItem.sdks[index].selected = !this.cartItem.sdks[index].selected; |
| | | this.cartItem.sdks[index].selected = !this.cartItem.sdks[index].selected |
| | | this.cartItem.sdks.forEach((item) => { |
| | | if (item.selected && this.cartItem.sdkIds.indexOf(item.id) < 0) { |
| | | this.cartItem.sdkIds.push(item.id); |
| | | this.cartItem.sdkIds.push(item.id) |
| | | } |
| | | if (!item.selected && this.cartItem.sdkIds.indexOf(item.id) >= 0) { |
| | | this.cartItem.sdkIds.splice(this.cartItem.sdkIds.indexOf(item.id), 1); |
| | | this.cartItem.sdkIds.splice(this.cartItem.sdkIds.indexOf(item.id), 1) |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | getDevList() { |
| | | findDevListByUser() |
| | | .then((res) => { |
| | | this.devList = res.data.menus; |
| | | this.devList = res.data.menus |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | handleChangeAuth() { |
| | | if (this.cartItem.authCount < this.cartItem.chCount) { |
| | |
| | | type: "warning", |
| | | message: "授权数量不能小于通道数量", |
| | | duration: 2500, |
| | | offset: 57, |
| | | }); |
| | | this.byChecked = false; |
| | | offset: 57 |
| | | }) |
| | | this.byChecked = false |
| | | } else { |
| | | this.byChecked = true; |
| | | this.byChecked = true |
| | | } |
| | | }, |
| | | selectImg(index, url) { |
| | | this.activeImg.index = index; |
| | | this.activeImg.url = url; |
| | | this.activeImg.index = index |
| | | this.activeImg.url = url |
| | | }, |
| | | confirmNow() { |
| | | let products = [ |
| | |
| | | sdkIds: this.cartItem.sdkIds, |
| | | serveYear: this.cartItem.timeLength, |
| | | targetPlatform: this.cartItem.targetPlatform, |
| | | vGpu: this.cartItem.vGpu, |
| | | }, |
| | | ]; |
| | | vGpu: this.cartItem.vGpu |
| | | } |
| | | ] |
| | | resumeOrder({ |
| | | // orderMoney: this.numeral(this.totalMoney).value(), |
| | | orderMoney: 0, |
| | | payMethod: 0, |
| | | products, |
| | | status: 0, |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id, |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | this.orderId = res.data.orderId; |
| | | this.orderId = res.data.orderId |
| | | |
| | | if (this.totalMoney == 0) { |
| | | resumePay({ orderId: this.orderId, payMethod: 5 }).then((res) => { |
| | |
| | | this.$router.push({ |
| | | path: "/personalCenter", |
| | | query: { |
| | | id: 0, |
| | | }, |
| | | }); |
| | | id: 0 |
| | | } |
| | | }) |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "成功试用", |
| | | duration: 2500, |
| | | offset: 57, |
| | | }); |
| | | offset: 57 |
| | | }) |
| | | } |
| | | }); |
| | | return; |
| | | }) |
| | | return |
| | | } else { |
| | | this.showOrder = true; |
| | | this.showOrder = true |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | indicator-position="none" |
| | | :arrow="data.baseInfo.length > 1 ? 'always' : 'never'" |
| | | > |
| | | <el-carousel-item |
| | | v-for="(item, index) in data.baseInfo" |
| | | :key="index" |
| | | > |
| | | <img |
| | | :src="item.targetPicUrl | httpImage" |
| | | class="cursor-pointer" |
| | | @click="detailsClick($event)" |
| | | /> |
| | | <el-carousel-item v-for="(item, index) in data.baseInfo" :key="index"> |
| | | <img :src="item.targetPicUrl | httpImage" class="cursor-pointer" @click="detailsClick($event)" /> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | </div> |
| | |
| | | class="s-card-left-isCompare-div compareScore111" |
| | | :style="{ |
| | | bottom: '0', |
| | | background: getUrl( |
| | | data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType |
| | | ), |
| | | background: getUrl(data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType) |
| | | }" |
| | | > |
| | | <b>{{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].compareScore | percentage |
| | | }}</b> |
| | | <b>{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].compareScore | percentage }}</b> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | :autoplay="false" |
| | | @change="changeCarousel" |
| | | > |
| | | <el-carousel-item |
| | | v-for="(item, index) in data.picMaxUrl" |
| | | :key="index + 'img'" |
| | | > |
| | | <img |
| | | :src="item | httpImage" |
| | | class="cursor-pointer" |
| | | @click="detailsClick($event)" |
| | | /> |
| | | <el-carousel-item v-for="(item, index) in data.picMaxUrl" :key="index + 'img'"> |
| | | <img :src="item | httpImage" class="cursor-pointer" @click="detailsClick($event)" /> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | <!-- 暂时认为只有人脸抓拍的报警, 首页显示小图, 其他时间均显示大图 --> |
| | | <img |
| | | v-else-if=" |
| | | data.targetInfo == null || |
| | | data.targetInfo[0].targetType !== 'FaceDetect' |
| | | " |
| | | v-else-if="data.targetInfo == null || data.targetInfo[0].targetType !== 'FaceDetect'" |
| | | :src="data.picMaxUrl[0] | httpImage" |
| | | class="cursor-pointer" |
| | | @click="detailsClick($event)" |
| | |
| | | /> |
| | | </div> |
| | | <div class="s-card-left-box" v-else> |
| | | <img |
| | | :src="data.baseInfo[0].targetPicUrl | httpImage" |
| | | class="cursor-pointer" |
| | | /> |
| | | <img :src="data.baseInfo[0].targetPicUrl | httpImage" class="cursor-pointer" /> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | @mouseleave="cardMouseleave($event)" |
| | | > |
| | | <p> |
| | | <span class="fontStyle color222">{{ |
| | | data.picDate | formatTime |
| | | }}</span> |
| | | <span class="fontStyle color222">{{ data.picDate | formatTime }}</span> |
| | | </p> |
| | | <p style="margin-bottom: 8px"> |
| | | <span class="fontStyle color222">{{ data.cameraAddr }}</span> |
| | |
| | | <div slot="content"> |
| | | <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'"> |
| | | <span>{{ data.taskName }}</span |
| | | > |
| | | <span v-if="item.alarmLevel !== '撤防'" |
| | | > {{ item.alarmLevel }}</span |
| | | > <span v-if="item.alarmLevel !== '撤防'"> {{ item.alarmLevel }}</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'"> 联动任务</span> |
| | | </p> |
| | |
| | | > |
| | | <span class="fontStyle color666">{{ data.taskName }}</span |
| | | > |
| | | <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'" |
| | | > {{ item.alarmLevel }}</span |
| | | <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'"> {{ item.alarmLevel }}</span |
| | | > |
| | | <span |
| | | class="fontStyle color666" |
| | | v-if="item.linkInfo == '联动任务'" |
| | | > 联动任务</span |
| | | > |
| | | <span class="fontStyle color666" v-if="item.linkInfo == '联动任务'"> 联动任务</span> |
| | | <span v-if="index < data.alarmRules.length - 1">/ </span> |
| | | </span> |
| | | </el-button> |
| | |
| | | <el-tooltip placement="right" popper-class="atooltip"> |
| | | <div slot="content"> |
| | | <p> |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].tableName |
| | | " |
| | | >{{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].tableName |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName">{{ |
| | | data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName |
| | | }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].targetName |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].targetName |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].labels |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].labels | idCard |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels | idCard }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].monitorLevel |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].monitorLevel |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel }}</span |
| | | > |
| | | </p> |
| | | </div> |
| | |
| | | > |
| | | <span |
| | | :style=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].bwType === '1' |
| | | data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType === '1' |
| | | ? 'color: red;font-size:12px;line-height:20px' |
| | | : 'font-size:12px;line-height:20px' |
| | | " |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].tableName |
| | | " |
| | | >{{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].tableName |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName">{{ |
| | | data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName |
| | | }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].targetName |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].targetName |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].labels |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].labels | idCard |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels | idCard }}</span |
| | | > |
| | | <span |
| | | class="fontStyle" |
| | | v-if=" |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].monitorLevel |
| | | " |
| | | >/ {{ |
| | | data.baseInfo[initialIndex] && |
| | | data.baseInfo[initialIndex].monitorLevel |
| | | }}</span |
| | | <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel" |
| | | >/ {{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel }}</span |
| | | > |
| | | </span> |
| | | </el-button> |
| | |
| | | <p :style="data.baseInfo[0].bwType == '0' ? '' : 'color:red'"> |
| | | <span>{{ data.baseInfo[0] && data.baseInfo[0].targetName }}</span |
| | | > |
| | | <span v-if="data.baseInfo[0].labels" |
| | | >/ {{ data.baseInfo[0].labels | idCard }}</span |
| | | > |
| | | <span v-if="data.baseInfo[0].labels">/ {{ data.baseInfo[0].labels | idCard }}</span> |
| | | </p> |
| | | </div> |
| | | <div class="card-icon-box"> |
| | | <el-tooltip |
| | | content="查找此人" |
| | | placement="top" |
| | | popper-class="atooltip" |
| | | style="margin-left: 10px" |
| | | > |
| | | <i |
| | | class="iconfont iconsousuoren" |
| | | @click="tosearch(data)" |
| | | title="查找此人" |
| | | ></i> |
| | | <el-tooltip content="查找此人" placement="top" popper-class="atooltip" style="margin-left: 10px"> |
| | | <i class="iconfont iconsousuoren" @click="tosearch(data)" title="查找此人"></i> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | <!-- 没有底库 16:9图片 最正常的yolo抓拍 无人值守 正常yolo抓拍没有小图--> |
| | | <div |
| | | v-else-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''" |
| | | class="s-card-right-signal" |
| | | > |
| | | <div v-else-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''" class="s-card-right-signal"> |
| | | <div |
| | | class="signal-img-dev" |
| | | :style="overflowState ? 'overflow: hidden' : 'overflow: auto'" |
| | |
| | | @mouseleave="cardMouseleave($event)" |
| | | > |
| | | <p :title="data.picDate"> |
| | | <span class="fontStyle color222">{{ |
| | | data.picDate | formatTime |
| | | }}</span> |
| | | <span class="fontStyle color222">{{ data.picDate | formatTime }}</span> |
| | | </p> |
| | | <p :title="data.cameraAddr" style="margin-bottom: 8px"> |
| | | <span class="fontStyle color222">{{ data.cameraAddr }}</span> |
| | |
| | | <div slot="content"> |
| | | <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'"> |
| | | <span>{{ data.taskName }}</span |
| | | > |
| | | <span v-if="item.alarmLevel !== '撤防'">{{ |
| | | item.alarmLevel |
| | | }}</span |
| | | > <span v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'"> 联动任务</span> |
| | | </p> |
| | |
| | | > |
| | | <span class="fontStyle color666">{{ data.taskName }}</span |
| | | > |
| | | <span |
| | | class="fontStyle color666" |
| | | v-if="item.alarmLevel !== '撤防'" |
| | | >{{ item.alarmLevel }}</span |
| | | <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span |
| | | > |
| | | <span |
| | | class="fontStyle color666" |
| | | v-if="item.linkInfo == '联动任务'" |
| | | > 联动任务</span |
| | | > |
| | | <span class="fontStyle color666" v-if="item.linkInfo == '联动任务'"> 联动任务</span> |
| | | <span v-if="index < data.alarmRules.length - 1">/ </span> |
| | | </span> |
| | | </el-button> |
| | |
| | | <div class="right-bottom"> |
| | | <div v-if="!data.id" class="card-icon-box"> |
| | | <!-- <i class="iconfont systemxing ml50" title="收藏" ></i> --> |
| | | <el-tooltip |
| | | content="查找此人" |
| | | placement="top" |
| | | popper-class="atooltip" |
| | | > |
| | | <el-tooltip content="查找此人" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont iconsousuoren ml50" @click="tosearch(data)"></i> |
| | | </el-tooltip> |
| | | </div> |
| | | <div |
| | | v-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''" |
| | | class="card-icon-box" |
| | | > |
| | | <div v-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''" class="card-icon-box"> |
| | | <el-tooltip content="详情" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont iconcaidan" @click="detailsClick($event)"></i> |
| | | </el-tooltip> |
| | |
| | | <el-tooltip content="详情" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont iconcaidan" @click="detailsClick($event)"></i> |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | content="查找此人" |
| | | placement="top" |
| | | popper-class="atooltip" |
| | | > |
| | | <el-tooltip content="查找此人" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont iconsousuoren" @click="tosearch(data)"></i> |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | content="加入底库" |
| | | placement="top" |
| | | popper-class="atooltip" |
| | | > |
| | | <el-tooltip content="加入底库" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont icontianjiaren" @click="toAdd(data)"></i> |
| | | </el-tooltip> |
| | | <!-- <el-tooltip content="收藏" placement="top" popper-class="atooltip"> |
| | |
| | | </div> |
| | | |
| | | <!-- 没有底库,非比对,普通模式 一定有targetInfo,并且targetInfo个数为1--> |
| | | <div |
| | | v-else-if="data.targetInfo !== null && data.targetInfo[0].picSmUrl !== ''" |
| | | class="s-card-right-signal" |
| | | > |
| | | <div v-else-if="data.targetInfo !== null && data.targetInfo[0].picSmUrl !== ''" class="s-card-right-signal"> |
| | | <div |
| | | class="signal-img-dev" |
| | | :style="overflowState ? 'overflow: hidden' : 'overflow: auto'" |
| | |
| | | <span v-else>{{ data.baseInfo[0].compareScore | percentage }}</span> |
| | | </p> |
| | | <p :title="data.picDate"> |
| | | <span class="fontStyle color222">{{ |
| | | data.picDate | formatTime |
| | | }}</span> |
| | | <span class="fontStyle color222">{{ data.picDate | formatTime }}</span> |
| | | </p> |
| | | <p :title="data.cameraAddr" style="margin-bottom: 8px"> |
| | | <span class="fontStyle color222">{{ data.cameraAddr }}</span> |
| | | </p> |
| | | <el-tooltip |
| | | placement="right" |
| | | popper-class="atooltip" |
| | | v-if="!VideoPhotoData.uploadType" |
| | | > |
| | | <el-tooltip placement="right" popper-class="atooltip" v-if="!VideoPhotoData.uploadType"> |
| | | <div slot="content"> |
| | | <p v-for="(item, index) in data.alarmRules" :key="index + 'rule2'"> |
| | | <span class="fontStyle">{{ data.taskName }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.alarmLevel !== '撤防'">{{ |
| | | item.alarmLevel |
| | | }}</span |
| | | > <span class="fontStyle" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'" class="fontStyle" |
| | | > 联动任务</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'" class="fontStyle"> 联动任务</span> |
| | | <span v-if="index < data.alarmRules.length - 1">/ </span> |
| | | </p> |
| | | </div> |
| | |
| | | text-align: left; |
| | | " |
| | | > |
| | | <span |
| | | v-for="(item, index) in data.alarmRules" |
| | | :key="index + 'rule3'" |
| | | > |
| | | <span v-for="(item, index) in data.alarmRules" :key="index + 'rule3'"> |
| | | <span class="fontStyle color666">{{ data.taskName }}</span |
| | | > |
| | | <span |
| | | class="fontStyle color666" |
| | | v-if="item.alarmLevel !== '撤防'" |
| | | >{{ item.alarmLevel }}</span |
| | | <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span |
| | | > |
| | | <span |
| | | v-if="item.linkInfo == '联动任务'" |
| | | class="fontStyle color666" |
| | | > 联动任务</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'" class="fontStyle color666"> 联动任务</span> |
| | | <span v-if="index < data.alarmRules.length - 1">/ </span> |
| | | </span> |
| | | </el-button> |
| | |
| | | <div slot="content"> |
| | | <p v-for="(item, index) in data.baseInfo" :key="index + 'base1'"> |
| | | <span class="fontStyle">{{ item.tableName }}</span |
| | | > <span class="fontStyle" v-if="item.targetName.length">/ {{ item.targetName }}</span |
| | | > <span class="fontStyle" v-if="item.labels.length">/ {{ item.labels | idCard }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.targetName.length" |
| | | >/ {{ item.targetName }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length" |
| | | >/ {{ item.labels | idCard }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length" |
| | | >/ {{ item.labels | sex }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length">/ {{ item.labels | sex }}</span> |
| | | </p> |
| | | </div> |
| | | <el-button |
| | |
| | | v-for="(item, index) in data.baseInfo" |
| | | :key="index + 'base'" |
| | | :style=" |
| | | item.bwType == '1' |
| | | ? 'color:red;font-size:12px;line-height:20px' |
| | | : 'font-size:12px;line-height:20px' |
| | | item.bwType == '1' ? 'color:red;font-size:12px;line-height:20px' : 'font-size:12px;line-height:20px' |
| | | " |
| | | > |
| | | <span class="fontStyle">{{ item.tableName }}</span |
| | | > <span class="fontStyle" v-if="item.targetName.length">/ {{ item.targetName }}</span |
| | | > <span class="fontStyle" v-if="item.labels.length">/ {{ item.labels | idCard }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.targetName.length" |
| | | >/ {{ item.targetName }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length" |
| | | >/ {{ item.labels | idCard }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length" |
| | | >/ {{ item.labels | sex }}</span |
| | | > |
| | | <span class="fontStyle" v-if="item.labels.length">/ {{ item.labels | sex }}</span> |
| | | </span> |
| | | </el-button> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip |
| | | placement="right" |
| | | popper-class="atooltip" |
| | | v-if="data.baseInfo == null" |
| | | style="margin-top: 5px" |
| | | > |
| | | <el-tooltip placement="right" popper-class="atooltip" v-if="data.baseInfo == null" style="margin-top: 5px"> |
| | | <div slot="content"> |
| | | <span :style="'color:red;font-size:14px;line-height:20px'">{{ |
| | | data.showLabels |
| | | }}</span> |
| | | <span :style="'color:red;font-size:14px;line-height:20px'">{{ data.showLabels }}</span> |
| | | </div> |
| | | <el-button |
| | | style=" |
| | |
| | | text-align: left; |
| | | " |
| | | > |
| | | <span :style="'color:red;font-size:14px;line-height:20px'">{{ |
| | | data.showLabels |
| | | }}</span> |
| | | <span :style="'color:red;font-size:14px;line-height:20px'">{{ data.showLabels }}</span> |
| | | </el-button> |
| | | </el-tooltip> |
| | | </div> |
| | |
| | | <div v-if="!data.id" class="card-icon-box"> |
| | | <!-- 底库人员 --> |
| | | <!-- <i class="iconfont systemxing ml50" title="收藏" ></i> --> |
| | | <el-tooltip |
| | | content="查找此人" |
| | | placement="top" |
| | | popper-class="atooltip" |
| | | > |
| | | <el-tooltip content="查找此人" placement="top" popper-class="atooltip"> |
| | | <i class="iconfont iconsousuoren ml50" @click="tosearch(data)"></i> |
| | | </el-tooltip> |
| | | </div> |
| | |
| | | > |
| | | <div> |
| | | <p :title="data.picDate"> |
| | | <span class="fontStyle color222">{{ |
| | | data.picDate | formatTime |
| | | }}</span> |
| | | <span class="fontStyle color222">{{ data.picDate | formatTime }}</span> |
| | | </p> |
| | | <p :title="data.cameraAddr" style="margin-bottom: 8px"> |
| | | <span class="fontStyle color222">{{ data.cameraAddr }}</span> |
| | | </p> |
| | | <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'"> |
| | | <span class="fontStyle color666">{{ data.taskName }}</span |
| | | > / <span class="fontStyle color666">{{ item.alarmLevel }}</span |
| | | > / |
| | | <span class="fontStyle color666">{{ item.alarmLevel }}</span |
| | | > / |
| | | <span |
| | | v-if="item.linkInfo == '联动任务'" |
| | | class="fontStyle color666" |
| | | >联动任务</span |
| | | > |
| | | <span v-if="item.linkInfo == '联动任务'" class="fontStyle color666">联动任务</span> |
| | | <span v-if="index < data.alarmRules.length - 1">/ </span> |
| | | </p> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | Date.prototype.Format = function (fmt) { |
| | | Date.prototype.Format = function(fmt) { |
| | | var o = { |
| | | "M+": this.getMonth() + 1, //月份 |
| | | "d+": this.getDate(), //日 |
| | |
| | | "m+": this.getMinutes(), //分 |
| | | "s+": this.getSeconds(), //秒 |
| | | "q+": Math.floor((this.getMonth() + 3) / 3), //季度 |
| | | S: this.getMilliseconds(), //毫秒 |
| | | }; |
| | | if (/(y+)/.test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | (this.getFullYear() + "").substr(4 - RegExp.$1.length) |
| | | ); |
| | | S: this.getMilliseconds() //毫秒 |
| | | } |
| | | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)) |
| | | for (var k in o) |
| | | if (new RegExp("(" + k + ")").test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length) |
| | | ); |
| | | return fmt; |
| | | }; |
| | | fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)) |
| | | return fmt |
| | | } |
| | | |
| | | export default { |
| | | mounted() { |
| | | //window.addEventListener("resize", this.watchWindow); |
| | | window.addEventListener("resize", this.getBottom); |
| | | window.addEventListener("resize", this.getBottom) |
| | | }, |
| | | props: { |
| | | data: { |
| | | type: Object, |
| | | default: null, |
| | | default: null |
| | | }, |
| | | showType: { |
| | | type: String, |
| | | default: "search", |
| | | default: "search" |
| | | }, |
| | | fromCluster: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | searchT: {}, |
| | | searchT: {} |
| | | }, |
| | | computed: { |
| | | isId() { |
| | | return this.data.id; |
| | | }, |
| | | return this.data.id |
| | | } |
| | | }, |
| | | filters: { |
| | | formatTime(t) { |
| | | return new Date(t).Format("yyyy-MM-dd HH:mm:ss"); |
| | | return new Date(t).Format("yyyy-MM-dd HH:mm:ss") |
| | | }, |
| | | percentage(score) { |
| | | return score.toFixed(2) + "%"; |
| | | return score.toFixed(2) + "%" |
| | | }, |
| | | idCard(v) { |
| | | try { |
| | | let obj = JSON.parse(v); |
| | | return obj.idCard; |
| | | let obj = JSON.parse(v) |
| | | return obj.idCard |
| | | } catch (error) { |
| | | return v.split("/")[1]; |
| | | return v.split("/")[1] |
| | | } |
| | | }, |
| | | sex(v) { |
| | | try { |
| | | let obj = JSON.parse(v); |
| | | return obj.sex; |
| | | let obj = JSON.parse(v) |
| | | return obj.sex |
| | | } catch (error) { |
| | | return v.split("/")[0]; |
| | | return v.split("/")[0] |
| | | } |
| | | }, |
| | | httpImage(url) { |
| | | if (!url.length) { |
| | | return ""; |
| | | return "" |
| | | } |
| | | return ( |
| | | "/httpImage/" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160" |
| | | ); |
| | | }, |
| | | return "/httpImage/" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160" |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | initialIndex: 0, |
| | | carouselIndex: 0, |
| | | dialogVisible: false, |
| | | overflowState: true, |
| | | }; |
| | | overflowState: true |
| | | } |
| | | }, |
| | | watch: { |
| | | data: { |
| | | handler() { |
| | | this.$forceUpdate(); |
| | | this.$forceUpdate() |
| | | }, |
| | | deep: true, |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | getBottom() { |
| | | this.$nextTick(() => { |
| | | let imgDom = this.$refs.firstImg; |
| | | let imgDom = this.$refs.firstImg |
| | | if (imgDom) { |
| | | let num = (imgDom.offsetHeight - imgDom.offsetWidth) / 2; |
| | | return `${num}px`; |
| | | let num = (imgDom.offsetHeight - imgDom.offsetWidth) / 2 |
| | | return `${num}px` |
| | | } |
| | | return `4px`; |
| | | }); |
| | | return `4px` |
| | | }) |
| | | }, |
| | | getUrl(bwtype) { |
| | | if (bwtype == 1) { |
| | | return `url(${require("@/assets/img/red.png")})`; |
| | | return `url(${require("@/assets/img/red.png")})` |
| | | } else { |
| | | return `url(${require("@/assets/img/green.png")})`; |
| | | return `url(${require("@/assets/img/green.png")})` |
| | | } |
| | | }, |
| | | changeInitialIndex(index) { |
| | | this.initialIndex = index; |
| | | this.initialIndex = index |
| | | }, |
| | | cardMouseenter() { |
| | | this.overflowState = false; |
| | | this.overflowState = false |
| | | }, |
| | | cardMouseleave() { |
| | | this.overflowState = true; |
| | | this.overflowState = true |
| | | }, |
| | | changeCarousel(index) { |
| | | this.carouselIndex = index; |
| | | this.carouselIndex = index |
| | | }, |
| | | detailsClick(ev) { |
| | | this.$emit("detailsClick", ev); |
| | | this.$emit("detailsClick", ev) |
| | | }, |
| | | toAdd(item) { |
| | | this.$emit("addToBase", item); |
| | | this.$emit("addToBase", item) |
| | | }, |
| | | tosearch(item) { |
| | | this.searchT; |
| | | let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id; |
| | | let imgUrl = item.targetInfo |
| | | ? item.targetInfo[0].picSmUrl |
| | | : item.baseInfo[0].targetPicUrl; |
| | | let compType = 1; // 数据来自于es |
| | | this.searchT |
| | | let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id |
| | | let imgUrl = item.targetInfo ? item.targetInfo[0].picSmUrl : item.baseInfo[0].targetPicUrl |
| | | let compType = 1 // 数据来自于es |
| | | if (!item.id || item.id == "") { |
| | | compType = 0; // 数据来自于底库 |
| | | compType = 0 // 数据来自于底库 |
| | | } |
| | | let message; |
| | | let message |
| | | if (this.fromCluster) { |
| | | message = |
| | | "toCluster?showType=findByPic&targetId=" + |
| | |
| | | "&start=" + |
| | | this.searchT[0] + |
| | | "&end=" + |
| | | this.searchT[1]; |
| | | this.searchT[1] |
| | | } else { |
| | | message = |
| | | "toSearch?showType=findByPic&targetId=" + |
| | |
| | | "&start=" + |
| | | this.searchT[0] + |
| | | "&end=" + |
| | | this.searchT[1]; |
| | | this.searchT[1] |
| | | } |
| | | window.parent.postMessage( |
| | | { |
| | | msg: message, |
| | | msg: message |
| | | }, |
| | | "*" |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .cursor-pointer { |
| | | cursor: pointer; |
| | | } |
| | | .fontStyle { |
| | | font-family: PingFangSC-Medium; |
| | | } |
| | |
| | | "allowJs": true, |
| | | "sourceMap": true, |
| | | "baseUrl": ".", |
| | | "skipLibCheck": true, |
| | | "types": ["webpack-env"], |
| | | "paths": { |
| | | "@/*": ["src/*"] |
| | | }, |
| | | "lib": ["esnext", "dom", "dom.iterable", "scripthost"] |
| | | }, |
| | | "include": [ |
| | | "src/**/*.ts", |
| | | "src/**/*.tsx", |
| | | "src/**/*.vue", |
| | | "tests/**/*.ts", |
| | | "tests/**/*.tsx" |
| | | , "src/router/index.js" ], |
| | | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "src/router/index.js"], |
| | | "exclude": ["node_modules"] |
| | | } |