This commit is contained in:
faiz 2024-06-24 17:43:49 +08:00
parent 471c3492db
commit af6be7dcfb
3 changed files with 114 additions and 8 deletions

38
admin/src/api/qa.js Normal file
View File

@ -0,0 +1,38 @@
import request from '@/utils/request'
export function login(data) {
return request({
url: '/admin/login',
method: 'post',
data
})
}
// 获取城市列表
export function getCityList() {
return request({
url: '/admin/city/getCityList',
method: 'get'
})
}
// 获取子集列表
export function getQaList(city_id) {
return request({
url: '/admin/qa/getQaList',
method: 'get',
params: {
city_id
}
})
}
// 获取qa详情
export function getQaDetail(city_id) {
return request({
url: 'admin/qa/getQaDetail',
method: 'get',
params: {
city_id
}
})
}

View File

@ -8,14 +8,16 @@
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<!-- <search id="header-search" class="right-menu-item" /> --> <!-- <search id="header-search" class="right-menu-item" /> -->
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="Global Size" effect="dark" placement="bottom"> <el-tooltip content="Global Size" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip> -->
</template> </template>
<div class="right-menu-item hover-effect">
<el-button @click="drawer = true">QA常见问题</el-button>
</div>
<div v-if="$store.getters.is_anchor" class="right-menu-item hover-effect"> <div v-if="$store.getters.is_anchor" class="right-menu-item hover-effect">
<el-button @click="dialogWorks = true">排班{{ $store.getters.name }}</el-button> <el-button @click="dialogWorks = true">排班{{ $store.getters.name }}</el-button>
</div> </div>
@ -116,7 +118,28 @@
<el-button type="primary" @click="saveWork"> </el-button> <el-button type="primary" @click="saveWork"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-drawer
:with-header="false"
:visible.sync="drawer"
size="800px"
direction="rtl"
:modal="false"
:before-close="handleClose"
>
<div v-clickoutside="handleClose" class="drawer">
<el-button v-if="QaShow" type="success" @click="drawer = false"> </el-button>
<el-button v-if="!QaShow" type="success" @click="QaShow = true"> </el-button>
<div v-if="QaShow" class="mod">
<el-button v-for="item in getCityList" style="width: 150px;" size="medium" type="primary" @click="getQaDetail(item.city_id)">
{{ item.city_name }}
</el-button>
</div>
<div v-if="QaInfo && !QaShow" class="ver">
<div class="ver_title">{{ QaInfo.title }}</div>
<div class="ver_content">{{ QaInfo.content }}</div>
</div>
</div>
</el-drawer>
</div> </div>
</template> </template>
@ -130,8 +153,10 @@ import Search from '@/components/HeaderSearch'
import { color } from 'echarts/lib/export' import { color } from 'echarts/lib/export'
import sidebar from '@/layout/components/Sidebar/index.vue' import sidebar from '@/layout/components/Sidebar/index.vue'
import avatar from 'element-ui/packages/avatar' import avatar from 'element-ui/packages/avatar'
import { getCityList, getQaList, getQaDetail } from '@/api/qa'
import clickoutside from 'element-ui/src/utils/clickoutside'
export default { export default {
directives: { clickoutside },
components: { components: {
Breadcrumb, Breadcrumb,
Hamburger, Hamburger,
@ -157,17 +182,24 @@ export default {
data() { data() {
return { return {
workstatus: false, workstatus: false,
drawer: false,
showAvatar: false, showAvatar: false,
dialogPWD: false, dialogPWD: false,
dialogWorks: false, dialogWorks: false,
centerDialogVisible: false, centerDialogVisible: false,
imageUrl: false, imageUrl: false,
QaShow: true,
os: [], os: [],
getCityList: [],
times: [], times: [],
form: { form: {
oldpwd: '', oldpwd: '',
pwd: '' pwd: ''
}, },
QaInfo: {
title: '',
content: ''
},
rules: { rules: {
oldpwd: [ oldpwd: [
{ required: true, message: '请输入旧密码', trigger: 'blur' }, { required: true, message: '请输入旧密码', trigger: 'blur' },
@ -182,12 +214,32 @@ export default {
}, },
created() { created() {
this.getworkstatus() this.getworkstatus()
getCityList().then(res => {
this.getCityList = res.data
})
}, },
methods: { methods: {
color, color,
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')
}, },
handleClose() {
this.drawer = false
this.QaShow = true
},
getQaDetail(id) {
getQaDetail(id).then(res => {
this.QaInfo = res.data
if (!this.QaInfo) {
return this.$message({
message: '暂无QA问题',
type: 'warning',
duration: 1500
})
}
this.QaShow = false
})
},
async logout() { async logout() {
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$router.push(`/login?redirect=${this.$route.fullPath}`)
@ -264,6 +316,22 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.drawer{
padding: 20px 0 0 20px;
width: 100%;
height: 100vh;
}
.mod{
margin-top: 50px;
}
.ver{
margin-top: 20px;
&_title{
font-size: 24px;
color: #1890ff;
margin-bottom: 20px;
}
}
.navbar { .navbar {
height: 50px; height: 50px;
overflow: hidden; overflow: hidden;

View File

@ -38,7 +38,7 @@ module.exports = {
}, },
proxy: { proxy: {
'/dev-api': { // 接口地址 以 api开头的都走下面的配置 '/dev-api': { // 接口地址 以 api开头的都走下面的配置
target: 'http://127.0.0.1:8787', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2 target: 'http://192.168.1.132:8787', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
ws: true, // 是否支持 websocket 请求 支持 ws: true, // 是否支持 websocket 请求 支持
changeOrigin: true, // 是否启用跨域 changeOrigin: true, // 是否启用跨域
pathRewrite: { pathRewrite: {