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`, //登录
verification: `${host}users/users/user/captcha`,// 验证码图片
isClient: `${host}users/users/user/isClient`,// 验证码图片
// 权限管理
getUserRolesPermissionMenu: `${host}users/user-role/getUserRolesPermissionMenu`,

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

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

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