f6aed480 by zhangmeng

中间部分

1 parent 51762012
1 import request from '@/utils/request'
2
3 /**
4 * 营业收入
5 * @returns {*}
6 */
7 export function getYS001() {
8 return request({
9 method: 'post',
10 data: {
11 'INTERFACEID': 'YS001',
12 'USERCONTEXT': 'a6c49439-f01c-0292-1757-30563fb41c77'
13 }
14 })
15 }
16
17 /**
18 * 应收余额
19 * @returns {*}
20 */
21 export function getYS002() {
22 return request({
23 method: 'post',
24 data: {
25 'INTERFACEID': 'YS002',
26 'USERCONTEXT': 'a6c49439-f01c-0292-1757-30563fb41c77'
27 }
28 })
29 }
30
31 /**
32 * 现金余额
33 * @returns {*}
34 */
35 export function getYS003() {
36 return request({
37 method: 'post',
38 data: {
39 'INTERFACEID': 'YS003',
40 'USERCONTEXT': 'a6c49439-f01c-0292-1757-30563fb41c77'
41 }
42 })
43 }
44
45 /**
46 * DSO天数
47 * @returns {*}
48 */
49 export function getYS004() {
50 return request({
51 method: 'post',
52 data: {
53 'INTERFACEID': 'YS004',
54 'USERCONTEXT': 'a6c49439-f01c-0292-1757-30563fb41c77'
55 }
56 })
57 }
58
59 /**
60 * (五)董事会得分、领导重点关注
61 * @returns {*}
62 */
63 export function getYS005() {
64 return request({
65 method: 'post',
66 data: {
67 'INTERFACEID': 'YS005',
68 'USERCONTEXT': 'a6c49439-f01c-0292-1757-30563fb41c77'
69 }
70 })
71 }
1 import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus' 1 import {ElMessage, ElMessageBox, ElNotification, ElLoading} from 'element-plus'
2 import {useStorage} from "@vueuse/core/index"; 2 import {useStorage} from "@vueuse/core/index";
3 3
4 const language= useStorage('language',0) 4 const language = useStorage('language', 0)
5 let loadingInstance 5 let loadingInstance
6 6
7 export default { 7 export default {
8 // 消息提示 8 // 消息提示
9 msg(content) { 9 msg(content) {
10 ElMessage.info(content) 10 ElMessage.info(content)
11 }, 11 },
12 // 错误消息 12 // 错误消息
13 msgError(content) { 13 msgError(content) {
14 ElMessage.error(content) 14 ElMessage.error(content)
15 }, 15 },
16 // 成功消息 16 // 成功消息
17 msgSuccess(content) { 17 msgSuccess(content) {
18 ElMessage.success(content) 18 ElMessage.success(content)
19 }, 19 },
20 // 警告消息 20 // 警告消息
21 msgWarning(content) { 21 msgWarning(content) {
22 ElMessage.warning(content) 22 ElMessage.warning(content)
23 }, 23 },
24 // 弹出提示 24 // 弹出提示
25 alert(content) { 25 alert(content) {
26 return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips') 26 return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips')
27 }, 27 },
28 // 错误提示 28 // 错误提示
29 alertError(content) { 29 alertError(content) {
30 return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips', { type: 'error' }) 30 return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips', {type: 'error'})
31 }, 31 },
32 // 成功提示 32 // 成功提示
33 alertSuccess(content) { 33 alertSuccess(content) {
34 return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'success' }) 34 return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', {type: 'success'})
35 }, 35 },
36 // 警告提示 36 // 警告提示
37 alertWarning(content) { 37 alertWarning(content) {
38 return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'warning' }) 38 return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', {type: 'warning'})
39 }, 39 },
40 // 通知提示 40 // 通知提示
41 notify(content) { 41 notify(content) {
42 return ElNotification.info(content) 42 return ElNotification.info(content)
43 }, 43 },
44 // 错误通知 44 // 错误通知
45 notifyError(content) { 45 notifyError(content) {
46 return ElNotification.error(content) 46 return ElNotification.error(content)
47 }, 47 },
48 // 成功通知 48 // 成功通知
49 notifySuccess(content) { 49 notifySuccess(content) {
50 return ElNotification.success(content) 50 return ElNotification.success(content)
51 }, 51 },
52 // 警告通知 52 // 警告通知
53 notifyWarning(content) { 53 notifyWarning(content) {
54 return ElNotification.warning(content) 54 return ElNotification.warning(content)
55 }, 55 },
56 // 确认窗体 56 // 确认窗体
57 confirm(content) { 57 confirm(content) {
58 return ElMessageBox.confirm(content, language.value==0 ? '系统提示' :'Tips', { 58 return ElMessageBox.confirm(content, language.value == 0 ? '系统提示' : 'Tips', {
59 confirmButtonText: language.value==0 ? '确定' :'OK', 59 confirmButtonText: language.value == 0 ? '确定' : 'OK',
60 cancelButtonText: language.value==0 ? '取消' :'Cancel', 60 cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
61 type: 'warning' 61 type: 'warning'
62 }) 62 })
63 }, 63 },
64 // 提交内容 64 // 提交内容
65 prompt(content) { 65 prompt(content) {
66 return ElMessageBox.prompt(content, language.value==0 ? '系统提示' :'Tips', { 66 return ElMessageBox.prompt(content, language.value == 0 ? '系统提示' : 'Tips', {
67 confirmButtonText: language.value==0 ? '确定' :'OK', 67 confirmButtonText: language.value == 0 ? '确定' : 'OK',
68 cancelButtonText: language.value==0 ? '取消' :'Cancel', 68 cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
69 type: 'warning' 69 type: 'warning'
70 }) 70 })
71 }, 71 },
72 // 打开遮罩层 72 // 打开遮罩层
73 loading(content) { 73 loading(content) {
74 loadingInstance = ElLoading.service({ 74 loadingInstance = ElLoading.service({
75 lock: true, 75 lock: true,
76 text: content, 76 text: content,
77 background: 'rgba(0, 0, 0, 0.7)' 77 background: 'rgba(0, 0, 0, 0.7)'
78 }) 78 })
79 }, 79 },
80 // 关闭遮罩层 80 // 关闭遮罩层
81 closeLoading() { 81 closeLoading() {
82 loadingInstance.close() 82 loadingInstance?.close()
83 } 83 }
84 } 84 }
......
1 import { 1 import {
2 createWebHistory, 2 createWebHistory,
3 createWebHashHistory, 3 createWebHashHistory,
4 createRouter 4 createRouter
5 } from 'vue-router' 5 } from 'vue-router'
6 /* Layout */ 6 /* Layout */
7 import Layout from '@/layoutPc' 7 import Layout from '@/layoutPc'
...@@ -38,101 +38,103 @@ import {ElMessage} from "element-plus"; ...@@ -38,101 +38,103 @@ import {ElMessage} from "element-plus";
38 38
39 // 公共路由 39 // 公共路由
40 export const constantRoutes = [ 40 export const constantRoutes = [
41 { 41 {
42 path: '/redirect', 42 path: '/redirect',
43 component: Layout, 43 component: Layout,
44 hidden: true, 44 hidden: true,
45 children: [
46 {
47 path: '/redirect/:path(.*)',
48 component: () => import('@/views/redirect/index')
49 }
50 ]
51 },
52 {
53 path: '/:pathMatch(.*)*',
54 component: () => import('@/views/error/404'),
55 hidden: true
56 },
57 {
58 path: '/401',
59 component: () => import('@/views/error/401'),
60 hidden: true
61 },
62 {
63 path: '/index',
64 redirect: '/'
65 },
66 {
67 path: '/',
68 component: Layout,
69 children: [
70 {
71 path: '',
72 component: () => import('@/viewsPc/home'),
73 name: 'home'
74 },
75 {
76 path: 'center',
77 component: () => import('@/viewsPc/center/index'),
78 children: [ 45 children: [
79 { 46 {
80 path: 'myInfo', 47 path: '/redirect/:path(.*)',
81 component: () => import('@/viewsPc/center/myInfo'), 48 component: () => import('@/views/redirect/index')
82 name: 'myInfo', 49 }
83 meta: {title: '个人中心'}
84 },
85 {
86 path: 'myPassword',
87 component: () => import('@/viewsPc/center/myPassword'),
88 name: 'myPassword',
89 meta: {title: '修改密码'}
90 }
91 ] 50 ]
92 } 51 },
93 ] 52 {
94 } 53 path: '/:pathMatch(.*)*',
54 component: () => import('@/views/error/404'),
55 hidden: true
56 },
57 {
58 path: '/401',
59 component: () => import('@/views/error/401'),
60 hidden: true
61 },
62 {
63 path: '/index',
64 redirect: '/'
65 },
66 {
67 path: '/',
68 component: Layout,
69 children: [
70 {
71 path: '',
72 component: () => import('@/viewsPc/home'),
73 name: 'home'
74 },
75 {
76 path: 'center',
77 component: () => import('@/viewsPc/center/index'),
78 children: [
79 {
80 path: 'myInfo',
81 component: () => import('@/viewsPc/center/myInfo'),
82 name: 'myInfo',
83 meta: {title: '个人中心'}
84 },
85 {
86 path: 'myPassword',
87 component: () => import('@/viewsPc/center/myPassword'),
88 name: 'myPassword',
89 meta: {title: '修改密码'}
90 }
91 ]
92 }
93 ]
94 }
95 ] 95 ]
96 96
97 const router = createRouter({ 97 const router = createRouter({
98 // history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH), 98 // history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
99 history: createWebHashHistory(import.meta.env.VITE_APP_CONTEXT_PATH), 99 history: createWebHashHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
100 routes: constantRoutes, 100 routes: constantRoutes,
101 scrollBehavior(to, from, savedPosition) { 101 scrollBehavior(to, from, savedPosition) {
102 if (savedPosition) { 102 if (savedPosition) {
103 return savedPosition 103 return savedPosition
104 } else { 104 } else {
105 return {top: 0} 105 return {top: 0}
106 }
106 } 107 }
107 }
108 }) 108 })
109 NProgress.configure({showSpinner: false}) 109 NProgress.configure({showSpinner: false})
110 110
111 router.beforeEach((to, from, next) => { 111 router.beforeEach((to, from, next) => {
112 NProgress.start() 112 NProgress.start()
113 if (getToken()) {
114 // 判断当前用户是否已拉取完user_info信息
115 if (!useUserStore().user) {
116 isRelogin.show = true
117 useUserStore().getInfo().then(() => {
118 isRelogin.show = false
119 next() // hack方法 确保addRoutes已完成
120 }).catch(err => {
121 useUserStore().logOut().then(() => {
122 ElMessage.error(err)
123 next({path: '/'})
124 })
125 })
126 } else {
127 next()
128 }
129 } else {
130 // 没有token
131 next() 113 next()
132 } 114 // if (getToken()) {
115 // // 判断当前用户是否已拉取完user_info信息
116 // if (!useUserStore().user) {
117 //
118 // isRelogin.show = true
119 // useUserStore().getInfo().then(() => {
120 // isRelogin.show = false
121 // next() // hack方法 确保addRoutes已完成
122 // }).catch(err => {
123 // useUserStore().logOut().then(() => {
124 // ElMessage.error(err)
125 // next({path: '/'})
126 // })
127 // })
128 // } else {
129 // next()
130 // }
131 // } else {
132 // // 没有token
133 // next()
134 // }
133 }) 135 })
134 136
135 router.afterEach((to) => { 137 router.afterEach((to) => {
136 NProgress.done() 138 NProgress.done()
137 }) 139 })
138 export default router 140 export default router
......
1 import axios from 'axios/dist/axios' 1 import axios from 'axios/dist/axios'
2 import { 2 import {
3 ElNotification, 3 ElNotification,
4 ElMessageBox, 4 ElMessageBox,
5 ElMessage, 5 ElMessage,
6 ElLoading 6 ElLoading
7 } from 'element-plus' 7 } from 'element-plus'
8 import { getToken } from '@/utils/auth' 8 import {getToken} from '@/utils/auth'
9 import errorCode from '@/utils/errorCode' 9 import errorCode from '@/utils/errorCode'
10 import { tansParams, blobValidate } from '@/utils/ruoyi' 10 import {tansParams, blobValidate} from '@/utils/ruoyi'
11 import cache from '@/plugins/cache' 11 import cache from '@/plugins/cache'
12 import modal from '@/plugins/modal' 12 import modal from '@/plugins/modal'
13 import { saveAs } from 'file-saver' 13 import {saveAs} from 'file-saver'
14 import useUserStore from '@/store/modules/user' 14 import {sendNotification} from '@/assets/lib/extend'
15 import { sendNotification } from '@/assets/lib/extend' 15
16 import _ from 'lodash'
17 // const language = cache.local.get('language') || 0
18 import {useStorage} from "@vueuse/core/index";
19 const language= useStorage('language',0)
20 let downloadLoadingInstance 16 let downloadLoadingInstance
21 // 是否显示重新登录 17 // 是否显示重新登录
22 export const isRelogin = { show: false } 18 export const isRelogin = {show: false}
23 19
24 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' 20 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
25 // 对应国际化资源文件后缀 21
26 axios.defaults.headers['Content-Language'] = (language.value==0? 'zh_CN':'en_US' )
27 // 创建axios实例 22 // 创建axios实例
28 const service = axios.create({ 23 const service = axios.create({
29 // axios中请求配置有baseURL选项,表示请求URL公共部分 24 // axios中请求配置有baseURL选项,表示请求URL公共部分
30 baseURL: import.meta.env.VITE_APP_BASE_API, 25 baseURL: import.meta.env.VITE_APP_BASE_API,
31 // 超时 26 // 超时
32 timeout: 0 27 timeout: 0
33 }) 28 })
34 29
35 const otherWeb = ['ztx-match/', 'ztx-webSite/', 'ztx-train/']
36 const excludeUrl = ['system/remindCount/getCounts']
37 const noModal = ['person/info/extractInfo']
38 30
39 // request拦截器 31 // request拦截器
40 service.interceptors.request.use( 32 service.interceptors.request.use(
41 (config) => { 33 (config) => {
42 if (config.method.toLowerCase() !== 'get' && !_.some(noModal, (m) => config.url.indexOf(m) > -1)) { 34 if (!config.url) {
43 modal.loading() 35 config.url = '/portal/r/jd?cmd=com.dr.coslexpro.cwys.unifiedInterface'
44 } 36 }
45
46 // 是否需要设置 token
47 const isToken = (config.headers || {}).isToken === false
48 // 是否需要防止数据重复提交
49 const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
50 if (getToken() && !isToken) {
51 config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
52 }
53 if (_.some(otherWeb, (w) => config.url.indexOf(w) > -1)) {
54 config.headers['Ztx-Per-Id'] = useUserStore().perId || -1
55 }
56 37
57 // get请求映射params参数 38 // 是否需要设置 token
58 if (config.method === 'get') { 39 const isToken = (config.headers || {}).isToken === false
59 if (!config.params) { 40 // 是否需要防止数据重复提交
60 config.params = { 41 const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
61 t: new Date().valueOf() 42 if (getToken() && !isToken) {
43 config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
62 } 44 }
63 } else {
64 config.params.t = new Date().valueOf()
65 }
66 45
67 let url = config.url + '?' + tansParams(config.params) 46 // get请求映射params参数
68 url = url.slice(0, -1) 47 if (config.method === 'get') {
69 config.params = {} 48 if (!config.params) {
70 config.url = url 49 config.params = {
71 } 50 t: new Date().valueOf()
72 if ( 51 }
73 !isRepeatSubmit && 52 } else {
74 (config.method === 'post' || config.method === 'put') 53 config.params.t = new Date().valueOf()
75 ) { 54 }
76 const requestObj = { 55
77 url: config.url, 56 let url = config.url + '?' + tansParams(config.params)
78 data: 57 url = url.slice(0, -1)
79 typeof config.data === 'object' 58 config.params = {}
80 ? JSON.stringify(config.data) 59 config.url = url
81 : config.data, 60 }
82 time: new Date().valueOf()
83 }
84 const sessionObj = cache.session.getJSON('sessionObj')
85 if (
86 sessionObj === undefined ||
87 sessionObj === null ||
88 sessionObj === ''
89 ) {
90 cache.session.setJSON('sessionObj', requestObj)
91 } else {
92 const s_url = sessionObj.url // 请求地址
93 const s_data = sessionObj.data // 请求数据
94 const s_time = sessionObj.time // 请求时间
95 const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
96 if ( 61 if (
97 s_data === requestObj.data && 62 !isRepeatSubmit &&
98 requestObj.time - s_time < interval && 63 (config.method === 'post' || config.method === 'put')
99 s_url === requestObj.url
100 ) { 64 ) {
101 const message = '数据正在处理,请勿重复提交' 65 const requestObj = {
102 console.warn(`[${s_url}]: ` + message) 66 url: config.url,
103 modal.closeLoading() 67 data:
104 return Promise.reject(new Error(message)) 68 typeof config.data === 'object'
105 } else { 69 ? JSON.stringify(config.data)
106 cache.session.setJSON('sessionObj', requestObj) 70 : config.data,
71 time: new Date().valueOf()
72 }
73 const sessionObj = cache.session.getJSON('sessionObj')
74 if (
75 sessionObj === undefined ||
76 sessionObj === null ||
77 sessionObj === ''
78 ) {
79 cache.session.setJSON('sessionObj', requestObj)
80 } else {
81 const s_url = sessionObj.url // 请求地址
82 const s_data = sessionObj.data // 请求数据
83 const s_time = sessionObj.time // 请求时间
84 const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
85 // if (
86 // s_data === requestObj.data &&
87 // requestObj.time - s_time < interval &&
88 // s_url === requestObj.url
89 // ) {
90 // const message = '数据正在处理,请勿重复提交'
91 // console.warn(`[${s_url}]: ` + message)
92 // modal.closeLoading()
93 // return Promise.reject(new Error(message))
94 // } else {
95 // cache.session.setJSON('sessionObj', requestObj)
96 // }
97 cache.session.setJSON('sessionObj', requestObj)
98 }
107 } 99 }
108 } 100 return config
101 },
102 (error) => {
103 console.log(error)
104 Promise.reject(error)
109 } 105 }
110 return config
111 },
112 (error) => {
113 console.log(error)
114 Promise.reject(error)
115 }
116 ) 106 )
117 107
118 108
119 // 响应拦截器 109 // 响应拦截器
120 service.interceptors.response.use( 110 service.interceptors.response.use(
121 (res) => { 111 (res) => {
122 if (res.config.method.toLowerCase() !== 'get' && !_.some(noModal, (m) => res.config.url.indexOf(m) > -1)) { 112 // 未设置状态码则默认成功状态
123 modal.closeLoading() 113 const code = res.code || 200
124 } 114 // 获取错误信息
125 // 未设置状态码则默认成功状态 115 const msg = errorCode[code] || res.data.msg
126 const code = res.data.code || 200 116 // const msg = errorCode[code] || res.data.msg || errorCode['default']
127 // 获取错误信息 117 // 二进制数据则直接返回
128 const msg = errorCode[code] || res.data.msg 118 // debugger
129 // const msg = errorCode[code] || res.data.msg || errorCode['default']
130 // 二进制数据则直接返回
131 // debugger
132 119
133 if ( 120 if (
134 res.request.responseType === 'blob' || 121 res.request.responseType === 'blob' ||
135 res.request.responseType === 'arraybuffer' 122 res.request.responseType === 'arraybuffer'
136 ) { 123 ) {
137 return res 124 return res
138 } 125 }
139 126
140 if (_.some(excludeUrl, (m) => res.config.url.indexOf(m) > -1)) { 127 if (code === 401) {
141 return Promise.resolve(res.data) 128 if (!isRelogin.show) {
142 } 129 isRelogin.show = true
143 if (code === 401) { 130 // ElMessage({ message: '登录状态已过期', type: 'error' })
144 if (!isRelogin.show) { 131 // ElMessageBox.confirm(
145 isRelogin.show = true 132 // '登录状态已过期,您可以继续留在该页面,或者重新登录',
146 // ElMessage({ message: '登录状态已过期', type: 'error' }) 133 // '系统提示',
147 // ElMessageBox.confirm( 134 // {
148 // '登录状态已过期,您可以继续留在该页面,或者重新登录', 135 // confirmButtonText: '好的',
149 // '系统提示', 136 // cancelButtonText: '取消',
150 // { 137 // type: 'warning'
151 // confirmButtonText: '好的', 138 // }
152 // cancelButtonText: '取消', 139 // )
153 // type: 'warning' 140 // .then(() => {
154 // } 141 // isRelogin.show = false
155 // ) 142 // useUserStore()
156 // .then(() => { 143 // .logOut()
157 // isRelogin.show = false 144 // .then(() => {
158 // useUserStore() 145 // location.reload()
159 // .logOut() 146 // })
160 // .then(() => { 147 // })
161 // location.reload() 148 // .catch(() => {
162 // }) 149 // isRelogin.show = false
163 // }) 150 // })
164 // .catch(() => { 151 }
165 // isRelogin.show = false 152 return Promise.reject('会话已过期,请重新登录。')
166 // }) 153 } else if (code === 500) {
167 } 154 if (msg) {
168 return Promise.reject('会话已过期,请重新登录。') 155 ElMessage({message: msg, type: 'error'})
169 } else if (code === 500) { 156 sendNotification('错误提示', {body: msg})
170 if(msg){ 157 }
171 ElMessage({ message: msg, type: 'error' }) 158 return Promise.reject(new Error(msg))
172 sendNotification('错误提示', { body: msg }) 159 } else if (code === 601) {
160 ElMessage({message: msg, type: 'warning'})
161 return Promise.reject(new Error(msg))
162 } else if (code !== 200) {
163 ElNotification.error({title: msg})
164 return Promise.reject('error')
165 } else {
166 return Promise.resolve(res.data)
173 } 167 }
174 return Promise.reject(new Error(msg)) 168 },
175 } else if (code === 601) { 169 (error) => {
176 ElMessage({ message: msg, type: 'warning' }) 170 console.log('err' + error)
177 return Promise.reject(new Error(msg)) 171 let {message} = error
178 } else if (code !== 200) { 172 if (message === 'Network Error') {
179 ElNotification.error({ title: msg }) 173 message = '后端接口连接异常'
180 return Promise.reject('error') 174 } else if (message.includes('timeout')) {
181 } else { 175 message = '系统接口请求超时'
182 return Promise.resolve(res.data) 176 } else if (message.includes('Request failed with status code')) {
183 } 177 message = '系统接口' + message.substr(message.length - 3) + '异常'
184 }, 178 }
185 (error) => { 179 ElMessage({message: message, type: 'error', duration: 5 * 1000})
186 console.log('err' + error) 180 sendNotification('错误提示', {body: message})
187 let { message } = error 181 modal.closeLoading()
188 if (message === 'Network Error') { 182 return Promise.reject(error)
189 message = '后端接口连接异常'
190 } else if (message.includes('timeout')) {
191 message = '系统接口请求超时'
192 } else if (message.includes('Request failed with status code')) {
193 message = '系统接口' + message.substr(message.length - 3) + '异常'
194 } 183 }
195 ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
196 sendNotification('错误提示', { body: message })
197 modal.closeLoading()
198 return Promise.reject(error)
199 }
200 ) 184 )
201 185
202 // 通用下载方法 186 // 通用下载方法
203 export function download(url, params, filename, config) { 187 export function download(url, params, filename, config) {
204 downloadLoadingInstance = ElLoading.service({ 188 downloadLoadingInstance = ElLoading.service({
205 text: '正在下载数据,请稍候', 189 text: '正在下载数据,请稍候',
206 background: 'rgba(0, 0, 0, 0.7)' 190 background: 'rgba(0, 0, 0, 0.7)'
207 })
208 return service
209 .post(url, params, {
210 transformRequest: [
211 (params) => {
212 return tansParams(params)
213 }
214 ],
215 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
216 responseType: 'blob',
217 ...config
218 })
219 .then(async(res) => {
220 const data = res.data
221 const isBlob = blobValidate(data)
222 if (isBlob) {
223 let hz = ''
224 if (res.headers['content-disposition'].indexOf('zip') > -1 || res.headers['content-type'].indexOf('pdf') > -1) {
225 // if (res.headers['content-type'].indexOf('zip') > -1) {
226 // hz = '.zip'
227 // } else if (res.headers['content-type'].indexOf('pdf') > -1) {
228 // hz = '.pdf'
229 // }
230 const index = res.headers['content-disposition'].indexOf('=')
231 hz = res.headers['content-disposition'].substr(index + 1, res.headers['content-disposition'].length)
232 }
233 const blob = new Blob([data])
234 saveAs(blob, hz ? filename = decodeURIComponent(hz) : filename)
235 } else {
236 const resText = await data.text()
237 const rspObj = JSON.parse(resText)
238 const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
239 ElMessage.error(errMsg)
240 downloadLoadingInstance.close()
241 }
242 downloadLoadingInstance.close()
243 })
244 .catch((r) => {
245 console.error(r)
246 ElMessage.error('下载文件出现错误,请联系管理员!')
247 downloadLoadingInstance.close()
248 }) 191 })
192 return service
193 .post(url, params, {
194 transformRequest: [
195 (params) => {
196 return tansParams(params)
197 }
198 ],
199 headers: {'Content-Type': 'application/x-www-form-urlencoded'},
200 responseType: 'blob',
201 ...config
202 })
203 .then(async (res) => {
204 const data = res.data
205 const isBlob = blobValidate(data)
206 if (isBlob) {
207 let hz = ''
208 if (res.headers['content-disposition'].indexOf('zip') > -1 || res.headers['content-type'].indexOf('pdf') > -1) {
209 // if (res.headers['content-type'].indexOf('zip') > -1) {
210 // hz = '.zip'
211 // } else if (res.headers['content-type'].indexOf('pdf') > -1) {
212 // hz = '.pdf'
213 // }
214 const index = res.headers['content-disposition'].indexOf('=')
215 hz = res.headers['content-disposition'].substr(index + 1, res.headers['content-disposition'].length)
216 }
217 const blob = new Blob([data])
218 saveAs(blob, hz ? filename = decodeURIComponent(hz) : filename)
219 } else {
220 const resText = await data.text()
221 const rspObj = JSON.parse(resText)
222 const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
223 ElMessage.error(errMsg)
224 downloadLoadingInstance.close()
225 }
226 downloadLoadingInstance.close()
227 })
228 .catch((r) => {
229 console.error(r)
230 ElMessage.error('下载文件出现错误,请联系管理员!')
231 downloadLoadingInstance.close()
232 })
249 } 233 }
250 234
251 export default service 235 export default service
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
3 <div ref="textRef" class="top"> 3 <div ref="textRef" class="top">
4 <div class="left"> 4 <div class="left">
5 <div class="titleTop">董事会得分</div> 5 <div class="titleTop">董事会得分</div>
6 <div class="titleCenter">预计得分 <span class="tex1">5</span></div> 6 <div class="titleCenter">预计得分 <span class="tex1">{{ form.YJSCORE }}</span></div>
7 <div class="titleCenter">标准得分 <span class="tex2">10</span> 7 <div class="titleCenter">标准得分 <span class="tex2">{{ form.STANDARDSCORE }}</span>
8 </div> 8 </div>
9 </div> 9 </div>
10 <div class="right"> 10 <div class="right">
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 <div><img alt="" class="rTop-img" src="@/assets/image/more@2x.png"></div> 13 <div><img alt="" class="rTop-img" src="@/assets/image/more@2x.png"></div>
14 </div> 14 </div>
15 <div class="rBotton"> 15 <div class="rBotton">
16 <ScrollingData :data="dataItems" speed="1"/> 16 <ScrollingData :data="form.leaderinfo" speed="1"/>
17 </div> 17 </div>
18 </div> 18 </div>
19 </div> 19 </div>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <div ref="bing1" style="width: 100%;height:13vh;"> 29 <div ref="bing1" style="width: 100%;height:13vh;">
30 </div> 30 </div>
31 <div class="bingBottom"> 31 <div class="bingBottom">
32 <div>2025年营业收入</div> 32 <div>{{ activeName1 }}年营业收入</div>
33 <div>(万元)</div> 33 <div>(万元)</div>
34 </div> 34 </div>
35 </div> 35 </div>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 <div ref="bing2" style="width: 100%;height:13vh;"> 48 <div ref="bing2" style="width: 100%;height:13vh;">
49 </div> 49 </div>
50 <div class="bingBottom"> 50 <div class="bingBottom">
51 <div>2025年3月前 累计应收余额</div> 51 <div>{{ `${dayjs().format('YYYY')}年${dayjs().format('MM')}月` }}累计应收余额</div>
52 <div>(万元)</div> 52 <div>(万元)</div>
53 </div> 53 </div>
54 </div> 54 </div>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
67 <div ref="bing3" style="width: 100%;height:13vh;"> 67 <div ref="bing3" style="width: 100%;height:13vh;">
68 </div> 68 </div>
69 <div class="bingBottom"> 69 <div class="bingBottom">
70 <div>2025年3月前 累计现金余额</div> 70 <div>{{ `${dayjs().format('YYYY')}年${dayjs().format('MM')}月` }}前累计应收余额</div>
71 <div>(万元)</div> 71 <div>(万元)</div>
72 </div> 72 </div>
73 </div> 73 </div>
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
84 </div> 84 </div>
85 </div> 85 </div>
86 </div> 86 </div>
87
88 </div> 87 </div>
89 88
90 89
...@@ -92,28 +91,15 @@ ...@@ -92,28 +91,15 @@
92 91
93 <script setup> 92 <script setup>
94 import {autoToolTip} from "@/plugins/auto-toolTip"; 93 import {autoToolTip} from "@/plugins/auto-toolTip";
95 import ScrollingData from './scrollingData .vue' 94 import ScrollingData from './scrollingData.vue'
96 import * as echarts from "echarts"; 95 import * as echarts from "echarts";
97 import * as api from "@/apiPc/common" 96 import * as api from "@/apiPc/common"
98 import {onMounted, ref} from 'vue' 97 import {onMounted, ref} from 'vue'
98 import {dayjs} from 'element-plus'
99 import {getYS001, getYS002, getYS003, getYS004, getYS005} from '@/api/server.js'
99 100
100 101
101 const dataItems = ref([ 102 const dataItems = ref([]);
102 '数据项 1: 当前值 256',
103 '数据项 2: 当前值 189',
104 '数据项 3: 当前值 342',
105 '数据项 4: 当前值 127',
106 '数据项 5: 当前值 298',
107 '数据项 6: 当前值 431',
108 '数据项 7: 当前值 156',
109 '数据项 8: 当前值 321',
110 '数据项 9: 当前值 456',
111 '数据项 10: 当前值 234',
112 '数据项 11: 当前值 321',
113 '数据项 12: 当前值 456',
114 '数据项 13: 当前值 234',
115 '数据项 14: 当前值 321',
116 ]);
117 const zhuRef1 = ref(null) 103 const zhuRef1 = ref(null)
118 const zhuRef2 = ref(null) 104 const zhuRef2 = ref(null)
119 const zhuRef3 = ref(null) 105 const zhuRef3 = ref(null)
...@@ -122,6 +108,15 @@ const bing1 = ref(null) ...@@ -122,6 +108,15 @@ const bing1 = ref(null)
122 const bing2 = ref(null) 108 const bing2 = ref(null)
123 const bing3 = ref(null) 109 const bing3 = ref(null)
124 const textRef = ref(null) 110 const textRef = ref(null)
111 const form = ref({})
112
113 const resYear1 = ref()
114 const resYear2 = ref()
115 const resYear3 = ref()
116 const activeName1 = ref()
117 const activeName2 = ref()
118 const activeName3 = ref()
119
125 120
126 let chart1 121 let chart1
127 let chart11 122 let chart11
...@@ -139,15 +134,57 @@ let intervalA = null ...@@ -139,15 +134,57 @@ let intervalA = null
139 onMounted(() => { 134 onMounted(() => {
140 // init() 135 // init()
141 window.addEventListener('resize', handleResize); 136 window.addEventListener('resize', handleResize);
142 handelBing1() 137 // handelBing1()
143 handelZhu1() 138 // handelZhu1()
144 handelBing2() 139 handelGetYS001()
145 handelZhu2() 140 handelGetYS002()
146 handelBing3() 141 handelGetYS003()
147 handelZhu3() 142 handelGetYS004()
148 handelZhu4() 143 handelGetYS005()
144 // handelBing2()
145 // handelZhu2()
146 // handelBing3()
147 // handelZhu3()
148 // handelZhu4()
149
149 }) 150 })
150 151
152 async function handelGetYS001() {
153 const res = await getYS001()
154 resYear1.value = res.data.yeargroup
155 handelBing1(res.data.yeargroup[0], res.data.yeargroup[1])
156 handelZhu1(res.data.yeargroup[0], res.data.yeargroup[1])
157 activeName1.value = res.data.yeargroup[1].YEAR
158 }
159
160
161 async function handelGetYS002() {
162 const res = await getYS002()
163 resYear2.value = res.data.yeargroup
164 handelBing2(res.data.yeargroup[0], res.data.yeargroup[1])
165 handelZhu2(res.data.yeargroup[0], res.data.yeargroup[1])
166 activeName2.value = res.data.yeargroup[1].YEAR
167 }
168
169 async function handelGetYS003() {
170 const res = await getYS003()
171 resYear3.value = res.data.yeargroup
172 handelBing3(res.data.yeargroup[0], res.data.yeargroup[1])
173 handelZhu3(res.data.yeargroup[0], res.data.yeargroup[1])
174 activeName3.value = res.data.yeargroup[1].YEAR
175 }
176
177 async function handelGetYS004() {
178 const res = await getYS004()
179 handelZhu4(res.data.blockgroup[0], res.data.blockgroup[1])
180 }
181
182 async function handelGetYS005() {
183 const res = await getYS005()
184 form.value = res.data
185 console.log(res)
186
187 }
151 188
152 const init = () => { 189 const init = () => {
153 if (!intervalA) { 190 if (!intervalA) {
...@@ -176,7 +213,7 @@ function handleResize() { ...@@ -176,7 +213,7 @@ function handleResize() {
176 chart44?.resize() 213 chart44?.resize()
177 } 214 }
178 215
179 const handelBing1 = () => { 216 const handelBing1 = (arr1, arr2) => {
180 chart1 = echarts.init(bing1.value) 217 chart1 = echarts.init(bing1.value)
181 const option = { 218 const option = {
182 tooltip: { 219 tooltip: {
...@@ -185,7 +222,7 @@ const handelBing1 = () => { ...@@ -185,7 +222,7 @@ const handelBing1 = () => {
185 222
186 series: [ 223 series: [
187 { 224 {
188 name: '1', 225 name: '',
189 type: 'pie', 226 type: 'pie',
190 radius: ['99%', '100%'], 227 radius: ['99%', '100%'],
191 center: ['50%', '60%'], 228 center: ['50%', '60%'],
...@@ -199,9 +236,9 @@ const handelBing1 = () => { ...@@ -199,9 +236,9 @@ const handelBing1 = () => {
199 startAngle: 180, 236 startAngle: 180,
200 endAngle: 360, 237 endAngle: 360,
201 data: [ 238 data: [
202 {value: 48, name: '1'}, 239 {value: 48},
203 {value: 1, name: '1'}, 240 {value: 1},
204 {value: 48, name: '1'} 241 {value: 48}
205 ], 242 ],
206 itemStyle: { 243 itemStyle: {
207 color: 'rgba(1, 162, 237, 1)', 244 color: 'rgba(1, 162, 237, 1)',
...@@ -209,7 +246,7 @@ const handelBing1 = () => { ...@@ -209,7 +246,7 @@ const handelBing1 = () => {
209 barWidth: 2 246 barWidth: 2
210 }, 247 },
211 { 248 {
212 name: '2', 249 name: arr1.YEAR,
213 type: 'pie', 250 type: 'pie',
214 radius: ['75%', '95%'], 251 radius: ['75%', '95%'],
215 center: ['50%', '60%'], 252 center: ['50%', '60%'],
...@@ -223,15 +260,15 @@ const handelBing1 = () => { ...@@ -223,15 +260,15 @@ const handelBing1 = () => {
223 scale: false 260 scale: false
224 }, 261 },
225 data: [ 262 data: [
226 {value: 735, name: 'Direct', itemStyle: {color: "rgb(255,217,0)"}}, 263 {value: arr1.TOTAL, name: '营业收入', itemStyle: {color: "rgb(255,217,0)"}},
227 {value: 1048, name: 'Search Engine'}, 264 {value: arr1.TOTAL ? arr1.TOTAL * 2 : 1, name: '营业收入'},
228 ], 265 ],
229 itemStyle: { 266 itemStyle: {
230 color: 'rgba(1, 162, 237, .3)', 267 color: 'rgba(1, 162, 237, .3)',
231 }, 268 },
232 }, 269 },
233 { 270 {
234 name: '3', 271 name: arr2.YEAR,
235 type: 'pie', 272 type: 'pie',
236 radius: ['55%', '70%'], 273 radius: ['55%', '70%'],
237 center: ['50%', '60%'], 274 center: ['50%', '60%'],
...@@ -247,8 +284,8 @@ const handelBing1 = () => { ...@@ -247,8 +284,8 @@ const handelBing1 = () => {
247 startAngle: 180, 284 startAngle: 180,
248 endAngle: 360, 285 endAngle: 360,
249 data: [ 286 data: [
250 {value: 1048, name: '2025', itemStyle: {color: "rgba(240, 255, 0, .5)"}}, 287 {value: arr2.TOTAL, name: '', itemStyle: {color: "rgba(240, 255, 0, .5)"}},
251 {value: 735, name: '2025'} 288 {value: arr2.TOTAL ? arr2.TOTAL * 2 : 1, name: (arr2.TOTAL / 10000).toFixed(0) + 'W'}
252 ], 289 ],
253 itemStyle: { 290 itemStyle: {
254 color: 'rgba(1, 162, 237, .3)', 291 color: 'rgba(1, 162, 237, .3)',
...@@ -286,7 +323,7 @@ const handelBing1 = () => { ...@@ -286,7 +323,7 @@ const handelBing1 = () => {
286 chart1.setOption(option) 323 chart1.setOption(option)
287 autoHover(chart1, option, 3, 2000) 324 autoHover(chart1, option, 3, 2000)
288 } 325 }
289 const handelBing2 = () => { 326 const handelBing2 = (row1, row2) => {
290 chart2 = echarts.init(bing2.value) 327 chart2 = echarts.init(bing2.value)
291 const option = { 328 const option = {
292 tooltip: { 329 tooltip: {
...@@ -318,7 +355,7 @@ const handelBing2 = () => { ...@@ -318,7 +355,7 @@ const handelBing2 = () => {
318 barWidth: 2 355 barWidth: 2
319 }, 356 },
320 { 357 {
321 name: '2', 358 name: row2.YEAR,
322 type: 'pie', 359 type: 'pie',
323 radius: ['75%', '95%'], 360 radius: ['75%', '95%'],
324 center: ['50%', '60%'], 361 center: ['50%', '60%'],
...@@ -332,8 +369,8 @@ const handelBing2 = () => { ...@@ -332,8 +369,8 @@ const handelBing2 = () => {
332 scale: false 369 scale: false
333 }, 370 },
334 data: [ 371 data: [
335 {value: 1048, name: 'Search Engine', itemStyle: {color: "rgba(0, 255, 190,1)"}}, 372 {value: row1.TOTAL, name: (row1.TOTAL / 10000).toFixed(0) + 'W', itemStyle: {color: "rgba(0, 255, 190,1)"}},
336 {value: 735, name: 'Direct'} 373 {value: row2.TOTAL, name: (row2.TOTAL / 10000).toFixed(0) + 'W'}
337 ], 374 ],
338 itemStyle: { 375 itemStyle: {
339 color: 'rgba(1, 162, 237, .5)', 376 color: 'rgba(1, 162, 237, .5)',
...@@ -356,7 +393,7 @@ const handelBing2 = () => { ...@@ -356,7 +393,7 @@ const handelBing2 = () => {
356 startAngle: 180, 393 startAngle: 180,
357 endAngle: 360, 394 endAngle: 360,
358 data: [ 395 data: [
359 {value: 1048, name: '2025'}, 396 {value: 1048,},
360 ], 397 ],
361 itemStyle: { 398 itemStyle: {
362 color: { 399 color: {
...@@ -375,7 +412,7 @@ const handelBing2 = () => { ...@@ -375,7 +412,7 @@ const handelBing2 = () => {
375 chart2.setOption(option) 412 chart2.setOption(option)
376 autoHover(chart2, option, 2, 2000) 413 autoHover(chart2, option, 2, 2000)
377 } 414 }
378 const handelBing3 = () => { 415 const handelBing3 = (row1, row2) => {
379 chart3 = echarts.init(bing3.value) 416 chart3 = echarts.init(bing3.value)
380 const option = { 417 const option = {
381 tooltip: { 418 tooltip: {
...@@ -421,7 +458,7 @@ const handelBing3 = () => { ...@@ -421,7 +458,7 @@ const handelBing3 = () => {
421 }, 458 },
422 data: [ 459 data: [
423 { 460 {
424 value: 1048, name: 'Search Engine', 461 value: row2.TOTAL, name: row2.YEAR,
425 itemStyle: { 462 itemStyle: {
426 color: { 463 color: {
427 type: 'linear', 464 type: 'linear',
...@@ -433,7 +470,7 @@ const handelBing3 = () => { ...@@ -433,7 +470,7 @@ const handelBing3 = () => {
433 } 470 }
434 } 471 }
435 }, 472 },
436 {value: 735, name: 'Direct'} 473 {value: row1.TOTAL, name: row1.YEAR}
437 ], 474 ],
438 itemStyle: { 475 itemStyle: {
439 color: 'rgba(1, 162, 237, .3)', 476 color: 'rgba(1, 162, 237, .3)',
...@@ -456,7 +493,7 @@ const handelBing3 = () => { ...@@ -456,7 +493,7 @@ const handelBing3 = () => {
456 startAngle: 180, 493 startAngle: 180,
457 endAngle: 360, 494 endAngle: 360,
458 data: [ 495 data: [
459 {value: 1048, name: '2025'}, 496 {value: 1048, name: ''},
460 ], 497 ],
461 itemStyle: { 498 itemStyle: {
462 color: { 499 color: {
...@@ -473,17 +510,18 @@ const handelBing3 = () => { ...@@ -473,17 +510,18 @@ const handelBing3 = () => {
473 } 510 }
474 511
475 chart3.setOption(option) 512 chart3.setOption(option)
476 autoHover(chart3, option, 2, 2000) 513 autoHover(chart3, option, 0, 2000)
477 } 514 }
478 515
479 const handelZhu1 = () => { 516 const handelZhu1 = (row1, row2) => {
480 chart11 = echarts.init(zhuRef1.value) 517 chart11 = echarts.init(zhuRef1.value)
481 const option = { 518 const option = {
482 tooltip: { 519 tooltip: {
483 trigger: 'axis', 520 trigger: 'axis',
484 axisPointer: { 521 axisPointer: {
485 type: 'shadow' 522 type: 'shadow'
486 } 523 },
524 // formatter: '{a0},{b0},{c}W <br /> {a1},{b1},{c1}W '
487 }, 525 },
488 legend: { 526 legend: {
489 top: '0', 527 top: '0',
...@@ -492,6 +530,7 @@ const handelZhu1 = () => { ...@@ -492,6 +530,7 @@ const handelZhu1 = () => {
492 }, 530 },
493 }, 531 },
494 grid: { 532 grid: {
533 top: '25%',
495 left: '0%', 534 left: '0%',
496 right: '0%', 535 right: '0%',
497 bottom: '1%', 536 bottom: '1%',
...@@ -527,13 +566,15 @@ const handelZhu1 = () => { ...@@ -527,13 +566,15 @@ const handelZhu1 = () => {
527 ], 566 ],
528 series: [ 567 series: [
529 { 568 {
530 name: '2025年', 569 name: row1.YEAR,
531 type: 'bar', 570 type: 'bar',
532 barGap: 0, 571 barGap: 0,
533 emphasis: { 572 emphasis: {
534 focus: 'series' 573 focus: 'series'
535 }, 574 },
536 data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,], 575 data: row1.list.map(val => {
576 return (val.SRJE / 10000).toFixed(2)
577 }),
537 itemStyle: { 578 itemStyle: {
538 color: { 579 color: {
539 type: 'linear', 580 type: 'linear',
...@@ -550,12 +591,14 @@ const handelZhu1 = () => { ...@@ -550,12 +591,14 @@ const handelZhu1 = () => {
550 borderColor: 'rgba(240, 255, 0, 1)' 591 borderColor: 'rgba(240, 255, 0, 1)'
551 }, 592 },
552 { 593 {
553 name: '2024年', 594 name: row2.YEAR,
554 type: 'bar', 595 type: 'bar',
555 emphasis: { 596 emphasis: {
556 focus: 'series' 597 focus: 'series'
557 }, 598 },
558 data: [150, 232, 201, 154, 190, 330, 410, 201, 154, 190, 330, 410], 599 data: row2.list.map(val => {
600 return (val.SRJE / 10000).toFixed(2)
601 }),
559 itemStyle: { 602 itemStyle: {
560 color: { 603 color: {
561 type: 'linear', 604 type: 'linear',
...@@ -575,7 +618,7 @@ const handelZhu1 = () => { ...@@ -575,7 +618,7 @@ const handelZhu1 = () => {
575 chart11.setOption(option) 618 chart11.setOption(option)
576 autoHover(chart11, option, 0, 2000) 619 autoHover(chart11, option, 0, 2000)
577 } 620 }
578 const handelZhu2 = () => { 621 const handelZhu2 = (row1, row2) => {
579 chart22 = echarts.init(zhuRef2.value) 622 chart22 = echarts.init(zhuRef2.value)
580 const option = { 623 const option = {
581 tooltip: { 624 tooltip: {
...@@ -591,6 +634,7 @@ const handelZhu2 = () => { ...@@ -591,6 +634,7 @@ const handelZhu2 = () => {
591 }, 634 },
592 }, 635 },
593 grid: { 636 grid: {
637 top: "25%",
594 left: '3%', 638 left: '3%',
595 right: '4%', 639 right: '4%',
596 bottom: '3%', 640 bottom: '3%',
...@@ -626,13 +670,16 @@ const handelZhu2 = () => { ...@@ -626,13 +670,16 @@ const handelZhu2 = () => {
626 ], 670 ],
627 series: [ 671 series: [
628 { 672 {
629 name: '2025年', 673 name: row1.YEAR,
630 type: 'bar', 674 type: 'bar',
631 barGap: 0, 675 barGap: 0,
632 emphasis: { 676 emphasis: {
633 focus: 'series' 677 focus: 'series'
634 }, 678 },
635 data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,], 679 // data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,],
680 data: row1.list.map(val => {
681 return (val.YSCOST / 10000).toFixed(2)
682 }),
636 itemStyle: { 683 itemStyle: {
637 color: { 684 color: {
638 type: 'linear', 685 type: 'linear',
...@@ -648,12 +695,15 @@ const handelZhu2 = () => { ...@@ -648,12 +695,15 @@ const handelZhu2 = () => {
648 barWidth: '35%', 695 barWidth: '35%',
649 }, 696 },
650 { 697 {
651 name: '2024年', 698 name: row2.YEAR,
652 type: 'bar', 699 type: 'bar',
653 emphasis: { 700 emphasis: {
654 focus: 'series' 701 focus: 'series'
655 }, 702 },
656 data: [150, 232, 201, 154, 190, 330, 410, 201, 154, 190, 330, 410], 703 // data: [150, 232, 201, 154, 190, 330, 410, 201, 154, 190, 330, 410],
704 data: row2.list.map(val => {
705 return (val.YSCOST / 10000).toFixed(2)
706 }),
657 itemStyle: { 707 itemStyle: {
658 color: { 708 color: {
659 type: 'linear', 709 type: 'linear',
...@@ -673,7 +723,9 @@ const handelZhu2 = () => { ...@@ -673,7 +723,9 @@ const handelZhu2 = () => {
673 chart22.setOption(option) 723 chart22.setOption(option)
674 autoHover(chart22, option, 0, 2000) 724 autoHover(chart22, option, 0, 2000)
675 } 725 }
676 const handelZhu3 = () => { 726 const handelZhu3 = (row1, row2) => {
727 let name1 = row1.YEAR + '年'
728 let name2 = row2.YEAR + '年'
677 chart33 = echarts.init(zhuRef3.value) 729 chart33 = echarts.init(zhuRef3.value)
678 const option = { 730 const option = {
679 color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'], 731 color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
...@@ -727,6 +779,7 @@ const handelZhu3 = () => { ...@@ -727,6 +779,7 @@ const handelZhu3 = () => {
727 yAxis: [ 779 yAxis: [
728 { 780 {
729 type: 'value', 781 type: 'value',
782 name: '单位(万)',
730 axisLine: { 783 axisLine: {
731 show: true, 784 show: true,
732 lineStyle: { 785 lineStyle: {
...@@ -739,7 +792,7 @@ const handelZhu3 = () => { ...@@ -739,7 +792,7 @@ const handelZhu3 = () => {
739 ], 792 ],
740 series: [ 793 series: [
741 { 794 {
742 name: '2024年', 795 name: name1,
743 type: 'line', 796 type: 'line',
744 stack: 'Total', 797 stack: 'Total',
745 smooth: false, 798 smooth: false,
...@@ -763,10 +816,13 @@ const handelZhu3 = () => { ...@@ -763,10 +816,13 @@ const handelZhu3 = () => {
763 emphasis: { 816 emphasis: {
764 focus: 'series' 817 focus: 'series'
765 }, 818 },
766 data: [140, 232, 301, 264, 200, 340, 250, 301, 264, 200, 340, 250] 819 // data: [140, 232, 301, 264, 200, 340, 250, 301, 264, 200, 340, 250]
820 data: row1.list.map(val => {
821 return (val.XJCOST / 10000).toFixed(0)
822 })
767 }, 823 },
768 { 824 {
769 name: '2025年', 825 name: name2,
770 type: 'line', 826 type: 'line',
771 stack: 'Total', 827 stack: 'Total',
772 smooth: false, 828 smooth: false,
...@@ -790,14 +846,37 @@ const handelZhu3 = () => { ...@@ -790,14 +846,37 @@ const handelZhu3 = () => {
790 emphasis: { 846 emphasis: {
791 focus: 'series' 847 focus: 'series'
792 }, 848 },
793 data: [120, 282, 211, 234, 220, 340, 310, 120, 282, 211, 234, 220] 849 // data: [120, 282, 211, 234, 220, 340, 310, 120, 282, 211, 234, 220]
850 data: row2.list.map(val => {
851 return (val.XJCOST / 10000).toFixed(0)
852 })
794 }, 853 },
795 ] 854 ]
796 } 855 }
797 chart33.setOption(option) 856 chart33.setOption(option)
798 autoHover(chart33, option, 0, 2000) 857 autoHover(chart33, option, 0, 2000)
799 } 858 }
800 const handelZhu4 = () => { 859 const handelZhu4 = (row1, row2) => {
860 let name1 = row1.BLOCK
861 let name2 = row2.BLOCK
862
863 let x1 = row1.list.forEach(val => val.type = 1) || []
864 let x2 = row2.list.forEach(val => val.type = 2) || []
865 let list = [...x1, ...x2].map(val => val.BASE)
866 let listX = []
867 let listL = []
868 let listH = []
869 for (const val of list) {
870 listX.push(val.BASE)
871 if (val.type == 1) {
872 listL.push(val.DSO)
873 listH.push(0)
874 } else {
875 listL.push(0)
876 listH.push(val.DSO)
877 }
878 }
879
801 chart44 = echarts.init(zhuRef4.value) 880 chart44 = echarts.init(zhuRef4.value)
802 const option = { 881 const option = {
803 tooltip: { 882 tooltip: {
...@@ -821,7 +900,8 @@ const handelZhu4 = () => { ...@@ -821,7 +900,8 @@ const handelZhu4 = () => {
821 { 900 {
822 type: 'category', 901 type: 'category',
823 stack: 'Ad', 902 stack: 'Ad',
824 data: ['山西', '陕西', '新疆', '伊拉克', '塘沽', '深圳', '湛江', '汉南', '上海'], 903 // data: ['山西', '陕西', '新疆', '伊拉克', '塘沽', '深圳', '湛江', '汉南', '上海'],
904 data: listX,
825 axisLine: { 905 axisLine: {
826 show: true, 906 show: true,
827 lineStyle: { 907 lineStyle: {
...@@ -835,7 +915,7 @@ const handelZhu4 = () => { ...@@ -835,7 +915,7 @@ const handelZhu4 = () => {
835 yAxis: [ 915 yAxis: [
836 { 916 {
837 type: 'value', 917 type: 'value',
838 name: '金额(万元)', 918 name: '',
839 axisLine: { 919 axisLine: {
840 show: true, 920 show: true,
841 lineStyle: { 921 lineStyle: {
...@@ -848,13 +928,14 @@ const handelZhu4 = () => { ...@@ -848,13 +928,14 @@ const handelZhu4 = () => {
848 ], 928 ],
849 series: [ 929 series: [
850 { 930 {
851 name: '海陆', 931 name: name1,
852 type: 'bar', 932 type: 'bar',
853 stack: 'Ad', 933 barGap: 0,
854 emphasis: { 934 emphasis: {
855 focus: 'series' 935 focus: 'series'
856 }, 936 },
857 data: [320, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390], 937 // data: [320, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390],
938 data: listL,
858 itemStyle: { 939 itemStyle: {
859 color: { 940 color: {
860 type: 'linear', 941 type: 'linear',
...@@ -867,7 +948,30 @@ const handelZhu4 = () => { ...@@ -867,7 +948,30 @@ const handelZhu4 = () => {
867 borderColor: 'rgba(0, 255, 190, 1)', 948 borderColor: 'rgba(0, 255, 190, 1)',
868 borderWidth: 1 949 borderWidth: 1
869 }, 950 },
870 barWidth: '35%', 951 barWidth: '30%',
952 },
953 {
954 name: name2,
955 type: 'bar',
956 barGap: 0,
957 emphasis: {
958 focus: 'series'
959 },
960 // data: [30, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390],
961 data: listH,
962 itemStyle: {
963 color: {
964 type: 'linear',
965 x: 0, y: 0, x2: 1, y2: 1, // 垂直渐变
966 colorStops: [
967 {offset: 0, color: 'rgba(0, 168, 255, 1)'}, // 顶部颜色
968 {offset: 1, color: 'rgba(77, 197, 243, 1)'} // 底部颜色
969 ]
970 },
971 borderColor: 'rgba(0, 168, 255, .5)',
972 borderWidth: 1
973 },
974 barWidth: '30%',
871 }, 975 },
872 ] 976 ]
873 } 977 }
......
1 import { defineConfig, loadEnv } from 'vite' 1 import {defineConfig, loadEnv} from 'vite'
2 import path, { resolve } from 'path' 2 import path, {resolve} from 'path'
3 import createVitePlugins from './vite/plugins' 3 import createVitePlugins from './vite/plugins'
4 import inject from '@rollup/plugin-inject' 4 import inject from '@rollup/plugin-inject'
5 import commonjs from '@rollup/plugin-commonjs' 5 import commonjs from '@rollup/plugin-commonjs'
6 // import legacy from '@vitejs/plugin-legacy'
7 6
8 // https://vitejs.dev/config/ 7 export default defineConfig(({mode, command}) => {
9 export default defineConfig(({ mode, command }) => { 8 const env = loadEnv(mode, process.cwd())
10 const env = loadEnv(mode, process.cwd()) 9 return {
11 return { 10 // 部署生产环境和开发环境下的URL。
12 // 部署生产环境和开发环境下的URL。 11 // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
13 // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 12 base: env.VITE_APP_CONTEXT_PATH,
14 base: env.VITE_APP_CONTEXT_PATH, 13 plugins: [
15 plugins: [ 14 createVitePlugins(env, command === 'build'),
16 createVitePlugins(env, command === 'build'), 15 commonjs(),
17 commonjs(), 16 inject({
18 inject({ 17 include: ['node_modules/**'],
19 include: ['node_modules/**'], 18 'window.katex': 'katex',
20 'window.katex': 'katex', 19 'window.Quill': ['@vueup/vue-quill', 'Quill']
21 'window.Quill': ['@vueup/vue-quill', 'Quill'] 20 })
22 }) 21 ],
23 // legacy({ 22 resolve: {
24 // targets: ['defaults', 'not IE 11'], // 需要兼容的目标列表,可以设置多个 23 alias: {
25 // additionalLegacyPolyfills: ['regenerator-runtime/runtime'], 24 // 设置路径
26 // renderLegacyChunks: true, 25 '~': path.resolve(__dirname, './'),
27 // polyfills: [ 26 // 设置别名
28 // 'es.symbol', 27 '@': path.resolve(__dirname, './src'),
29 // 'es.array.filter', 28 '/@': path.resolve(__dirname, './src')
30 // 'es.promise', 29 },
31 // 'es.promise.finally', 30 // https://cn.vitejs.dev/config/#resolve-extensions
32 // 'es/map', 31 extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
33 // 'es/set',
34 // 'es.array.for-each',
35 // 'es.object.define-properties',
36 // 'es.object.define-property',
37 // 'es.object.get-own-property-descriptor',
38 // 'es.object.get-own-property-descriptors',
39 // 'es.object.keys',
40 // 'es.object.to-string',
41 // 'web.dom-collections.for-each',
42 // 'esnext.global-this',
43 // 'esnext.string.match-all'
44 // ]
45 // })
46 ],
47 resolve: {
48 // https://cn.vitejs.dev/config/#resolve-alias
49 alias: {
50 // 设置路径
51 '~': path.resolve(__dirname, './'),
52 // 设置别名
53 '@': path.resolve(__dirname, './src'),
54 '/@': path.resolve(__dirname, './src')
55 },
56 // https://cn.vitejs.dev/config/#resolve-extensions
57 extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
58 },
59 // vite 相关配置
60 server: {
61 port: 5180,
62 host: true,
63 open: true,
64 proxy: {
65 // https://cn.vitejs.dev/config/#server-proxy
66 '/dev-api/ztx-train': {
67 // target: 'http://123.60.96.243:1896/stage-api',
68 target: 'https://jijin.wtwuxicenter.com/stage-api',
69 changeOrigin: true,
70 rewrite: (p) => p.replace(/^\/dev-api\/ztx-train/, '')
71 },
72 '/dev-api/ztx-match': {
73 // target: 'http://192.168.1.118:8083',
74 target: 'https://jijin.wtwuxicenter.com/stage-api',
75 changeOrigin: true,
76 rewrite: (p) => p.replace(/^\/dev-api\/ztx-match/, '')
77 }, 32 },
78 '/dev-api/ztx-webSite': { 33 // vite 相关配置
79 target: 'https://wdsfwuxicenter.com/stage-api/', 34 server: {
80 changeOrigin: true, 35 port: 5180,
81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '') 36 host: true,
37 open: true,
38 proxy: {
39 '/dev-api/portal': {
40 // target: 'http://116.63.185.147:8088',
41 target: 'https://ff9451fo0879.vicp.fun',
42 changeOrigin: true,
43 rewrite: (p) => p.replace(/^\/dev-api\/portal/, '')
44 }
45 }
82 }, 46 },
83 '/dev-api': { 47 css: {
84 // target: 'http://192.168.1.207:5511/', 48 postcss: {
85 target: 'https://jijin.wtwuxicenter.com/stage-api', 49 plugins: [
86 changeOrigin: true, 50 {
87 rewrite: (p) => p.replace(/^\/dev-api/, '') 51 postcssPlugin: 'internal:charset-removal',
52 AtRule: {
53 charset: (atRule) => {
54 if (atRule.name === 'charset') {
55 atRule.remove()
56 }
57 }
58 }
59 }
60 ]
61 }
88 }, 62 },
89 '/ticket': { 63 build: {
90 // target: 'http://192.168.1.131:8098/', 64 rollupOptions: {
91 // target: 'http://192.168.1.131:8081/', 65 input: {
92 target: 'https://jijin.wtwuxicenter.com/h5/', 66 main: resolve(__dirname, 'index.html')
93 // target: 'https://ticketh5.wdsfwuxicenter.com/h5/',
94 changeOrigin: true,
95 rewrite: (p) => p.replace(/^\/ticket/, '')
96 }
97 }
98 },
99 // fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
100 css: {
101 postcss: {
102 plugins: [
103 {
104 postcssPlugin: 'internal:charset-removal',
105 AtRule: {
106 charset: (atRule) => {
107 if (atRule.name === 'charset') {
108 atRule.remove()
109 } 67 }
110 }
111 } 68 }
112 }
113 ]
114 }
115 },
116 build: {
117 // target: 'es2015',
118 rollupOptions: {
119 input: {
120 main: resolve(__dirname, 'index.html')
121 } 69 }
122 }
123 } 70 }
124 }
125 }) 71 })
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!