lion 2 years ago
commit 9d2ddb0fb6

@ -4,5 +4,7 @@ NODE_ENV = production
ENV = 'staging'
# base api
VUE_APP_BASE_API = '/stage-api'
VUE_APP_BASE_API=http://jiwei.ali251.langye.net
VUE_APP_UPLOAD_API=http://jiwei.ali251.langye.net/api/admin/upload-file

@ -17,3 +17,57 @@ export function recordStore (data,isLoading=true) {
isLoading
})
}
export function getYears (params,isLoading=false) {
return request({
method: "get",
url: "/api/person/get-years",
params,
isLoading
})
}
export function getYearStatistics (params,isLoading=false) {
return request({
method: "get",
url: "/api/person/get-year-statistics",
params,
isLoading
})
}
export function getByCategory (params,isLoading=true) {
return request({
method: "get",
url: "/api/person/record/get-by-category",
params,
isLoading
})
}
export function destroy (data,isLoading=true) {
return request({
method: "post",
url: "/api/person/record/delete",
data,
isLoading
})
}
export function show (params,isLoading=true) {
return request({
method: "get",
url: "/api/person/record/show",
params,
isLoading
})
}
export function save (data,isLoading=true) {
return request({
method: "post",
url: "/api/person/record/save",
data,
isLoading
})
}

@ -1,6 +1,6 @@
import request from "@/utils/request";
export function login (data,isLoading=true) {
export function login (data,isLoading=false) {
return request({
method: "post",
url: "/api/person/auth/login",
@ -25,3 +25,11 @@ export function logout () {
isLoading: false
})
}
export function getBaseInfo (isLoading=false) {
return request({
method: "get",
url: "/api/person/get-base-info",
isLoading
})
}

@ -77,6 +77,8 @@ export const constantRoutes = [{
{
path: "/h5",
name: "h5",
redirect: "/h5/index",
component: () => import("@/views/h5/index.vue"),
hidden: true,
children: [
@ -98,16 +100,13 @@ export const constantRoutes = [{
},
{
path: '/h5/login',
name: "h5login",
component:() => import("@/views/h5/login/login.vue"),
meta: {
title: "登录",
},
hidden: true
},
{
path: '/h5',
redirect: '/h5/index'
},
]

@ -66,8 +66,8 @@ const actions = {
username: username.trim(),
password: password
}).then(res => {
commit('SET_TOKEN_H5', res.access_token)
setToken(res.access_token)
commit('SET_TOKEN_H5', res.access_token)
resolve(res)
}).catch(error => {
reject(error)

@ -5,6 +5,7 @@ import {
Loading
} from 'element-ui'
import store from '@/store'
import route from "@/router"
import {
getToken
} from '@/utils/auth'
@ -30,13 +31,13 @@ service.interceptors.request.use(
}
// do something before request is sent
if (store.getters.token) {
if (getToken(/\/h5/g.test(route.currentRoute.path))) {
// let each request carry token
// ['X-Token'] is a custom headers key
// please modify it according to the actual situation
//config.headers['X-Token'] = getToken();
config.headers['Authorization'] = "Bearer " + getToken()
config.headers['Authorization'] = "Bearer " + getToken(/\/h5/g.test(route.currentRoute.path))
}
return config
},

@ -1,25 +1,58 @@
<template>
<div class="card">
<xy-table ref="xyTable"
height="100%"
:isHandlerKey="false"
:is-page="false"
:list="categories"
res-prop=""
:indent="20"
:row-key="row => row._index"
:table-item="table"
:auths="[]">
<div style="padding: 15px">
<el-radio-group v-model="select.year">
<el-radio v-for="item in years" :label="item" border>{{ item }}</el-radio>
</el-radio-group>
</div>
<div class="info">
<p class="info__title">
{{ title }}
</p>
<div class="info__status">
正常填报 <div class="cir1"></div> {{ static.count_normal }}迟报 <div class="cir2"></div> {{ static.count_delayed }}逾期未报 <div class="cir3"></div> {{ static.count_missed }}
</div>
</div>
<xy-table
ref="xyTable"
height=""
:isHandlerKey="false"
:is-page="false"
:list="categories"
res-prop=""
:indent="20"
:row-key="(row) => row._index"
:table-item="table"
:auths="[]"
>
</xy-table>
<el-drawer title="填报清单" :visible.sync="isShowDrawer" position="rtl" size="560px">
<div style="padding: 20px 40px;">
<el-form class="form" ref="elForm" :model="form" :rules="rules" label-width="80px" size="small">
<el-drawer
title="填报清单"
:visible.sync="isShowDrawer"
position="rtl"
size="750px"
:wrapper-closable="false"
>
<div style="padding: 20px 40px">
<el-form
class="form"
ref="elForm"
:model="form"
:rules="rules"
label-width="80px"
size="small"
>
<el-form-item label="标题" prop="title">
<el-input v-model="form.title"></el-input>
<el-input v-model="form.title" placeholder="请填写标题"></el-input>
</el-form-item>
<el-form-item label="内容" required prop="content">
<el-input type="textarea" :autosize="{ minRows:2 }" v-model="form.content"></el-input>
<el-input
type="textarea"
:autosize="{ minRows: 30 }"
v-model="form.content"
></el-input>
</el-form-item>
<el-form-item label="附件" prop="files">
<el-upload
@ -27,118 +60,203 @@
:action="action"
multiple
:limit="10"
:headers="{
'Authorization': 'Bearer ' + getToken(true)
}"
:before-upload="beforeUpload"
:file-list="fileList">
:on-success="uploadSuccess"
:file-list="fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="所属月份" required prop="belongs_year_month">
<el-date-picker placeholder="请选择所属月份" type="month" value-format="yyyy-MM" v-model="form.belongs_year_month"></el-date-picker>
<el-form-item label="所属周期" prop="_week">
<el-input
placeholder="请选择所属周期"
readonly
v-model="form._week"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onSubmit">{{ type === 'add' ? '' : '' }}</el-button>
<el-button @click="isShowDrawer = false">取消</el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
<detail ref="show" @edit="editShow"></detail>
</div>
</template>
<script>
import { category, recordStore } from "@/api/h5/form";
import detail from "@/views/h5/form/show.vue";
import { category, recordStore, getYears, show, save } from "@/api/h5/form";
import { getToken } from "@/utils/auth";
export default {
components: {
detail
},
inject: ['myInfo', 'statics'],
data() {
return {
isShowDrawer: false,
formInfo: [],
customForm: {
customFormId: 11,
tableName: "asd",
},
fileList: [],
action: process.env.VUE_APP_UPLOAD_API,
select: {
year: ""
year: this.$moment().format("YYYY"),
},
years: [],
categories: [],
table: [
{
type: "",
label: "",
prop: "index",
customFn:row => {
customFn: row => {
return row._type === 'type' ? row._text : row._index;
}
},
{
prop: "title",
label: "清单类型名称",
minWidth: 300,
renderHeader: col => {
return (
<div>{ this.title ? this.title.substring(0, this.title.length - 2) + '清单' : '清单类型名称' }</div>
)
},
align: "left",
customFn:row => {
return row._type === 'type' ? (<span><i style="padding: 0 8px;color: rgb(239, 216, 117);" class="el-icon-folder-opened"></i><span>{row.title}</span></span>) : (
<span><i style="padding: 0 8px;" class="el-icon-document"></i><span>{row.title}</span></span>)
}
customFn: (row) => {
return row._type === "type" ? (
<span>
<i
style="padding: 0 8px;color: rgb(239, 216, 117);"
class="el-icon-folder-opened"
></i>
<span>{row.title}</span>
</span>
) : (
<span>
<i style="padding: 0 8px;" class="el-icon-document"></i>
<span>{row.title}</span>
</span>
);
},
},
{
fixed: "right",
prop: "records_count",
label: "填报数量",
customFn:row => {
if (!row.children?.length) {
return (<span>{row.records_count}</span>)
}
label: "填报要求",
width: 240,
customFn: row => {
return(<div>
{
row.rules.map(item => (<div>{item.start_at} ~ {item.end_at}不少于{item.quantity}</div>))
}
</div>)
}
},
{
prop: "btns",
label: "填报",
fixed: "right",
width: 80,
customFn: row => {
if (!row.children?.length) {
return (
<Button
size="small"
type="primary"
icon="ios-create"
on={
prop: "records_count",
label: "填报情况",
showOverflowTooltip: false,
width: 150,
customFn: (row) => {
return row._is_end ? (
<div>
<Button type="primary" size="small" ghost on={{
['click']:_ => {
this.pickRule = row.rules
this.$refs['show'].setId(row.id)
this.$refs['show'].show()
}
}}>
查看
<Icon type="ios-search"></Icon>
</Button>
<el-dropdown size="small" disabled={!(row.rules instanceof Array && row.rules.length > 0)} style="margin-left: 10px" on={{
['command']: e => {
this.type = "add"
this.isShowDrawer = true;
this.form.category_rule_id = e;
this.form.category_id = row.id;
let rule = row.rules.find(item => (item.id === e))
this.form._week = `${rule.start_at} ~ ${rule.end_at}`
}
}}>
<Button type="primary" size="small">
填报
<Icon type="ios-arrow-down"></Icon>
</Button>
<el-dropdown-menu slot="dropdown">
{
['click']:_ => {
this.isShowDrawer = true;
this.form.category_id = row.id;
}
row.rules.map(item => (<el-dropdown-item command={item.id}>{item.start_at} ~ {item.end_at}</el-dropdown-item>))
}
}>
填报
</Button>
)
}
</el-dropdown-menu>
</el-dropdown>
</div>
) : '';
},
},
{
fixed: "right",
label: "系统预警",
width: 116,
customFn: row => {
let color = ['#377e22', '#f2a93c', '#ea3423']
let nums = [
row.rules.reduce((pre, cur) => (pre + (cur.record_count?.count_normal ?? 0)),0),
row.rules.reduce((pre, cur) => (pre + (cur.record_count?.count_delayed ?? 0)),0),
row.rules.reduce((pre, cur) => (pre + (cur.record_count?.count_missed ?? 0)),0)
]
return row._is_end ? (
<div style="display: flex;">
{
Array.from({ length: 3 },_ => undefined).map((i, index) => (
<div style="display: flex;align-items: center;">
<div style={{
'color': '#fff',
'background': color[index],
'padding': '10px',
'border-radius': '100%'
}}></div>
<span style="padding: 4px;">{ nums[index] }</span>
</div>
))
}
</div>
) : ''
}
}
},
],
type: "add",
pickRule: [],
form: {
category_rule_id: "",
category_id: "",
title: "",
content: "",
files: "",
belongs_year_month: "",
myindex: ""
myindex: "",
_week: ""
},
rules: {
content: [
{ required: true, message: "请填写内容" }
],
belongs_year_month: [
{ required: true, message: "请选择所属月份" }
]
}
}
content: [{ required: true, message: "请填写内容" }]
},
};
},
methods: {
async getList () {
let res = await category(this.select);
this.formatList(res);
this.list = res;
},
beforeUpload (file) {
if ((file.size / 1000) > (20 * 1024)) {
getToken,
beforeUpload(file) {
if (file.size / 1000 > 20 * 1024) {
this.$message({
type: "warning",
message: "上传大小超过20Mb",
@ -146,9 +264,40 @@ export default {
return false;
}
},
uploadSuccess (response, file, fileList) {
this.form.files = fileList.map(i => i.response?.id).toString()
},
async getDetail (id) {
const res = await show({
id
})
this.$integrateData(this.form, res)
this.form.id = id
},
async editShow (id) {
this.type = 'edit'
await this.getDetail(id)
let rule = this.pickRule.find(i => i.id === this.form.category_rule_id)
this.form._week = `${rule.start_at} ~ ${rule.end_at}`
this.isShowDrawer = true
},
toChineseNum(number) {
const chineseNum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
const chineseNum = [
"零",
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
];
const chineseUnit = ["", "十", "百", "千", "万", "亿"];
let numStr = number.toString();
let len = numStr.length;
@ -163,53 +312,115 @@ export default {
if (str[str.length - 1] === "零") {
str = str.slice(0, -1);
}
return str
return str;
},
formatList (data=[],pid) {
data.forEach((item,index) => {
formatList(data = [], pid) {
data.forEach((item, index) => {
if (item.hasOwnProperty('categories_tree')) {
item._id = item.id
delete item.id;
item._disabled = true
item._type = 'type'
item.children = item.categories_tree
item._text = this.toChineseNum(index+1)
item._text = this.toChineseNum(index + 1)
} else {
item._type = 'doc'
item._index = pid ? `${pid}-${index+1}` : (index+1)
item._index = pid ? `${pid}-${index+1}` : (index + 1)
// item._index = pid ? (index+1) : (index + 1)
}
if (item.children instanceof Array && item.children.length > 0) {
this.formatList(item.children,item._index ? item._index : false)
this.formatList(item.children, item._index ? item._index : false)
} else {
item._is_end = 1
}
})
},
async getCategories () {
const res = await category(this.select,false)
this.formatList(res)
this.categories = res
async getCategories() {
const res = await category(this.select, false);
this.formatList(res);
this.categories = res;
},
async getYears () {
const res = await getYears();
this.select.year = res.selected_year;
this.years = res.years;
},
onSubmit () {
this.$refs['elForm'].validate(res => {
onSubmit() {
this.$refs["elForm"].validate((res) => {
if (res) {
this.form.files = this.fileList.map(i => i.response.id).toString()
recordStore(this.form).then(res => {
this.$message({
type: "success",
message: "填报成功"
})
})
this.form.files = this.fileList.map((i) => i.response.id).toString();
if (this.type === 'add') {
recordStore(this.form).then((res) => {
this.$message({
type: "success",
message: "填报成功",
});
this.isShowDrawer = false;
this.getCategories()
});
} else {
save(this.form).then((res) => {
this.$message({
type: "success",
message: "修改成功",
});
this.isShowDrawer = false;
this.getCategories()
this.$refs['show'].getData()
});
}
}
})
});
},
},
computed: {
title () {
return `${this.me?.department?.name ?? ''}-${this.me?.name ?? ''}-${this.me?.category_type?.title ?? ''}-${this.select.year}年填报总览`
},
me () {
return this.myInfo()
},
static () {
return this.statics()
}
},
watch: {
type (newVal) {
if (newVal === 'add') {
delete this.form.id
}
},
isShowDrawer (newVal) {
if (newVal) {
} else {
this.fileList = [];
this.form = {
category_rule_id: "",
category_id: "",
title: "",
content: "",
files: "",
myindex: "",
_week: ""
}
this.$refs['elForm'].clearValidate()
}
}
},
computed: {},
created() {
this.getCategories()
}
}
this.getYears();
this.getCategories();
},
};
</script>
<style lang="scss">
@ -220,10 +431,75 @@ export default {
<style scoped lang="scss">
.card {
height: 100%;
background-color: #fff;
margin: 40px;
}
.info {
border-top: 1px solid #EBEEF5;
background: #faf0e9;
padding: 40px;
padding: 10px 15px;
&__title {
font-size: 22px;
font-weight: 600;
padding-bottom: 8px;
}
&__status {
$color: #377e22,#f2a93c,#ea3423;
display: flex;
align-items: center;
font-size: 12px;
@mixin cir {
padding: 8px;
border-radius: 100%;
margin: 0 6px;
}
@for $i from 1 through length($color) {
.cir#{$i} {
@include cir;
background: nth($color, $i);
}
}
}
}
::v-deep .table-tree {
height: 100%;
background: #f0f2f8;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
color: #c4312b;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
background-color: #c4312b;
border-color: #c4312b;
}
::v-deep .el-radio__inner {
width: 18px;
height: 18px;
}
::v-deep .el-radio__input.is-checked .el-radio__inner:after {
content: "";
width: 12px;
height: 6px;
margin-top: -1px;
border: 2px solid white;
border-top: transparent;
border-right: transparent;
text-align: center;
display: block;
position: absolute;
top: 50%;
left: 50%;
vertical-align: middle;
transform: translate(-50%, -50%) rotate(-45deg);
border-radius: 0px;
background: none;
}
::v-deep .el-tabs__nav-wrap::after {
background-color: #ebeef5;
}
</style>

@ -0,0 +1,125 @@
<template>
<div>
<el-dialog title="填报" width="860px" :visible.sync="visible">
<xy-table style="width: 820px"
stripe
ref="xyTable"
:req-opt="select"
:is-first-req="false"
:height="500"
:action="getByCategory"
:table-item="table"
:destroy-action="destroy">
</xy-table>
</el-dialog>
</div>
</template>
<script>
import { getByCategory, destroy } from "@/api/h5/form";
export default {
data() {
return {
auth: ['delete'],
visible: false,
select: {
category_id: ""
},
table: [
{
prop: "title",
label: "标题",
fixed: "left",
width: 180
},
{
prop: "created_at",
label: "填报日期",
width: 160
},
{
prop: "content",
label: "内容",
align: "left",
minWidth: 200
},
{
prop: "operate",
label: "操作",
align: "left",
width: 140,
customFn: row => {
const _this = this
return (
<div>
<Button type="primary"
size="small"
on={{
['click']:_ => {
this.$emit('edit', row.id)
}
}}>编辑</Button>
<Button type="error"
size="small"
on={{
['click']:_ => {
this.$confirm('此操作将永久删除该填报, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
destroy({
id: row.id
}).then(_ => {
this.$message({
type: 'success',
message: '删除成功!'
});
_this.$refs['xyTable'].getTableData()
})
})
}
}}>删除</Button>
</div>
)
}
}
]
}
},
methods: {
getByCategory,destroy,
show () {
this.visible = true;
},
hide () {
this.visible = false;
},
setId (id) {
this.select.category_id = id;
},
getData () {
this.$refs['xyTable'].getTableData()
}
},
computed: {},
watch: {
visible (newVal) {
if (newVal) {
this.$nextTick(_ => {
this.$refs['xyTable'].getTableData(true)
})
} else {
}
}
},
created() {
}
}
</script>
<style scoped lang="scss">
</style>

@ -1,287 +1,78 @@
<template>
<div class="card">
<div style="padding:15px">
<el-radio-group v-model="select.year">
<el-radio v-for="item in years" :label="item">{{item}}</el-radio>
</el-radio-group>
</div>
<xy-table ref="xyTable"
height="100%"
:isHandlerKey="false"
:is-page="false"
:list="categories"
res-prop=""
:indent="20"
:row-key="row => row._index"
:table-item="table"
:auths="[]">
</xy-table>
<el-drawer title="填报清单" :visible.sync="isShowDrawer" position="rtl" size="560px">
<div style="padding: 20px 40px;">
<el-form class="form" ref="elForm" :model="form" :rules="rules" label-width="80px" size="small">
<el-form-item label="标题" prop="title">
<el-input v-model="form.title"></el-input>
</el-form-item>
<el-form-item label="内容" required prop="content">
<el-input type="textarea" :autosize="{ minRows:2 }" v-model="form.content"></el-input>
</el-form-item>
<el-form-item label="附件" prop="files">
<el-upload
class="upload-demo"
:action="action"
multiple
:limit="10"
:before-upload="beforeUpload"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="所属月份" required prop="belongs_year_month">
<el-date-picker placeholder="请选择所属月份" type="month" value-format="yyyy-MM" v-model="form.belongs_year_month"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="isShowDrawer = false">取消</el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
<h2 class="title">欢迎进入一把手和领导班子监督平台</h2>
<Card style="padding: 20px;">
<el-descriptions title="用户信息" :column="1">
<el-descriptions-item v-for="(value, key) in descriptions" :label="value">
{{ descriptionLabel(key) }}
</el-descriptions-item>
<el-descriptions-item label="本年统计">
正常填报{{ static.count_normal }}迟报{{ static.count_delayed }}超期未报{{ static.count_missed }}
</el-descriptions-item>
</el-descriptions>
<Button type="primary" long @click="$router.push('/h5/form')"></Button>
</Card>
</div>
</template>
<script>
import { category, recordStore } from "@/api/h5/form";
export default {
components:{
},
inject: ['myInfo', 'statics'],
data() {
return {
isShowDrawer: false,
formInfo:[],
customForm:{
customFormId:11,
tableName:'asd'
},
fileList: [],
action: process.env.VUE_APP_UPLOAD_API,
select: {
year: this.$moment().format('YYYY')
},
years: [],
categories: [],
table: [
{
type: "",
label: "",
prop: "index",
customFn:row => {
return row._type === 'type' ? row._text : row._index;
}
},
{
prop: "title",
label: "清单类型名称",
align: "left",
customFn:row => {
return row._type === 'type' ? (<span><i style="padding: 0 8px;color: rgb(239, 216, 117);" class="el-icon-folder-opened"></i><span>{row.title}</span></span>) : (
<span><i style="padding: 0 8px;" class="el-icon-document"></i><span>{row.title}</span></span>)
}
},
{
label: "年份",
prop: "year",
width:120,
customFn:row => {
return row._type === 'type' ? '--' : row.year;
}
},
{
prop: "records_count",
label: "填报数量",
customFn:row => {
if (!row.children?.length) {
return (<span>{row.records_count}</span>)
}
}
},
{
prop: "btns",
label: "填报",
fixed: "right",
width: 80,
customFn: row => {
if (!row.children?.length) {
return (
<Button
size="small"
type="primary"
icon="ios-create"
on={
{
['click']:_ => {
// this.isShowDrawer = true;
// this.form.category_id = row.id;
this.openDialog(row.id)
}
}
}>
填报
</Button>
)
}
}
}
],
form: {
category_id: "",
title: "",
content: "",
files: "",
belongs_year_month: "",
myindex: ""
},
rules: {
content: [
{ required: true, message: "请填写内容" }
],
belongs_year_month: [
{ required: true, message: "请选择所属月份" }
]
descriptions: {
"department.name": "市委",
"name": "姓名",
"position": "职位",
"start_at": "开始填报",
"end_at": "结束填报"
}
}
},
methods: {
beforeUpload (file) {
if ((file.size / 1000) > (20 * 1024)) {
this.$message({
type: "warning",
message: "上传大小超过20Mb",
});
return false;
}
},
getSelectYear() {
const currentYear = this.$moment().format('YYYY');
const years = [];
for (let i = currentYear; i >= 2017; i--) {
years.push(i);
}
this.years = years
},
toChineseNum(number) {
const chineseNum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
const chineseUnit = ["", "十", "百", "千", "万", "亿"];
let numStr = number.toString();
let len = numStr.length;
let str = "";
for (let i = 0; i < len; i++) {
str += chineseNum[parseInt(numStr[i])] + chineseUnit[len - 1 - i];
}
str = str.replace(/零[十百千]/g, "零");
str = str.replace(/零+/g, "零");
str = str.replace(/^零+/, "");
str = str.replace(/零+$/, "");
if (str[str.length - 1] === "零") {
str = str.slice(0, -1);
}
return str
},
formatList (data=[],pid) {
data.forEach((item,index) => {
if (item.hasOwnProperty('categories_tree')) {
item._id = item.id
delete item.id;
item._disabled = true
item._type = 'type'
item.children = item.categories_tree
item._text = this.toChineseNum(index+1)
} else {
item._type = 'doc'
item._index = pid ? `${pid}-${index+1}` : (index+1)
}
if (item.children instanceof Array && item.children.length > 0) {
this.formatList(item.children,item._index ? item._index : false)
}
})
},
computed: {
static () {
return this.statics()
},
async getCategories () {
const res = await category(this.select,false)
this.formatList(res)
this.categories = res
me () {
return this.myInfo()
},
onSubmit () {
this.$refs['elForm'].validate(res => {
if (res) {
this.form.files = this.fileList.map(i => i.response.id).toString()
recordStore(this.form).then(res => {
this.$message({
type: "success",
message: "填报成功"
})
this.isShowDrawer = false;
descriptionLabel () {
return function (key) {
if (!this.me) return ""
let splitKey = key.split(".")
if (splitKey.length > 0) {
let res = {}
splitKey.forEach((k, index) => {
res = index === 0 ? this.me[k] : res[k]
})
return res
} else {
return this.me[key] || ""
}
})
},
},
computed: {},
created() {
this.getSelectYear()
this.getCategories()
}
}
}
}
</script>
<style lang="scss">
.el-cascader-node__label {
max-width: 300px;
}
</style>
<style scoped lang="scss">
.card {
height: 100%;
background-color: #fff;
margin: 40px;
}
::v-deep .table-tree {
height: 100%;
}
::v-deep .el-radio__input.is-checked+.el-radio__label {
color: #c4312b;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
background-color: #c4312b;
border-color: #c4312b;
}
::v-deep .el-radio__inner{
width:18px;
height:18px;
}
::v-deep .el-radio__input.is-checked .el-radio__inner:after {
content: '';
width: 12px;
height: 6px;
margin-top:-1px;
border: 2px solid white;
border-top: transparent;
border-right: transparent;
text-align: center;
display: block;
position: absolute;
top: 50%;
left: 50%;
vertical-align: middle;
transform: translate(-50%, -50%) rotate(-45deg);
border-radius: 0px;
background: none;
}
::v-deep .el-tabs__nav-wrap::after{
background-color: #EBEEF5;
$width: 46vw;
$height: 56vh;
width: $width;
height: $height;
position: absolute;
left: calc(50% - #{$width} / 2);
top: calc(50% - #{$height} / 2);
.title {
text-align: center;
padding: 20px 0;
}
}
</style>

@ -1,6 +1,6 @@
<template>
<div style="width: 100%;height: 100%;">
<Menu class="menu" mode="horizontal" theme="primary" active-name="1">
<div style="width: 100%;height: 100%;" id="h5-page">
<Menu class="menu" mode="horizontal" theme="primary" :active-name="name" @on-select="e => name = e">
<MenuItem name="1" to="/h5/index">
<Icon type="ios-home" />
首页
@ -22,25 +22,6 @@
</el-dropdown-menu>
</el-dropdown>
</div>
<!-- <Submenu name="3">-->
<!-- <template slot="title">-->
<!-- <Icon type="ios-stats" />-->
<!-- 统计分析-->
<!-- </template>-->
<!-- <MenuGroup title="使用">-->
<!-- <MenuItem name="3-1">新增和启动</MenuItem>-->
<!-- <MenuItem name="3-2">活跃分析</MenuItem>-->
<!-- <MenuItem name="3-3">时段分析</MenuItem>-->
<!-- </MenuGroup>-->
<!-- <MenuGroup title="留存">-->
<!-- <MenuItem name="3-4">用户留存</MenuItem>-->
<!-- <MenuItem name="3-5">流失用户</MenuItem>-->
<!-- </MenuGroup>-->
<!-- </Submenu>-->
<!-- <MenuItem name="4">-->
<!-- <Icon type="ios-construct" />-->
<!-- 综合设置-->
<!-- </MenuItem>-->
</Menu>
<section class="app-main__h5">
@ -52,12 +33,32 @@
</template>
<script>
import { getBaseInfo } from "@/api/h5/login";
import {getYearStatistics} from "@/api/h5/form";
export default {
provide() {
return {
myInfo: () => this.myInfo,
statics: () => this.statics,
}
},
data() {
return {
name: "1",
myInfo: null,
statics: {
count_normal: 0,
count_delayed: 0,
count_missed: 0
}
}
},
methods: {
async getStatics () {
this.statics = await getYearStatistics(this.select);
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/h5/login?redirect=${this.$route.fullPath}`)
@ -68,6 +69,10 @@ export default {
return this.$route.path
}
},
created() {
this.getStatics();
getBaseInfo().then(res => (this.myInfo = res))
}
}
</script>
@ -144,3 +149,12 @@ export default {
height: calc(100% - 60px);
}
</style>
<style>
#app:has(#h5-page) {
height: auto;
min-height: 100%;
background: url("../../assets/bkg.png") no-repeat;
background-size: cover;
padding-bottom: 50px;
}
</style>

@ -172,11 +172,12 @@ export default {
this.$store
.dispatch("user/login", this.loginForm)
.then(() => {
console.log(this.redirect);
this.$router.push({
path: this.redirect || "/h5/index",
});
this.loading = false;
setTimeout(() => {
this.$router.push({
path: this.redirect || "/h5/index",
});
this.loading = false;
}, 500)
})
.catch(() => {
this.loading = false;

@ -24,7 +24,7 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: './dist',
assetsDir: 'static',
css: {
@ -35,10 +35,6 @@ module.exports = {
sass:{
prependData: '@import "@/styles/index.scss";'
}
},
extract: { // 打包后css文件名称添加时间戳
filename: `static/css/[name].${timeStamp}.css`,
chunkFilename: `static/css/chunk.[id].${timeStamp}.css`
}
},
lintOnSave: process.env.NODE_ENV === 'development',
@ -69,10 +65,6 @@ module.exports = {
alias: {
'@': resolve('src')
}
},
output: {
filename: `js/[name]-${timeStamp}.js`,
chunkFilename: `js/[name]-${timeStamp}.js`
}
},
chainWebpack(config) {

Loading…
Cancel
Save