dev_2022-05-11
yujialong 3 years ago
parent b28167044e
commit 05d2d51886
  1. 1
      src/api/index.js
  2. 2
      src/main.js
  3. 5
      src/pages/account/login/index.vue
  4. 26
      src/pages/evaluation/list/index.vue
  5. 2
      src/router/index.js

@ -8,6 +8,7 @@ export default {
logins: `${host}users/users/user/login`, //登录 logins: `${host}users/users/user/login`, //登录
verification: `${host}users/users/user/captcha`,// 验证码图片 verification: `${host}users/users/user/captcha`,// 验证码图片
isClient: `${host}users/users/user/isClient`,// 验证码图片
// 权限管理 // 权限管理
getUserRolesPermissionMenu: `${host}users/user-role/getUserRolesPermissionMenu`, getUserRolesPermissionMenu: `${host}users/user-role/getUserRolesPermissionMenu`,

@ -39,7 +39,7 @@ Vue.prototype.auth = function(values){
// 直接拿值进行匹配,取得当前router的mate信息,传入,返回一个boolean,以此进行vif判断 // 直接拿值进行匹配,取得当前router的mate信息,传入,返回一个boolean,以此进行vif判断
// router.meta 信息匹配传进来的value,用vif去进行按钮级权限配置即可。 // router.meta 信息匹配传进来的value,用vif去进行按钮级权限配置即可。
// $router.currentRoute.meta // $router.currentRoute.meta
// console.log(router.currentRoute.meta,'当前路由的按钮权限数组') console.log(router.currentRoute.meta,'当前路由的按钮权限数组')
return router.currentRoute.meta.btn.some(e=>e===values) return router.currentRoute.meta.btn.some(e=>e===values)
} }
new Vue({ new Vue({

@ -140,7 +140,10 @@ export default {
}); });
}, },
queryCustomer() { // queryCustomer() { //
this.$get(this.api.isClient).then(res => {
this.setCustomer(res.customer);
this.setCustomerName(res.customerName);
}).catch(res => {});
}, },
phoneCountdown() { phoneCountdown() {
let count = 60; let count = 60;

@ -44,19 +44,15 @@
<el-table-column prop="updateTime" label="时间" align="center"></el-table-column> <el-table-column prop="updateTime" label="时间" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.isEnable">
<el-button v-if="auth('查看')" type="text" @click="showQues(scope.row)">查看</el-button> <el-button v-if="auth('查看')" type="text" @click="showQues(scope.row)">查看</el-button>
</template> <el-button v-if="auth('编辑')" type="text" @click="editQues(scope.row)">编辑</el-button>
<template v-else>
<el-button v-if="auth('修改')" type="text" @click="editQues(scope.row)">修改</el-button>
</template>
<el-switch <el-switch
v-if="auth('禁用')" v-if="auth('禁用')"
v-model="scope.row.isEnable" v-model="scope.row.isEnable"
:active-text="scope.row.isEnable ? '关闭' : '启用'" :active-text="!scope.row.isEnable ? '禁用' : '启用'"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
style="margin: 0 10px 0 5px" style="margin: 0 10px;"
@change="switchQues($event,scope.row,scope.$index)" @change="switchQues($event,scope.row,scope.$index)"
></el-switch> ></el-switch>
<el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button> <el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button>
@ -395,15 +391,10 @@ export default {
this.resetForm(); this.resetForm();
}, },
switchQues(val, row, index) { switchQues(val, row, index) {
this.$post(`${this.api.questionsIsDisable}?id=${row.id}`) this.$post(`${this.api.questionsIsDisable}?id=${row.id}`).then(res => {
.then(res => { util.successMsg("更新状态成功");
if (res.status == 400) { this.getData();
util.errorMsg(res.message); }).catch(err => {});
row.isEnable = row.isEnable == 1 ? 0 : 1;
}
})
.catch(err => {
});
}, },
delData(row) { delData(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -664,5 +655,8 @@ export default {
.check-wrap.checked { .check-wrap.checked {
color: #9076FF; color: #9076FF;
} }
/deep/ .el-switch__label *{
font-size: 12px;
}
</style> </style>

@ -267,7 +267,7 @@ router.beforeEach(function(to, from, next) {
} }
} }
// 根据路由元信息设置文档标题 // 根据路由元信息设置文档标题
window.document.title = to.meta.title; window.document.title = to.meta.title ? to.meta.title : "";
next(); next();
}); });
Loading…
Cancel
Save