role1.0
fanluyan 1 year ago
parent f18923ebf1
commit b3a60b2240

@ -13,6 +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"));
config.headers.Authorization = localStorage.getItem("token"); config.headers.Authorization = localStorage.getItem("token");
} }
return config; return config;

@ -261,16 +261,15 @@
type="text" type="text"
class="deleteText" class="deleteText"
@click.native.stop="handleDelete(scope.row)" @click.native.stop="handleDelete(scope.row)"
v-if="scope.row.status == 1" >删除</el-button
>关闭</el-button
> >
<el-button <!-- <el-button
type="text" type="text"
class="deleteText" class="deleteText"
@click.native.stop="handleOpen(scope.row)" @click.native.stop="handleOpen(scope.row)"
v-if="scope.row.status == 0" v-if="scope.row.status == 0"
>打开</el-button >打开</el-button
> > -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="180" v-else> <el-table-column fixed="right" label="操作" width="180" v-else>
@ -591,24 +590,20 @@ export default {
// //
handleDelete(data) { handleDelete(data) {
console.log(data); console.log(data);
this.deleteArr.push({ this.deleteArr.push(data.id);
termid: data.id,
});
console.log(this.deleteArr); console.log(this.deleteArr);
this.$confirm("确定要关闭该装置?", "提示", { this.$confirm("确定要删除该装置?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
// //
deleteTerminalJoggle({ list: this.deleteArr, type: 0 }).then( deleteTerminalJoggle({ list: this.deleteArr }).then((res) => {
(res) => {
console.log(res); console.log(res);
this.deleteArr = []; this.deleteArr = [];
this.terminalList(); // this.terminalList(); //
} });
);
this.$message({ this.$message({
duration: 1500, duration: 1500,
type: "success", type: "success",
@ -625,43 +620,43 @@ export default {
// }); // });
}); });
}, },
// // //
handleOpen(data) { // handleOpen(data) {
console.log(data); // console.log(data);
this.deleteArr.push({ // this.deleteArr.push({
termid: data.id, // termid: data.id,
}); // });
console.log(this.deleteArr); // console.log(this.deleteArr);
this.$confirm("确定要打开该装置?", "提示", { // this.$confirm("?", "", {
confirmButtonText: "确定", // confirmButtonText: "",
cancelButtonText: "取消", // cancelButtonText: "",
type: "success", // type: "success",
}) // })
.then(() => { // .then(() => {
// // //
deleteTerminalJoggle({ list: this.deleteArr, type: 1 }).then( // deleteTerminalJoggle({ list: this.deleteArr, type: 1 }).then(
(res) => { // (res) => {
console.log(res); // console.log(res);
this.deleteArr = []; // this.deleteArr = [];
this.terminalList(); // // this.terminalList(); //
} // }
); // );
this.$message({
duration: 1500,
type: "success",
message: "打开成功!",
showClose: true,
});
})
.catch(() => {
// this.$message({ // this.$message({
// duration: 1500, // duration: 1500,
// type: "info", // type: "success",
// message: "", // message: "!",
// showClose: true, // showClose: true,
// }); // });
}); // })
}, // .catch(() => {
// // this.$message({
// // duration: 1500,
// // type: "info",
// // message: "",
// // showClose: true,
// // });
// });
// },
// //
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;

@ -54,10 +54,7 @@
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="200"> <el-table-column fixed="right" label="操作" width="200">
<template <template slot-scope="scope" v-if="scope.row.role !== 0">
slot-scope="scope"
v-if="scope.row.roleName !== '超级管理员'"
>
<el-button <el-button
@click.native.stop="handleResive(scope.row)" @click.native.stop="handleResive(scope.row)"
type="text" type="text"

@ -3,12 +3,12 @@ const { defineConfig } = require("@vue/cli-service");
// const webpack = require("webpack"); // const webpack = require("webpack");
module.exports = defineConfig({ module.exports = defineConfig({
//打包清除console //打包清除console
chainWebpack(config) { // chainWebpack(config) {
config.optimization.minimizer("terser").tap((args) => { // config.optimization.minimizer("terser").tap((args) => {
args[0].terserOptions.compress.drop_console = true; // args[0].terserOptions.compress.drop_console = true;
return args; // return args;
}); // });
}, // },
productionSourceMap: false, // 生产环境是否要生成 sourceMap productionSourceMap: false, // 生产环境是否要生成 sourceMap
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
//assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/", //assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",

Loading…
Cancel
Save