stName: function (raw_name) { return "post[" + raw_name + "]"; }, generatePostMoreName: function (raw_name) { return "post[more][" + raw_name + "]"; }, generateUploadSingleImg: function (value) { return "javascript:uploadOneImage('图片上传','#" + value + "');"; }, generateUploadMultiImg: function (value) { return "javascript:uploadMultiImage('图片上传','#" + value + "','photos-item-tpl');"; }, generateUploadSingleFile: function (value) { return "javascript:uploadOne('附件上传','#" + value + "','file');"; }, generateUploadMultiFile: function (value) { return "javascript:uploadMultiFile('附件上传','#" + value + "','files-item-tpl','file');"; }, generateRemoveImg: function (value) { return 'javascript:(function(){$("#' + value + '").remove();})()'; }, generateRemoveFile: function (value) { return 'javascript:(function(){$("#' + value + '").remove();})()'; }, format_time: function (value) { var date = new Date(value * 1000); return formatDate(date, 'yyyy-MM-dd hh:mm:ss'); }, format_img_link: function (value) { return '/upload/' + value; }, format_file_link: function (value) { return '/upload/' + value; }, open_img: function (value) { this.imgShow.visiable = true; this.imgShow.url = this.format_img_link(value); }, commonHttp: function (url, data, refresh, call_back, error_call_back) { if (arguments.length < 5) error_call_back = function () { }; if (arguments.length < 4) call_back = function () { }; if (arguments.length < 3) refresh = true; this.$http.post(url, data, { emulateJSON: true }).then(function (response) { var res = response.body; if (res.code == 1) { if ('' == res.msg) { call_back(res.data); if (refresh) location.href = res.url; } else { this.$message({ showClose: true, message: res.msg, type: 'success', duration: this.message_duration, customClass: 'message' , onClose: function () { call_back(res.data); if (refresh) location.href = res.url; } }); } } else { this.error(res.msg); error_call_back(); } }, function (res) { this.error("错误"); }); //http }, error: function (message, message_duration, customClass) { if (arguments.length < 3) customClass = 'message'; if (arguments.length < 2) message_duration = this.message_duration; if (arguments.length < 1) message = '错误'; this.$message({ showClose: true, message: message, type: 'error', duration: message_duration, customClass: customClass }); }, warning: function (message, message_duration, customClass) { if (arguments.length < 3) customClass = 'message'; if (arguments.length < 2) message_duration = this.message_duration; if (arguments.length < 1) message = '警告'; this.$message({ showClose: true, message: message, type: 'warning', duration: message_duration, customClass: customClass }); }, success: function (message, message_duration, customClass) { if (arguments.length < 3) customClass = 'message'; if (arguments.length < 2) message_duration = this.message_duration; if (arguments.length < 1) message = '警告'; this.$message({ showClose: true, message: message, type: 'success', duration: message_duration, customClass: customClass }); }, //深度克隆 deep_clone: function (obj) { var result, oClass = vm_common.tell_class(obj); //确定result的类型 if (oClass === "Object") { result = {}; } else if (oClass === "Array") { result = []; } else { return obj; } for (key in obj) { var copy = obj[key]; if (vm_common.tell_class(copy) == "Object") { result[key] = arguments.callee(copy);//递归调用 } else if (vm_common.tell_class(copy) == "Array") { result[key] = arguments.callee(copy); } else { result[key] = obj[key]; } } return result; }, is_array: function (value) { if (typeof Array.isArray === "function") return Array.isArray(value); else return Object.prototype.toString.call(value) === "[object Array]"; }, //返回传递给他的任意对象的类 tell_class: function (value) { if (value === null) return "Null"; if (value === undefined) return "Undefined"; return Object.prototype.toString.call(value).slice(8, -1); }, create_html: function (name, style) { if (arguments.length < 2) style = {}; var default_style = $.extend(true, { initialFrameHeight: 240, initialFrameWidth: '100%', autoHeightEnabled: false, scaleEnabled: true, zIndex: 2000 }, style); var editorcontent = new baidu.editor.ui.Editor(default_style); editorcontent.render(name); try { editorcontent.sync(); } catch (err) { } return editorcontent; }, is_empty: function (value) { return value === undefined ? true : value === null ? true : value === "" ? true : this.is_array(value) ? value.length == 0 : false; }, url_encode: function (param, key, encode) { if (param == null) return ''; var paramStr = ''; var t = typeof (param); if (t == 'string' || t == 'number' || t == 'boolean') { paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param); } else { for (var i in param) { var k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '[' + i + ']'); paramStr += this.urlEncode(param[i], k, encode); } } return paramStr; }, is_weixin: function () { var ua = window.navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == 'micromessenger') { return true; } else { return false; } }, is_mobile: function () { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = false; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; } } return flag; }, }, filters: { formatDateTime: function (inputTime) { var date = new Date(inputTime); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; var d = date.getDate(); d = d < 10 ? ('0' + d) : d; var h = date.getHours(); h = h < 10 ? ('0' + h) : h; var minute = date.getMinutes(); var second = date.getSeconds(); minute = minute < 10 ? ('0' + minute) : minute; second = second < 10 ? ('0' + second) : second; return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; }, unescape: function (html) { if (null === html || undefined === html) return ''; return html .replace(html ? /&(?!#?\w+;)/g : /&/g, '&') .replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, "\"") .replace(/'/g, "\'"); } } }; var vm_common = new Vue(none);
您好,欢迎访问呼伦贝尔市第三人民医院官网 | 今天是:2026年11月25日 星期三 │
全国统一心理援助热线:12356
医院新闻
1.996959s