role1.0
fanluyan 1 year ago
parent 2f54c610a0
commit 221be28fff

@ -63,7 +63,6 @@ export default {
index: "/realTimeMonitor", index: "/realTimeMonitor",
title: "实时监控", title: "实时监控",
}, },
{ {
icon: "el-icon-film", icon: "el-icon-film",
index: "/pictureRotation", index: "/pictureRotation",
@ -74,7 +73,6 @@ export default {
index: "/photoAlarm", index: "/photoAlarm",
title: "告警处理", title: "告警处理",
}, },
{ {
icon: "el-icon-search", icon: "el-icon-search",
index: "/realTimeSearch", index: "/realTimeSearch",
@ -289,6 +287,7 @@ export default {
}, },
], ],
role: "", role: "",
menuList: [],
}; };
}, },
@ -309,25 +308,23 @@ export default {
this.role = localStorage.getItem("role"); this.role = localStorage.getItem("role");
console.log("用户管理"); console.log("用户管理");
console.log(this.role); console.log(this.role);
// if (this.role == 0) { // if (this.role == 0) {
// this.items = this.items; // this.items = this.items;
// } else { // } else {
// this.items = this.items1; // this.menuList = JSON.parse(localStorage.getItem("menuPermission"));
// this.items = this.menuList;
// } // }
if (this.role == 0) { if (this.role == 0) {
console.log("ssssssssssssssssssssssssssssssssssssssss");
this.items = this.items; this.items = this.items;
} else if (this.role == 1) { } else if (this.role == 1) {
this.items = this.items1; this.items = this.items1;
} else if (this.role == 2) { } else if (this.role == 2) {
this.items = this.items2; this.items = this.items2;
} else if (this.role == 4) { } else if (this.role == 4) {
console.log("ssssssssssssssssssssssssssssssssssssssss");
this.items = this.hnjcitems; this.items = this.hnjcitems;
console.log("ssssssssssssssssssssssssssssssssssssssss", this.items);
} }
this.activeIndex = this.items[0].index;
console.log(this.items); console.log(this.items);
console.log(this.activeIndex); console.log(this.activeIndex);
}, },

@ -6,9 +6,19 @@
:close-on-click-modal="false" :close-on-click-modal="false"
width="420px" width="420px"
> >
<el-form :model="psdForm" :rules="rules" ref="formInfo" label-position="left" label-width="80px"> <el-form
:model="psdForm"
:rules="rules"
ref="formInfo"
label-position="left"
label-width="80px"
>
<el-form-item label="用户名:"> <el-form-item label="用户名:">
<el-input v-model="psdForm.userName" autocomplete="off" :disabled="true"></el-input> <el-input
v-model="psdForm.userName"
autocomplete="off"
:disabled="true"
></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="原密码:"> <!-- <el-form-item label="原密码:">
<el-input v-model="psdForm.originalPsd" autocomplete="off"></el-input> <el-input v-model="psdForm.originalPsd" autocomplete="off"></el-input>
@ -31,9 +41,9 @@ import { updateUserApi } from "@/utils/api/index";
export default { export default {
data() { data() {
return { return {
isShow:false, isShow: false,
psdForm: { psdForm: {
userName: localStorage.getItem('userName'), userName: localStorage.getItem("userName"),
originalPsd: "", originalPsd: "",
newPsd: "", newPsd: "",
password: "", password: "",
@ -54,12 +64,12 @@ export default {
submitForm() { submitForm() {
this.$refs.formInfo.validate((valid) => { this.$refs.formInfo.validate((valid) => {
if (valid) { if (valid) {
this.$set(this.psdForm,'userId',localStorage.getItem('userid')) this.$set(this.psdForm, "uid", localStorage.getItem("uid"));
updateUserApi(this.psdForm) updateUserApi(this.psdForm)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success("修改成功,请重新登录"); this.$message.success("修改成功,请重新登录");
this.isShow = false this.isShow = false;
this.$store.commit("REMOVE_INFO"); this.$store.commit("REMOVE_INFO");
this.$router.push("/login"); this.$router.push("/login");
} else { } else {

@ -8,7 +8,7 @@ export default new Vuex.Store({
//用户登录token 存储 //用户登录token 存储
token: "", token: "",
userName: "", userName: "",
userid: "", uid: "",
role: "", role: "",
currentData: "", currentData: "",
channelId: "", channelId: "",
@ -22,6 +22,7 @@ export default new Vuex.Store({
token: (state) => state.token, token: (state) => state.token,
userName: (state) => state.userName, userName: (state) => state.userName,
role: (state) => state.role, role: (state) => state.role,
menuPermission: (state) => state.resources,
}, },
mutations: { mutations: {
//点击获取的左侧列表 //点击获取的左侧列表
@ -64,11 +65,13 @@ export default new Vuex.Store({
}, },
SET_USERINFO(state, val) { SET_USERINFO(state, val) {
state.userName = val.userName; state.userName = val.userName;
state.userid = val.id; state.uid = val.uid;
state.role = val.role; state.role = val.role;
state.resources = val.resources;
localStorage.setItem("userName", state.userName); localStorage.setItem("userName", state.userName);
localStorage.setItem("userid", state.userid); localStorage.setItem("uid", state.uid);
localStorage.setItem("role", state.role); localStorage.setItem("role", state.role);
localStorage.setItem("menuPermission", JSON.stringify(state.resources));
}, },
//退出清除locastorge //退出清除locastorge
REMOVE_INFO(state) { REMOVE_INFO(state) {

@ -872,7 +872,7 @@ export function listApk(data) {
} }
//上传apk //上传apk
export function uploadApk(data) { export function uploadApk(data, onUploadProgress) {
return request({ return request({
url: "/xymanager/uploadApk", url: "/xymanager/uploadApk",
method: "post", method: "post",
@ -880,6 +880,7 @@ export function uploadApk(data) {
headers: { headers: {
"Content-Type": "multipart/form-data", // set the content type to multipart/form-data "Content-Type": "multipart/form-data", // set the content type to multipart/form-data
}, },
onUploadProgress: onUploadProgress, // 允许外部传递进度回调函数
}); });
} }

@ -13,7 +13,7 @@ const service = axios.create({
service.interceptors.request.use((config) => { service.interceptors.request.use((config) => {
if (localStorage.getItem("token")) { if (localStorage.getItem("token")) {
console.log("aaaaaaaaaaaaaa", localStorage.getItem("token")); // console.log("aaaaaaaaaaaaaa", localStorage.getItem("token"));
config.headers.Authorization = localStorage.getItem("token"); config.headers.Authorization = localStorage.getItem("token");
} }
return config; return config;

@ -81,12 +81,7 @@ export default {
this.$store.commit("SET_TOKEN", res.data.token); //tokenvuex this.$store.commit("SET_TOKEN", res.data.token); //tokenvuex
this.$store.commit("SET_USERINFO", res.data); //vuex this.$store.commit("SET_USERINFO", res.data); //vuex
console.log(res.data); console.log(res.data);
if (res.data.role == 5) { this.$router.push("/stritl");
this.$router.push("/weather");
} else {
this.$router.push("/stritl");
}
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,

@ -1927,6 +1927,7 @@ export default {
// //
handleupgradation() { handleupgradation() {
console.log(this.upgradationform.upVal); console.log(this.upgradationform.upVal);
console.log(this.selectUpObj.name);
this.$refs.upgradationRuleForm.validate((valid) => { this.$refs.upgradationRuleForm.validate((valid) => {
if (valid) { if (valid) {
this.ugradLoading = true; this.ugradLoading = true;
@ -1939,6 +1940,10 @@ export default {
name: "file", name: "file",
value: this.upgradationform.upVal, value: this.upgradationform.upVal,
}, },
{
name: "name",
value: this.selectUpObj.name,
},
]; ];
this.setTermFn(params); this.setTermFn(params);
} }

@ -7,6 +7,7 @@
class="upload-demo" class="upload-demo"
ref="upload" ref="upload"
action="#" action="#"
:before-upload="beforeUpload"
:http-request="customUpload" :http-request="customUpload"
:limit="1" :limit="1"
:file-list="fileList" :file-list="fileList"
@ -190,6 +191,14 @@ export default {
// //
console.log(this.progress); // 使使 console.log(this.progress); // 使使
}, },
beforeUpload(file) {
const fileName = file.name;
if (fileName.length > 19) {
this.$message.error("文件名长度不能超过 19 个字符!");
return false; //
}
return true; //
},
// // // //
// beforeAvatarUpload(file) { // beforeAvatarUpload(file) {
// console.log(this.reportData.title); // console.log(this.reportData.title);
@ -206,7 +215,19 @@ export default {
formData.append("file", options.file); formData.append("file", options.file);
formData.append("title", this.reportData.title); // formData.append("title", this.reportData.title); //
console.log(formData); console.log(formData);
uploadApk(formData) uploadApk(formData, (progressEvent) => {
//
const percentCompleted = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
this.progressLoading = true;
// UI
console.log(`上传进度: ${percentCompleted}%`);
this.progress = Math.round(percentCompleted);
// Vue
// this.uploadProgress = percentCompleted; // data
})
.then((res) => { .then((res) => {
console.log(res); console.log(res);
// this.progressLoading = true; // this.progressLoading = true;
@ -220,7 +241,7 @@ export default {
this.reportData.title = ""; this.reportData.title = "";
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.getUpgradeList(); this.getUpgradeList();
// this.progressLoading = false; this.progressLoading = false;
} else { } else {
this.$message({ this.$message({
duration: 1500, duration: 1500,

@ -26,12 +26,12 @@
prop="id" prop="id"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="key" label="路由名称"
show-overflow-tooltip show-overflow-tooltip
prop="key" prop="key"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="desc" label="菜单名称"
show-overflow-tooltip show-overflow-tooltip
prop="desc" prop="desc"
></el-table-column> ></el-table-column>

@ -21,6 +21,13 @@
autocomplete="off" autocomplete="off"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注:" prop="desc">
<el-input
placeholder="请输入备注"
v-model="formdata.desc"
autocomplete="off"
></el-input>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button> <el-button @click="isShow = false"> </el-button>
@ -41,10 +48,10 @@ export default {
formdata: {}, formdata: {},
rules: { rules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }], name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
}, },
xgrules: { xgrules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }], name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
}, },
}; };
}, },

@ -30,7 +30,11 @@
show-overflow-tooltip show-overflow-tooltip
prop="name" prop="name"
></el-table-column> ></el-table-column>
<el-table-column
label="备注"
show-overflow-tooltip
prop="desc"
></el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
show-overflow-tooltip show-overflow-tooltip
@ -106,7 +110,7 @@ export default {
this.roleListAll(); this.roleListAll();
}, },
methods: { methods: {
//线 //
roleListAll() { roleListAll() {
getRoleList() getRoleList()
.then((res) => { .then((res) => {

@ -105,14 +105,23 @@ export default {
//this.formdata = val; //this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val)); this.formdata = JSON.parse(JSON.stringify(val));
}, },
//
getRoleListAll() { getRoleListAll() {
getRoleList() getRoleList()
.then((res) => { .then((res) => {
// console.log("获取角色列表", res.data);
this.roleoptions = res.data.filter((role) => role.id !== 0); this.roleoptions = res.data.filter((role) => role.id !== 0);
}) })
.catch((err) => {}); .catch((err) => {});
}, },
// getRoleListAll() {
// getRoleList()
// .then((res) => {
// //
// this.roleoptions = res.data.filter((role) => role.id !== 0);
// })
// .catch((err) => {});
// },
// //
submitForm() { submitForm() {
this.$refs.formInfo.validate((valid) => { this.$refs.formInfo.validate((valid) => {
@ -154,7 +163,7 @@ export default {
display() { display() {
this.isShow = true; this.isShow = true;
this.roleUser = localStorage.getItem("role"); this.roleUser = localStorage.getItem("role");
//this.getRoleListAll(); this.getRoleListAll();
}, },
hide() { hide() {
this.isShow = false; this.isShow = false;

@ -31,13 +31,13 @@
<!-- <el-table-column label="角色" show-overflow-tooltip prop="roleName"> <!-- <el-table-column label="角色" show-overflow-tooltip prop="roleName">
<template slot-scope="scope">{{ scope.row.roleName }}</template> <template slot-scope="scope">{{ scope.row.roleName }}</template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="角色" show-overflow-tooltip prop="role"> <el-table-column label="角色" show-overflow-tooltip prop="roleName">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<span v-if="scope.row.role == 0"></span> <span v-if="scope.row.role == 0"></span>
<span v-else-if="scope.row.role == 1">管理员</span> <span v-else-if="scope.row.role == 1">管理员</span>
<span v-else-if="scope.row.role == 2">用户</span> <span v-else-if="scope.row.role == 2">用户</span>
<span v-else>{{ scope.row.role }}</span> <span v-else>{{ scope.row.role }}</span>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="备注" label="备注"
@ -129,6 +129,7 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
// //
handleRowClick(row, column, event) { handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row); this.$refs.multipleTable.toggleRowSelection(row);

@ -23,7 +23,7 @@ module.exports = defineConfig({
//表示拦截以/api开头的请求路径 //表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境 //target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell target: "http://180.166.218.222:40080", //dell
//target: "http://192.168.1.190:8080", //liu 本机ip //target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
// target: "http://192.168.50.42:81", //东视 // target: "http://192.168.50.42:81", //东视
changOrigin: true, //是否开启跨域 changOrigin: true, //是否开启跨域
pathRewrite: { pathRewrite: {

Loading…
Cancel
Save