Commit 401752ab authored by dupengyu's avatar dupengyu

路由修改前

parent 099aff70
......@@ -2,11 +2,11 @@ import request from '@/utils/request'
/* 运行报表 */
export function chartInfo(params) {
export function chartInfo(data) {
return request({
url: '/device/chartInfo',
method: 'post',
params
data
})
}
/* 任务管理 */
......
import request from '@/utils/request'
// 查询角色列表
export function listRole(query) {
export function listRole(data) {
return request({
url: '/api/role/list',
method: 'get',
params: query
method: 'post',
data
})
}
......
/**
* v-hasPermi 操作权限处理
* Copyright (c) 2019 ruoyi
*/
/**
* v-hasPermi 操作权限处理
* Copyright (c) 2019 ruoyi
*/
import store from '@/store'
......@@ -10,7 +10,7 @@ export default {
const { value } = binding
const all_permission = "*:*:*";
const permissions = store.getters && store.getters.permissions
console.log(permissions)
if (value && value instanceof Array && value.length > 0) {
const permissionFlag = value
......
......@@ -13,6 +13,7 @@ import performLoader from '@/utils/global_main_loader.js'
import WS from '@/utils/websocket'
import { getDicts } from "@/api/system/dict/data";
import directive from './directive' // directive
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, getDictLabel } from '@/utils/ruoyi'
// 字典标签组件
import DictTag from '@/components/DictTag'
import RightToolbar from '@/components/RightToolbar'
......@@ -24,6 +25,12 @@ Vue.use(ElementUI, { locale })
performLoader(Vue) // 所有的第三方插件性质的东西都放到这里面了
Vue.config.productionTip = false
Vue.prototype.getDicts = getDicts
Vue.prototype.parseTime = parseTime
Vue.prototype.handleTree = handleTree
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.component('RightToolbar', RightToolbar)
Vue.component('DictTag', DictTag)
Vue.use(directive)
......@@ -35,7 +42,7 @@ function dispatchWithPromise(path) {
}
const beforeEnterApp = () => {
dispatchWithPromise('depart/getDepart')
// dispatchWithPromise('depart/getDepart')
dispatchWithPromise('user/getInfo')
dispatchWithPromise('alarm/getAlarmList')
}
......
......@@ -42,12 +42,12 @@ export const constantRoutes = [
component: () => import('@/views/alarm/cableTime/index'),
meta: { title: '漏缆监测告警' }
},
{
path: 'device',
name: 'device',
component: () => import('@/views/alarm/device/index'),
meta: { title: '设备连接告警' }
},
// {
// path: 'device',
// name: 'device',
// component: () => import('@/views/alarm/device/index'),
// meta: { title: '设备连接告警' }
// },
{
path: 'statistics',
name: 'statistics',
......@@ -135,12 +135,12 @@ export const constantRoutes = [
component: () => import('@/views/monitor/leakageCable/index'),
meta: { title: '漏缆实时状态' }
},
{
path: 'equipment',
name: '设备实时状态',
component: () => import('@/views/monitor/equipment/index'),
meta: { title: '设备实时状态' }
}
// {
// path: 'equipment',
// name: '设备实时状态',
// component: () => import('@/views/monitor/equipment/index'),
// meta: { title: '设备实时状态' }
// }
]
},
{
......@@ -243,10 +243,10 @@ export const constantRoutes = [
meta: { title: '菜单管理' }
},
{
path: 'synchronize',
name: '时间同步',
component: () => import('@/views/backup/synchronize/index'),
meta: { title: '时间同步' }
path: 'role',
name: '角色管理',
component: () => import('@/views/system/role/index'),
meta: { title: '角色管理' }
}
]
},
......
......@@ -2,5 +2,6 @@ const getters = {
sidebar: state => state.app.sidebar,
device: state => state.app.device,
token: state => state.user.token,
dict: state => state.dict.dict,
}
export default getters
......@@ -7,6 +7,7 @@ import user from './modules/user'
import depart from './modules/depart'
import alarm from './modules/alarm'
import permission from './modules/peimission'
import dict from './modules/dict'
Vue.use(Vuex)
......@@ -18,7 +19,8 @@ const store = new Vuex.Store({
user,
depart,
alarm,
permission
permission,
dict
},
getters
})
......
const state = {
dict: new Array()
}
const mutations = {
SET_DICT: (state, { key, value }) => {
if (key !== null && key !== "") {
state.dict.push({
key: key,
value: value
})
}
},
REMOVE_DICT: (state, key) => {
try {
for (let i = 0; i < state.dict.length; i++) {
if (state.dict[i].key == key) {
state.dict.splice(i, 1)
return true
}
}
} catch (e) {
}
},
CLEAN_DICT: (state) => {
state.dict = new Array()
}
}
const actions = {
// 设置字典
setDict({ commit }, data) {
commit('SET_DICT', data)
},
// 删除字典
removeDict({ commit }, key) {
commit('REMOVE_DICT', key)
},
// 清空字典
cleanDict({ commit }) {
commit('CLEAN_DICT')
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
......@@ -66,4 +66,6 @@ export default {
state,
mutations,
actions,
}
\ No newline at end of file
}
......@@ -54,7 +54,15 @@ service.interceptors.request.use(
let errorShowing = false
service.interceptors.response.use(
response => {
console.log(response)
let res = response.data.data ? response.data.data : response.data
if (response.data.msg == "操作成功") {
res = response.data
}
// if (response.data.success) {
// res = response.data
// }
if (response.data.recordsTotal) {
res = {
recordsTotal: response.data.recordsTotal,
......
......@@ -8,9 +8,9 @@ export default function socket(handlerOptions) {
onopen,
// socketUrl
} = handlerOptions
let socketUrl = 'ws://101.126.159.207:8087/device/websocket/1'
// let socketUrl = 'ws://101.126.159.207:8087/device/websocket/1'
// let socketUrl = 'ws://127.0.0.1:8087/device/websocket/1'
let socketUrl = 'ws://127.0.0.1:8087/device/websocket/1'
let websocket
if ("WebSocket" in window) {
websocket = new WebSocket(socketUrl)
......
......@@ -128,7 +128,7 @@
<div class="item_data">{{ form.type4 }}</div>
</el-col>
</el-row>
<el-row class="text" :gutter="24">
<!-- <el-row class="text" :gutter="24">
<el-col :span="10">
<div class="item_name">漏缆</div>
</el-col>
......@@ -143,7 +143,7 @@
<el-col :span="10">
<div class="item_data">{{ form.type6 }}</div>
</el-col>
</el-row>
</el-row> -->
</div>
</el-card>
</el-col>
......
......@@ -69,8 +69,25 @@ export default {
this.handleChartInfo();
},
methods: {
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
async handleChartInfo() {
let res = await chartInfo({});
const midnight = new Date();
midnight.setHours(0, 0, 0, 0);
midnight.setTime(midnight.getTime() - 7 * 24 * 60 * 60 * 1000);
let data = {
startDate: this.formatDate(midnight),
endDate: this.formatDate(new Date()),
};
const queryParams = new URLSearchParams(data).toString();
let res = await chartInfo(queryParams);
this.chartInfo = res.content;
if (this.myChart.chart1 != null) {
this.myChart.chart1.dispose();
......@@ -100,16 +117,40 @@ export default {
name: "成功",
data: this.chartInfo.triggerDayCountSucList,
type: "line",
lineStyle: {
color: "#91CC75",
},
itemStyle: {
normal: {
color: "#91CC75",
},
},
},
{
name: "失败",
data: this.chartInfo.triggerDayCountFailList,
type: "line",
lineStyle: {
color: "#EE6666",
},
itemStyle: {
normal: {
color: "#EE6666",
},
},
},
{
name: "进行中",
data: this.chartInfo.triggerDayCountRunningList,
type: "line",
lineStyle: {
color: "#FAC858",
},
itemStyle: {
normal: {
color: "#FAC858",
},
},
},
],
};
......@@ -133,6 +174,11 @@ export default {
orient: "vertical",
left: "left",
},
color: [
"#91CC75",
"#EE6666",
"#FAC858"
],
series: [
{
name: "数量",
......
......@@ -307,7 +307,9 @@ export default {
visible: undefined
},
// 表单参数
form: {},
form: {
parentId:''
},
// 表单校验
rules: {
menuName: [
......@@ -334,6 +336,7 @@ export default {
getList() {
this.loading = true;
listMenu(this.queryParams).then(response => {
console.log(response);
this.menuList = this.handleTree(response.data, "menuId");
this.loading = false;
});
......@@ -392,6 +395,7 @@ export default {
handleAdd(row) {
this.reset();
this.getTreeselect();
console.log(row);
if (row != null && row.menuId) {
this.form.parentId = row.menuId;
} else {
......
......@@ -150,8 +150,8 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
@pagination="getList"
/>
......@@ -315,8 +315,8 @@ export default {
deptOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
current: 1,
size: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
......@@ -348,8 +348,9 @@ export default {
/** 查询角色列表 */
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
let data = { ...this.queryParams ,...this.dateRange};
listRole(data).then(response => {
this.roleList = response.records;
this.total = response.total;
this.loading = false;
}
......
......@@ -9,7 +9,6 @@ function resolve(dir) {
const name = defaultSettings.title || '漏缆故障定位监测系统' // page title
const port = process.env.port || process.env.npm_config_port || 8890 // dev port
const href = 'http://101.126.159.207'
// const href = 'http://192.168.0.118'
// const href = 'http://127.0.0.1'
// const href = 'http://192.168.0.122'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment