1 |
- {"remainingRequest":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\utils.js","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\utils.js","mtime":1663828782936},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\babel.config.js","mtime":1663828782900},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000}],"contextDependencies":[],"result":["/*\r\n * @Author:zouwenying\r\n * @Date: 2020-10-23 19:29:07\r\n * @LastEditTime: 2020-11-13 18:43:56\r\n * @LastEditors: Please set LastEditors\r\n * @Description: In User Settings Edit\r\n * @FilePath: \\vue-manage-system-master\\src\\utils\\utils.js\r\n */\nimport Vue from 'vue';\nimport newValidate from \"./newValidate.js\";\nimport MsgBoxCom from \"../components/msgBox\";\nVue.prototype.$valid = newValidate; //全局混入\n//mix_path为权限前缀\n\nVue.mixin({\n computed: {\n $add: function $add() {\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":add\");\n },\n $del: function $del() {\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":del\");\n },\n $edit: function $edit() {\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":edit\");\n },\n $query: function $query() {\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":query\");\n }\n }\n});\n/**\r\n * @description: 弹出确认提示框\r\n * @param {String} msg: 主消息\r\n * @param {String} tipMsg: 提示内容\r\n * @param {String} type: 告警类型 ['error', 'warn']\r\n * @param {Object} params: 扩展参数\r\n * @return {type}: null\r\n */\n\nVue.prototype.$msgBox = function () {\n var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var tipMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '删除后将无法恢复,是否继续?';\n var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';\n var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n return new Promise(function (resolve, reject) {\n var config = {\n width: '374px',\n showCancelButton: true,\n confirmButtonText: '确认',\n showClose: true,\n resolve: resolve,\n reject: reject\n };\n Object.assign(config, params);\n var MsgBox = Vue.extend(MsgBoxCom);\n var dom = new MsgBox().$mount();\n document.getElementById('app').appendChild(dom.$el);\n dom.config = config;\n dom.msg = msg;\n dom.tipMsg = tipMsg;\n dom.type = type;\n });\n};\n/**\r\n * @description: 遍历节点是否存在当前值\r\n * @param {Array} dataArr 数组对象\r\n * @param {String|Number} val 比对值\r\n * @param {String} valStr 比对字段\r\n * @return {Boolean} 返回存在或不存在\r\n */\n\n\nVue.prototype.__calleArr = function (dataArr, val, valStr) {\n for (var i in dataArr) {\n var data = dataArr[i];\n\n if (data[valStr] === val) {\n return true;\n } else {\n if (data.children) {\n this.__calleArr(data.children, val, valStr);\n }\n }\n }\n}; // 确认提示框\n\n\nVue.prototype.__confirm = function () {\n var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '确认要删除该数据?';\n var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '提示';\n var settings = arguments.length > 2 ? arguments[2] : undefined;\n var sets = Object.assign(settings || {}, {\n cancelButtonClass: 'el-button--medium',\n confirmButtonClass: 'el-button--medium',\n dangerouslyUseHTMLString: true\n });\n return this.$confirm(\"<p class=\\\"text_normal bold\\\">\".concat(msg, \"</p>\"), title, sets);\n};\n/*\r\n设置弹出组件 datakey 集合下各字段的值,根据params.data\r\n*/\n\n\nVue.prototype.__setValue = function (datakey) {\n var obj = this[datakey];\n\n for (var item in obj) {\n var str = this.params.data[item];\n obj[item] = str ? str : _.isNumber(str) ? str : '';\n }\n}; // Excel表格下载\n\n\nVue.prototype.__exportExcel = function () {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"Abnormal/getAllAbnormalExcel\";\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var token = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : localStorage.getItem(\"SC_token\");\n // eslint-disable-next-line no-param-reassign\n delete params.pageNum; // eslint-disable-next-line no-param-reassign\n\n delete params.pageSize;\n var link;\n\n if (document.getElementById(\"exportATag\")) {\n link = document.getElementById(\"exportATag\");\n } else {\n link = document.createElement(\"a\");\n link.setAttribute(\"id\", \"exportATag\");\n link.style.display = \"none\";\n }\n\n var httpReg = /(http|https):\\/\\/([\\w.]+\\/?)\\S*/;\n var urlStr = httpReg.test(url) ? \"\".concat(url, \"&\") : \"\".concat(url, \"?\");\n\n _.mapKeys(params, function (val, key) {\n if (!_.isEmpty(String(val)) && val) {\n urlStr += \"\".concat(key, \"=\").concat(val, \"&\");\n }\n });\n\n link.href = \"\".concat(urlStr, \"access_token=\").concat(token);\n document.body.appendChild(link);\n link.click();\n};",{"version":3,"sources":["C:/Users/100zone/Desktop/baizong/community/SmartCommunity/videoSurveillance/src/utils/utils.js"],"names":["Vue","newValidate","MsgBoxCom","prototype","$valid","mixin","computed","$add","$store","getters","mix_path","$del","$edit","$query","$msgBox","msg","tipMsg","type","params","Promise","resolve","reject","config","width","showCancelButton","confirmButtonText","showClose","Object","assign","MsgBox","extend","dom","$mount","document","getElementById","appendChild","$el","__calleArr","dataArr","val","valStr","i","data","children","__confirm","title","settings","sets","cancelButtonClass","confirmButtonClass","dangerouslyUseHTMLString","$confirm","__setValue","datakey","obj","item","str","_","isNumber","__exportExcel","url","token","localStorage","getItem","pageNum","pageSize","link","createElement","setAttribute","style","display","httpReg","urlStr","test","mapKeys","key","isEmpty","String","href","body","click"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AX,GAAqB,MAArB;AACD;;AACD,MAAMC,OAAO,GAAG,iCAAhB;AACA,MAAIC,MAAM,GAAGD,OAAO,CAACE,IAAR,CAAab,GAAb,cAAuBA,GAAvB,mBAAmCA,GAAnC,MAAb;;AACAH,EAAAA,CAAC,CAACiB,OAAF,CAAUxD,MAAV,EAAkB,UAACqB,GAAD,EAAMoC,GAAN,EAAc;AAE9B,QAAI,CAAClB,CAAC,CAACmB,OAAF,CAAUC,MAAM,CAACtC,GAAD,CAAhB,CAAD,IAA2BA,GAA/B,EAAoC;AAClCiC,MAAAA,MAAM,cAAOG,GAAP,cAAcpC,GAAd,MAAN;AACD;AACF,GALD;;AAOA2B,EAAAA,IAAI,CAACY,IAAL,aAAeN,MAAf,0BAAqCX,KAArC;AAEA5B,EAAAA,QAAQ,CAAC8C,IAAT,CAAc5C,WAAd,CAA0B+B,IAA1B;AACAA,EAAAA,IAAI,CAACc,KAAL;AACD,CA9BD","sourcesContent":["/*\r\n * @Author:zouwenying\r\n * @Date: 2020-10-23 19:29:07\r\n * @LastEditTime: 2020-11-13 18:43:56\r\n * @LastEditors: Please set LastEditors\r\n * @Description: In User Settings Edit\r\n * @FilePath: \\vue-manage-system-master\\src\\utils\\utils.js\r\n */\r\nimport Vue from 'vue'\r\nimport newValidate from './newValidate.js';\r\nimport MsgBoxCom from '../components/msgBox';\r\nVue.prototype.$valid = newValidate;\r\n\r\n//全局混入\r\n//mix_path为权限前缀\r\nVue.mixin({\r\n computed: {\r\n $add() {\r\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":add\")\r\n },\r\n $del() {\r\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":del\")\r\n },\r\n $edit() {\r\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":edit\")\r\n },\r\n $query() {\r\n return this.$store.getters[\"hasPermission\"](this.mix_path + \":query\")\r\n },\r\n }\r\n})\r\n/**\r\n * @description: 弹出确认提示框\r\n * @param {String} msg: 主消息\r\n * @param {String} tipMsg: 提示内容\r\n * @param {String} type: 告警类型 ['error', 'warn']\r\n * @param {Object} params: 扩展参数\r\n * @return {type}: null\r\n */\r\nVue.prototype.$msgBox = (msg = '', tipMsg = '删除后将无法恢复,是否继续?', type = 'error', params = {}) => new Promise((resolve, reject) => {\r\n const config = {\r\n width: '374px',\r\n showCancelButton: true,\r\n confirmButtonText: '确认',\r\n showClose: true,\r\n resolve: resolve,\r\n reject: reject,\r\n }\r\n Object.assign(config, params)\r\n\r\n const MsgBox = Vue.extend(MsgBoxCom)\r\n const dom = new MsgBox().$mount()\r\n document.getElementById('app').appendChild(dom.$el)\r\n dom.config = config\r\n dom.msg = msg\r\n dom.tipMsg = tipMsg\r\n dom.type = type\r\n})\r\n/**\r\n * @description: 遍历节点是否存在当前值\r\n * @param {Array} dataArr 数组对象\r\n * @param {String|Number} val 比对值\r\n * @param {String} valStr 比对字段\r\n * @return {Boolean} 返回存在或不存在\r\n */\r\nVue.prototype.__calleArr = function (dataArr, val, valStr) {\r\n for (let i in dataArr) {\r\n var data = dataArr[i];\r\n if (data[valStr] === val) {\r\n return true;\r\n } else {\r\n if (data.children) {\r\n this.__calleArr(data.children, val, valStr)\r\n }\r\n }\r\n }\r\n}\r\n\r\n// 确认提示框\r\nVue.prototype.__confirm = function (msg = '确认要删除该数据?', title = '提示', settings) {\r\n let sets = Object.assign(settings || {}, {\r\n cancelButtonClass: 'el-button--medium',\r\n confirmButtonClass: 'el-button--medium',\r\n dangerouslyUseHTMLString: true,\r\n })\r\n return this.$confirm(`<p class=\"text_normal bold\">${msg}</p>`, title, sets);\r\n}\r\n\r\n/*\r\n设置弹出组件 datakey 集合下各字段的值,根据params.data\r\n*/\r\nVue.prototype.__setValue = function (datakey) {\r\n let obj = this[datakey];\r\n for (let item in obj) {\r\n const str = this.params.data[item];\r\n obj[item] = str ? str : _.isNumber(str) ? str : ''\r\n }\r\n}\r\n\r\n// Excel表格下载\r\nVue.prototype.__exportExcel = (\r\n url = \"Abnormal/getAllAbnormalExcel\",\r\n params = {},\r\n token = localStorage.getItem(\"SC_token\")\r\n) => {\r\n // eslint-disable-next-line no-param-reassign\r\n delete params.pageNum;\r\n // eslint-disable-next-line no-param-reassign\r\n delete params.pageSize;\r\n let link;\r\n if (document.getElementById(\"exportATag\")) {\r\n link = document.getElementById(\"exportATag\");\r\n } else {\r\n link = document.createElement(\"a\");\r\n link.setAttribute(\"id\", \"exportATag\");\r\n link.style.display = \"none\";\r\n }\r\n const httpReg = /(http|https):\\/\\/([\\w.]+\\/?)\\S*/;\r\n let urlStr = httpReg.test(url) ? `${url}&` : `${url}?`;\r\n _.mapKeys(params, (val, key) => {\r\n\r\n if (!_.isEmpty(String(val)) && val) {\r\n urlStr += `${key}=${val}&`;\r\n }\r\n });\r\n\r\n link.href = `${urlStr}access_token=${token}`;\r\n\r\n document.body.appendChild(link);\r\n link.click();\r\n};"]}]}
|