Commit 125938b0 by 潘建波

临时提交

2 parents 918a409f e4cd9fcc
No preview for this file type
......@@ -6,10 +6,10 @@ import search from "./search";
import device from "./device"
import resource from "./resource"
import ops from "./ops"
let wsIP = "192.168.9.133:20080";
let wsIP = "vion-panda.51vip.biz:52510";
switch (process.env.NODE_ENV) {
case "development":
wsIP = "192.168.9.133:20080"; // 测试环境url
wsIP = "vion-panda.51vip.biz:52510"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
break;
case "pre":
......
......@@ -17,7 +17,7 @@ service.interceptors.request.use(
}
if (config.method == 'get') {
config.params = {
_t: Date.parse(new Date()) / 1000,
// _t: Date.parse(new Date()) / 1000,
...config.params
}
}
......
......@@ -6,5 +6,6 @@ export default {
cates: baseUrl + "/api/v1/codes/traffic/cates",
codes: baseUrl + "/api/v1/codes/traffic/cates/",
customCode:baseUrl + "/api/v1/codes/custom/cates",
menus:baseUrl + "/api/v1/auth/menu_tree"
menus:baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus"
// getApps:baseUrl + "/api/v1/auth/apps"
};
......@@ -5,7 +5,7 @@ export default {
pass:baseUrl+'/api/v1/datahandle/behavior/audit/',
delResult:baseUrl+'/api/v1/datahandle/behavior/events/',
delEvent:baseUrl+'/api/v1/datahandle/behavior/archive/',
eventTypeData:'http://192.168.9.133:20080'+'/api/v1/codes/event_types',
eventTypeData:baseUrl+'/api/v1/codes/event_types',
homeNum:baseUrl+'/api/v1/datahandle/statistics/type',
homeLine:baseUrl+'/api/v1/datahandle/statistics/hour',
homeCatch:baseUrl+'/api/v1/datahandle/statistics/handle',
......
import api from '../index'
import baseUrl from '../baseUrl'
export default {
getUserList(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/users`, params)
getUserList(params,id){
return api.get(`${baseUrl}/api/v1/auth/users/${id}`, params)
},
getRoleList(params,id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/roles`, params)
return api.get(`${baseUrl}/api/v1/auth/roles`, params)
},
addUser(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/users`, params)
return api.post(`${baseUrl}/api/v1/auth/users`, params)
},
editUser(params,id) {
return api.post(`${baseUrl}/api/v1/devconf_fx/users/${id}`, params)
......@@ -23,9 +23,12 @@ export default {
return api.get(`${baseUrl}/api/v1/devconf_fx/menu/list`, params)
},
addRole(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/roles`, params)
return api.post(`${baseUrl}/api/v1/auth/roles`, params)
},
logList(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/logs`, params)
},
bindperms(params,id){
return api.post(`${baseUrl}/api/v1/auth/roles/${id}/perms`, params)
}
}
\ No newline at end of file
......@@ -47,6 +47,7 @@ export default {
uploadFile(params,id){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'})
},
getResource(params,id){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params)
},
......@@ -56,6 +57,9 @@ export default {
getStoreConList(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params)
},
uploadStore(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/store_confs`, params,{'Content-Type': 'multipart/form-data'})
},
getSubTask(params,id){
return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params)
},
......
......@@ -2,7 +2,7 @@ import api from "../index";
import baseUrl from "../baseUrl";
export default {
getEventType() {
return api.get(`http://192.168.9.133:20080/api/v1/codes/event_types`);
return api.get(`${baseUrl}/api/v1/codes/event_types`);
},
getTrafficType(params) {
//类型统计
......
......@@ -201,6 +201,13 @@ export const asyncRouterMap = [
},
component: resolve => require(["../views/ops/role_manage.vue"], resolve),
},{
path: "/ops/batch_upgrade",
name: "批量升级",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/ops/log_manage.vue"], resolve),
},{
path: "/ops/log_manage",
name: "日志管理",
meta: {
......
......@@ -36,10 +36,10 @@ function filterAsyncRouter(asyncRouterMap, roles) {
// return routers
asyncRouterMap.forEach((ele, index) => {
roles.map(m => {
if (ele.path == m.menu_api) {
if (ele.path == m.path) {
let obj = ele;
if (m.childs && m.childs.length > 0) {
obj.children = filterAsyncRouter(ele.children, m.childs);
if (m.children && m.children.length > 0) {
obj.children = filterAsyncRouter(ele.children, m.children);
} else {
obj.children = []
}
......@@ -72,6 +72,7 @@ const menu = {
commit("SET_ROUTERS", []);
return;
} else {
console.log('aaa',data)
let accessedRouters = filterAsyncRouter(asyncRouterMap, data);
commit("SET_ROUTERS", accessedRouters);
}
......
......@@ -45,8 +45,9 @@ import types from '../store/types.js'
},
login(){
this.$api.login.login({
user_name: this.username,
user_password: sha1(this.),
"username":this.username,
"password":this.password,
"user_type": "user"
}).then(res => {
if(!res.ecode){
this.$store.commit(types.ATOKEN,res.token);
......@@ -74,6 +75,17 @@ import types from '../store/types.js'
}).catch((err) => {
})
},
getMenu(id){
//获取菜单
this.$api.login.getMenus({
"shape":"tree"
}).then(res=>{
localStorage.setItem('menu', JSON.stringify(res.menu_tree[0].children))
this.$store.dispatch('GetMenuRole',res.menu_tree[0].children).then(res => {
this.$router.push('/')
})
})
},
algoList() {
this.$api.login.algocombs({
limit: '',
......
......@@ -266,8 +266,10 @@
this.addForm.menu_unids=this.$refs.addTree.getCheckedKeys().sort((a, b) => { return a - b; });
this.$refs[formName].validate((valid) => {
if (valid) {
this.$api.ops.addRole(this.addForm).then(res=>{
this.$api.ops.addRole({name:this.addForm.role_name}).then(res=>{
if(!res.ecode){
// this.$api.ops.bindperms({})
this.$message({
type: 'success',
message: '添加成功!'
......
......@@ -164,9 +164,10 @@
page:1,
pageSize:30,
addForm:{
norm_type:"login",
role_unid:'',
user_name:'',
user_password:''
username:'',
password:''
},
editForm:{
role_unid:'',
......@@ -211,11 +212,12 @@
},
getTableList(){
this.tableData=[];
console.log('aa',this.userId)
let offset = (this.page - 1) * this.pageSize;
this.$api.ops.getUserList({
limit: this.pageSize,
offset: offset,
}).then((res)=>{
},this.userId).then((res)=>{
this.total=res.total_num;
if(res.list_data==null){
......@@ -232,6 +234,7 @@
this.$api.ops.getRoleList({
limit: 9999,
offset: 0,
is_active:true
}).then((res)=>{
if(res.list_data==null){
this.roleList=[]
......
......@@ -71,6 +71,36 @@
</div>
</div>
<el-dialog
title="添加"
:visible.sync="addVisible"
width="450px">
<div>
<el-form label-position="left" label-width="120px">
<el-form-item label="配置名称">
<el-input v-model="names"></el-input>
</el-form-item>
<el-form-item label="添加文件">
<el-upload
ref="upload"
action="uploadUrl"
:http-request="httpRequest"
multiple
name="file"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible=false">取 消</el-button>
<el-button type="primary" @click="save">上 传</el-button>
</span>
</el-dialog>
<el-dialog title="详情" :visible.sync="detailVisible" width="30%">
<div class="title">任务列表</div>
<div class="maxHeight">
......@@ -87,6 +117,10 @@
export default {
data(){
return{
addVisible:false,
uploadUrl: '',
names:'',
file:[],
props: {
label: 'name',
children: 'child',
......@@ -117,6 +151,26 @@
this.query();
},
methods:{
// 自定义的上传函数
httpRequest(param) {
this.file=[];
// 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息
this.file.push(param.file)
},
save(){
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// 最重要的就是这段代码
var upData = new FormData() // 首先创建FormData对象
this.file.forEach((file)=>{
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append('name', this.names);
upData.append("is_temp", 0);
})
this.$api.resource.uploadStore(upData).then(res=>{
this.query();
})
},
loadNode(node, resolve) {
if (node.level === 0) {
return resolve(this.curentSubList);
......@@ -164,7 +218,7 @@
})
},
add(){
this.addVisible=true;
},
taskFormatter(row, column, cellValue, index){
let columnText='';
......
......@@ -30,7 +30,6 @@
action="uploadUrl"
:http-request="httpRequest"
multiple
:data="uploadData"
name="file"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
......@@ -63,10 +62,6 @@
childs: []
}
],
uploadData:{
vchan_type:'vfile',
vchan_refid:new Date().getTime()
},
defaultProps:{
children: "childs",
disabled: "disabled",
......@@ -123,19 +118,8 @@
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append('name', file.name);
upData.append('vchan_type', 'vfile');
upData.append('vchan_refid', '11111111');
upData.append('vchan_refid', new Date().getTime());
})
console.log(upData.getAll('file'))
// this.axios.post('http://192.168.9.133:20080/api/v1/devconf_fx/devs/'+this.devsId+'/vfile_vchans', upData, {
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
// }).then(res => {
// console.log(res);
// }).catch(err => {
// console.log(err);
// });
this.$api.resource.uploadFile(upData,this.devsId).then(res=>{
console.log(res)
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!