Compare commits
3 Commits
projects/l
...
projects/l
| Author | SHA1 | Date | |
|---|---|---|---|
| ef230b3836 | |||
| 9f2f7036fd | |||
| 2f3586e2f2 |
7
.env.dev
7
.env.dev
@@ -9,7 +9,12 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
|
|||||||
# VUE_APP_BASE_API = 'http://172.16.32.95:7070'
|
# 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://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
1
.gitignore
vendored
@@ -20,3 +20,4 @@ selenium-debug.log
|
|||||||
*.local
|
*.local
|
||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
sync_luobo.bat
|
||||||
@@ -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) {
|
export function getSalesRevenueGroupData(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -254,6 +270,13 @@ export function getCalendar(data) {
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export function getCalendarYear(data) {
|
||||||
|
return request({
|
||||||
|
url: "lb/index-target-year/getCalendarYear",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
export function getLevelStruc(data) {
|
export function getLevelStruc(data) {
|
||||||
return request({
|
return request({
|
||||||
url: "/lb/index-target-month/getLevelStruc",
|
url: "/lb/index-target-month/getLevelStruc",
|
||||||
|
|||||||
11
src/assets/icons/svg/logout.svg
Normal file
11
src/assets/icons/svg/logout.svg
Normal 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 |
@@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||||
<transition name="sidebarLogoFade">
|
<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" />
|
<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>
|
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||||
</router-link>
|
</div>
|
||||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
<div v-else key="expand" class="sidebar-logo-link">
|
||||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||||
</router-link>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -8,6 +8,38 @@ import { isRelogin } from '@/utils/request'
|
|||||||
|
|
||||||
NProgress.configure({ showSpinner: false })
|
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 芋艿
|
// 增加三方登陆 update by 芋艿
|
||||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
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)
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: store.getters.defaultPath || '/' })
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.roles.length === 0) {
|
if (store.getters.roles.length === 0) {
|
||||||
@@ -31,7 +63,13 @@ router.beforeEach((to, from, next) => {
|
|||||||
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||||
// 根据 roles 权限生成可访问的路由表
|
// 根据 roles 权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
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 => {
|
}).catch(err => {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
@@ -40,7 +78,12 @@ router.beforeEach((to, from, next) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
next()
|
if (to.path === '/') {
|
||||||
|
const defaultPath = store.getters.defaultPath || '/'
|
||||||
|
next({ path: defaultPath, replace: true })
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const getters = {
|
|||||||
topbarRouters:state => state.permission.topbarRouters,
|
topbarRouters:state => state.permission.topbarRouters,
|
||||||
defaultRoutes:state => state.permission.defaultRoutes,
|
defaultRoutes:state => state.permission.defaultRoutes,
|
||||||
sidebarRouters:state => state.permission.sidebarRouters,
|
sidebarRouters:state => state.permission.sidebarRouters,
|
||||||
|
defaultPath: state => state.permission.defaultPath,
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dict_datas: state => state.dict.dictDatas
|
dict_datas: state => state.dict.dictDatas
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,12 @@ const permission = {
|
|||||||
addRoutes: [],
|
addRoutes: [],
|
||||||
sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用
|
sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用
|
||||||
topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用
|
topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用
|
||||||
|
defaultPath: '/', // 登录后默认跳转路径(由菜单 jumpFlag===1 决定)
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
SET_DEFAULT_PATH: (state, path) => {
|
||||||
|
state.defaultPath = path || '/'
|
||||||
|
},
|
||||||
SET_ROUTES: (state, routes) => {
|
SET_ROUTES: (state, routes) => {
|
||||||
state.addRoutes = routes
|
state.addRoutes = routes
|
||||||
state.routes = constantRoutes.concat(routes)
|
state.routes = constantRoutes.concat(routes)
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ export const DICT_TYPE = {
|
|||||||
PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式
|
PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式
|
||||||
PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态
|
PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态
|
||||||
PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举
|
PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举
|
||||||
|
|
||||||
|
// ========== 模块 ==========
|
||||||
|
LB_DW: 'lb_dw'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,3 +142,15 @@ export function getDictDataLabel(dictType, value) {
|
|||||||
const dict = getDictData(dictType, value);
|
const dict = getDictData(dictType, value);
|
||||||
return dict ? dict.label : '';
|
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]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
grid-template-columns:416px 1192px;
|
grid-template-columns:416px 1192px;
|
||||||
">
|
">
|
||||||
<indicatorCalendar :calendarList="calendarList" />
|
<indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
|
||||||
<indicatorDetails :timeType="timeType" />
|
<indicatorDetails :timeType="timeType" @updateLeft='getData'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
|
<!-- <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 operatingLineChart from "../operatingComponents/operatingLineChart";
|
||||||
// import operatingLineChartCumulative from "../operatingComponents/operatingLineChartCumulative.vue";
|
// import operatingLineChartCumulative from "../operatingComponents/operatingLineChartCumulative.vue";
|
||||||
|
|
||||||
import { getSalesRevenueGroupData, getCalendar } from '@/api/cockpit'
|
import { getSalesRevenueGroupData } from '@/api/cockpit'
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import {getCalendar, getCalendarYear} from '@/api/cockpit';
|
||||||
export default {
|
export default {
|
||||||
name: "DayReport",
|
name: "DayReport",
|
||||||
components: {
|
components: {
|
||||||
@@ -78,7 +79,7 @@ export default {
|
|||||||
selectDate:{},
|
selectDate:{},
|
||||||
monthData: {},
|
monthData: {},
|
||||||
ytdData: {},
|
ytdData: {},
|
||||||
calendarList:{},
|
calendarObj:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -147,34 +148,21 @@ export default {
|
|||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// sortChange(value) {
|
|
||||||
// this.sort = value
|
|
||||||
// this.getData()
|
|
||||||
// },
|
|
||||||
getData() {
|
getData() {
|
||||||
getCalendar().then((res) => {
|
if(this.timeType == 'month'){
|
||||||
console.log(res, 'res');
|
getCalendar().then((res) => {
|
||||||
this.calendarList = res.data
|
this.calendarObj = res.data
|
||||||
// this.monthData = res.data.month
|
})
|
||||||
// this.ytdData = res.data.ytd
|
}else{
|
||||||
})
|
getCalendarYear().then((res) => {
|
||||||
// getSalesRevenueGroupData({
|
this.calendarObj = res.data
|
||||||
// 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) {
|
handleTimeChange(obj) {
|
||||||
console.log(obj, 'obj');
|
console.log(obj, 'obj');
|
||||||
this.timeType = obj
|
this.timeType = obj
|
||||||
// this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
handleClickOutside() {
|
handleClickOutside() {
|
||||||
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
|
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
|
||||||
|
|||||||
@@ -8,6 +8,15 @@
|
|||||||
|
|
||||||
<!-- 右侧区域:全屏按钮 -->
|
<!-- 右侧区域:全屏按钮 -->
|
||||||
<div class="right-content">
|
<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">
|
<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-if="openSider" icon-class="closeSider" />
|
||||||
<svg-icon style="color: #0B58FF;" v-else icon-class="openSider" />
|
<svg-icon style="color: #0B58FF;" v-else icon-class="openSider" />
|
||||||
@@ -36,6 +45,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import {getPath} from "@/utils/ruoyi";
|
||||||
export default {
|
export default {
|
||||||
name: 'Header',
|
name: 'Header',
|
||||||
props: {
|
props: {
|
||||||
@@ -139,6 +149,19 @@ export default {
|
|||||||
const timeRange = this.calculateTimeRange();
|
const timeRange = this.calculateTimeRange();
|
||||||
this.$emit('timeRangeChange', timeRange);
|
this.$emit('timeRangeChange', timeRange);
|
||||||
console.log('触发时间范围变化:', 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: {
|
watch: {
|
||||||
@@ -325,10 +348,11 @@ export default {
|
|||||||
|
|
||||||
.right-content {
|
.right-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 60px;
|
margin-top: 12px;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 10px;
|
gap: 21px;
|
||||||
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.current-time {
|
.current-time {
|
||||||
@@ -345,6 +369,15 @@ export default {
|
|||||||
color: #00fff0;
|
color: #00fff0;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
font-size: 30px;
|
||||||
|
padding: 0;
|
||||||
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
||||||
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
||||||
<div class="monthItem" :class="{
|
<div class="monthItem" :class="{
|
||||||
'has-data': month.haveData,
|
'has-data': calendar.haveData,
|
||||||
'current': index === currentMonthIndex // 本月匹配current样式
|
'current': calendar.isActive // 本月匹配current样式
|
||||||
}" v-for="(month, index) in monthList" :key="index">
|
}" v-for="(calendar, index) in calendarList" :key="index">
|
||||||
{{ month.name }}
|
{{ calendar.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,49 +25,35 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Container from './container.vue'
|
import Container from './container.vue'
|
||||||
// import * as echarts from 'echarts'
|
|
||||||
// import topItem from './operating-item.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProductionStatus',
|
name: 'ProductionStatus',
|
||||||
components: { Container },
|
components: { Container },
|
||||||
// mixins: [resize],
|
// mixins: [resize],
|
||||||
props: {
|
props: {
|
||||||
calendarList: { // 接收父组件传递的年月状态对象
|
timeType: {
|
||||||
|
type: String,
|
||||||
|
default: 'month', // 默认月份维度
|
||||||
|
},
|
||||||
|
calendarObj: { // 接收父组件传递的年月状态对象
|
||||||
type: Object, // 注意:父组件传递的是对象,不是数组,修正props类型
|
type: Object, // 注意:父组件传递的是对象,不是数组,修正props类型
|
||||||
default: () => ({}) // 默认空对象,避免报错
|
default: () => ({}) // 默认空对象,避免报错
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
calendarList:[],// 日历列表
|
||||||
// 初始化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();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 监听calendarList变化,实时更新monthList的haveData状态
|
// 监听calendarList变化,实时更新monthList的haveData状态
|
||||||
calendarList: {
|
// timeType: {
|
||||||
|
// immediate: true, // 组件挂载时立即执行一次
|
||||||
|
// deep: true, // 深度监听对象内部属性变化
|
||||||
|
// handler() {
|
||||||
|
// this.updateMonthHaveData();
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
calendarObj:{
|
||||||
immediate: true, // 组件挂载时立即执行一次
|
immediate: true, // 组件挂载时立即执行一次
|
||||||
deep: true, // 深度监听对象内部属性变化
|
deep: true, // 深度监听对象内部属性变化
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
@@ -75,28 +61,24 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
// 初始化图表(若需展示图表,需在模板中添加对应 DOM)
|
|
||||||
// this.$nextTick(() => this.updateChart())
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 根据calendarList更新monthList的haveData状态
|
// 根据月或者年维度,获取不同的接口,拿到数据,更新左侧日历框
|
||||||
updateMonthHaveData(calendarObj) {
|
updateMonthHaveData(calendarObj) {
|
||||||
if (!calendarObj || typeof calendarObj !== 'object') return;
|
if(this.timeType == 'month'){
|
||||||
|
const keys = Object.keys(calendarObj);
|
||||||
// 遍历12个月,匹配对应年月
|
this.calendarList = []
|
||||||
this.monthList.forEach((month, index) => {
|
for(let i = 0; i < keys.length; i++) {
|
||||||
// 获取月份数字(索引+1,补两位,如1→01,10→10)
|
this.calendarList.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
|
||||||
const monthNum = (index + 1).toString().padStart(2, '0');
|
|
||||||
// 拼接成calendarList中的键格式(如2025-01)
|
|
||||||
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定,可改为props传递年份
|
|
||||||
|
|
||||||
// 判断calendarObj中该键对应的值:1→true,0→false,无该键则保持默认false
|
|
||||||
if (calendarObj.hasOwnProperty(yearMonthKey)) {
|
|
||||||
month.haveData = calendarObj[yearMonthKey] === 1;
|
|
||||||
}
|
}
|
||||||
});
|
}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>
|
</script>
|
||||||
@@ -119,7 +101,6 @@ export default {
|
|||||||
line-height: 42px;
|
line-height: 42px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
cursor: pointer; // 鼠标悬浮手型
|
|
||||||
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
||||||
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
||||||
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
||||||
@@ -140,5 +121,3 @@ export default {
|
|||||||
border: 2px solid #0B58FF !important;
|
border: 2px solid #0B58FF !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style></style>
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,14 +35,14 @@
|
|||||||
<div v-if="!isDetail" style="display: flex;gap: 8px;align-items: center;height: 32px;">
|
<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: 4px;height: 16px;background: #0B58FF;border-radius: 1px;"></div>
|
||||||
<div style="width: 58px;
|
<div style="width: 58px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0,0,0,0.85);
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-style: normal;">指标详情</div>
|
font-style: normal;">指标详情</div>
|
||||||
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
|
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
|
||||||
@click="handleEdit">编辑</el-button>
|
@click="handleEdit">编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,12 +53,12 @@ font-style: normal;">指标详情</div>
|
|||||||
<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;">
|
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>
|
快捷操作</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"
|
<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"
|
<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"
|
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
|
||||||
@click="handleClear">清空配置</el-button>
|
@click="handleClear">清空配置</el-button>
|
||||||
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
|
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
|
||||||
@@ -69,24 +69,24 @@ font-style: normal;">指标详情</div>
|
|||||||
|
|
||||||
<!-- 表格组件:添加key属性强制刷新,绑定所有必要属性 -->
|
<!-- 表格组件:添加key属性强制刷新,绑定所有必要属性 -->
|
||||||
<base-table style="height: 700px;" :maxHeight=" '700' " @emitFun="inputChange" class="right-aside"
|
<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"
|
:table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable" id='calendarTable'
|
||||||
:key="`base-table-${isDetail}-${timeType}`"></base-table>
|
:key="tableKey"></base-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
<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"
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" action="#" :disabled="upload.isUploading"
|
||||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
:on-change="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
<div class="el-upload__tip" slot="tip">
|
|
||||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
|
||||||
</div>
|
|
||||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
|
||||||
@click="importTemplate">下载模板</el-link>
|
|
||||||
</div>
|
</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>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
@@ -99,9 +99,11 @@ font-style: normal;">指标详情</div>
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Container from './container.vue'
|
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 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 {
|
export default {
|
||||||
name: 'ProductionStatus',
|
name: 'ProductionStatus',
|
||||||
components: {
|
components: {
|
||||||
@@ -118,34 +120,33 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
levelId: 1,
|
levelId: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
date: undefined, // 统一存储日期(月份/年份)
|
date: undefined, // 统一存储日期(月份/年份)
|
||||||
startTime: undefined, // 起始时间戳
|
startTime: undefined, // 起始时间戳
|
||||||
endTime: undefined // 结束时间戳
|
endTime: undefined // 结束时间戳
|
||||||
},
|
},
|
||||||
dictData: [],
|
|
||||||
upload: {
|
upload: {
|
||||||
// 是否显示弹出层(用户导入)
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 弹出层标题(用户导入)
|
// 弹出层标题
|
||||||
title: "",
|
title: "预算填报导入",
|
||||||
// 是否禁用上传
|
// 是否禁用上传
|
||||||
isUploading: false,
|
isUploading: false,
|
||||||
// 是否更新已经存在的用户数据
|
fileList:[],
|
||||||
updateSupport: 0,
|
currentFile:null,
|
||||||
// 设置上传的请求头部
|
timeDim: 2
|
||||||
headers: getBaseHeader(),
|
|
||||||
// 上传的地址
|
|
||||||
url: process.env.VUE_APP_BASE_API + '/admin-api/system/user/import'
|
|
||||||
},
|
},
|
||||||
getDataList: null, // 动态切换的查询接口
|
getDataList: null, // 动态切换的查询接口
|
||||||
updateData: null, // 动态切换的更新接口
|
updateData: null, // 动态切换的更新接口
|
||||||
isDetail: false, // 编辑状态标识:false=只读,true=编辑
|
isDetail: false, // 编辑状态标识:false=只读,true=编辑
|
||||||
tableData: [], // 表格数据
|
tableData: [], // 表格数据
|
||||||
levelLList: [], // 所属层级下拉数据
|
levelLList: [], // 所属层级下拉数据
|
||||||
tableProps: [] // 表格列配置
|
tableProps: [], // 表格列配置
|
||||||
|
tableKey:0,// 强制表格更新
|
||||||
|
allUpBtn: false, // 全部上调按钮状态
|
||||||
|
allDownBtn: false // 全部下调按钮状态
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -182,7 +183,6 @@ export default {
|
|||||||
this.initDefaultDate();
|
this.initDefaultDate();
|
||||||
// 2. 计算对应时间戳
|
// 2. 计算对应时间戳
|
||||||
this.calculateTimeStamp();
|
this.calculateTimeStamp();
|
||||||
this.getDictData()
|
|
||||||
// 3. 先初始化表格配置(优先于数据请求,避免表格空配置渲染)
|
// 3. 先初始化表格配置(优先于数据请求,避免表格空配置渲染)
|
||||||
this.initTableProps(this.isDetail);
|
this.initTableProps(this.isDetail);
|
||||||
// 4. 等待配置就绪后,再请求数据,避免异步冲突
|
// 4. 等待配置就绪后,再请求数据,避免异步冲突
|
||||||
@@ -191,70 +191,119 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDictData() {
|
// 清空配置
|
||||||
getDictListData({ pageNo: 1, pageSize: 100, dictType: 'lb_dw' }).then((res) => {
|
handleClear() {
|
||||||
this.dictData = res.data.list
|
// 清空target
|
||||||
|
this.tableData.forEach(item => {
|
||||||
|
item.target = null;
|
||||||
})
|
})
|
||||||
|
this.tableKey++;
|
||||||
|
this.allDownBtn = false;
|
||||||
|
this.allUpBtn = false;
|
||||||
},
|
},
|
||||||
// 表格单元格数据变更回调
|
//复制上月/上年数据(调用接口不同)
|
||||||
inputChange(val) {
|
copyLastMonth() {
|
||||||
console.log('修改的数据:', val);
|
if(this.timeType === 'month') {
|
||||||
// 安全修改:判断索引是否存在,避免数组越界
|
this.$modal.confirm('是否确认复制上月数据?').then(() => {
|
||||||
if (this.tableData[val._pageIndex - 1]) {
|
this.copyLastMonthDataPage()
|
||||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop];
|
}).then(() => {
|
||||||
// 标记数据为已修改状态
|
this.$modal.msgSuccess("复制成功");
|
||||||
this.tableData[val._pageIndex - 1].status = 1;
|
}).catch(() => { });
|
||||||
|
}else{
|
||||||
|
this.$modal.confirm('是否确认复制上年数据?').then(() => {
|
||||||
|
this.copyLastYearDataPage()
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess("复制成功");
|
||||||
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
copyLastMonthDataPage() {
|
||||||
// 初始化表格列配置(核心:精准控制inputArea挂载)
|
copyLastMonthData({
|
||||||
initTableProps(isEdit) {
|
levelId: this.form.levelId,
|
||||||
console.log('当前编辑状态:', isEdit, '当前时间维度:', this.timeType);
|
startTime: this.form.startTime,
|
||||||
|
endTime: this.form.endTime,
|
||||||
// 基础表格列配置(只读模式使用)
|
pageSize: this.form.pageSize,
|
||||||
const baseTableProps = [
|
pageNo: this.form.pageNo
|
||||||
{ prop: 'type', label: '指标类型', align: 'center' },
|
}).then((res) => {
|
||||||
{ prop: 'name', label: '指标名称', align: 'center' },
|
this.tableData = res.data.map(item => {
|
||||||
{ prop: 'unit', label: '单位', align: 'center' },
|
// 新增unitLabel字段,存储匹配后的显示名称
|
||||||
{ prop: 'target', label: '预估值', align: 'center' },
|
return {
|
||||||
];
|
...item
|
||||||
|
};
|
||||||
if (isEdit) {
|
|
||||||
// 编辑模式:仅给「预估值」列添加inputArea(精准挂载,避免无效配置)
|
|
||||||
this.tableProps = baseTableProps.map(item => {
|
|
||||||
if (item.prop === 'target') { // 只给需要编辑的列添加子组件
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
subcomponent: inputArea // 挂载输入组件
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return item; // 其他列保持原有配置
|
|
||||||
});
|
});
|
||||||
} else {
|
this.tableKey++;
|
||||||
// 只读模式:深拷贝基础配置,避免引用污染
|
this.allDownBtn = false;
|
||||||
this.tableProps = JSON.parse(JSON.stringify(baseTableProps));
|
this.allUpBtn = false;
|
||||||
}
|
}).catch(err => {
|
||||||
console.log('表格配置:', this.tableProps);
|
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() {
|
handleEdit() {
|
||||||
this.isDetail = true;
|
this.isDetail = true;
|
||||||
// 先更新表格配置,再强制表格刷新(双重保障)
|
// 先更新表格配置,再强制表格刷新
|
||||||
this.initTableProps(this.isDetail);
|
this.initTableProps(this.isDetail);
|
||||||
this.$nextTick(() => {
|
this.tableKey++;
|
||||||
if (this.$refs.baseTable) {
|
|
||||||
this.$refs.baseTable.$forceUpdate(); // 强制表格组件刷新
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存数据(使用动态切换的updateData接口)
|
// 保存数据(使用动态切换的updateData接口)
|
||||||
handleSave() {
|
handleSave() {
|
||||||
// if (!this.updateData) {
|
|
||||||
// this.$modal.msgWarning('当前时间维度异常,无法保存');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
this.$modal.confirm('是否确认保存数据?').then(() => {
|
this.$modal.confirm('是否确认保存数据?').then(() => {
|
||||||
return this.updateData(this.tableData)
|
return this.updateData(this.tableData)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
@@ -269,23 +318,58 @@ export default {
|
|||||||
this.$modal.msgSuccess("保存成功");
|
this.$modal.msgSuccess("保存成功");
|
||||||
}).catch(() => { });
|
}).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() {
|
handleCancel() {
|
||||||
this.isDetail = false;
|
this.isDetail = false;
|
||||||
// 重置表格配置
|
this.allUpBtn = false;
|
||||||
this.initTableProps(this.isDetail);
|
this.allDownBtn = false;
|
||||||
// 清空并重新请求数据,恢复原始状态
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.tableData = [];
|
|
||||||
this.getData();
|
|
||||||
});
|
|
||||||
console.log('已取消编辑,恢复原始数据');
|
|
||||||
},
|
|
||||||
|
|
||||||
// 清空配置
|
|
||||||
handleClear() {
|
|
||||||
this.isDetail = false;
|
|
||||||
// 重置表格配置
|
// 重置表格配置
|
||||||
this.initTableProps(this.isDetail);
|
this.initTableProps(this.isDetail);
|
||||||
// 清空并重新请求数据,恢复原始状态
|
// 清空并重新请求数据,恢复原始状态
|
||||||
@@ -294,13 +378,39 @@ export default {
|
|||||||
this.getData();
|
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)
|
// 初始化默认日期(根据timeType)
|
||||||
initDefaultDate() {
|
initDefaultDate() {
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
this.form.date = currentDate;
|
this.form.date = currentDate;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算时间戳(根据timeType切换:月/年)
|
// 计算时间戳(根据timeType切换:月/年)
|
||||||
calculateTimeStamp(selectDate) {
|
calculateTimeStamp(selectDate) {
|
||||||
let targetDate = selectDate || this.form.date;
|
let targetDate = selectDate || this.form.date;
|
||||||
@@ -330,7 +440,6 @@ export default {
|
|||||||
this.form.endTime = endDatePrecise.getTime();
|
this.form.endTime = endDatePrecise.getTime();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 日期选择器变更事件(统一处理月/年变更)
|
// 日期选择器变更事件(统一处理月/年变更)
|
||||||
handleDateChange(val) {
|
handleDateChange(val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
@@ -342,62 +451,61 @@ export default {
|
|||||||
// 计算选中日期对应的时间戳
|
// 计算选中日期对应的时间戳
|
||||||
this.calculateTimeStamp(val);
|
this.calculateTimeStamp(val);
|
||||||
},
|
},
|
||||||
getUnitLabel(unitCode) {
|
// 导入
|
||||||
// 若字典为空或无匹配编码,返回原编码或空字符串
|
importExcel() {
|
||||||
if (!this.dictData || this.dictData.length === 0) {
|
this.upload.open = true
|
||||||
return unitCode || '';
|
|
||||||
}
|
|
||||||
// 查找匹配的字典项
|
|
||||||
const matchItem = this.dictData.find(item => item.value == unitCode);
|
|
||||||
// 返回匹配的label,无匹配则返回原unit编码
|
|
||||||
return matchItem ? matchItem.label : (unitCode || '');
|
|
||||||
},
|
},
|
||||||
// 请求下拉数据和表格数据(使用动态切换的getDataList接口)
|
// 文件上传中处理
|
||||||
getData() {
|
handleFileUploadProgress(file, fileList) {
|
||||||
if (!this.getDataList) {
|
console.log('文件上传中:',file, fileList)
|
||||||
console.warn('当前时间维度异常,无法获取数据');
|
this.upload.isUploading = true;
|
||||||
return;
|
this.upload.fileList = fileList;
|
||||||
}
|
this.upload.currentFile = file.raw;
|
||||||
|
},
|
||||||
// 1. 请求所属层级下拉数据
|
handleFileSuccess() {},
|
||||||
getLevelStruc().then((res) => {
|
importTemplate() {},
|
||||||
console.log('所属层级数据:', res);
|
// 提交上传文件
|
||||||
this.levelLList = res.data || [];
|
async submitFileForm() {
|
||||||
}).catch(err => {
|
try {
|
||||||
console.error('获取所属层级失败:', err);
|
if (!this.upload.currentFile) {
|
||||||
this.levelLList = [];
|
return this.$message.error('请先选择要上传的文件!')
|
||||||
});
|
}
|
||||||
|
const formData = new FormData()
|
||||||
// 2. 请求表格分页数据(使用动态接口)
|
formData.append('file', this.upload.currentFile) // 文件字段
|
||||||
this.getDataList({
|
formData.append('timeDim', this.upload.timeDim) // 年月维度字段
|
||||||
levelId: this.form.levelId,
|
formData.append('reportDate', this.form.endTime) // 时间维度字段
|
||||||
startTime: this.form.startTime,
|
formData.append('levelId', this.form.levelId) // 层级维度字段
|
||||||
endTime: this.form.endTime,
|
const response = await axios({
|
||||||
pageSize: this.form.pageSize,
|
url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-target-month/import',
|
||||||
pageNo: this.form.pageNo
|
method: 'post',
|
||||||
}).then((res) => {
|
data: formData,
|
||||||
console.log('表格数据:', res);
|
headers: {
|
||||||
this.tableData = res.data.map(item => {
|
'Content-Type': 'multipart/form-data',
|
||||||
// 新增unitLabel字段,存储匹配后的显示名称
|
'Authorization': "Bearer " + getAccessToken(),
|
||||||
return {
|
'tenant-id': getTenantId(),
|
||||||
...item,
|
},
|
||||||
unitLabel: this.getUnitLabel(item.unit)
|
timeout: 30000
|
||||||
};
|
})
|
||||||
});
|
// 4. 处理响应结果
|
||||||
}).catch(err => {
|
if (response.data.code === 0) {
|
||||||
console.error('获取表格数据失败:', err);
|
this.$message.success('文件上传成功!')
|
||||||
this.tableData = [];
|
// 重置表单
|
||||||
});
|
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>
|
</script>
|
||||||
|
|||||||
@@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
<!-- 右侧区域:全屏按钮 -->
|
<!-- 右侧区域:全屏按钮 -->
|
||||||
<div class="right-content">
|
<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">
|
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
|
||||||
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
|
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -35,7 +44,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'; // 引入moment
|
import moment from 'moment'; // 引入moment
|
||||||
|
import {getPath} from "@/utils/ruoyi";
|
||||||
export default {
|
export default {
|
||||||
name: 'Header',
|
name: 'Header',
|
||||||
props: {
|
props: {
|
||||||
@@ -75,6 +84,18 @@ export default {
|
|||||||
handleReturn() {
|
handleReturn() {
|
||||||
this.$router.go(-1);
|
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() {
|
exportPDF() {
|
||||||
this.$emit('exportPDF');
|
this.$emit('exportPDF');
|
||||||
},
|
},
|
||||||
@@ -300,6 +321,7 @@ export default {
|
|||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
gap: 21px;
|
gap: 21px;
|
||||||
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .current-time {
|
// .current-time {
|
||||||
@@ -326,6 +348,7 @@ export default {
|
|||||||
color: #00fff0;
|
color: #00fff0;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.return-btn {
|
.return-btn {
|
||||||
@@ -336,6 +359,13 @@ export default {
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
font-size: 28px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义下拉框样式(替换原有日期选择器样式) */
|
/* 自定义下拉框样式(替换原有日期选择器样式) */
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="monthItem" :class="{
|
<div class="monthItem" :class="{
|
||||||
'has-data': month.haveData,
|
'has-data': month.haveData,
|
||||||
'current': index === currentMonthIndex // 本月匹配current样式
|
'current': index === currentMonthIndex // 本月匹配current样式
|
||||||
}" v-for="(month, index) in monthList" :key="index">
|
}" v-for="(month, index) in list" :key="index">
|
||||||
{{ month.name }}
|
{{ month.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -41,21 +41,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null,
|
||||||
// 初始化12个月的列表,可根据实际需求修改haveData默认值
|
list:[]
|
||||||
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: {
|
computed: {
|
||||||
@@ -83,19 +69,15 @@ export default {
|
|||||||
// 根据calendarList更新monthList的haveData状态
|
// 根据calendarList更新monthList的haveData状态
|
||||||
updateMonthHaveData(calendarObj) {
|
updateMonthHaveData(calendarObj) {
|
||||||
if (!calendarObj || typeof calendarObj !== 'object') return;
|
if (!calendarObj || typeof calendarObj !== 'object') return;
|
||||||
|
const keys = Object.keys(calendarObj);
|
||||||
// 遍历12个月,匹配对应年月
|
if(keys.length == 0){
|
||||||
this.monthList.forEach((month, index) => {
|
return
|
||||||
// 获取月份数字(索引+1,补两位,如1→01,10→10)
|
}
|
||||||
const monthNum = (index + 1).toString().padStart(2, '0');
|
console.log('calendarObj',calendarObj)
|
||||||
// 拼接成calendarList中的键格式(如2025-01)
|
this.list = []
|
||||||
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定,可改为props传递年份
|
for(let i = 0; i < keys.length; i++) {
|
||||||
|
this.list.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
|
||||||
// 判断calendarObj中该键对应的值:1→true,0→false,无该键则保持默认false
|
}
|
||||||
if (calendarObj.hasOwnProperty(yearMonthKey)) {
|
|
||||||
month.haveData = calendarObj[yearMonthKey] === 1;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -64,6 +64,22 @@ font-style: normal;">指标详情</div>
|
|||||||
></base-table>
|
></base-table>
|
||||||
</div>
|
</div>
|
||||||
</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>仅允许导入xls、xlsx格式文件。</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>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -72,7 +88,8 @@ font-style: normal;">指标详情</div>
|
|||||||
import Container from './container.vue'
|
import Container from './container.vue'
|
||||||
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit'
|
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit'
|
||||||
import inputArea from './inputArea.vue' // 导入输入组件
|
import inputArea from './inputArea.vue' // 导入输入组件
|
||||||
|
import {getAccessToken, getTenantId} from '@/utils/auth'
|
||||||
|
import axios from 'axios';
|
||||||
export default {
|
export default {
|
||||||
name: 'ProductionStatus',
|
name: 'ProductionStatus',
|
||||||
components: {
|
components: {
|
||||||
@@ -85,7 +102,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
levelId: 1,
|
levelId: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
month: undefined,
|
month: undefined,
|
||||||
@@ -96,7 +113,17 @@ export default {
|
|||||||
isDetail: false, // 编辑状态标识:false=只读,true=编辑
|
isDetail: false, // 编辑状态标识:false=只读,true=编辑
|
||||||
tableData: [], // 表格数据
|
tableData: [], // 表格数据
|
||||||
levelLList: [], // 所属层级下拉数据
|
levelLList: [], // 所属层级下拉数据
|
||||||
tableProps: [] // 表格列配置
|
tableProps: [], // 表格列配置
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题
|
||||||
|
title: "指标填报导入",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
fileList:[],
|
||||||
|
currentFile:null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -261,13 +288,16 @@ export default {
|
|||||||
getData() {
|
getData() {
|
||||||
// 1. 请求所属层级下拉数据
|
// 1. 请求所属层级下拉数据
|
||||||
getLevelStruc().then((res) => {
|
getLevelStruc().then((res) => {
|
||||||
console.log('所属层级数据:', res);
|
|
||||||
this.levelLList = res.data || [];
|
this.levelLList = res.data || [];
|
||||||
|
this.form.levelId = this.levelLList[0].id;
|
||||||
|
this.getDataPage()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('获取所属层级失败:', err);
|
console.error('获取所属层级失败:', err);
|
||||||
this.levelLList = [];
|
this.levelLList = [];
|
||||||
});
|
});
|
||||||
|
this.$emit('updateLeft')
|
||||||
|
},
|
||||||
|
getDataPage() {
|
||||||
// 2. 请求表格分页数据
|
// 2. 请求表格分页数据
|
||||||
getRealMonthPage({
|
getRealMonthPage({
|
||||||
levelId: this.form.levelId,
|
levelId: this.form.levelId,
|
||||||
@@ -288,6 +318,7 @@ export default {
|
|||||||
console.error('获取表格数据失败:', err);
|
console.error('获取表格数据失败:', err);
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询按钮点击事件(可根据需求扩展逻辑)
|
// 查询按钮点击事件(可根据需求扩展逻辑)
|
||||||
@@ -295,8 +326,61 @@ export default {
|
|||||||
// 清空原有表格数据,重新请求
|
// 清空原有表格数据,重新请求
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
this.$nextTick(() => {
|
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('上传失败!')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
<!-- 右侧区域:全屏按钮 -->
|
<!-- 右侧区域:全屏按钮 -->
|
||||||
<div class="right-content">
|
<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">
|
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
|
||||||
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
|
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -31,7 +40,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'; // 引入moment
|
import moment from 'moment'; // 引入moment
|
||||||
|
import {getPath} from "@/utils/ruoyi";
|
||||||
export default {
|
export default {
|
||||||
name: 'Header',
|
name: 'Header',
|
||||||
props: {
|
props: {
|
||||||
@@ -100,6 +109,18 @@ export default {
|
|||||||
this.$router.go(-1);
|
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
|
* 固定为月维度:当月1日00:00:00 → 当月最后一天23:59:59
|
||||||
@@ -297,6 +318,7 @@ export default {
|
|||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
gap: 21px;
|
gap: 21px;
|
||||||
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.screen-btn {
|
.screen-btn {
|
||||||
@@ -305,6 +327,7 @@ export default {
|
|||||||
color: #00fff0;
|
color: #00fff0;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.home-btn {
|
.home-btn {
|
||||||
@@ -322,6 +345,14 @@ export default {
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
font-size: 28px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 日期选择器自定义样式 */
|
/* 日期选择器自定义样式 */
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export default {
|
|||||||
grid: {
|
grid: {
|
||||||
top: 35,
|
top: 35,
|
||||||
bottom: 20,
|
bottom: 20,
|
||||||
right: 25,
|
right: 13,
|
||||||
},
|
},
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
@@ -222,11 +222,11 @@ export default {
|
|||||||
/* (你的样式代码保持不变) */
|
/* (你的样式代码保持不变) */
|
||||||
.legend {
|
.legend {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 12px;
|
||||||
top: -5px;
|
top: 0px;
|
||||||
display: flex;
|
display: flex;
|
||||||
/* 使用 flex 布局让两个图例项并排且对齐 */
|
/* 使用 flex 布局让两个图例项并排且对齐 */
|
||||||
gap: 20px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.legend-item-line {
|
.legend-item-line {
|
||||||
@@ -237,7 +237,7 @@ export default {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 20px;
|
padding-left: 24px;
|
||||||
/* 为圆点和线条留出空间 */
|
/* 为圆点和线条留出空间 */
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export default {
|
|||||||
|
|
||||||
.lineFour {
|
.lineFour {
|
||||||
top: 5px;
|
top: 5px;
|
||||||
left: 268px;
|
left: 252px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-button {
|
.item-button {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default {
|
|||||||
// 定义一个映射关系,将后端字段名与前端显示信息关联起来
|
// 定义一个映射关系,将后端字段名与前端显示信息关联起来
|
||||||
const dataMap = [
|
const dataMap = [
|
||||||
{
|
{
|
||||||
key: 'processCost',
|
key: 'totalCost',
|
||||||
unit: '制造成本·元/㎡',
|
unit: '制造成本·元/㎡',
|
||||||
route: '/productionCostAnalysis/productionCostAnalysis'
|
route: '/productionCostAnalysis/productionCostAnalysis'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import { getOperateCockpit, getOrderDetail } from '@/api/cockpit'
|
|||||||
import { Sidebar } from "../../layout/components";
|
import { Sidebar } from "../../layout/components";
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: 'DayReport',
|
name: 'JtHome',
|
||||||
components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts, Sidebar },
|
components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts, Sidebar },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
grid-template-columns:416px 1192px;
|
grid-template-columns:416px 1192px;
|
||||||
">
|
">
|
||||||
<indicatorCalendar :calendarList="calendarList" />
|
<indicatorCalendar :calendarList="calendarList" />
|
||||||
<indicatorDetails />
|
<indicatorDetails @updateLeft='getData'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
|
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
|
||||||
@@ -146,27 +146,11 @@ export default {
|
|||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// sortChange(value) {
|
|
||||||
// this.sort = value
|
|
||||||
// this.getData()
|
|
||||||
// },
|
|
||||||
getData() {
|
getData() {
|
||||||
getRealMonthCalendar().then((res) => {
|
getRealMonthCalendar().then((res) => {
|
||||||
console.log(res, 'res');
|
console.log(res, 'res');
|
||||||
this.calendarList = res.data
|
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) {
|
handleTimeChange(obj) {
|
||||||
console.log(obj, 'obj');
|
console.log(obj, 'obj');
|
||||||
|
|||||||
@@ -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="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="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="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="手机号码" 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">
|
<el-table-column label="状态" key="status" v-if="columns[5].visible" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|||||||
136
sync_luobo.bat
136
sync_luobo.bat
@@ -1,68 +1,68 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
set cmdstr=rsync
|
set cmdstr=rsync
|
||||||
set zipfile=cwrsync.zip
|
set zipfile=cwrsync.zip
|
||||||
set downurl=https://itefix.net/download/free/cwrsync_6.3.0_x64_free.zip
|
set downurl=https://itefix.net/download/free/cwrsync_6.3.0_x64_free.zip
|
||||||
set currpath=%~dp0
|
set currpath=%~dp0
|
||||||
set "rsynchome=%ProgramFiles%\%zipfile:~0,-4%"
|
set "rsynchome=%ProgramFiles%\%zipfile:~0,-4%"
|
||||||
set passfile=%temp%\.password
|
set passfile=%temp%\.password
|
||||||
set syncdir=dist/
|
set syncdir=dist/
|
||||||
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
:: <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 accountwithost=kszny@192.168.0.35::data
|
||||||
set "password=kszny@123"
|
set "password=kszny@123"
|
||||||
set "runcommand=%cmdstr% --port=873 -rlptvz --progress --password-file=%passfile% --exclude=google.exe --exclude=Lodap.zip %syncdir% %accountwithost%"
|
set "runcommand=%cmdstr% --port=873 -rlptvz --progress --password-file=%passfile% --exclude=google.exe --exclude=Lodap.zip %syncdir% %accountwithost%"
|
||||||
|
|
||||||
where %cmdstr% >nul 2>nul
|
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>
|
::<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 (
|
if %errorlevel% neq 0 (
|
||||||
::<3A><>δ<EFBFBD><CEB4><EFBFBD>ذ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>װĿ¼
|
::<3A><>δ<EFBFBD><CEB4><EFBFBD>ذ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>װĿ¼
|
||||||
if not exist "%rsynchome%" (
|
if not exist "%rsynchome%" (
|
||||||
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><C8A8>
|
:: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><C8A8>
|
||||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\runAsAdmin.vbs"
|
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\runAsAdmin.vbs"
|
||||||
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\runAsAdmin.vbs"
|
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\runAsAdmin.vbs"
|
||||||
"%temp%\runAsAdmin.vbs"
|
"%temp%\runAsAdmin.vbs"
|
||||||
:: <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><EFBFBD><DEB2>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
|
:: <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱȨ<D4B1><EFBFBD><DEB2>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
|
||||||
mkdir "%rsynchome%"
|
mkdir "%rsynchome%"
|
||||||
del "%temp%\runAsAdmin.vbs"
|
del "%temp%\runAsAdmin.vbs"
|
||||||
exit /B
|
exit /B
|
||||||
)
|
)
|
||||||
|
|
||||||
:: ʹ<><CAB9>powershell<6C><6C>curl<72><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
:: ʹ<><CAB9>powershell<6C><6C>curl<72><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
powershell curl -o %temp%\%zipfile% %downurl%
|
powershell curl -o %temp%\%zipfile% %downurl%
|
||||||
:: <20><>ѹ
|
:: <20><>ѹ
|
||||||
tar -xf "%temp%\%zipfile%" -C "%rsynchome%"
|
tar -xf "%temp%\%zipfile%" -C "%rsynchome%"
|
||||||
echo "%cmdstr%<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%rsynchome%Ŀ¼<EFBFBD><EFBFBD>"
|
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><>
|
:: <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PATH <20><>
|
||||||
set "found=false"
|
set "found=false"
|
||||||
for %%I in ("%PATH:;=";"%") do (
|
for %%I in ("%PATH:;=";"%") do (
|
||||||
if /I "%%~I"=="%rsynchome%\bin" (
|
if /I "%%~I"=="%rsynchome%\bin" (
|
||||||
set "found=true"
|
set "found=true"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: δ<><CEB4><EFBFBD>õ<EFBFBD>path<74><68><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ӵ<EFBFBD>path<74><68><EFBFBD><EFBFBD>
|
:: δ<><CEB4><EFBFBD>õ<EFBFBD>path<74><68><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ӵ<EFBFBD>path<74><68><EFBFBD><EFBFBD>
|
||||||
if "!found!"=="false" (
|
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>
|
:: <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
|
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%PATH%;%rsynchome%\bin" /f
|
||||||
)
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
::<3A><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB>distĿ¼
|
::<3A><>ǰĿ¼<C4BF><C2BC>û<EFBFBD><C3BB>distĿ¼
|
||||||
if not exist "%currpath%%syncdir%" (
|
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>
|
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 (
|
) else (
|
||||||
echo !password!>%passfile%
|
echo !password!>%passfile%
|
||||||
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>...
|
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>...
|
||||||
!runcommand! && (
|
!runcommand! && (
|
||||||
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
echo <20><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
||||||
) || (
|
) || (
|
||||||
echo !runcommand!
|
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>
|
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%
|
del %passfile%
|
||||||
)
|
)
|
||||||
|
|
||||||
endlocal
|
endlocal
|
||||||
pause
|
pause
|
||||||
|
|||||||
Reference in New Issue
Block a user