Compare commits

..

3 Commits

Author SHA1 Message Date
ef230b3836 登录后跳转到打标页面 2026-03-06 09:28:06 +08:00
9f2f7036fd 增加退出登录 2026-03-05 16:09:07 +08:00
2f3586e2f2 预算&指标填报 2026-03-05 11:12:34 +08:00
24 changed files with 705 additions and 383 deletions

View File

@@ -9,7 +9,12 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
# VUE_APP_BASE_API = 'http://172.16.32.95:7070'
# VUE_APP_BASE_API = 'http://172.16.33.83:7070'
VUE_APP_BASE_API = 'http://192.168.0.35:7070'
# 杨姗姗
VUE_APP_BASE_API = 'http://172.16.20.218:7070'
# 小田
# VUE_APP_BASE_API = 'http://172.16.19.232:7070'
# 测试
# VUE_APP_BASE_API = 'http://192.168.0.35:8080'
# 路由懒加载

1
.gitignore vendored
View File

@@ -20,3 +20,4 @@ selenium-debug.log
*.local
package-lock.json
sync_luobo.bat

View File

@@ -117,6 +117,22 @@ export function updateDataBackUpDetail(data) {
});
}
export function copyLastMonthData(data) {
return request({
url: "/lb/index-target-month/copyLastMonth",
method: "post",
data: data,
});
}
export function copyLastYearData(data) {
return request({
url: "/lb/index-target-year/copyLastYear",
method: "post",
data: data,
});
}
export function getSalesRevenueGroupData(data) {
return request({
@@ -254,6 +270,13 @@ export function getCalendar(data) {
data: data,
});
}
export function getCalendarYear(data) {
return request({
url: "lb/index-target-year/getCalendarYear",
method: "post",
data: data,
});
}
export function getLevelStruc(data) {
return request({
url: "/lb/index-target-month/getLevelStruc",

View File

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g id="组_1" data-name="组 1" transform="translate(-970 -281.875)">
<g id="编辑备份" transform="translate(970 281.5)">
<rect id="矩形" width="16" height="16" transform="translate(0 0.375)" opacity="0"/>
<path id="形状" d="M12.281,5.406a.512.512,0,0,0,1.023,0V2.559A2.559,2.559,0,0,0,10.746,0H2.559A2.559,2.559,0,0,0,0,2.559v8.188A2.559,2.559,0,0,0,2.559,13.3H5.415a.512.512,0,1,0,0-1.023H2.559a1.535,1.535,0,0,1-1.535-1.535V2.559A1.535,1.535,0,0,1,2.559,1.023h8.188a1.535,1.535,0,0,1,1.535,1.535Z" transform="translate(1.535 1.535)" fill="#3d7aff"/>
</g>
<g id="移出" transform="translate(978 290.608)">
<path id="形状结合" d="M0,2.821a.746.746,0,0,0,.529.73l.118.011,3.68-.011L3.459,4.4a.656.656,0,0,0,.816,1.02l.1-.083L6.146,3.6a1.107,1.107,0,0,0,.321-.634l.012-.2,0-.026a.61.61,0,0,0-.015-.125,1.106,1.106,0,0,0-.189-.455l-.107-.129L4.39.2a.656.656,0,0,0-1.022.814L4.23,2.108.654,2.1l-.125.011A.88.88,0,0,0,0,2.821Z" transform="translate(0 0)" fill="#3d7aff"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,14 +1,14 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<div v-if="collapse" key="collapse" class="sidebar-logo-link">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
</div>
<div v-else key="expand" class="sidebar-logo-link">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>
</div>
</transition>
</div>
</template>

View File

@@ -8,6 +8,38 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
/**
* 从菜单树中查找 jumpFlag===1 的默认跳转路径
* 若打标在父节点则取其下第一个可见叶子路径;若在叶子则直接返回该路径
*/
function findDefaultPathFromMenus(menus) {
if (!Array.isArray(menus) || menus.length === 0) return null
function dfs(list, parentPath = '') {
for (const item of list) {
if (item.visible === false) continue
const rawPath = item.path || ''
const currentPath = rawPath.startsWith('/')
? rawPath
: `${parentPath}/${rawPath}`.replace(/\/+/g, '/')
if (item.jumpFlag === 1) {
if (item.children && item.children.length > 0) {
const childPath = dfs(item.children, currentPath)
return childPath != null ? childPath : currentPath
}
return currentPath
}
if (item.children && item.children.length > 0) {
const found = dfs(item.children, currentPath)
if (found != null) return found
}
}
return null
}
return dfs(menus)
}
// 增加三方登陆 update by 芋艿
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
@@ -17,7 +49,7 @@ router.beforeEach((to, from, next) => {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/
if (to.path === '/login') {
next({ path: '/' })
next({ path: store.getters.defaultPath || '/' })
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
@@ -31,7 +63,13 @@ router.beforeEach((to, from, next) => {
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
// 根据 roles 权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/'
store.commit('permission/SET_DEFAULT_PATH', defaultPath)
if (to.path === '/' || to.matched.length === 0) {
next({ path: defaultPath, replace: true })
} else {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
}
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
@@ -40,7 +78,12 @@ router.beforeEach((to, from, next) => {
})
})
} else {
next()
if (to.path === '/') {
const defaultPath = store.getters.defaultPath || '/'
next({ path: defaultPath, replace: true })
} else {
next()
}
}
}
} else {

View File

@@ -17,6 +17,7 @@ const getters = {
topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters,
defaultPath: state => state.permission.defaultPath,
// 数据字典
dict_datas: state => state.dict.dictDatas
}

View File

@@ -11,8 +11,12 @@ const permission = {
addRoutes: [],
sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用
topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用
defaultPath: '/', // 登录后默认跳转路径(由菜单 jumpFlag===1 决定)
},
mutations: {
SET_DEFAULT_PATH: (state, path) => {
state.defaultPath = path || '/'
},
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)

View File

@@ -81,6 +81,9 @@ export const DICT_TYPE = {
PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式
PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举
// ========== 模块 ==========
LB_DW: 'lb_dw'
}
/**
@@ -139,3 +142,15 @@ export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value);
return dict ? dict.label : '';
}
// table中用来过滤字典
export function publicFormatter(dictTable) {
const dictDatas = getDictDatas(dictTable)
return function (val) {
const arr = {}
dictDatas.map((item) => {
arr[item.value] = item.label
})
return arr?.[val]
}
}

View File

@@ -16,8 +16,8 @@
gap: 12px;
grid-template-columns:416px 1192px;
">
<indicatorCalendar :calendarList="calendarList" />
<indicatorDetails :timeType="timeType" />
<indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
<indicatorDetails :timeType="timeType" @updateLeft='getData'/>
</div>
</div>
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
@@ -53,8 +53,9 @@ import { mapState } from "vuex";
// import operatingLineChart from "../operatingComponents/operatingLineChart";
// import operatingLineChartCumulative from "../operatingComponents/operatingLineChartCumulative.vue";
import { getSalesRevenueGroupData, getCalendar } from '@/api/cockpit'
import { getSalesRevenueGroupData } from '@/api/cockpit'
import moment from "moment";
import {getCalendar, getCalendarYear} from '@/api/cockpit';
export default {
name: "DayReport",
components: {
@@ -78,7 +79,7 @@ export default {
selectDate:{},
monthData: {},
ytdData: {},
calendarList:{},
calendarObj:{}
};
},
@@ -147,34 +148,21 @@ export default {
this.getData()
},
methods: {
// sortChange(value) {
// this.sort = value
// this.getData()
// },
getData() {
getCalendar().then((res) => {
console.log(res, 'res');
this.calendarList = res.data
// this.monthData = res.data.month
// this.ytdData = res.data.ytd
})
// getSalesRevenueGroupData({
// startTime: this.dateData.startTime,
// endTime: this.dateData.endTime,
// sort: this.sort,
// index: undefined,
// factory: undefined
// // timeDim: obj.mode
// }).then((res) => {
// console.log(res);
// this.monthData= res.data.month
// this.ytdData = res.data.ytd
// })
if(this.timeType == 'month'){
getCalendar().then((res) => {
this.calendarObj = res.data
})
}else{
getCalendarYear().then((res) => {
this.calendarObj = res.data
})
}
},
handleTimeChange(obj) {
console.log(obj, 'obj');
this.timeType = obj
// this.getData()
this.getData()
},
handleClickOutside() {
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });

View File

@@ -8,6 +8,15 @@
<!-- 右侧区域全屏按钮 -->
<div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="screen-btn" @click="changeHomeSider">
<svg-icon style="color: #0B58FF;" v-if="openSider" icon-class="closeSider" />
<svg-icon style="color: #0B58FF;" v-else icon-class="openSider" />
@@ -36,6 +45,7 @@
<script>
import moment from 'moment'
import {getPath} from "@/utils/ruoyi";
export default {
name: 'Header',
props: {
@@ -139,6 +149,19 @@ export default {
const timeRange = this.calculateTimeRange();
this.$emit('timeRangeChange', timeRange);
console.log('触发时间范围变化:', timeRange);
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}
},
watch: {
@@ -325,10 +348,11 @@ export default {
.right-content {
display: flex;
margin-bottom: 60px;
margin-top: 12px;
margin-right: 16px;
justify-content: flex-end;
gap: 10px;
gap: 21px;
height: 35px;
}
.current-time {
@@ -345,6 +369,15 @@ export default {
color: #00fff0;
font-size: 26px;
padding: 0;
margin: 0;
}
.logout-btn {
width: 30px;
height: 30px;
font-size: 30px;
padding: 0;
margin-top: 2px;
}
}

View File

@@ -11,10 +11,10 @@
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
<!-- 循环生成12个月通过判断当前月份索引添加current类 -->
<div class="monthItem" :class="{
'has-data': month.haveData,
'current': index === currentMonthIndex // 本月匹配current样式
}" v-for="(month, index) in monthList" :key="index">
{{ month.name }}
'has-data': calendar.haveData,
'current': calendar.isActive // 本月匹配current样式
}" v-for="(calendar, index) in calendarList" :key="index">
{{ calendar.name }}
</div>
</div>
</div>
@@ -25,49 +25,35 @@
<script>
import Container from './container.vue'
// import * as echarts from 'echarts'
// import topItem from './operating-item.vue'
export default {
name: 'ProductionStatus',
components: { Container },
// mixins: [resize],
props: {
calendarList: { // 接收父组件传递的年月状态对象
timeType: {
type: String,
default: 'month', // 默认月份维度
},
calendarObj: { // 接收父组件传递的年月状态对象
type: Object, // 注意父组件传递的是对象不是数组修正props类型
default: () => ({}) // 默认空对象,避免报错
},
},
data() {
return {
chart: null,
// 初始化12个月的列表可根据实际需求修改haveData默认值
monthList: [
{ name: '1月', haveData: false, isActive: false },
{ name: '2月', haveData: false, isActive: false },
{ name: '3月', haveData: false, isActive: false },
{ name: '4月', haveData: false, isActive: false },
{ name: '5月', haveData: false, isActive: false },
{ name: '6月', haveData: false, isActive: false },
{ name: '7月', haveData: false, isActive: false },
{ name: '8月', haveData: false, isActive: false },
{ name: '9月', haveData: false, isActive: false },
{ name: '10月', haveData: false, isActive: false },
{ name: '11月', haveData: false, isActive: false },
{ name: '12月', haveData: false, isActive: false }
],
}
},
computed: {
// 计算属性获取当前月份对应的索引0-11对应1月-12月
currentMonthIndex() {
// new Date().getMonth() 返回 0(1月) - 11(12月)正好匹配monthList索引
return new Date().getMonth();
calendarList:[],// 日历列表
}
},
watch: {
// 监听calendarList变化实时更新monthList的haveData状态
calendarList: {
// timeType: {
// immediate: true, // 组件挂载时立即执行一次
// deep: true, // 深度监听对象内部属性变化
// handler() {
// this.updateMonthHaveData();
// }
// },
calendarObj:{
immediate: true, // 组件挂载时立即执行一次
deep: true, // 深度监听对象内部属性变化
handler(newVal) {
@@ -75,28 +61,24 @@ export default {
}
}
},
mounted() {
// 初始化图表(若需展示图表,需在模板中添加对应 DOM
// this.$nextTick(() => this.updateChart())
},
mounted() {},
methods: {
// 根据calendarList更新monthList的haveData状态
// 根据月或者年维度,获取不同的接口,拿到数据,更新左侧日历框
updateMonthHaveData(calendarObj) {
if (!calendarObj || typeof calendarObj !== 'object') return;
// 遍历12个月匹配对应年月
this.monthList.forEach((month, index) => {
// 获取月份数字(索引+1补两位如1→0110→10
const monthNum = (index + 1).toString().padStart(2, '0');
// 拼接成calendarList中的键格式如2025-01
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定可改为props传递年份
// 判断calendarObj中该键对应的值1→true0→false无该键则保持默认false
if (calendarObj.hasOwnProperty(yearMonthKey)) {
month.haveData = calendarObj[yearMonthKey] === 1;
if(this.timeType == 'month'){
const keys = Object.keys(calendarObj);
this.calendarList = []
for(let i = 0; i < keys.length; i++) {
this.calendarList.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
}
});
},
}else{
const keys = Object.keys(calendarObj);
this.calendarList = []
for(let i = 0; i < keys.length; i++) {
this.calendarList.push({name:keys[i]+'年',haveData:calendarObj[keys[i]],isActive:keys[i]==new Date().getFullYear()})
}
}
}
}
}
</script>
@@ -119,7 +101,6 @@ export default {
line-height: 42px;
text-align: center;
font-style: normal;
cursor: pointer; // 鼠标悬浮手型
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
margin: 0; // 清除默认外边距,进一步缩小缝隙
@@ -140,5 +121,3 @@ export default {
border: 2px solid #0B58FF !important;
}
</style>
<style></style>

View File

@@ -22,7 +22,7 @@
</el-form-item>
<el-form-item>
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
<!-- <el-button type="primary" plain size="medium">导入</el-button> -->
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
</el-form-item>
</el-form>
</div>
@@ -35,14 +35,14 @@
<div v-if="!isDetail" style="display: flex;gap: 8px;align-items: center;height: 32px;">
<div style="width: 4px;height: 16px;background: #0B58FF;border-radius: 1px;"></div>
<div style="width: 58px;
height: 16px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: rgba(0,0,0,0.85);
line-height: 16px;
text-align: right;
font-style: normal;">指标详情</div>
height: 16px;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 14px;
color: rgba(0,0,0,0.85);
line-height: 16px;
text-align: right;
font-style: normal;">指标详情</div>
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
@click="handleEdit">编辑</el-button>
</div>
@@ -53,12 +53,12 @@ font-style: normal;">指标详情</div>
<div
style="width: 58px;height: 16px;font-family: PingFangSC, PingFang SC;font-weight: 400;font-size: 14px;color: rgba(0,0,0,0.85);line-height: 16px;text-align: right;font-style: normal;">
快捷操作</div>
<!-- <el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">复制上月</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">全部上调5%</el-button>
@click="copyLastMonth">复制上月/</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">全部调5%</el-button> -->
@click="allUp">全部调5%</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="allDown">全部下调5%</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="handleClear">清空配置</el-button>
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
@@ -69,24 +69,24 @@ font-style: normal;">指标详情</div>
<!-- 表格组件添加key属性强制刷新绑定所有必要属性 -->
<base-table style="height: 700px;" :maxHeight=" '700' " @emitFun="inputChange" class="right-aside"
:table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable"
:key="`base-table-${isDetail}-${timeType}`"></base-table>
:table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable" id='calendarTable'
:key="tableKey"></base-table>
</div>
</div>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" action="#" :disabled="upload.isUploading"
:on-change="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板</el-link>
</div>
<div class="el-upload__tip" slot="tip">
<el-radio-group v-model="upload.timeDim">
<el-radio :label="2">月预算</el-radio>
<el-radio :label="3">年预算</el-radio>
</el-radio-group>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
@@ -99,9 +99,11 @@ font-style: normal;">指标详情</div>
<script>
import Container from './container.vue'
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData, getDictListData } from '@/api/cockpit'
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData} from '@/api/cockpit'
import inputArea from './inputArea.vue' // 导入输入组件
import { getBaseHeader } from "@/utils/request";
import { publicFormatter } from '@/utils/dict';
import {getAccessToken, getTenantId} from '@/utils/auth'
import axios from 'axios';
export default {
name: 'ProductionStatus',
components: {
@@ -118,34 +120,33 @@ export default {
data() {
return {
form: {
levelId: 1,
levelId: undefined,
pageNo: 1,
pageSize: 100,
date: undefined, // 统一存储日期(月份/年份)
startTime: undefined, // 起始时间戳
endTime: undefined // 结束时间戳
},
dictData: [],
upload: {
// 是否显示弹出层(用户导入)
// 是否显示弹出层
open: false,
// 弹出层标题(用户导入)
title: "",
// 弹出层标题
title: "预算填报导入",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: getBaseHeader(),
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/admin-api/system/user/import'
fileList:[],
currentFile:null,
timeDim: 2
},
getDataList: null, // 动态切换的查询接口
updateData: null, // 动态切换的更新接口
isDetail: false, // 编辑状态标识false=只读true=编辑
tableData: [], // 表格数据
levelLList: [], // 所属层级下拉数据
tableProps: [] // 表格列配置
tableProps: [], // 表格列配置
tableKey:0,// 强制表格更新
allUpBtn: false, // 全部上调按钮状态
allDownBtn: false // 全部下调按钮状态
}
},
watch: {
@@ -182,7 +183,6 @@ export default {
this.initDefaultDate();
// 2. 计算对应时间戳
this.calculateTimeStamp();
this.getDictData()
// 3. 先初始化表格配置(优先于数据请求,避免表格空配置渲染)
this.initTableProps(this.isDetail);
// 4. 等待配置就绪后,再请求数据,避免异步冲突
@@ -191,70 +191,119 @@ export default {
});
},
methods: {
getDictData() {
getDictListData({ pageNo: 1, pageSize: 100, dictType: 'lb_dw' }).then((res) => {
this.dictData = res.data.list
// 清空配置
handleClear() {
// 清空target
this.tableData.forEach(item => {
item.target = null;
})
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
},
// 表格单元格数据变更回调
inputChange(val) {
console.log('修改的数据:', val);
// 安全修改:判断索引是否存在,避免数组越界
if (this.tableData[val._pageIndex - 1]) {
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop];
// 标记数据为已修改状态
this.tableData[val._pageIndex - 1].status = 1;
//复制上月/上年数据(调用接口不同)
copyLastMonth() {
if(this.timeType === 'month') {
this.$modal.confirm('是否确认复制上月数据?').then(() => {
this.copyLastMonthDataPage()
}).then(() => {
this.$modal.msgSuccess("复制成功");
}).catch(() => { });
}else{
this.$modal.confirm('是否确认复制上年数据?').then(() => {
this.copyLastYearDataPage()
}).then(() => {
this.$modal.msgSuccess("复制成功");
}).catch(() => { });
}
},
// 初始化表格列配置核心精准控制inputArea挂载
initTableProps(isEdit) {
console.log('当前编辑状态:', isEdit, '当前时间维度:', this.timeType);
// 基础表格列配置(只读模式使用)
const baseTableProps = [
{ prop: 'type', label: '指标类型', align: 'center' },
{ prop: 'name', label: '指标名称', align: 'center' },
{ prop: 'unit', label: '单位', align: 'center' },
{ prop: 'target', label: '预估值', align: 'center' },
];
if (isEdit) {
// 编辑模式仅给「预估值」列添加inputArea精准挂载避免无效配置
this.tableProps = baseTableProps.map(item => {
if (item.prop === 'target') { // 只给需要编辑的列添加子组件
return {
...item,
subcomponent: inputArea // 挂载输入组件
};
}
return item; // 其他列保持原有配置
copyLastMonthDataPage() {
copyLastMonthData({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
} else {
// 只读模式:深拷贝基础配置,避免引用污染
this.tableProps = JSON.parse(JSON.stringify(baseTableProps));
}
console.log('表格配置:', this.tableProps);
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
copyLastYearDataPage() {
copyLastYearData({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
//全部上调5%
allUp() {
if(this.allUpBtn || this.allDownBtn) {
this.$modal.msgWarning("数据已调整,请先保存数据");
return
}
for(let i = 0; i < this.tableData.length; i++) {
this.tableData[i].target = (this.tableData[i].target * 1.05).toFixed(2)
}
// 强制表格组件刷新
this.tableKey++;
this.allUpBtn = true;
},
// 全部下调5%
allDown() {
if(this.allUpBtn || this.allDownBtn) {
this.$modal.msgWarning("数据已调整,请先保存数据");
return;
}
for(let i = 0; i < this.tableData.length; i++) {
this.tableData[i].target = (this.tableData[i].target * 0.95).toFixed(2)
}
// 强制表格组件刷新
this.tableKey++;
this.allDownBtn = true;
},
// 查询按钮
onSubmit() {
// 清空原有表格数据,重新请求
this.tableData = [];
this.$nextTick(() => {
this.getDataPage();
});
},
// 切换到编辑模式
handleEdit() {
this.isDetail = true;
// 先更新表格配置,再强制表格刷新(双重保障)
// 先更新表格配置,再强制表格刷新
this.initTableProps(this.isDetail);
this.$nextTick(() => {
if (this.$refs.baseTable) {
this.$refs.baseTable.$forceUpdate(); // 强制表格组件刷新
}
});
this.tableKey++;
},
// 保存数据使用动态切换的updateData接口
handleSave() {
// if (!this.updateData) {
// this.$modal.msgWarning('当前时间维度异常,无法保存');
// return;
// }
this.$modal.confirm('是否确认保存数据?').then(() => {
return this.updateData(this.tableData)
}).then(() => {
@@ -269,23 +318,58 @@ export default {
this.$modal.msgSuccess("保存成功");
}).catch(() => { });
},
// 请求下拉数据和表格数据使用动态切换的getDataList接口
getData() {
if (!this.getDataList) {
console.warn('当前时间维度异常,无法获取数据');
return;
}
// 1. 请求所属层级下拉数据
getLevelStruc().then((res) => {
this.levelLList = res.data || [];
this.form.levelId = this.levelLList[0].id;
this.getDataPage()
}).catch(err => {
console.error('获取所属层级失败:', err);
this.levelLList = [];
});
this.$emit('updateLeft')
},
getDataPage() {
// 2. 请求表格分页数据(使用动态接口)
this.getDataList({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
console.log('表格数据:', res);
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
// 表格单元格数据变更回调
inputChange(val) {
// 安全修改:判断索引是否存在,避免数组越界
if (this.tableData[val._pageIndex - 1]) {
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop];
// 标记数据为已修改状态
this.tableData[val._pageIndex - 1].status = 1;
}
},
// 取消编辑,恢复只读模式
handleCancel() {
this.isDetail = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
});
console.log('已取消编辑,恢复原始数据');
},
// 清空配置
handleClear() {
this.isDetail = false;
this.allUpBtn = false;
this.allDownBtn = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
@@ -294,13 +378,39 @@ export default {
this.getData();
});
},
// 初始化表格列配置核心精准控制inputArea挂载
initTableProps(isEdit) {
console.log('当前编辑状态:', isEdit, '当前时间维度:', this.timeType);
// 基础表格列配置(只读模式使用)
const baseTableProps = [
{ prop: 'type', label: '指标类型', align: 'center' },
{ prop: 'name', label: '指标名称', align: 'center' },
{ prop: 'unit', label: '单位', align: 'center', filter: publicFormatter('lb_dw') },
{ prop: 'target', label: '预估值', align: 'center' },
];
if (isEdit) {
// 编辑模式仅给「预估值」列添加inputArea精准挂载避免无效配置
this.tableProps = baseTableProps.map(item => {
if (item.prop === 'target') { // 只给需要编辑的列添加子组件
return {
...item,
subcomponent: inputArea // 挂载输入组件
};
}
return item; // 其他列保持原有配置
});
} else {
// 只读模式:深拷贝基础配置,避免引用污染
// this.tableProps = JSON.parse(JSON.stringify(baseTableProps));
this.tableProps = baseTableProps;
}
console.log('表格配置:', this.tableProps);
},
// 初始化默认日期根据timeType
initDefaultDate() {
const currentDate = new Date();
this.form.date = currentDate;
},
// 计算时间戳根据timeType切换月/年)
calculateTimeStamp(selectDate) {
let targetDate = selectDate || this.form.date;
@@ -330,7 +440,6 @@ export default {
this.form.endTime = endDatePrecise.getTime();
}
},
// 日期选择器变更事件(统一处理月/年变更)
handleDateChange(val) {
if (!val) {
@@ -342,62 +451,61 @@ export default {
// 计算选中日期对应的时间戳
this.calculateTimeStamp(val);
},
getUnitLabel(unitCode) {
// 若字典为空或无匹配编码,返回原编码或空字符串
if (!this.dictData || this.dictData.length === 0) {
return unitCode || '';
}
// 查找匹配的字典项
const matchItem = this.dictData.find(item => item.value == unitCode);
// 返回匹配的label无匹配则返回原unit编码
return matchItem ? matchItem.label : (unitCode || '');
// 导入
importExcel() {
this.upload.open = true
},
// 请求下拉数据和表格数据使用动态切换的getDataList接口
getData() {
if (!this.getDataList) {
console.warn('当前时间维度异常,无法获取数据');
return;
}
// 1. 请求所属层级下拉数据
getLevelStruc().then((res) => {
console.log('所属层级数据:', res);
this.levelLList = res.data || [];
}).catch(err => {
console.error('获取所属层级失败:', err);
this.levelLList = [];
});
// 2. 请求表格分页数据(使用动态接口)
this.getDataList({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
console.log('表格数据:', res);
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item,
unitLabel: this.getUnitLabel(item.unit)
};
});
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
// 文件上传中处理
handleFileUploadProgress(file, fileList) {
console.log('文件上传中:',file, fileList)
this.upload.isUploading = true;
this.upload.fileList = fileList;
this.upload.currentFile = file.raw;
},
handleFileSuccess() {},
importTemplate() {},
// 提交上传文件
async submitFileForm() {
try {
if (!this.upload.currentFile) {
return this.$message.error('请先选择要上传的文件!')
}
const formData = new FormData()
formData.append('file', this.upload.currentFile) // 文件字段
formData.append('timeDim', this.upload.timeDim) // 年月维度字段
formData.append('reportDate', this.form.endTime) // 时间维度字段
formData.append('levelId', this.form.levelId) // 层级维度字段
const response = await axios({
url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-target-month/import',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': "Bearer " + getAccessToken(),
'tenant-id': getTenantId(),
},
timeout: 30000
})
// 4. 处理响应结果
if (response.data.code === 0) {
this.$message.success('文件上传成功!')
// 重置表单
this.upload.fileList = []
this.upload.timeDim = 2
this.upload.currentFile = null
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}
} catch (error) {
// 5. 异常处理
console.error('文件上传出错:', error)
this.$message.error('上传失败!')
}
},
// 查询按钮点击事件(可根据需求扩展逻辑)
onSubmit() {
// 清空原有表格数据,重新请求
this.tableData = [];
this.$nextTick(() => {
this.getData();
});
}
}
}
</script>

View File

@@ -7,6 +7,15 @@
<!-- 右侧区域全屏按钮 -->
<div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
</el-button>
@@ -35,7 +44,7 @@
<script>
import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi";
export default {
name: 'Header',
props: {
@@ -75,6 +84,18 @@ export default {
handleReturn() {
this.$router.go(-1);
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
},
exportPDF() {
this.$emit('exportPDF');
},
@@ -300,6 +321,7 @@ export default {
margin-top: 12px;
margin-right: 10px;
gap: 21px;
height: 35px;
}
// .current-time {
@@ -326,6 +348,7 @@ export default {
color: #00fff0;
font-size: 26px;
padding: 0;
margin: 0;
}
.return-btn {
@@ -336,6 +359,13 @@ export default {
font-size: 26px;
padding: 0;
}
.logout-btn {
width: 28px;
height: 28px;
font-size: 28px;
padding: 0;
}
}
/* 自定义下拉框样式(替换原有日期选择器样式) */

View File

@@ -13,7 +13,7 @@
<div class="monthItem" :class="{
'has-data': month.haveData,
'current': index === currentMonthIndex // 本月匹配current样式
}" v-for="(month, index) in monthList" :key="index">
}" v-for="(month, index) in list" :key="index">
{{ month.name }}
</div>
</div>
@@ -41,21 +41,7 @@ export default {
data() {
return {
chart: null,
// 初始化12个月的列表可根据实际需求修改haveData默认值
monthList: [
{ name: '1月', haveData: false, isActive: false },
{ name: '2月', haveData: false, isActive: false },
{ name: '3月', haveData: false, isActive: false },
{ name: '4月', haveData: false, isActive: false },
{ name: '5月', haveData: false, isActive: false },
{ name: '6月', haveData: false, isActive: false },
{ name: '7月', haveData: false, isActive: false },
{ name: '8月', haveData: false, isActive: false },
{ name: '9月', haveData: false, isActive: false },
{ name: '10月', haveData: false, isActive: false },
{ name: '11月', haveData: false, isActive: false },
{ name: '12月', haveData: false, isActive: false }
],
list:[]
}
},
computed: {
@@ -83,19 +69,15 @@ export default {
// 根据calendarList更新monthList的haveData状态
updateMonthHaveData(calendarObj) {
if (!calendarObj || typeof calendarObj !== 'object') return;
// 遍历12个月匹配对应年月
this.monthList.forEach((month, index) => {
// 获取月份数字(索引+1补两位如1→0110→10
const monthNum = (index + 1).toString().padStart(2, '0');
// 拼接成calendarList中的键格式如2025-01
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定可改为props传递年份
// 判断calendarObj中该键对应的值1→true0→false无该键则保持默认false
if (calendarObj.hasOwnProperty(yearMonthKey)) {
month.haveData = calendarObj[yearMonthKey] === 1;
}
});
const keys = Object.keys(calendarObj);
if(keys.length == 0){
return
}
console.log('calendarObj',calendarObj)
this.list = []
for(let i = 0; i < keys.length; i++) {
this.list.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
}
},
}
}

View File

@@ -20,7 +20,7 @@
</el-form-item>
<el-form-item>
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
<!-- <el-button type="primary" plain size="medium">导入</el-button> -->
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
</el-form-item>
</el-form>
</div>
@@ -64,6 +64,22 @@ font-style: normal;">指标详情</div>
></base-table>
</div>
</div>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" action="#" :disabled="upload.isUploading"
:on-change="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
</div>
<div class="el-upload__tip" slot="tip">
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</Container>
</div>
</template>
@@ -72,7 +88,8 @@ font-style: normal;">指标详情</div>
import Container from './container.vue'
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit'
import inputArea from './inputArea.vue' // 导入输入组件
import {getAccessToken, getTenantId} from '@/utils/auth'
import axios from 'axios';
export default {
name: 'ProductionStatus',
components: {
@@ -85,7 +102,7 @@ export default {
data() {
return {
form: {
levelId: 1,
levelId: undefined,
pageNo: 1,
pageSize: 100,
month: undefined,
@@ -96,7 +113,17 @@ export default {
isDetail: false, // 编辑状态标识false=只读true=编辑
tableData: [], // 表格数据
levelLList: [], // 所属层级下拉数据
tableProps: [] // 表格列配置
tableProps: [], // 表格列配置
upload: {
// 是否显示弹出层
open: false,
// 弹出层标题
title: "指标填报导入",
// 是否禁用上传
isUploading: false,
fileList:[],
currentFile:null
}
}
},
watch: {
@@ -261,13 +288,16 @@ export default {
getData() {
// 1. 请求所属层级下拉数据
getLevelStruc().then((res) => {
console.log('所属层级数据:', res);
this.levelLList = res.data || [];
this.form.levelId = this.levelLList[0].id;
this.getDataPage()
}).catch(err => {
console.error('获取所属层级失败:', err);
this.levelLList = [];
});
this.$emit('updateLeft')
},
getDataPage() {
// 2. 请求表格分页数据
getRealMonthPage({
levelId: this.form.levelId,
@@ -288,6 +318,7 @@ export default {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
// 查询按钮点击事件(可根据需求扩展逻辑)
@@ -295,8 +326,61 @@ export default {
// 清空原有表格数据,重新请求
this.tableData = [];
this.$nextTick(() => {
this.getData();
this.getDataPage();
});
},
// 导入
importExcel() {
this.upload.open = true
},
// 文件上传中处理
handleFileUploadProgress(file, fileList) {
console.log('文件上传中:',file, fileList)
this.upload.isUploading = true;
this.upload.fileList = fileList;
this.upload.currentFile = file.raw;
},
handleFileSuccess() {},
importTemplate() {},
// 提交上传文件
async submitFileForm() {
try {
if (!this.upload.currentFile) {
return this.$message.error('请先选择要上传的文件!')
}
const formData = new FormData()
formData.append('file', this.upload.currentFile) // 文件字段
formData.append('reportDate', this.form.endTime) // 时间维度字段
formData.append('levelId', this.form.levelId) // 层级维度字段
const response = await axios({
url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-real-month/actualIndicatorImport',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': "Bearer " + getAccessToken(),
'tenant-id': getTenantId(),
},
timeout: 30000
})
// 4. 处理响应结果
if (response.data.code === 0) {
this.$message.success('文件上传成功!')
// 重置表单
this.upload.fileList = []
this.upload.currentFile = null
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}
} catch (error) {
// 5. 异常处理
console.error('文件上传出错:', error)
this.$message.error('上传失败!')
}
}
}
}

View File

@@ -7,6 +7,15 @@
<!-- 右侧区域全屏按钮 -->
<div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
</el-button>
@@ -31,7 +40,7 @@
<script>
import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi";
export default {
name: 'Header',
props: {
@@ -100,6 +109,18 @@ export default {
this.$router.go(-1);
}
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
},
/**
* 计算时间范围(时间戳格式)
* 固定为月维度当月1日00:00:00 → 当月最后一天23:59:59
@@ -297,6 +318,7 @@ export default {
margin-top: 12px;
margin-right: 10px;
gap: 21px;
height: 35px;
}
.screen-btn {
@@ -305,6 +327,7 @@ export default {
color: #00fff0;
font-size: 26px;
padding: 0;
margin: 0;
}
.home-btn {
@@ -322,6 +345,14 @@ export default {
font-size: 26px;
padding: 0;
}
.logout-btn {
width: 28px;
height: 28px;
font-size: 28px;
padding: 0;
}
}
/* 日期选择器自定义样式 */

View File

@@ -99,7 +99,7 @@ export default {
grid: {
top: 35,
bottom: 20,
right: 25,
right: 13,
},
xAxis: [
{
@@ -222,11 +222,11 @@ export default {
/* (你的样式代码保持不变) */
.legend {
position: absolute;
right: 10px;
top: -5px;
right: 12px;
top: 0px;
display: flex;
/* 使用 flex 布局让两个图例项并排且对齐 */
gap: 20px;
gap: 5px;
}
.legend-item-line {
@@ -237,7 +237,7 @@ export default {
text-align: left;
font-style: normal;
position: relative;
padding-left: 20px;
padding-left: 24px;
/* 为圆点和线条留出空间 */
display: flex;
align-items: center;

View File

@@ -121,7 +121,7 @@ export default {
.lineFour {
top: 5px;
left: 268px;
left: 252px;
}
.item-button {

View File

@@ -71,7 +71,7 @@ export default {
// 定义一个映射关系,将后端字段名与前端显示信息关联起来
const dataMap = [
{
key: 'processCost',
key: 'totalCost',
unit: '制造成本·元/㎡',
route: '/productionCostAnalysis/productionCostAnalysis'
},

View File

@@ -45,7 +45,7 @@ import { getOperateCockpit, getOrderDetail } from '@/api/cockpit'
import { Sidebar } from "../../layout/components";
import { mapState } from "vuex";
export default {
name: 'DayReport',
name: 'JtHome',
components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts, Sidebar },
data() {
return {

View File

@@ -17,7 +17,7 @@
grid-template-columns:416px 1192px;
">
<indicatorCalendar :calendarList="calendarList" />
<indicatorDetails />
<indicatorDetails @updateLeft='getData'/>
</div>
</div>
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
@@ -146,27 +146,11 @@ export default {
this.getData()
},
methods: {
// sortChange(value) {
// this.sort = value
// this.getData()
// },
getData() {
getRealMonthCalendar().then((res) => {
console.log(res, 'res');
this.calendarList = res.data
})
// getSalesRevenueGroupData({
// startTime: this.dateData.startTime,
// endTime: this.dateData.endTime,
// sort: this.sort,
// index: undefined,
// factory: undefined
// // timeDim: obj.mode
// }).then((res) => {
// console.log(res);
// this.monthData= res.data.month
// this.ytdData = res.data.ytd
// })
},
handleTimeChange(obj) {
console.log(obj, 'obj');

View File

@@ -75,7 +75,7 @@
<el-table-column label="用户编号" align="center" key="id" prop="id" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="username" prop="username" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickname" prop="nickname" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.name" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="mobile" prop="mobile" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" key="status" v-if="columns[5].visible" align="center">
<template v-slot="scope">

View File

@@ -1,68 +1,68 @@
@echo off
setlocal enabledelayedexpansion
set cmdstr=rsync
set zipfile=cwrsync.zip
set downurl=https://itefix.net/download/free/cwrsync_6.3.0_x64_free.zip
set currpath=%~dp0
set "rsynchome=%ProgramFiles%\%zipfile:~0,-4%"
set passfile=%temp%\.password
set syncdir=dist/
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
set accountwithost=kszny@192.168.0.35::data
set "password=kszny@123"
set "runcommand=%cmdstr% --port=873 -rlptvz --progress --password-file=%passfile% --exclude=google.exe --exclude=Lodap.zip %syncdir% %accountwithost%"
where %cmdstr% >nul 2>nul
::<3A>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD>
if %errorlevel% neq 0 (
::<3A><>δ<EFBFBD><CEB4><EFBFBD>ذ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>װĿ¼
if not exist "%rsynchome%" (
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><C8A8>
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\runAsAdmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\runAsAdmin.vbs"
"%temp%\runAsAdmin.vbs"
:: <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1>޲<EFBFBD><DEB2>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
mkdir "%rsynchome%"
del "%temp%\runAsAdmin.vbs"
exit /B
)
:: ʹ<><CAB9>powershell<6C><6C>curl<72><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
powershell curl -o %temp%\%zipfile% %downurl%
:: <20><>ѹ
tar -xf "%temp%\%zipfile%" -C "%rsynchome%"
echo "%cmdstr%<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%rsynchome%Ŀ¼<EFBFBD><EFBFBD>"
:: <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PATH <20><>
set "found=false"
for %%I in ("%PATH:;=";"%") do (
if /I "%%~I"=="%rsynchome%\bin" (
set "found=true"
)
)
:: δ<><CEB4><EFBFBD>õ<EFBFBD>path<74><68><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ӵ<EFBFBD>path<74><68><EFBFBD><EFBFBD>
if "!found!"=="false" (
:: <20><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> PATH <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>setx<74><78>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>1024<32><34><EFBFBD>ַ<EFBFBD><D6B7>ͻᱻ<CDBB>ض<EFBFBD>
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%PATH%;%rsynchome%\bin" /f
)
)
::<3A><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB>distĿ¼
if not exist "%currpath%%syncdir%" (
echo <20><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Ҫͬ<D2AA><CDAC><EFBFBD><EFBFBD>%syncdir%Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%syncdir%Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰĿ¼<EFBFBD>£<EFBFBD>
) else (
echo !password!>%passfile%
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>...
!runcommand! && (
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
) || (
echo !runcommand!
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>VPN<50><4E>
)
del %passfile%
)
endlocal
pause
@echo off
setlocal enabledelayedexpansion
set cmdstr=rsync
set zipfile=cwrsync.zip
set downurl=https://itefix.net/download/free/cwrsync_6.3.0_x64_free.zip
set currpath=%~dp0
set "rsynchome=%ProgramFiles%\%zipfile:~0,-4%"
set passfile=%temp%\.password
set syncdir=dist/
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
set accountwithost=kszny@192.168.0.35::data
set "password=kszny@123"
set "runcommand=%cmdstr% --port=873 -rlptvz --progress --password-file=%passfile% --exclude=google.exe --exclude=Lodap.zip %syncdir% %accountwithost%"
where %cmdstr% >nul 2>nul
::<3A>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD>
if %errorlevel% neq 0 (
::<3A><>δ<EFBFBD><CEB4><EFBFBD>ذ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>װĿ¼
if not exist "%rsynchome%" (
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><C8A8>
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\runAsAdmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\runAsAdmin.vbs"
"%temp%\runAsAdmin.vbs"
:: <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1>޲<EFBFBD><DEB2>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
mkdir "%rsynchome%"
del "%temp%\runAsAdmin.vbs"
exit /B
)
:: ʹ<><CAB9>powershell<6C><6C>curl<72><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
powershell curl -o %temp%\%zipfile% %downurl%
:: <20><>ѹ
tar -xf "%temp%\%zipfile%" -C "%rsynchome%"
echo "%cmdstr%<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%rsynchome%Ŀ¼<EFBFBD><EFBFBD>"
:: <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PATH <20><>
set "found=false"
for %%I in ("%PATH:;=";"%") do (
if /I "%%~I"=="%rsynchome%\bin" (
set "found=true"
)
)
:: δ<><CEB4><EFBFBD>õ<EFBFBD>path<74><68><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ӵ<EFBFBD>path<74><68><EFBFBD><EFBFBD>
if "!found!"=="false" (
:: <20><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> PATH <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>setx<74><78>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>1024<32><34><EFBFBD>ַ<EFBFBD><D6B7>ͻᱻ<CDBB>ض<EFBFBD>
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%PATH%;%rsynchome%\bin" /f
)
)
::<3A><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB>distĿ¼
if not exist "%currpath%%syncdir%" (
echo <20><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Ҫͬ<D2AA><CDAC><EFBFBD><EFBFBD>%syncdir%Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%syncdir%Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰĿ¼<EFBFBD>£<EFBFBD>
) else (
echo !password!>%passfile%
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>...
!runcommand! && (
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
) || (
echo !runcommand!
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>VPN<50><4E>
)
del %passfile%
)
endlocal
pause