| | |
| | | "keywords": [], |
| | | "author": "", |
| | | "license": "ISC" |
| | | } |
| | | } |
| | |
| | | </el-submenu> |
| | | </el-menu> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="集群" name="cluster" :style="`height:${height - 56}px;`" v-if="showCluster"> |
| | | |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | label="集群" |
| | | name="cluster" |
| | | :style="`height:${height - 56}px;`" |
| | | v-if="showCluster" |
| | | ></el-tab-pane> |
| | | <el-tab-pane |
| | | label="数据栈" |
| | | name="dataStack" |
| | |
| | | return true; |
| | | }, |
| | | showCam() { |
| | | return this.appName === "Camera" || this.appName === "Search"; |
| | | debugger |
| | | return this.appName === "Camera" || (this.appName === "Search" && this.buttonAuthority.indexOf("search:camera") >= 0); |
| | | }, |
| | | showCluster() { |
| | | return this.appName === "Cluster" |
| | | return this.appName === "Cluster"; |
| | | }, |
| | | // 数据栈配置必须显示。 检索通过权限控制显示, 未安装数据栈也不显示 |
| | | showDataStack() { |
| | | return this.appName === "DataStack" || this.appName === "Search"; |
| | | if (this.appName === "DataStack") { |
| | | return true; |
| | | } |
| | | |
| | | if (this.appName === "Search") { |
| | | // 未安装数据栈配置 |
| | | if (this.installedApps.indexOf("dataStack") >= 0) { |
| | | if (this.isAdmin) { |
| | | return true; |
| | | } |
| | | |
| | | if (this.buttonAuthority.indexOf("search:stack") >= 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | showLock() { |
| | | return this.edit; |
| | |
| | | dataStack: "videoMonitor:dataStack", |
| | | activeIndexVideo: "", |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | installedApps: sessionStorage.getItem("apps") || [], |
| | | loginName: JSON.parse(sessionStorage.getItem("userInfo")).username || "用户名", |
| | | searchTypeOptions: [ |
| | | { |
| | |
| | | promiseArr.push(createCamera(camera)); |
| | | } |
| | | let _this = this; |
| | | Promise.allSettled(promiseArr).then(res=>{ |
| | | res.forEach(item=>{ |
| | | if(item.status === 'fulfilled'){ |
| | | Promise.allSettled(promiseArr).then(res => { |
| | | res.forEach(item => { |
| | | if (item.status === 'fulfilled') { |
| | | succeed++; |
| | | }else{ |
| | | } else { |
| | | failed++; |
| | | } |
| | | }); |
| | |
| | | message: "操作完成, 导入成功:" + succeed + "个 失败:" + failed + "个" |
| | | }) |
| | | _this.TreeDataPool.fetchTreeData(); |
| | | }).catch(e=>{ |
| | | }).catch(e => { |
| | | console.log(e) |
| | | }); |
| | | |
| | | |
| | | } |
| | | } catch (e) { |
| | | this.menuLoading = false |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | isAdmin () { |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem('userInfo') && |
| | | sessionStorage.getItem('userInfo') !== '' |
| | |
| | | } |
| | | return false |
| | | }, |
| | | isShow () { |
| | | isShow() { |
| | | if (this.isAdmin) { |
| | | return true |
| | | } else if ( |
| | |
| | | </div>
|
| | | </div>
|
| | | <!-- 超级管理员可见 -->
|
| | | <div class="super" v-if="isSuperUser">
|
| | | <div class="super">
|
| | | <div class="left-box">
|
| | | <!-- <div class="title">
|
| | | <label>算法库</label>
|
| | |
| | | <el-tab-pane
|
| | | label="离线升级/安装"
|
| | | name="upgradeOrInstallation"
|
| | | v-show="activeName==='upgradeOrInstallation'"
|
| | | v-if="isShow('algorithmManage:insOffLine')"
|
| | | >
|
| | | <div class="tab-content">
|
| | | <div class="action-bar">
|
| | |
| | | </div>
|
| | | </div>
|
| | | </el-tab-pane>
|
| | | <el-tab-pane label="应用中心" name="algorithmMall" v-show="activeName==='algorithmMall'">
|
| | | <el-tab-pane label="应用中心" name="algorithmMall" v-if=" isShow('algorithmManage:buy')">
|
| | | <div class="tab-content">
|
| | | <p class="src-title">算法软件</p>
|
| | | <div class="store-list flex-list">
|
| | |
| | | FileUploader
|
| | | },
|
| | | computed: {
|
| | | notInstalledList () {
|
| | | notInstalledList() {
|
| | | return this.TaskMange.list1.filter(sdk => {
|
| | | return sdk.installed === false;
|
| | | });
|
| | | },
|
| | | installedList () {
|
| | | installedList() {
|
| | | return this.TaskMange.list1.filter(sdk => {
|
| | | return sdk.installed === true;
|
| | | });
|
| | | },
|
| | | ungradeList () {
|
| | | ungradeList() {
|
| | | // 升级处理会导致重复的key,需要修改
|
| | | return [];
|
| | | return this.TaskMange.list1.filter(sdk => {
|
| | | return sdk.isUpgrade === true;
|
| | | });
|
| | | },
|
| | | isAdmin() {
|
| | | if (
|
| | | sessionStorage.getItem("userInfo") &&
|
| | | sessionStorage.getItem("userInfo") !== ""
|
| | | ) {
|
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
|
| | | return loginName === "superadmin" || loginName === "basic";
|
| | | }
|
| | |
|
| | | return false;
|
| | | },
|
| | | },
|
| | | data () {
|
| | | data() {
|
| | | return {
|
| | | TaskMange: new TaskManage,
|
| | | VideoManageData: new VideoManageData,
|
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [],
|
| | | activeName: "myAlgorithm",
|
| | | patchUpdateStatus: "",
|
| | | dragging: false,
|
| | |
| | | },
|
| | | watch: {
|
| | | list2: {
|
| | | handler (newVal, oldVal) {
|
| | | handler(newVal, oldVal) {
|
| | | // window.console.log(newVal, oldVal, '监听list2')
|
| | | if (newVal !== oldVal) {
|
| | | // window.console.log(newVal, '监听list2')
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | mounted () {
|
| | | mounted() {
|
| | | this.getAllApps();
|
| | | this.findAllSdk();
|
| | | this.findByType();
|
| | | this.getBaseList();
|
| | | this.findAll();
|
| | | this.getUser();
|
| | | this.getUnActivedList();
|
| | | this.getUnActivedAppList();
|
| | | // this.TaskMange.findAllSdk();
|
| | |
| | | this.VideoManageData.init();
|
| | | },
|
| | | methods: {
|
| | | offlineInstall () {
|
| | | isShow(authority) {
|
| | | return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1
|
| | | },
|
| | | offlineInstall() {
|
| | | this.installDialogVisible = false;
|
| | | this.isInstall = true;
|
| | | //安装
|
| | |
| | | });
|
| | | })
|
| | | },
|
| | | downloadApp (app) {
|
| | | downloadApp(app) {
|
| | | app.installLoading = true;
|
| | | let _this = this;
|
| | | installApp({ path: app.id }).then(res => {
|
| | |
| | | }
|
| | | })
|
| | | },
|
| | | getAllApps () {
|
| | | getAllApps() {
|
| | | let _this = this;
|
| | | _this.installedApps = [];
|
| | | _this.storeApps = [];
|
| | |
| | | })
|
| | | },
|
| | | //卸载应用
|
| | | unLoad (app) {
|
| | | unLoad(app) {
|
| | | app.unloadLoading = true;
|
| | | let _this = this;
|
| | | removeApp({ appId: app.id }).then(res => {
|
| | |
| | | // this.activeCode = '';
|
| | | // this.activedSdkOrApp = this.newActInfo()
|
| | | // },
|
| | | actSdkOrApp (id, type = 'sdk') {
|
| | | actSdkOrApp(id, type = 'sdk') {
|
| | | this.actType = type;
|
| | | this.actId = id;
|
| | | this.actDrawerShow = true;
|
| | |
| | | this.activeCode = '';
|
| | | this.activedSdkOrApp = this.newActInfo()
|
| | | },
|
| | | newActInfo () {
|
| | | newActInfo() {
|
| | | return {
|
| | | activateCode: '',
|
| | | productName: '',
|
| | |
| | | devIds: ''
|
| | | }
|
| | | },
|
| | | getUnActivedList () {
|
| | | getUnActivedList() {
|
| | | getUnActivedSdk().then(res => {
|
| | | if (res.code == 200) {
|
| | | this.unActivedSDKList = res.data;
|
| | |
| | | })
|
| | |
|
| | | },
|
| | | getUnActivedAppList () {
|
| | | getUnActivedAppList() {
|
| | | getUnActivedApp().then(res => {
|
| | | if (res.code == 200) {
|
| | | this.unActivedAppList = res.data;
|
| | |
| | | });
|
| | | },
|
| | |
|
| | | installFormat (percentage) {
|
| | | installFormat(percentage) {
|
| | | return percentage === 100 ? '安装成功' : `${percentage}%`;
|
| | | },
|
| | | actived () {
|
| | | actived() {
|
| | | let _this = this;
|
| | | if (this.actType == 'sdk') {
|
| | | //激活算法
|
| | |
| | | });
|
| | | }
|
| | | },
|
| | | getCodeDetail () { },
|
| | | checkMyAlgorith () {
|
| | | getCodeDetail() { },
|
| | | checkMyAlgorith() {
|
| | | this.actDrawerShow = false;
|
| | | this.activeName = "myAlgorithm";
|
| | | },
|
| | | onFileUpload (file) {
|
| | | onFileUpload(file) {
|
| | | //this.patchUpdateStatus = `<span style="color:green">上传成功, 点击升级按钮开始安装</span>`;
|
| | | this.patchFile = { ...file };
|
| | | this.fileAdded = true;
|
| | |
| | |
|
| | | },
|
| | |
|
| | | onFileAdded (f) {
|
| | | onFileAdded(f) {
|
| | | ;
|
| | | this.patchUpdateStatus = "";
|
| | | },
|
| | | // 校验输入的是否是数字
|
| | | valiNum (value) {
|
| | | valiNum(value) {
|
| | | if (value) {
|
| | | let re = /[^\-?\d.]*$/;
|
| | | if (!re.test(value)) {
|
| | |
| | | }
|
| | | },
|
| | | // 左边拖动模块得拖动结束后的触发函数
|
| | | endLeft (env) {
|
| | | endLeft(env) {
|
| | | this.dragging = false;
|
| | | let taskId = env.to.id;
|
| | | let sdkId = this.TaskMange.list1[env.oldIndex].id;
|
| | |
| | | this.addTaskSdk(json);
|
| | | },
|
| | | // 右边拖动模块开始拖动触发函数
|
| | | startRight (env) {
|
| | | startRight(env) {
|
| | | this.$nextTick(() => {
|
| | | this.dragging = true;
|
| | | });
|
| | | // window.window.console.log(env, "right start");
|
| | | },
|
| | | // 右边拖动模块拖动结束触发函数
|
| | | endRight (env) {
|
| | | endRight(env) {
|
| | | // window.window.console.log(env, "right end");
|
| | | },
|
| | | clickSet (data) {
|
| | | clickSet(data) {
|
| | | if (data.isSetting) {
|
| | | data.isSetting = false;
|
| | | } else {
|
| | | data.isSetting = true;
|
| | | }
|
| | | },
|
| | | clickDel (data, Index) {
|
| | | clickDel(data, Index) {
|
| | | this.$confirm("提示:删除后,此任务在摄像机中的应用失效,是否删除?", {
|
| | | center: true,
|
| | | showConfirmButton: true,
|
| | |
| | | })
|
| | | .catch(err => { });
|
| | | },
|
| | | clickSetAlgo (row, data) {
|
| | | clickSetAlgo(row, data) {
|
| | | // window.console.log(row, data, "编辑任务中某一个算法");
|
| | | if (row.isShowSetAlgo && data.id === this.TaskMange.currentAlgoId) {
|
| | | row.isShowSetAlgo = false;
|
| | |
| | | // });
|
| | | }
|
| | | },
|
| | | async getRulesByTaskSdk (taskId, sdkId) {
|
| | | async getRulesByTaskSdk(taskId, sdkId) {
|
| | | let res = await getRulesByTaskSdk({
|
| | | taskId: taskId,
|
| | | sdkId: sdkId
|
| | |
| | | this.argsList = JSON.parse(JSON.stringify(this.TaskMange.argsList));
|
| | | }
|
| | | },
|
| | | async findAllSdk () {
|
| | | async findAllSdk() {
|
| | | let res = await findAllSdk();
|
| | | if (res && res.success) {
|
| | | this.TaskMange.list1 = res.data.map((i, index) => {
|
| | |
| | | });
|
| | | }
|
| | | },
|
| | | addTask () {
|
| | | addTask() {
|
| | | let obj = {
|
| | | id: "",
|
| | | name: "任务" + this.TaskMange.list2.length,
|
| | |
| | | taskArea.scrollTop = taskArea.scrollHeight;
|
| | | });
|
| | | },
|
| | | async findAll () {
|
| | | async findAll() {
|
| | | let res = await findAll();
|
| | | if (res && res.success) {
|
| | | if (res.data && res.data.length !== 0) {
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | clickDelSdk (task, sdk) {
|
| | | clickDelSdk(task, sdk) {
|
| | | this.$confirm(
|
| | | "提示:删除后,此算法在本任务中移除,同时在摄像机中的应用失效,是否删除?",
|
| | | {
|
| | |
| | | })
|
| | | .catch(err => { });
|
| | | },
|
| | | selectChange (event, type, data) {
|
| | | selectChange(event, type, data) {
|
| | | if (type === "options1") {
|
| | | // window.window.console.log(type, data, "选择下拉框");
|
| | | data.options1.map(i => {
|
| | |
| | | }
|
| | | },
|
| | | // 删除任务算法
|
| | | async delTaskSdk (task, sdk) {
|
| | | async delTaskSdk(task, sdk) {
|
| | | let json = {
|
| | | taskId: task.id,
|
| | | sdkId: sdk.id
|
| | |
| | | }
|
| | | },
|
| | | // 删除任务
|
| | | async deleteTask (data, index) {
|
| | | async deleteTask(data, index) {
|
| | | // window.console.log(data, "deleteTask");
|
| | | let res = await deleteTask({ taskId: data.id });
|
| | | // this.$toast({
|
| | |
| | | }
|
| | | },
|
| | | // 更新任务状态
|
| | | async updateTaskStatus (data) {
|
| | | async updateTaskStatus(data) {
|
| | | // window.console.log(data, '更新任务状态')
|
| | | let json = {
|
| | | taskId: data.id,
|
| | |
| | | });
|
| | | },
|
| | | // 更新任务名称
|
| | | async updateTaskName (data) {
|
| | | async updateTaskName(data) {
|
| | | let json = {
|
| | | taskId: data.id,
|
| | | taskName: data.name
|
| | |
| | | }
|
| | | },
|
| | | // 获取底库数据
|
| | | async getBaseList () {
|
| | | async getBaseList() {
|
| | | // let res = await getTagList();
|
| | | // if (res && res.success) {
|
| | | // let filter = res.data.filter(i => {
|
| | |
| | | ];
|
| | | },
|
| | | // 获取算法参数
|
| | | async getSdkArgs (data) {
|
| | | async getSdkArgs(data) {
|
| | | let res = await getSdkArgs({
|
| | | sdkId: data.id,
|
| | | scope: "TASKRULE"
|
| | |
| | | }
|
| | | },
|
| | | // 查询字典
|
| | | async findByType () {
|
| | | async findByType() {
|
| | | let res = await findByType();
|
| | | if (res && res.success) {
|
| | | let list = res.data.RULECOMPUTEBETWEEN.map(i => {
|
| | |
| | | }
|
| | | },
|
| | | // 算法配置,新建
|
| | | add () {
|
| | | add() {
|
| | | this.TaskMange.argsList.push(
|
| | | JSON.parse(JSON.stringify(this.TaskMange.baseObject))
|
| | | );
|
| | | },
|
| | | // 算法配置 删除
|
| | | delRule (index) {
|
| | | delRule(index) {
|
| | | this.TaskMange.argsList.splice(index, 1);
|
| | | },
|
| | | // 算法参数保存
|
| | | async save () {
|
| | | async save() {
|
| | | let list = this.TaskMange.argsList.map(i => {
|
| | | let obj = {};
|
| | | obj.id = i.id;
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | getDefault () {
|
| | | getDefault() {
|
| | | this.deleteTaskSdkRule(
|
| | | this.TaskMange.currentTaskId,
|
| | | this.TaskMange.currentAlgoId
|
| | |
| | | );
|
| | | });
|
| | | },
|
| | | async deleteTaskSdkRule (taskId, sdkId) {
|
| | | async deleteTaskSdkRule(taskId, sdkId) {
|
| | | let json = {
|
| | | taskId: taskId,
|
| | | sdkId: sdkId
|
| | |
| | | }
|
| | | },
|
| | | // 给任务添加算法
|
| | | async addTaskSdk (data) {
|
| | | async addTaskSdk(data) {
|
| | | let res = await addTaskSdk(data);
|
| | | if (res && res.success) {
|
| | | // window.console.log(res, 'res')
|
| | |
| | | }
|
| | | },
|
| | | // 新添加任务
|
| | | async addTaskAsync (name) {
|
| | | async addTaskAsync(name) {
|
| | | let res = await addTask({ taskname: name });
|
| | | // this.$toast({
|
| | | // type: res.success ? "success" : "error",
|
| | |
| | | this.findAll();
|
| | | }
|
| | | },
|
| | | cancle (row) {
|
| | | cancle(row) {
|
| | | if (row.isShowSetAlgo) {
|
| | | row.isShowSetAlgo = false;
|
| | | }
|
| | |
| | | this.$set(i, "isSelect", false);
|
| | | });
|
| | | },
|
| | | cancleTask (row) {
|
| | | cancleTask(row) {
|
| | | if (row.isSetting) {
|
| | | row.isSetting = false;
|
| | | }
|
| | | },
|
| | | commandAlgo (command, row, item) {
|
| | | commandAlgo(command, row, item) {
|
| | | if (command === 1) {
|
| | | // console.log('设置算法')
|
| | | this.clickSetAlgo(row, item);
|
| | |
| | | this.clickDelSdk(row, item);
|
| | | }
|
| | | },
|
| | | commandTask (command, row) {
|
| | | commandTask(command, row) {
|
| | | if (command === 1) {
|
| | | //编辑任务
|
| | | this.clickSet(row);
|
| | | }
|
| | | },
|
| | | getUser () {
|
| | | // console.log("登录用户",JSON.parse(sessionStorage.getItem("userInfo")).username)
|
| | | if (
|
| | | sessionStorage.getItem("userInfo") &&
|
| | | (JSON.parse(sessionStorage.getItem("userInfo")).username ==
|
| | | "superadmin" ||
|
| | | JSON.parse(sessionStorage.getItem("userInfo")).username == "basic")
|
| | | ) {
|
| | | this.isSuperUser = true;
|
| | | } else {
|
| | | this.isSuperUser = false;
|
| | | }
|
| | | },
|
| | | donwload (item) {
|
| | | donwload(item) {
|
| | | this.downloading = true;
|
| | | this.downloadItem = item.id;
|
| | |
|
| | |
| | | this.downloadItem = "";
|
| | | });
|
| | | },
|
| | | commandAlgLib (item) {
|
| | | commandAlgLib(item) {
|
| | | this.$set(item, "isEdit", true);
|
| | | },
|
| | | inputBlur (item) {
|
| | | inputBlur(item) {
|
| | | // console.log(item, '修改名称')
|
| | | this.$set(item, "isEdit", false);
|
| | | },
|
| | |
|
| | | cleanTemplateForm () {
|
| | | cleanTemplateForm() {
|
| | | this.appSceneForm.name = "";
|
| | | this.appSceneForm.desc = "";
|
| | | this.appSceneForm.rules = "";
|
| | |
| | |
|
| | | this.$refs.ruleEditor.cleanRule();
|
| | | },
|
| | | handleTabClick () {
|
| | | handleTabClick() {
|
| | |
|
| | | },
|
| | | handleCreateScene () {
|
| | | handleCreateScene() {
|
| | | this.sceneDialogVisible = true;
|
| | | this.dialogTitle = '创建场景模板';
|
| | |
|
| | |
| | | this.cleanTemplateForm();
|
| | | });
|
| | | },
|
| | | handleDialogClose () {
|
| | | handleDialogClose() {
|
| | | this.sceneDialogVisible = false;
|
| | | },
|
| | | handleEditScene (item) {
|
| | | handleEditScene(item) {
|
| | | this.appSceneForm.name = item.name;
|
| | | this.appSceneForm.desc = item.desc;
|
| | |
|
| | |
| | | .src-title {
|
| | | //color: #bfbfbf;
|
| | | color: #bbcee8;
|
| | | font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC';
|
| | | font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC";
|
| | | font-weight: 650;
|
| | | font-style: normal;
|
| | | height: 36px;
|
| | |
| | | position: absolute;
|
| | | top: 50%;
|
| | | left: 50%;
|
| | | background: url('/images/algo/green.gif');
|
| | | background: url("/images/algo/green.gif");
|
| | | overflow: hidden;
|
| | | transform: translate(-50%, -50%);
|
| | | .inner-bar {
|
| | |
| | | }
|
| | | }
|
| | | .drawer-content {
|
| | | font-family: 'PingFangSC-Regular';
|
| | | font-family: "PingFangSC-Regular";
|
| | | .el-step__title.is-process {
|
| | | border-color: #3d68e1 !important;
|
| | | color: #3d68e1 !important;
|
| | | font-family: Tahoma, Helvetica, Arial, '\5B8B\4F53', sans-serif;
|
| | | font-family: Tahoma, Helvetica, Arial, "\5B8B\4F53", sans-serif;
|
| | | }
|
| | | .el-step__head.is-process {
|
| | | border-color: #3d68e1 !important;
|
| | | color: #3d68e1 !important;
|
| | | font-family: Tahoma, Helvetica, Arial, '\5B8B\4F53', sans-serif;
|
| | | font-family: Tahoma, Helvetica, Arial, "\5B8B\4F53", sans-serif;
|
| | | }
|
| | | .el-input {
|
| | | width: 100%;
|
| | |
| | | </div> |
| | | <span :class="stretchStyle" @click="strethTable = !strethTable"></span> |
| | | |
| | | <el-button size="small" type="primary" style="float:right" @click="openDrawer">设置</el-button> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | style="float:right" |
| | | @click="openDrawer" |
| | | v-if="showSetting" |
| | | >设置</el-button> |
| | | </div> |
| | | |
| | | <el-table |
| | |
| | | } |
| | | |
| | | return ret |
| | | }, |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem("userInfo") && |
| | | sessionStorage.getItem("userInfo") !== "" |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | showSetting() { |
| | | return this.isAdmin || this.buttonAuthority.indexOf("analysisPower:set") > -1 |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | showSysInfo: false, |
| | | drawer: false, |
| | | formData: {}, |
| | | strethTable: false |
| | | strethTable: false, |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | <el-tab-pane |
| | | :label="firstLabeName" |
| | | name="camera-info" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('VIDEOCAMERA:camera:info')" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:cameraInfo')" |
| | | > |
| | | <camera-info ref="cameraInfo" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | :label="firstLabeName" |
| | | name="camera-info" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('VIDEOCAMERA:dataStack:stackInfo')" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:cameraInfo')" |
| | | > |
| | | <data-stack-info ref="dataStackInfo" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | label="独立场景" |
| | | name="separate-rule" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('VIDEOCAMERA:camera:selfRule')" |
| | | v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:selfRule')" |
| | | > |
| | | <separate-rules ref="sepRule" /> |
| | | <!-- <local-separate ref="localSeparate" v-else></local-separate> --> |
| | |
| | | <el-tab-pane |
| | | label="独立场景" |
| | | name="separate-rule" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('VIDEOCAMERA:dataStack:selfRule')" |
| | | v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:selfRule')" |
| | | > |
| | | <separate-rules ref="sepRule" /> |
| | | <!-- <local-separate ref="localSeparate" v-else></local-separate> --> |
| | |
| | | <el-tab-pane |
| | | label="联动场景" |
| | | name="linkage-rule" |
| | | v-if="(isShow('VIDEOCAMERA:camera:linkRule') || isShow('VIDEOCAMERA:dataStack:linkRule')) && this.TreeDataPool.treeActiveName == 'camera'" |
| | | v-if="(isShow('cameraAccess:linkRule')) && this.TreeDataPool.treeActiveName == 'camera'" |
| | | > |
| | | <linkage-rule ref="linkRule" /> |
| | | </el-tab-pane> |
| | |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | firstLabeName() { |
| | |
| | | }, |
| | | created() { |
| | | if (this.TreeDataPool.treeActiveName == 'camera') { |
| | | if (this.isShow('VIDEOCAMERA:camera:info')) { |
| | | if (this.isShow('cameraAccess:cameraInfo')) { |
| | | this.activeName = "camera-info" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:selfRule') || this.isShow('VIDEOCAMERA:datastack:selfRule')) { |
| | | } else if (this.isShow('cameraAccess:selfRule')) { |
| | | this.activeName = "separate-rule" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:linkRule') || this.isShow('VIDEOCAMERA:datastack:linkRule')) { |
| | | } else if (this.isShow('cameraAccess:linkRule')) { |
| | | this.activeName = "linkage-rule" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:resourceCalc') || this.isShow('VIDEOCAMERA:datastack:resourceCalc')) { |
| | | this.activeName = "poll-setting" |
| | | } |
| | | } else { |
| | | if (this.isShow('VIDEOCAMERA:camera:info')) { |
| | | if (this.isShow('dataStack:cameraInfo')) { |
| | | this.activeName = "camera-info" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:selfRule') || this.isShow('VIDEOCAMERA:datastack:selfRule')) { |
| | | } else if (this.isShow('dataStack:selfRule')) { |
| | | this.activeName = "separate-rule" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:linkRule') || this.isShow('VIDEOCAMERA:datastack:linkRule')) { |
| | | this.activeName = "linkage-rule" |
| | | } else if (this.isShow('VIDEOCAMERA:camera:resourceCalc') || this.isShow('VIDEOCAMERA:datastack:resourceCalc')) { |
| | | this.activeName = "poll-setting" |
| | | } |
| | | } |
| | | |
| | | this.TreeDataPool.readonly = true; |
| | | this.TreeDataPool.gbReadonly = true; |
| | | this.TreeDataPool.multiple = false; |
| | |
| | | }, |
| | | methods: { |
| | | isShow(authority) { |
| | | if (this.isAdmin) { |
| | | return true; |
| | | } else if (this.buttonAuthority.indexOf("," + authority + ",") > -1) { |
| | | return true; |
| | | } else if ("videoCamera:pollSetting" === authority) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 |
| | | }, |
| | | handAddDevice(node) { |
| | | let _this = this; |
| | |
| | | components: { |
| | | Desktop, NotificationCenter, NoticeTip, Tools, ToolsEntry |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | buttonAuthority: sessionStorage.getItem('buttonAuthoritys') || [] |
| | | } |
| | | }, |
| | | computed: { |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem('userInfo') && |
| | | sessionStorage.getItem('userInfo') !== '' |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem('userInfo')).username |
| | | return ( |
| | | loginName === 'superadmin' || loginName === 'basic' |
| | | ) |
| | | } |
| | | return false |
| | | } |
| | | }, |
| | | mounted() { |
| | | document.getElementById('app').style.backgroundImage = process.env.VUE_APP_MAIN_URL; |
| | | this.showApps(); |
| | |
| | | this.showApps(); |
| | | } |
| | | }); |
| | | findAllSdk().then(() => { |
| | | |
| | | }); |
| | | }, |
| | | methods: { |
| | | showApps() { |
| | |
| | | getApps().then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | _that.$store.state.desktop.docks = []; |
| | | let installedApps = []; |
| | | rsp.data.forEach(function (item) { |
| | | if (item.installed) { |
| | | let temp = { |
| | |
| | | isDefault: item.isDefault |
| | | } |
| | | |
| | | _that.$store.commit('desktop/addDock', temp); |
| | | // console.log(item) |
| | | // console.log('apps update') |
| | | //console.log(this.$store.state.desktop.docks) |
| | | } |
| | | // 判断权限 |
| | | if (_that.isAdmin || _that.buttonAuthority.indexOf(item.package) >= 0) { |
| | | _that.$store.commit('desktop/addDock', temp); |
| | | } |
| | | |
| | | installedApps.push(item.package); |
| | | } |
| | | }); |
| | | |
| | | sessionStorage.setItem("apps", installedApps.join(",")); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | import { tologin, getLoginUserData, getServerName } from './api.ts' |
| | | import ParticleNetwork from './ParticleNetwork' |
| | | import Licence from '@/components/licence' |
| | | import { getMenuListData, findButtonAuthoritys, findInArr } from "@/api/utils"; |
| | | |
| | | export default { |
| | | name: 'login-pgae', |
| | |
| | | currentHeight: 1057, |
| | | currentWidth: 1920 |
| | | }), |
| | | created() { |
| | | this.getServerName() |
| | | this.getScreenHeight() |
| | | }, |
| | | mounted() { |
| | | console.log(this.serverTitle) |
| | | }, |
| | | watch: {}, |
| | | beforeDestroy() { |
| | | window.onresize = null |
| | | }, |
| | | methods: { |
| | | systemLogin() { |
| | | this.nullRule = this.rules |
| | |
| | | type: 'success', |
| | | message: '登录成功!' |
| | | }) |
| | | // await this.getMenuList() |
| | | // this.$router.push('/Layout/Video') |
| | | |
| | | // 获取权限 |
| | | await this.getMenuList() |
| | | location.assign("/view/desktop/") |
| | | return json |
| | | } else { |
| | |
| | | sessionStorage.setItem('title', res.data.serverName) |
| | | } |
| | | }, |
| | | async getMenuList() { |
| | | let results = await getMenuListData({}); |
| | | if (results && results.success) { |
| | | /* 存储权限 */ |
| | | let buttonAuthoritys = results.data; |
| | | // console.log(this.$route.query.is_loginsss) |
| | | if (results && results.length && this.$route.query.is_login) { |
| | | this.$router.replace(results[0].url); |
| | | } |
| | | sessionStorage.setItem("buttonAuthoritys", "," + buttonAuthoritys + ","); |
| | | sessionStorage.setItem("menuInfo", JSON.stringify(results)); |
| | | } else { |
| | | this.$toast({ |
| | | type: "error", |
| | | message: "菜单获取失败" |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getServerName() |
| | | this.getScreenHeight() |
| | | }, |
| | | mounted(){ |
| | | console.log(this.serverTitle) |
| | | }, |
| | | watch: {}, |
| | | beforeDestroy() { |
| | | window.onresize = null |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
New file |
| | |
| | | <template> |
| | | <div class="mycanvas-container"> |
| | | <div class="left"> |
| | | <p>展示视口</p> |
| | | <div class="myshow"> |
| | | <img :src="mysrc" alt width="100%" /> |
| | | <!-- <div id="canvas" style="width:100%;height:100%" class="mycanvas"></div> --> |
| | | </div> |
| | | </div> |
| | | <div class="center"> |
| | | <p>操作视口</p> |
| | | <div |
| | | class="myedit" |
| | | ref="myedit" |
| | | @mousedown.prevent="onMousedown" |
| | | @mousemove="onMousemove" |
| | | @contextmenu.prevent |
| | | > |
| | | <!-- <img src="@/assets/jia.svg" alt=""> --> |
| | | <img :src="mysrc" /> |
| | | <span |
| | | class="myedit-span" |
| | | v-for="(item, index) in mydata" |
| | | :key="index" |
| | | :style="getSpanStyle(item)" |
| | | @contextmenu.prevent="onContextmenu(item, $event)" |
| | | ></span> |
| | | <!-- <div id="canvas" style="width:100%;height:100%" class="mycanvas"></div> --> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <img src alt class="mybutton" /> |
| | | <input v-show="0" ref="file" type="file" class="mybutton" @change="onChange" /> |
| | | <button class="mybutton" @click="selectFile">导入图片</button> |
| | | <button class="mybutton">新增标注</button> |
| | | <button class="mybutton">修改标注</button> |
| | | <button class="mybutton">删除</button> |
| | | <button class="mybutton">保存</button> |
| | | </div> |
| | | <div class="myMenu" v-show="mymenu.current" :style="mymenu.style"> |
| | | <!-- <button @click="onRemoveItem">删除</button> --> |
| | | <ui-button type="primary" @click="onRemoveItem">删除</ui-button> |
| | | <ui-select></ui-select> |
| | | <select name id> |
| | | <option value="1">ceshi</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | mysrc: "", |
| | | mydata: [], |
| | | mymenu: { current: null, style: { left: 0, top: 0 } } |
| | | }; |
| | | }, |
| | | mounted() { |
| | | document.addEventListener('mouseup', this.onMouseup) |
| | | }, |
| | | beforeDestroy() { |
| | | document.removeEventListener('mouseup', this.onMouseup) |
| | | }, |
| | | methods: { |
| | | getXY(e) { |
| | | let rect = this.$refs.myedit.getBoundingClientRect() |
| | | return { |
| | | x: e.clientX - rect.left, |
| | | y: e.clientY - rect.top |
| | | } |
| | | }, |
| | | // 上传图片1 |
| | | onChange(e) { |
| | | this.mysrc = window.URL.createObjectURL(e.target.files[0]); |
| | | e.target.value = '' |
| | | }, |
| | | // 上传图片2, |
| | | selectFile() { |
| | | this.$refs.file.click(); |
| | | }, |
| | | onMousedown(e) { |
| | | this.mymenu.current = null |
| | | let { x, y } = this.getXY(e) |
| | | this.currentItem = { x, y, w: 0, h: 0, now: Date.now() } |
| | | this.startPos = { x, y } |
| | | this.mydata.push(this.currentItem) |
| | | }, |
| | | onMousemove(e) { |
| | | if (!this.currentItem) return; |
| | | let { x, y } = this.getXY(e) |
| | | this.currentItem.w = Math.abs(x - this.startPos.x) |
| | | this.currentItem.h = Math.abs(y - this.startPos.y) |
| | | }, |
| | | onMouseup(e) { |
| | | this.currentItem = this.startPos = null; |
| | | this.mydata = this.mydata.filter(_ => _.w > 10 && _.h > 10) |
| | | }, |
| | | onContextmenu(item, e) { |
| | | this.mymenu = { |
| | | current: item, |
| | | style: { |
| | | top: e.clientY + 'px', |
| | | left: e.clientX + 'px' |
| | | } |
| | | } |
| | | }, |
| | | onRemoveItem() { |
| | | this.mydata.splice(this.mydata.indexOf(this.mymenu.current), 1) |
| | | this.mymenu = { ...this.mymenu, current: null } |
| | | }, |
| | | getSpanStyle(item) { |
| | | return { |
| | | width: `${item.w}px`, |
| | | height: `${item.h}px`, |
| | | top: `${item.y}px`, |
| | | left: `${item.x}px` |
| | | }; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | | // 设置绘图样式1 |
| | | body { |
| | | user-select: none; |
| | | } |
| | | |
| | | .myMenu { |
| | | position: fixed; |
| | | top: 400px; |
| | | left: 400px; |
| | | width: 100px; |
| | | padding: 8px 0; |
| | | background-color: #fff; |
| | | > * { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | #canvas > div { |
| | | /* border: 2px solid green; */ |
| | | position: absolute; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | #canvas > div > span { |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | font-family: simsun; |
| | | font-size: 9pt; |
| | | } |
| | | |
| | | // 设置绘图样式2 |
| | | |
| | | .mycanvas-container { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | .left, |
| | | .center, |
| | | .right { |
| | | width: 300px; |
| | | // height: 520px; |
| | | margin: 20px; |
| | | |
| | | p { |
| | | text-align: center; |
| | | } |
| | | |
| | | .myshow, |
| | | .myedit { |
| | | width: 300px; |
| | | // height: 500px; |
| | | border: 1px solid #000; |
| | | position: relative; |
| | | .myedit-span { |
| | | position: absolute; |
| | | border: 1px dashed #fff; |
| | | background: url("/images/cameraAccess/video.png") no-repeat center |
| | | center; |
| | | background-size: contain; |
| | | } |
| | | |
| | | .mycanvas { |
| | | border: 1px solid pink; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | } |
| | | |
| | | img { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .right { |
| | | width: 150px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: left; |
| | | flex-direction: column; |
| | | |
| | | .mybutton { |
| | | margin-top: 20px; |
| | | display: block; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | import request from '@/scripts/httpRequest' |
| | | import qs from 'qs' |
| | | |
| | | // Post |
| | | export const tologin = (query: any) => { |
| | | return request({ |
| | | url: '/data/api-u/sys/login', |
| | | method: 'post', |
| | | data: qs.stringify(query) |
| | | }) |
| | | } |
| | | |
| | | // get |
| | | export const testDBCompare = (query: any) => { |
| | | return request({ |
| | | url: '../../data/api-v/face/testEachCompareAll', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
New file |
| | |
| | | import Vue from 'vue'; |
| | | import App from './App.vue' |
| | | |
| | | import ElementUI from 'element-ui'; |
| | | import 'element-ui/lib/theme-chalk/index.css'; |
| | | import "@/assets/css/element-variables.scss"; |
| | | |
| | | Vue.use(ElementUI); |
| | | |
| | | new Vue({ |
| | | el: '#app', |
| | | render: h => h(App) |
| | | }); |
| | |
| | | type="border-card" |
| | | > |
| | | <!-- 本机信息 --> |
| | | <el-tab-pane label="本机信息" name="first"> |
| | | <el-tab-pane label="本机信息" name="sysInfo" v-if="isShow('settings:sysInfo')"> |
| | | <el-menu |
| | | :default-openeds="openeds" |
| | | background-color="#fff" |
| | |
| | | </el-tab-pane> |
| | | |
| | | <!-- 时间配置 --> |
| | | <el-tab-pane label="时间配置" name="second"> |
| | | <el-tab-pane label="时间配置" name="timeSet" v-if="isShow('settings:timeSet')"> |
| | | <el-form label-width="100px"> |
| | | <el-form-item label="设备时间"> |
| | | <!-- <el-input v-model="equipmentTime" placeholder="请输入" size="small"></el-input> --> |
| | |
| | | </el-tab-pane> |
| | | |
| | | <!-- 集群管理 --> |
| | | <el-tab-pane label="集群管理" name="third"> |
| | | <el-tab-pane label="集群管理" name="cluster" v-if="isShow('settings:cluster')"> |
| | | <cluster-management></cluster-management> |
| | | </el-tab-pane> |
| | | <!-- <el-tab-pane label="外部访问" name="fourth"> |
| | |
| | | </el-submenu> |
| | | </el-menu> |
| | | </el-tab-pane>--> |
| | | <el-tab-pane label="权限管理" name="user"> |
| | | <authority-management v-if="activeName === 'user'"></authority-management> |
| | | <el-tab-pane label="权限管理" name="permission" v-if="isShow('settings:permission')"> |
| | | <authority-management v-if="activeName === 'permission'"></authority-management> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="广播设置" name="radio"> |
| | | <radio-set v-if="activeName === 'radio'"></radio-set> |
| | | <el-tab-pane label="广播设置" name="broadcast" v-if="isShow('settings:broadcast')"> |
| | | <radio-set v-if="activeName === 'broadcast'"></radio-set> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | })) |
| | | }) |
| | | return options |
| | | } |
| | | }, |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem("userInfo") && |
| | | sessionStorage.getItem("userInfo") !== "" |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | }, |
| | | directives: { |
| | | focus: { |
| | |
| | | loading: true, |
| | | loadingText: "", |
| | | gutter: 10, |
| | | activeName: "first", |
| | | activeName: "sysInfo", |
| | | timezone: "", |
| | | syncType: "1", |
| | | ntpServer: "", |
| | |
| | | countyOptions: [] |
| | | }, |
| | | webPort: 0, |
| | | ntpTestLoading: false |
| | | ntpTestLoading: false, |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | }; |
| | | }, |
| | | created() { |
| | | if (this.isShow("settings:sysInfo")) { |
| | | this.activeName = "sysInfo"; |
| | | } else if (this.isShow("settings:timeSet")) { |
| | | this.activeName = "timeSet"; |
| | | } else if (this.isShow("settings:cluster")) { |
| | | this.activeName = "cluster"; |
| | | } else if (this.isShow("settings:permission")) { |
| | | this.activeName = "permission"; |
| | | } else if (this.isShow("settings:broadcast")) { |
| | | this.activeName = "broadcast"; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | |
| | | clearInterval(this.browserTimer); |
| | | }, |
| | | methods: { |
| | | isShow(authority) { |
| | | return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 |
| | | }, |
| | | initSysinfo() { |
| | | this.loadingText = "正在获取设备信息..."; |
| | | getDevInfo().then(rsp => { |
| | |
| | | <template> |
| | | <div class="s-system-manage"> |
| | | <el-tabs |
| | | |
| | | id="systemMaintenance" |
| | | v-model="activeName" |
| | | v-loading="loading" |
| | | :element-loading-text="loadingText" |
| | | > |
| | | <el-tab-pane label="设备维护" name="first"> |
| | | <el-tab-pane label="设备维护" name="device" v-if="isShow('vindicate:device')"> |
| | | <div class="s-system-maintenance"> |
| | | <div class="box-card"> |
| | | <div class="ui-top-view"> |
| | |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="数据库维护" name="second"> |
| | | <el-tab-pane label="数据库维护" name="dbvdc" v-if="isShow('vindicate:db')"> |
| | | <div class="box"> |
| | | <p class="title"> |
| | | <label>数据清理</label> |
| | |
| | | timer: null, |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | rebootCron: "", |
| | | activeName: "first", |
| | | activeName: "device", |
| | | restartValue: "不重启", |
| | | restartTimeValue: new Date(2019, 9, 10, 18, 40), |
| | | loading: false, |
| | |
| | | }, |
| | | }, |
| | | upgrading: false, |
| | | fileAdded: false |
| | | fileAdded: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getRebootCron() |
| | | if (!this.isShow('videoSystem:sysManage:sysfix')) { |
| | | console.log("默认显示数据库维护") |
| | | this.activeName = "second" |
| | | if (!this.isShow('vindicate:device')) { |
| | | this.activeName = "dbvdc" |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | .el-button--primary { |
| | | color: #FFFFFF; |
| | | background-color: #3D68E1; |
| | | border-color: #3D68E1; |
| | | color: #ffffff; |
| | | background-color: #3d68e1; |
| | | border-color: #3d68e1; |
| | | } |
| | | .el-button--primary.is-disabled, |
| | | .el-button--primary.is-disabled:hover, |
| | | .el-button--primary.is-disabled:focus, |
| | | .el-button--primary.is-disabled:active{ |
| | | color: #FFFFFF; |
| | | .el-button--primary.is-disabled, |
| | | .el-button--primary.is-disabled:hover, |
| | | .el-button--primary.is-disabled:focus, |
| | | .el-button--primary.is-disabled:active { |
| | | color: #ffffff; |
| | | background-color: #9eb4f0; |
| | | border-color: #9eb4f0; |
| | | } |