fix:多余依赖删除

This commit is contained in:
wangwenrui
2020-05-15 15:03:42 +08:00
parent b374f52050
commit 1ec3b0eab5
3 changed files with 23 additions and 3 deletions

View File

@@ -208,7 +208,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
<script>
import bus from "../../../../libs/bus";
import promqlInput from "./promqlInput";
import promqlInputPlus from "./promqlInputPlus";
// import promqlInputPlus from "./promqlInputPlus";
import chart from "../overview/chart";
import axios from 'axios';
import chartBox from "../../../page/dashboard/chartBox";
@@ -219,7 +219,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
name: "explore",
components: {
'promql-input': promqlInput,
'promql-input-plus':promqlInputPlus,
// 'promql-input-plus':promqlInputPlus,
'chart': chart,
'chart-box': chartBox,
},

View File

@@ -19,7 +19,7 @@ import plTable from 'pl-table'
import 'pl-table/themes/index.css'
import {post, get, put, del} from './http.js'
import {toTop, clickoutside, scrollBar, bottomBoxWindow,stringTimeParseToUnix} from './tools.js'
import {toTop, clickoutside, scrollBar, bottomBoxWindow,stringTimeParseToUnix,unixTimeParseToString} from './tools.js'
import Pagination from "./components/common/pagination"; //引入全局分页组件
@@ -80,6 +80,7 @@ Vue.prototype.$delete = del;
Vue.prototype.$toTop = toTop; //toTop置顶按钮方法
Vue.prototype.$bottomBoxWindow = bottomBoxWindow; //底部上滑框控制
Vue.prototype.$stringTimeParseToUnix = stringTimeParseToUnix;
Vue.prototype.$unixTimeParseToString = unixTimeParseToString;
Vue.prototype.$tableHeight = { //列表页表格的高度
normal: 'calc(100% - 100px)', //常规高度,特例在下方定义
openSubList: { //打开二级列表后的高度

View File

@@ -338,3 +338,22 @@ export function stringTimeParseToUnix(stringTime){
let time=new Date(stringTime).getTime();
return time/1000;
}
export function unixTimeParseToString(unixTime,fmt='yyyy-MM-dd hh-mm-ss'){
let date=new Date(unixTime * 1000);
var o = {
"M+" : date.getMonth()+1, //月份
"d+" : date.getDate(), //日
"h+" : date.getHours(), //小时
"m+" : date.getMinutes(), //分
"s+" : date.getSeconds(), //秒
"q+" : Math.floor((date.getMonth()+3)/3), //季度
"S" : date.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt))
fmt=fmt.replace(RegExp.$1, (date.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;
}