Compare commits

..

16 Commits

Author SHA1 Message Date
wenlong 0a9151eb3c 市况汇率更新 2024-08-22 00:32:58 +08:00
wenlong ccdf3b458f 市况汇率 2024-08-18 11:48:30 +08:00
wenlong 9384b096b2 市况汇率 2024-08-06 00:34:35 +08:00
wenlong b4f9d35de0 市况汇率 2024-08-06 00:28:06 +08:00
wwl b47fce05ca fix bugs 2024-08-02 10:16:24 +08:00
wwl a3d6077599 首页/cd 2024-07-31 14:19:42 +08:00
wwl 7b8c17de6f fix bugs 2024-07-22 13:14:24 +08:00
wwl 479c2d497c cd页面更新 2024-07-16 09:42:05 +08:00
wwl f48e39b7f6 首页菜单加下拉按钮 2024-06-27 11:30:16 +08:00
wwl f54f7e1608 新增置顶和定时发布功能,其他优化 2024-06-13 17:46:47 +08:00
wwl 06d4d33eb5 fix bug 2024-05-22 15:07:11 +08:00
wwl cdc9fff2d9 fix bug 2024-05-21 10:10:16 +08:00
wwl 405b215bf5 fix bug 2024-05-11 17:19:42 +08:00
wwl d233857ce2 fix bug 2024-05-08 13:41:28 +08:00
wwl 21a629b4fb fix bug 2024-05-05 21:57:08 +08:00
wwl 3734a770dd fix bug 2024-04-24 11:11:04 +08:00
77 changed files with 19333 additions and 11330 deletions

3
components.d.ts vendored
View File

@ -33,12 +33,15 @@ declare module 'vue' {
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress'] ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabPane: typeof import('element-plus/es')['ElTabPane']

View File

@ -1050,6 +1050,19 @@ export async function marketPreADD(data: any) {
export async function badartAdd(data: any) { export async function badartAdd(data: any) {
return http.post(`/quality/badartAdd`, data) return http.post(`/quality/badartAdd`, data)
} }
/**---
*
* http://127.0.0.1:8811/openApi/quality/badartAdd
*/
export async function badartAddUser(data: any) {
return http.post(`/quality/addUser`, data)
}
/**-
* http://127.0.0.1:8811/openApi/quality/badartDel?id=3
*/
export async function badartGetUser(params: { indexId: any }) {
return http.get(`/quality/getUser`, { params })
}
/**- /**-
* http://127.0.0.1:8811/openApi/quality/badartDel?id=3 * http://127.0.0.1:8811/openApi/quality/badartDel?id=3
*/ */
@ -1404,3 +1417,104 @@ export async function fetchPostList(params?: any) {
export async function fetchInternalUserStat(params?: any) { export async function fetchInternalUserStat(params?: any) {
return http.get(`/moduleStat/internalUserStat`, { params }) return http.get(`/moduleStat/internalUserStat`, { params })
} }
// CD-三个据点总发注金额饼状图
export async function fetchPartStatisRate(params?: any) {
return http.get(`/cdcontent/partStatisRate`, { params })
}
// CD-三据点历年发注金额
export async function fetchPartHisList(params?: any) {
return http.get(`/cdcontent/partHisList`, { params })
}
// CD-小业种发注金额
export async function fetchPartminBusSeedsRate(params?: any) {
return http.get(`/cdcontent/partminBusSeedsRate`, { params })
}
// CD-大业种发注金额
export async function fetchPartmaxBusSeedsRate(params?: any) {
return http.get(`/cdcontent/partmaxBusSeedsRate`, { params })
}
// CD-图表2-大业种发注金额
export async function fetchPartmaxBusSeedsDetailList(params?: any) {
return http.get(`/cdcontent/maxBusSeedsDetailList`, { params })
}
// CD-图表2-大业种发注金额供应商
export async function fetchPartmaxBusSeedsRateBySupplier(params?: any) {
return http.get(`/cdcontent/partmaxBusSeedsRateBySupplier`, { params })
}
// smm首页数据
export async function fetchHomeSmmExInfo(params?: any) {
return http.get(`/marketPre/homeSmmExInfo`, { params })
}
// smm/lme 分类数据
export async function fetchExchangeInfo(params?: any) {
return http.get(`/marketPre/getExchangeInfo`, { params })
}
// 获取分时数据 --沪铜主连
export async function fetchTimeFuturecenterCu(params?: any) {
return http.get(`/marketPre/getTimeFuturecenter/${params.type}`)
}
// 获取分时数据 --沪铜主连
export async function fetchTimeFuturecenterAl(params?: any) {
return http.get(`/marketPre/getTimeFuturecenter/${params.type}`)
}
// 获取SMM/LEM 更新时间
export async function fetchMarketUpdateTime(params?: any) {
return http.get(`/marketPre/getLastTime`, { params })
}
// 查询HP-联络人列表
export async function fetchContactList(params?: any) {
return http.get(`/liaison/list`, { params })
}
// 获取HP-联络人详细信息
export async function fetchContactDetail(id: any = '') {
return http.get(`/liaison/info/${id}`)
}
// 新增HP-联络人
export async function fetchContactAdd(data?: any) {
return http.post(`/liaison/post`, data)
}
// 修改HP-联络人
export async function fetchContactEdit(data?: any) {
return http.post(`/liaison/update`, data)
}
// 删除HP-联络人
export async function fetchContactDel(id: any = '') {
return http.get(`/liaison/${id}`)
}
// 查询HP-年度方针列表
export async function fetchYearPlanList(params?: any) {
return http.get(`/policy/list`, { params })
}
// 获取HP-年度方针详细信息
export async function fetchYearPlanDetail(id: any = '') {
return http.get(`/policy/info/${id}`)
}
// 新增HP-年度方针
export async function fetchYearPlanAdd(data?: any) {
return http.post(`/policy/add`, data)
}
// 修改HP-年度方针
export async function fetchYearPlanEdit(data?: any) {
return http.post(`/policy/update`, data)
}
// 删除HP-年度方针
export async function fetchYearPlanDel(id: any = '') {
return http.get(`/policy/${id}`)
}

View File

@ -23,8 +23,8 @@ onMounted(() => {
watchEffect(() => { watchEffect(() => {
// console.log( flgs.value,store.user.type, 'tech_service') // console.log( flgs.value,store.user.type, 'tech_service')
flgs.value = [1, 2, 3, 4].includes(store.user.type) flgs.value = [1, 2, 3, 4].includes(store.user.type)
userCode.value = ['admin', 'tech_service', 'footprint_dandang'].includes( userCode.value = ['admin', 'tech_service', 'footprint_dandang'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
}) })
const options = [ const options = [
@ -56,11 +56,11 @@ const noticeShow = ref(false)
let showIs = false let showIs = false
//id1- 2- 3- 4-BCP 5- 6- 7-LAB //id1- 2- 3- 4-BCP 5- 6- 7-LAB
const goModeuls = (obj) => { const goModeuls = (obj) => {
const { moduleId } = obj const { moduleId, type } = obj
if (!moduleId) return if (!moduleId) return
switch (moduleId) { switch (moduleId) {
case 1: case 1:
if (store.user.isReview === 1 || store.user.isPublish === 1) { if ((store.user.isReview === 1 || store.user.isPublish === 1) && type == 2) {
push('/Home/Process') push('/Home/Process')
} else { } else {
push('/Home/intelligence') push('/Home/intelligence')
@ -85,7 +85,7 @@ const goModeuls = (obj) => {
push({ name: 'Diffspace' }) push({ name: 'Diffspace' })
break break
case 9: case 9:
push({ name: 'DataBaseReview' }) push({ name: type === 2 ? 'DataBaseReview' : 'DataBase' })
break break
default: default:
push('/Home/intelligence') push('/Home/intelligence')
@ -108,9 +108,7 @@ const toFootPrint = () => {
<div class="inline-flex items-center relative"> <div class="inline-flex items-center relative">
<!-- 足迹 --> <!-- 足迹 -->
<!-- <div class="cursor-pointer w-40px h-40px z-200"> --> <!-- <div class="cursor-pointer w-40px h-40px z-200"> -->
<el-icon size="35" v-if="userCode" @click="toFootPrint" <el-icon size="35" v-if="userCode" @click="toFootPrint"><Platform /></el-icon>
><Platform
/></el-icon>
<!-- </div> --> <!-- </div> -->
<!-- 全屏小图标 --> <!-- 全屏小图标 -->
@ -139,23 +137,27 @@ const toFootPrint = () => {
class="bg-#fff/20 b-1px b-solid b-#fff rd-12px flex items-center h-52px px12px cursor-pointer" class="bg-#fff/20 b-1px b-solid b-#fff rd-12px flex items-center h-52px px12px cursor-pointer"
> >
<div size="small" @click="noticeShows"> <div size="small" @click="noticeShows">
<img <img src="../assets/images/tongzhi@2x.png" class="w20px mr5px mt--5px" />新着通知<span
src="../assets/images/tongzhi@2x.png" class="ml8px pl5px pr5px rounded-20px bg-#002FA7"
class="w20px mr5px mt--5px" >{{ store.user.reviewCount ?? 0 }}</span
/><span class="ml8px pl5px pr5px rounded-20px bg-#002FA7">{{ >
store.user.reviewCount ?? 0
}}</span>
</div> </div>
<!-- 跳转到碳中和页面的 --> <!-- 跳转到碳中和页面的 -->
<div class="notice" v-if="noticeShow"> <div class="notice" v-if="noticeShow">
<div <div
v-for="ite in noticeData" v-for="ite in noticeData"
class="p10px box flex justify-between" class="p10px box flex justify-between items-center"
v-if="noticeData" v-if="noticeData"
@click="goModeuls(ite)" @click="goModeuls(ite)"
> >
<template v-if="ite.type == 1">
<div>{{ ite.moduleName }}</div> <div>{{ ite.moduleName }}</div>
<span class="">{{ ite.moduleCount }}</span> <span class="min-w-70px">未读{{ ite.moduleCount }}</span>
</template>
<template v-if="ite.type == 2">
<div>{{ ite.moduleName }}</div>
<span class="min-w-70px">待审批{{ ite.moduleCount }}</span>
</template>
</div> </div>
</div> </div>
@ -165,8 +167,8 @@ const toFootPrint = () => {
<span class="ml8px pl5px pr5px rounded-20px bg-#002FA7">{{ <span class="ml8px pl5px pr5px rounded-20px bg-#002FA7">{{
store.user.reviewCount ?? 0 store.user.reviewCount ?? 0
}}</span> }}</span>
</div> --> </div>
<!-- <n-popover :overlap="false" placement="bottom-start" trigger="click"> <n-popover :overlap="false" placement="bottom-start" trigger="click">
<template #trigger> <template #trigger>
<div size="small"> <div size="small">
新着通知 新着通知
@ -174,11 +176,8 @@ const toFootPrint = () => {
store.user.reviewCount ?? 0 store.user.reviewCount ?? 0
}}</span> }}</span>
</div> </div>
</template> --> </template>
<!-- <div <div class="inline-flex items-center p10px cursor-pointer" v-if="store.user.isReview === 1">
class="inline-flex items-center p10px cursor-pointer"
v-if="store.user.isReview === 1"
>
待审核信息{{ store.user.reviewCount ?? 0 }} 待审核信息{{ store.user.reviewCount ?? 0 }}
<n-button <n-button
class="text-#fff bg-#0058E4 rounded-5px p5px pt2px pb2px ml 8px" class="text-#fff bg-#0058E4 rounded-5px p5px pt2px pb2px ml 8px"
@ -206,16 +205,13 @@ const toFootPrint = () => {
@click="push({ path: '/Home/intelligence' })" @click="push({ path: '/Home/intelligence' })"
>去查看</n-button >去查看</n-button
> >
</div> --> </div>
<!-- </n-popover> --> </n-popover> -->
</div> </div>
<!-- 当前登录用户信息 --> <!-- 当前登录用户信息 -->
<NDropdown show-arrow placement="bottom-end" size="huge" :options="options"> <NDropdown show-arrow placement="bottom-end" size="huge" :options="options">
<div class="cursor-pointer inline-flex items-center"> <div class="cursor-pointer inline-flex items-center">
<img <img src="@/assets/images/icon-user.svg" class="ml40px mr16px w60px h60px" />
src="@/assets/images/icon-user.svg"
class="ml40px mr16px w60px h60px"
/>
<!-- @click="toggle" --> <!-- @click="toggle" -->
<span>{{ store.user.nikeName ?? '游客' }}</span> <span>{{ store.user.nikeName ?? '游客' }}</span>
<img src="@/assets/images/icon-more.svg" class="ml30px w13px" /> <img src="@/assets/images/icon-more.svg" class="ml30px w13px" />
@ -229,7 +225,7 @@ const toFootPrint = () => {
position: absolute; position: absolute;
top: 52px; top: 52px;
left: -3px; left: -3px;
width: 200px; min-width: 240px;
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
max-height: 520px; max-height: 520px;
z-index: 500; z-index: 500;

View File

@ -18,9 +18,9 @@ const props = defineProps({
<img <img
v-if="isNotOneWeekAgo(publishTime) && labelText !== '紧急'" v-if="isNotOneWeekAgo(publishTime) && labelText !== '紧急'"
src="../assets/images/NEW3.gif" src="../assets/images/NEW3.gif"
:class="size || []" :class="'h20px'"
/> />
<img v-if="labelText === ''" src="../assets/images/jj.gif" :class="size || []" /> <img v-if="labelText === ''" src="../assets/images/jj.gif" :class="'h30px'" />
<span :style="isRead === 2 ? 'color:#0058E5;font-weight:800' : ''">{{ text }}</span> <span :style="isRead === 2 ? 'color:#0058E5;font-weight:800' : ''">{{ text }}</span>
<!-- <span class="invisible">{{ date }}</span> --> <!-- <span class="invisible">{{ date }}</span> -->
</div> </div>

View File

@ -1,22 +1,21 @@
import { createApp } from "vue"; import { createApp } from 'vue'
import { createPinia } from "pinia"; import { createPinia } from 'pinia'
import ECharts from 'vue-echarts' import ECharts from 'vue-echarts'
import App from "./App.vue"; import App from './App.vue'
import router from "./router"; import router from './router'
import "./styles/smallDog.css" import './styles/smallDog.css'
import "./styles/main.css"; import './styles/main.css'
import "uno.css"; import 'uno.css'
import "animate.css"; // https://animate.style/ import 'animate.css' // https://animate.style/
import * as ElementPlusIconsVue from '@element-plus/icons-vue' import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component) app.component(key, component)
} }
app.component('VChart', ECharts) app.component('VChart', ECharts)
app.use(createPinia()); app.use(createPinia())
app.use(router); app.use(router)
app.mount("#app"); app.mount('#app')

View File

@ -80,16 +80,16 @@ const router = createRouter({
name: 'DetailInfos', name: 'DetailInfos',
component: () => import('@/views/extermal/Article/Details.vue') component: () => import('@/views/extermal/Article/Details.vue')
}, },
{ // {
path: '/external/Board', // path: '/external/Board',
name: 'BoardlInfo', // name: 'BoardlInfo',
component: () => import('@/views/extermal/Board/index.vue') // component: () => import('@/views/extermal/Board/index.vue')
}, // },
{ // {
path: '/external/Process', // path: '/external/Process',
name: 'Process1', // name: 'Process1',
component: () => import('@/views/extermal/Process/index.vue') // component: () => import('@/views/extermal/Process/index.vue')
}, // },
// 内部首页 // 内部首页
{ {
@ -260,7 +260,8 @@ const router = createRouter({
{ {
path: '', path: '',
name: 'Market', name: 'Market',
component: () => import('@/views/home/market/Market.vue') component: () => import('@/views/home/market/Market_new.vue')
// component: () => import('@/views/home/market/Market.vue')
}, },
{ {
path: 'MarketDataModify', path: 'MarketDataModify',
@ -356,6 +357,16 @@ const router = createRouter({
name: 'Process', name: 'Process',
component: () => import('@/views/home/intelligence/process/Process.vue') component: () => import('@/views/home/intelligence/process/Process.vue')
}, },
{
path: '/external/Board',
name: 'BoardlInfo',
component: () => import('@/views/extermal/Board/index.vue')
},
{
path: '/external/Process',
name: 'Process1',
component: () => import('@/views/extermal/Process/index.vue')
},
{ {
path: '/Home/Process/ProcessInfo/:id', path: '/Home/Process/ProcessInfo/:id',
meta: { title: '情报审批详情' }, meta: { title: '情报审批详情' },
@ -456,6 +467,12 @@ const router = createRouter({
name: 'Group', name: 'Group',
component: () => import('@/views/company/index.vue') component: () => import('@/views/company/index.vue')
}, },
{
path: '',
meta: { title: '集团方针管理' },
name: 'policyManage',
component: () => import('@/views/company/manage.vue')
},
{ {
path: 'company', path: 'company',
meta: { title: '公司方针' }, meta: { title: '公司方针' },
@ -480,6 +497,11 @@ const router = createRouter({
name: 'phone', name: 'phone',
component: () => import('@/views/home/phone/index.vue') component: () => import('@/views/home/phone/index.vue')
}, },
{
path: 'manage',
name: 'phoneManage',
component: () => import('@/views/home/phone/manage.vue')
},
{ {
path: 'visit', path: 'visit',
meta: { title: '拜访' }, meta: { title: '拜访' },

View File

@ -19,7 +19,7 @@ export const useUserStore = defineStore('user', () => {
token: '', token: '',
appLoginCount: 0, appLoginCount: 0,
appLoginToDayCount: 0, appLoginToDayCount: 0,
isUpPwd:0, isUpPwd: 0
}) })
async function getUser() { async function getUser() {
@ -31,13 +31,13 @@ export const useUserStore = defineStore('user', () => {
user.value = Object.assign(data, { user.value = Object.assign(data, {
token: token.value token: token.value
}) })
if(a.includes(data.roleCode)){ if (a.some((item) => data.roleCode?.includes(item))) {
user.value.isReview = 1 user.value.isReview = 1
} }
if(b.includes(data.roleCode)){ if (b.some((item) => data.roleCode?.includes(item))) {
user.value.isPublish = 1 user.value.isPublish = 1
} }
// console.log( user.value) // console.log('----40----', user.value)
} catch (error) { } catch (error) {
LogOut() LogOut()
} }
@ -61,7 +61,7 @@ export const useUserStore = defineStore('user', () => {
appLoginCount: 0, appLoginCount: 0,
isUpPwd: 0 isUpPwd: 0
} }
console.log(user.value) // console.log('------64-', user.value)
push({ name: 'Entry' }) push({ name: 'Entry' })
} }
return { user, getUser, LogOut } return { user, getUser, LogOut }

View File

@ -275,5 +275,6 @@ declare global {
// for type re-export // for type re-export
declare global { declare global {
// @ts-ignore // @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
} }

53
src/utils/date.ts Normal file
View File

@ -0,0 +1,53 @@
import dayjs from 'dayjs'
const pickerOptions = {
disabledDate: (time) => {
return time.getTime() < Date.now()
},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
shortcuts: [
{
text: '3天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 3)
date.setHours(0, 0, 0, 0)
return date
}
},
{
text: '5天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 5)
date.setHours(0, 0, 0, 0)
return date
}
},
{
text: '7天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 7)
date.setHours(0, 0, 0, 0)
return date
}
},
{
text: '10天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 10)
date.setHours(0, 0, 0, 0)
return date
}
}
],
day: (() => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 1)
date.setHours(0, 0, 0, 0)
return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
})()
}
export { pickerOptions }

View File

@ -112,9 +112,7 @@ service.interceptors.response.use(
code: 200 code: 200
} }
if (response.headers['content-disposition']) { if (response.headers['content-disposition']) {
const fileName = response.headers['content-disposition'] const fileName = response.headers['content-disposition']?.split(';')[1]?.split('=')[1]
?.split(';')[1]
?.split('=')[1]
} else { } else {
return Promise.reject('没有访问权限') return Promise.reject('没有访问权限')
} }
@ -128,7 +126,7 @@ service.interceptors.response.use(
} }
if (![0, 200].includes(code)) { if (![0, 200].includes(code)) {
// if(errMsg==='用户未登录') if (errMsg === '用户未登录') return Promise.reject(errMsg)
// { message.error(errMsg);} // { message.error(errMsg);}
// else if(errMsg==='密码不正确'){ // else if(errMsg==='密码不正确'){
// message.error(errMsg); // message.error(errMsg);

View File

@ -10,4 +10,45 @@ function isNotOneWeekAgo(date: any) {
return dayjs(date).isSameOrAfter(oneWeekAgo, 'day') return dayjs(date).isSameOrAfter(oneWeekAgo, 'day')
} }
export { isNotOneWeekAgo } const pickerOptions = {
disabledDate(time) {
return time.getTime() < Date.now()
},
valueFormat: 'YYYY-MM-dd HH:mm:ss',
shortcuts: [
{
text: '3天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 3)
return date
}
},
{
text: '5天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 5)
return date
}
},
{
text: '7天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 7)
return date
}
},
{
text: '10天后',
value: () => {
const date = new Date()
date.setTime(date.getTime() + 3600 * 1000 * 24 * 10)
return date
}
}
]
}
export { isNotOneWeekAgo, pickerOptions }

View File

@ -3,8 +3,11 @@
import HomeHead from '@/views/home/components/HomeHead.vue' import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
// import { NTimeline, NTimelineItem } from 'naive-ui'
import { useMessage } from 'naive-ui' import { useMessage } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user'
// import { groupBy } from 'lodash-es'
const store = useUserStore()
import { cateFileList } from '@/api/daikin/base' import { cateFileList } from '@/api/daikin/base'
const { day, week } = useDate() const { day, week } = useDate()
@ -75,6 +78,13 @@ const goFile = (row: any) => {
} }
getFile() getFile()
const userCode = ref(false)
watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
})
</script> </script>
<template> <template>
@ -103,7 +113,14 @@ getFile()
</div> </div>
</div> </div>
</div> --> </div> -->
<div class="mt30px mr20px flex w100% relative"> <div class="mt20px mr20px pt40px flex w100% relative">
<!-- <el-button
v-if="userCode"
type="primary"
class="button absolute top-0px right-50px"
@click="push({ name: 'policyManage' })"
>数据管理</el-button
> -->
<!-- <img src="../../assets/images/fangz.png" class="w100%"/> --> <!-- <img src="../../assets/images/fangz.png" class="w100%"/> -->
<!-- <img src="../../assets/images/fzqiet.png" class="w100%" /> <!-- <img src="../../assets/images/fzqiet.png" class="w100%" />
<div <div
@ -115,14 +132,14 @@ getFile()
</div> --> </div> -->
<img src="../../assets/images/2024fz.jpg" class="w100%" /> <img src="../../assets/images/2024fz.jpg" class="w100%" />
<div <div
class="absolute py10px left-880px top-250px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer" class="absolute py10px left-880px top-282px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer font"
@click="goFile(fileItem)" @click="goFile(fileItem)"
> >
<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" /> <img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
2024年グループ年頭方针 2024年グループ年頭方针
</div> </div>
<div <div
class="absolute py10px left-920px top-645px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer" class="absolute py10px left-920px top-678px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer font"
@click="goFile(fileItemTwo)" @click="goFile(fileItemTwo)"
> >
<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" /> <img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
@ -137,6 +154,9 @@ getFile()
right: 30px; right: 30px;
top: -92px; top: -92px;
} }
.font {
font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}
.g-wrapper { .g-wrapper {
border-radius: 18px; border-radius: 18px;

View File

@ -0,0 +1,394 @@
<script setup lang="ts">
import AppBlock from '@/components/AppBlock.vue'
import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
import dayjs from 'dayjs'
import {
fetchDelHis,
marketPreADD,
getMetalList,
fetchGetHisPage,
fetchUpdateHis,
fetchSaveHis,
fetchContactList,
fetchContactEdit,
fetchContactDel,
fetchContactAdd,
fetchYearPlanList,
fetchYearPlanEdit,
fetchYearPlanAdd,
fetchYearPlanDel
} from '@/api/daikin/base'
const message = useMessage()
const store = useUserStore()
const header = { token: store.user.token }
const pageInfo = reactive({
currentPage: 1,
pageSize: 15,
total: 0
})
const dataA = ref<any>([])
const editA = ref<any>({})
const metaList = ref<any>([])
const metaObj = ref<any>({})
const stDateList = ref<any>([])
const shomkA = ref(false)
const type = ref(2)
async function getDataA() {
const { data } = await fetchGetHisPage({})
dataA.value = Object.entries(data).map(([key, value]: any) => {
return {
stDate: key,
yearId: key,
children: value.map((item: any) => {
return {
...item,
numbers: metaObj.value[item.number]
}
})
}
})
// setDataFiles(dataArr);
}
onMounted(async () => {
// const { data = [] } = await getMetalList()
// metaList.value = data
// data.forEach((item: any) => {
// metaObj.value[item.value] = item.title
// })
// getDataA()
fetchDataList()
})
const contactList = ref<any>([])
const fetchDataList = async () => {
const { rows = [] } = await fetchYearPlanList({
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize
})
contactList.value = rows
console.log('🚀 ~ file: manage.vue:66 ~ data:', rows)
}
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) {
console.log(row, 555)
const { id, title } = row
// let moduleId = 1;
let sendData = {}
if (!row.id) {
sendData = { title, type: type.value, userIdList: userData.value }
if (row.fileList && row.fileList.length > 0) {
row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename);
}
})
}
} else {
sendData = { id, title, type: type.value, userIdList: userData.value }
}
const { code, msg } = await marketPreADD(sendData)
if (code === 200) {
message.success('修改成功!')
} else {
message.error(msg)
}
shomkA.value = false
getDataA()
}
const handleEditA = (type: string, row: any = { type: 1 }) => {
if (!row) return
editA.value = { ...row }
// editA.value.stDateList = [row.stDate, row.stDate]
// stDateList.value = [row.stDate, row.stDate]
// setUserList.value =[]
shomkA.value = true
// editA.value.fileList = [{
// name: row.title,
// originalFilename: row.title,
// url: row.filePath,
// }]
// setUserList.value =row.userIdList
}
async function handleDeleteA(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await fetchYearPlanDel(id)
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
fetchDataList()
}
const showModal = ref(false)
const flg = ref()
const setUserList = ref()
async function getUser(row) {
console.log(row)
showModal.value = !showModal.value
flg.value = row
if (row.id && row.userIdList) {
setUserList.value = row.userIdList
}
// const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr
}
//
const userData = ref()
const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId)
})
if (flg.value.id) {
flg.value.userIdList = userIdList
marketPreADD(flg.value)
getDataA()
console.log(flg.value)
}
userData.value = userIdList
}
const CloseThiss = (data: boolean) => {
showModal.value = data
}
const goBacks = () => {
history.back()
}
const editForm = ref(null)
const channelList = ref([
{
label: 'LME',
value: 'LME'
},
{
label: 'SMM',
value: 'SMM'
}
])
const handleClickA = async () => {
const req = { ...editA.value }
let flag = false
try {
} catch (error) {}
let res: any = req.id ? await fetchYearPlanEdit(req) : await fetchYearPlanAdd(req)
if (res.code == 200) {
shomkA.value = false
message.success('操作成功!')
fetchDataList()
} else {
message.error(res.msg)
}
}
function generateDateRange() {
const [startDate, endDate] = stDateList.value || []
if (!startDate || !endDate) return []
const dateFormat = 'YYYY-MM-DD'
const dates = []
const start = dayjs(startDate, dateFormat)
const end = dayjs(endDate, dateFormat)
//
dates.push(start.format(dateFormat))
//
let currentDate = start
while (currentDate.isSameOrBefore(end)) {
currentDate = currentDate.add(1, 'day')
dates.push(currentDate.format(dateFormat))
}
return dates
}
// 1 2: DSZ 3: DISH
const typeList = [
{
label: '调达本部',
value: 1
},
{
label: 'DSZ',
value: 2
},
{
label: 'DISH',
value: 3
}
]
const handleClose = (tag: any) => {
editA.value = { type: 1 }
}
</script>
<template>
<HomeHead class="top">
<template #content>
<!-- <HomeHeadSearch /> -->
</template>
</HomeHead>
<AppBlock class="w-full h-full p30px text-#000">
<div class="font-600 flex items-center">
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
<div class="text-36px text-#000">年度方针-数据管理</div>
</div>
<div class="cont relative w100% h900px overflow-y-auto">
<el-button type="primary" @click="handleEditA" class="my20px">新增年度方针</el-button>
<div
class="rounded-md cursor-pointer float-right mr-30px mt-20px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
@click="goBacks"
>
<el-icon><ArrowLeftBold size="18" /></el-icon>
</div>
<el-table
:data="contactList"
style="width: 100%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
height="740px"
>
<el-table-column label="标题" prop="title" />
<el-table-column label="内容" prop="content" />
<el-table-column label="文件路径" prop="filePath" />
<!-- <el-table-column label="手机号" prop="mobile" />
<el-table-column label="行号" prop="rowIndex" />
<el-table-column label="排序" prop="sort" />
<el-table-column label="创建时间" prop="createTime">
<template #default="{ row }">
{{ dayjs(row.createTime).format('YYYY-MM-DD') }}
</template>
</el-table-column> -->
<!-- <el-table-column label="查看范围" prop="userIdList">
<template #default="scope">
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"> &nbsp;&nbsp; {{it.nickName}}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" width="180px">
<template #default="scope">
<template v-if="!scope.row.children?.length">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template>
</template>
</el-table-column>
</el-table>
<div class="absolute bottom-50px left-50% translate-x-[-50%] z-11">
<el-pagination
background
v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, total,jumper,->"
:total="pageInfo.total"
@current-change="fetchDataList"
/>
<!-- @size-change="handleSizeChange" -->
</div>
</div>
</AppBlock>
<el-dialog
:z-index="200"
v-model="shomkA"
title=" "
width="30%"
:modal="false"
top="30vh"
@close="handleClose"
>
<div class="bg-#FFF">
<el-form ref="editForm" :model="editA" label-width="100px" size="large">
<!-- <el-form-item label="部门" prop="dept">
<el-select v-model="editA.type" placeholder="选择部门" class="!w-100%">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<br /> -->
<el-form-item label="标题" prop="title">
<el-input v-model="editA.title" placeholder="请输入标题"></el-input>
</el-form-item>
<br />
<el-form-item label="内容" prop="content">
<el-input v-model="editA.content" placeholder="请输入内容"></el-input>
</el-form-item>
<br />
<el-form-item label="文件路径" prop="filePath">
<el-input v-model="editA.filePath" placeholder="请输入手机号"></el-input>
</el-form-item>
<br />
<div class="text-center">
<el-button type="" @click="shomkA = false" class="mb-20px !mr-50rpx"> 取消</el-button>
<el-button type="primary" @click="handleClickA(editA)" class="mb-20px"> 确认</el-button>
</div>
</el-form>
</div>
</el-dialog>
<n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
</n-modal>
</template>
<style lang="less" scoped>
.demo-tabs > .el-tabs__content {
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.top {
position: absolute;
right: 30px;
top: -92px;
}
.flex-center {
display: flex;
justify-content: center;
margin: 0 auto;
}
:deep(.el-input-number .el-input__inner) {
text-align: left !important;
}
:deep {
.el-dialog__body {
margin-top: 18px;
padding-top: 10px;
}
}
</style>

View File

@ -1,15 +1,19 @@
<template> <template>
<div class="page"> <HomeHead class="top"> </HomeHead>
<HomeHead class="top"> <div class="h-full relative flex flex-col">
<!-- <template #content> <div class="font-600 flex items-end mt30px">
<HomeHeadSearch /> <div class="text-36px">
</template> --> {{ not.article.cate == 7 ? '外部新增-News' : '外部新增-重要通知' }}
</HomeHead> </div>
<div class="back" @click="push({ name: 'external' })">返回首页</div> <div class="text-18px ml40px mr25px">{{ day }}</div>
<div class="bg-#fff p30px rounded-5px mt40px overflow-y-auto max-h980px"> <div class="text-18px">{{ week }}</div>
<n-form :label-width="900" size="medium" :model="formValue"> </div>
<div
class="q-wrapper flex-1 rounded-5px overflow-y-auto mt30px text-#142142 flex flex-col bg-#fff p30px"
>
<n-form :label-width="800" size="medium" :model="formValue">
<n-form-item label="标题" path="title"> <n-form-item label="标题" path="title">
<n-input v-model:value="formValue.title" placeholder="" /> <n-input class="w90%" v-model:value="formValue.title" placeholder="" />
</n-form-item> </n-form-item>
<n-form-item v-if="formValue.cate == 8" label="是否置顶" path="isTop"> <n-form-item v-if="formValue.cate == 8" label="是否置顶" path="isTop">
<n-radio-group v-model:value="formValue.isTop" name="radiogroup"> <n-radio-group v-model:value="formValue.isTop" name="radiogroup">
@ -35,7 +39,7 @@
<n-form-item label="内容" path="title"> <n-form-item label="内容" path="title">
<Editor @getChildData="handleChild" class="bg-#fff" /> <Editor @getChildData="handleChild" class="bg-#fff" />
</n-form-item> </n-form-item>
<n-button @click="thisClick" v-if="formValue.cate == 8"> <n-button class="w-120px" @click="thisClick" v-if="formValue.cate == 8">
情报公开范围 情报公开范围
</n-button> </n-button>
<div class="mt15px h150px overflow-y-auto" v-if="formValue.cate == 8"> <div class="mt15px h150px overflow-y-auto" v-if="formValue.cate == 8">
@ -55,16 +59,43 @@
<n-form-item> <n-form-item>
<n-button @click="showModal1 = true"> 文本内容预览</n-button> <n-button @click="showModal1 = true"> 文本内容预览</n-button>
</n-form-item> </n-form-item>
<el-button type="primary" class="mt20px" @click="saveThis"
>提交</el-button <n-form-item v-if="formValue.cate != 8" label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
inactive-value="Y"
active-value="N"
></el-switch>
</n-form-item>
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
> >
</el-date-picker>
</n-form-item>
<el-button type="primary" class="mt20px w-100px" @click="saveThis"></el-button>
</div> </div>
<n-modal v-model:show="showModal1"> <n-modal v-model:show="showModal1">
<div class="flex w80% p30px bg-#fff my40px rounded-30px"> <div class="flex w80% p30px bg-#fff my40px rounded-30px">
<div <div class="overflow-y-auto h800px container" v-html="editorContent"></div>
class="overflow-y-auto h800px container"
v-html="editorContent"
></div>
</div> </div>
</n-modal> </n-modal>
<div> <div>
@ -82,8 +113,8 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Editor from "@/views/home/intelligence/components/TinyECE.vue"; import Editor from '@/views/home/intelligence/components/TinyECE.vue'
import UserPage from "../../home/intelligence/process/UserPages.vue"; import UserPage from '../../home/intelligence/process/UserPages.vue'
import { import {
NModal, NModal,
NCard, NCard,
@ -96,68 +127,71 @@ import {
NSpace, NSpace,
NRadioGroup, NRadioGroup,
useMessage, useMessage,
treeDark, treeDark
} from "naive-ui"; } from 'naive-ui'
import HomeHead from "@/views/home/components/HomeHead.vue"; import HomeHead from '@/views/home/components/HomeHead.vue'
import { noticeld } from "@/stores/modules/noticeId"; import { noticeld } from '@/stores/modules/noticeId'
import { saveArticle,trendsAdd } from "@/api/daikin/base"; import { saveArticle, trendsAdd } from '@/api/daikin/base'
const editorContent = ref(); import { useDate } from '@/views/home/hooks/useDate'
const { push } = useRouter(); import { pickerOptions } from '@/utils/date'
const message = useMessage(); const editorContent = ref()
const not = noticeld(); const { push } = useRouter()
const message = useMessage()
const { day, week } = useDate()
const not = noticeld()
// const CloseThis = ()=>{ // const CloseThis = ()=>{
// mask.value = false // mask.value = false
// } // }
let formValue: any = ref({ let formValue: any = ref({
type: "1", type: '1',
cate: not.article.cate, cate: not.article.cate,
title: "", title: '',
tag: "", tag: '',
source: "", source: '',
content: "", content: '',
reviewSource: "3", reviewSource: '3',
isTop: "N", isTop: 'N',
treeSource: "3", treeSource: '3',
}); isPublish: 0,
publishTime: ''
})
function escapeHTML(html: string): string { function escapeHTML(html: string): string {
const tempElement = document.createElement("div"); const tempElement = document.createElement('div')
tempElement.textContent = html; tempElement.textContent = html
return tempElement.innerHTML; return tempElement.innerHTML
} }
const handleClose = (tag: any) => { const handleClose = (tag: any) => {
dataList.value.splice(dataList.value.indexOf(tag), 1); dataList.value.splice(dataList.value.indexOf(tag), 1)
}; }
// //
async function save() { async function save() {
let userIdList: any[] = []; let userIdList: any[] = []
const cont = editorContent.value; const cont = editorContent.value
const content = escapeHTML(cont); const content = escapeHTML(cont)
const { title, reviewSource, tag, treeSource, source, type, isTop } = const { title, reviewSource, tag, treeSource, source, type, isTop, isPublish, publishTime } =
formValue.value; formValue.value
const cate = not.article.cate; const cate = not.article.cate
// console.log(formValue.value, content,cate) // console.log(formValue.value, content,cate)
if (dataList.value) { if (dataList.value) {
dataList.value.forEach((i: { userId: any }) => { dataList.value.forEach((i: { userId: any }) => {
console.log(dataList.value); console.log(dataList.value)
userIdList.push(i.userId); userIdList.push(i.userId)
}); })
} }
// console.log(formValue.value) // console.log(formValue.value)
// if(userIdList.length<0) return // if(userIdList.length<0) return
if (not.article.cate === '9') { if (not.article.cate === '9') {
const { msg, code } = await trendsAdd({title,content}); const { msg, code } = await trendsAdd({ title, content })
if (code === 200) { if (code === 200) {
message.success("新增成功"); message.success('新增成功')
} else { } else {
message.success(msg); message.success(msg)
} }
} else {
}
else{
const { msg, code } = await saveArticle({ const { msg, code } = await saveArticle({
title, title,
tag: "", tag: '',
isTop, isTop,
treeSource, treeSource,
reviewSource, reviewSource,
@ -166,49 +200,50 @@ async function save() {
type, type,
content, content,
userIdList, userIdList,
}); isPublish,
publishTime
})
if (code === 200) { if (code === 200) {
message.success("新增成功"); message.success('新增成功')
} else { } else {
message.success(msg); message.success(msg)
} }
} }
push({ name: "external" }); push({ name: 'external' })
} }
// //
const handleChild = (data: string) => { const handleChild = (data: string) => {
editorContent.value = data; editorContent.value = data
// console.log(data) // console.log(data)
}; }
// //
const saveThis = (e: { preventDefault: () => void }) => { const saveThis = (e: { preventDefault: () => void }) => {
e.preventDefault(); e.preventDefault()
save(); save()
}; }
const stores = noticeld(); const stores = noticeld()
const showModal = ref(false); const showModal = ref(false)
const showModal1 = ref(false); const showModal1 = ref(false)
const setUserList = ref(); const setUserList = ref()
const dataList = ref(); const dataList = ref()
const thisClick = () => { const thisClick = () => {
showModal.value = true; showModal.value = true
setUserList.value = dataList.value; setUserList.value = dataList.value
stores.article.reviewSource = formValue.value.reviewSource; stores.article.reviewSource = formValue.value.reviewSource
}; }
const CloseThis = (data: boolean) => { const CloseThis = (data: boolean) => {
showModal.value = data; showModal.value = data
}; }
const handleChild1 = (data: any) => { const handleChild1 = (data: any) => {
const { showModal: show, multipleSelection } = data; const { showModal: show, multipleSelection } = data
console.log(show); console.log(show)
showModal.value = unref(show); showModal.value = unref(show)
dataList.value = unref(multipleSelection); dataList.value = unref(multipleSelection)
}; }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 1px; width: 1px;
@ -225,16 +260,28 @@ const handleChild1 = (data: any) => {
justify-content: center; justify-content: center;
} }
.top { .top {
position: absolute;
right: 30px; right: 30px;
top: 0px; top: -92px;
}
::-webkit-scrollbar {
width: 1px;
}
.q-wrapper {
border-radius: 18px;
border: 1px solid #e7ebf5;
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
overflow: auto;
} }
.page { .page {
width: 100%; width: 100%;
// height: 100px; // height: 100px;
font-family: "PingFang SC"; font-family: 'PingFang SC';
user-select: none; user-select: none;
background-image: url("@/assets/images/bg.jpg"); background-image: url('@/assets/images/bg.jpg');
background-color: #000; background-color: #000;
background-position: 0 0; background-position: 0 0;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -264,7 +311,7 @@ const handleChild1 = (data: any) => {
} }
} }
.main { .main {
background-image: url("@/assets/images/bg-rs-main.svg"); background-image: url('@/assets/images/bg-rs-main.svg');
background-position: 0 0; background-position: 0 0;
background-repeat: repeat-x; background-repeat: repeat-x;
background-size: auto; background-size: auto;

View File

@ -40,8 +40,8 @@ const userCode = ref(false)
const shormA = ref(false) const shormA = ref(false)
const shormB = ref(false) const shormB = ref(false)
watchEffect(() => { watchEffect(() => {
userCode.value = ['admin', 'waibuyemianguanliyuan', 'tech_service'].includes( userCode.value = ['admin', 'waibuyemianguanliyuan', 'tech_service'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
console.log(isUpPwds.value, userCode.value) console.log(isUpPwds.value, userCode.value)
isUpPwds.value = store.user.isUpPwd === 2 ? true : false isUpPwds.value = store.user.isUpPwd === 2 ? true : false
@ -76,8 +76,7 @@ const fromtB = ref({
}) })
const addClickA = async () => { const addClickA = async () => {
const { question1, question2, question3, question4, type, id, number } = const { question1, question2, question3, question4, type, id, number } = fromtA.value
fromtA.value
if (type === 'edit') { if (type === 'edit') {
const { code, msg } = await faqWithdraw({ const { code, msg } = await faqWithdraw({
addList: [ addList: [
@ -193,15 +192,11 @@ onMounted(async () => {
timeA.value = lastUTime timeA.value = lastUTime
timeB.value = _lastUTime timeB.value = _lastUTime
if (isUpPwds.value) { if (isUpPwds.value) {
ElMessageBox.alert( ElMessageBox.alert('为了您的帐号安全,此次登录必须更改密码', '重要提醒', {
'为了您的帐号安全,首次登录必须更改初始密码',
'重要提醒',
{
confirmButtonText: 'OK', confirmButtonText: 'OK',
showClose: false, showClose: false,
showCancelButton: false showCancelButton: false
} }).then(() => {
).then(() => {
push({ name: 'modify' }) push({ name: 'modify' })
}) })
} }
@ -392,8 +387,7 @@ async function setModule(codes: any) {
const handleVisitsScoll = () => { const handleVisitsScoll = () => {
const container = visitsScoll.value const container = visitsScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (visitPum < visitLength) { if (visitPum < visitLength) {
++visitPum ++visitPum
@ -406,8 +400,7 @@ const handleVisitsScoll = () => {
const handleInvScoll = () => { const handleInvScoll = () => {
const container = invsScoll.value const container = invsScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (invPum < invLength) { if (invPum < invLength) {
++invPum ++invPum
@ -420,8 +413,7 @@ const handleInvScoll = () => {
const handleTabScoll = () => { const handleTabScoll = () => {
const container = tabScll.value const container = tabScll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (tabPume < tabLength) { if (tabPume < tabLength) {
++tabPume ++tabPume
@ -435,8 +427,7 @@ const handleTabScoll = () => {
const handlePrScoll = () => { const handlePrScoll = () => {
const container = portant.value const container = portant.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (prpum < pLenght) { if (prpum < pLenght) {
++prpum ++prpum
@ -450,8 +441,7 @@ const handlePrScoll = () => {
const handleNewScoll = () => { const handleNewScoll = () => {
const container = newsSoll.value const container = newsSoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (newPum < newLength) { if (newPum < newLength) {
++newPum ++newPum
@ -465,8 +455,7 @@ const handleNewScoll = () => {
const handleMsgScoll = () => { const handleMsgScoll = () => {
const container = msgScoll.value const container = msgScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (psgPum < maxMsgLingth) { if (psgPum < maxMsgLingth) {
++psgPum ++psgPum
@ -583,9 +572,7 @@ const demandWithdraws = async (obj) => {
<template> <template>
<div class="page w-1920px h-1080px p30px flex flex-col"> <div class="page w-1920px h-1080px p30px flex flex-col">
<div class="w300px -mr-1px flex flex-col shrink-0"> <div class="w300px -mr-1px flex flex-col shrink-0">
<div class="text-20px text-#fff font-600 mt6px"> <div class="text-20px text-#fff font-600 mt6px">大金中国调达本部 HOMEPAGE</div>
大金中国调达本部 HOMEPAGE
</div>
<!-- @dblclick="toggle" --> <!-- @dblclick="toggle" -->
<img src="@/assets/images/logo.png" class="w197px h44px mt14px" /> <img src="@/assets/images/logo.png" class="w197px h44px mt14px" />
</div> </div>
@ -614,26 +601,21 @@ const demandWithdraws = async (obj) => {
<div class="cards w34% h800px page-wrapper"> <div class="cards w34% h800px page-wrapper">
<div class="cards_title">News</div> <div class="cards_title">News</div>
<el-button <el-button
v-if="userCode" v-if="false && userCode"
type="primary" type="primary"
class="absolute right-164px top-15px" class="absolute right-164px top-15px"
@click="push('/external/Process')" @click="push('/external/Process')"
>流程列表</el-button >流程列表</el-button
> >
<el-button <el-button
v-if="userCode" v-if="false && userCode"
type="primary" type="primary"
class="absolute right-80px top-15px" class="absolute right-80px top-15px"
@click="toDetail2(7)" @click="toDetail2(7)"
>+ 新增</el-button >+ 新增</el-button
> >
<span <span
style=" style="border: #417bef 1px solid; color: #417bef; border-radius: 5px; height: 30px"
border: #417bef 1px solid;
color: #417bef;
border-radius: 5px;
height: 30px;
"
class="mr15px mt17px flex px5px pt6px" class="mr15px mt17px flex px5px pt6px"
@click="toList(7)" @click="toList(7)"
>更多<el-icon> <DArrowRight class="" /> </el-icon >更多<el-icon> <DArrowRight class="" /> </el-icon
@ -645,15 +627,8 @@ const demandWithdraws = async (obj) => {
<ArrowRightBold /> <ArrowRightBold />
</el-icon> --> </el-icon> -->
</div> </div>
<div <div ref="newsSoll" class="p20px w100% h355px cent_box overflow-y-auto">
ref="newsSoll" <div v-if="newsList" class="text-#152242 truncate-box text-18px" v-for="i in newsList">
class="p20px w100% h355px cent_box overflow-y-auto"
>
<div
v-if="newsList"
class="text-#152242 truncate-box text-18px"
v-for="i in newsList"
>
<div class="truncate" @click="toDetail(i, 'App_E_News')"> <div class="truncate" @click="toDetail(i, 'App_E_News')">
<img <img
v-if="i.tag === 'New'" v-if="i.tag === 'New'"
@ -665,16 +640,12 @@ const demandWithdraws = async (obj) => {
class="text-#fff bg-red p5px text-18px rounded-5px mr-5px badge-24" class="text-#fff bg-red p5px text-18px rounded-5px mr-5px badge-24"
>置顶</span >置顶</span
> >
<span <span :style="i.isRead === 2 ? 'color:#0058E5;font-weight' : ''" :title="i.title">{{
:style="i.isRead === 2 ? 'color:#0058E5;font-weight' : ''" i.title
:title="i.title" }}</span>
>{{ i.title }}</span
>
</div> </div>
<div <div class="icons min-w-110px w110px h20px mt15px absolute right-0px top-0">
class="icons min-w-110px w110px h20px mt15px absolute right-0px top-0"
>
{{ i.createTime.substring(0, 10) }} {{ i.createTime.substring(0, 10) }}
</div> </div>
</div> </div>
@ -688,41 +659,31 @@ const demandWithdraws = async (obj) => {
<div class="icons w20px h20px mt15px absolute right-20px top-0"></div> <div class="icons w20px h20px mt15px absolute right-20px top-0"></div>
</div> --> </div> -->
</div> </div>
<div class="text-26px text-#142142 font-extrabold mb-10px pl20px"> <div class="text-26px text-#142142 font-extrabold mb-10px pl20px">重要通知</div>
重要通知
</div>
<div class="flex"> <div class="flex">
<el-button <el-button
v-if="userCode" v-if="false && userCode"
type="primary" type="primary"
class="mt0px mr0px" class="mt0px mr0px"
@click="push({ path: '/external/Process', query: { cate: '8' } })" @click="push({ path: '/external/Process', query: { cate: '8' } })"
>流程列表</el-button >流程列表</el-button
> >
<el-button <el-button
v-if="userCode" v-if="false && userCode"
type="primary" type="primary"
class="mt0px mr10px" class="mt0px mr10px"
@click="toDetail2(8)" @click="toDetail2(8)"
>+ 新增</el-button >+ 新增</el-button
> >
<span <span
style=" style="border: #417bef 1px solid; color: #417bef; border-radius: 5px; height: 30px"
border: #417bef 1px solid;
color: #417bef;
border-radius: 5px;
height: 30px;
"
class="mr15px mt2px flex px5px pt6px" class="mr15px mt2px flex px5px pt6px"
@click="toList(8)" @click="toList(8)"
>更多<el-icon> <DArrowRight class="" /> </el-icon >更多<el-icon> <DArrowRight class="" /> </el-icon
></span> ></span>
</div> </div>
<div <div ref="portant" class="p20px pt0px w100% h355px cent_box overflow-y-auto">
ref="portant"
class="p20px pt0px w100% h355px cent_box overflow-y-auto"
>
<div <div
v-if="portantList" v-if="portantList"
class="text-#152242 truncate-box text-18px" class="text-#152242 truncate-box text-18px"
@ -740,16 +701,12 @@ const demandWithdraws = async (obj) => {
class="text-#fff bg-red p5px text-14px rounded-5px mr-5px badge-24" class="text-#fff bg-red p5px text-14px rounded-5px mr-5px badge-24"
>置顶</span >置顶</span
> >
<span <span :style="i.isRead === 2 ? 'color:#0058E5;font-weight' : ''" :title="i.title">{{
:style="i.isRead === 2 ? 'color:#0058E5;font-weight' : ''" i.title
:title="i.title" }}</span>
>{{ i.title }}</span
>
</div> </div>
<div <div class="icons min-w-110px w110px h20px mt15px absolute right-0px top-0">
class="icons min-w-110px w110px h20px mt15px absolute right-0px top-0"
>
{{ i.createTime.substring(0, 10) }} {{ i.createTime.substring(0, 10) }}
</div> </div>
</div> </div>
@ -762,9 +719,7 @@ const demandWithdraws = async (obj) => {
</div> --> </div> -->
</div> </div>
</div> </div>
<div <div class="cards w64% h800px !shadow-none !bg-transparent page-wrapper">
class="cards w64% h800px !shadow-none !bg-transparent page-wrapper"
>
<div class="cards w760px h385px cursor-pointer"> <div class="cards w760px h385px cursor-pointer">
<div class="cards_title">市况汇率每日更新</div> <div class="cards_title">市况汇率每日更新</div>
<div class="cards_nav cards_nav2 !top--3px !right--1px"> <div class="cards_nav cards_nav2 !top--3px !right--1px">
@ -807,11 +762,7 @@ const demandWithdraws = async (obj) => {
> >
<td>{{ it.channel }}</td> <td>{{ it.channel }}</td>
<td>{{ it.negAmount }}</td> <td>{{ it.negAmount }}</td>
<td <td :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
:class="
it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'
"
>
{{ displayDiffValue(it.diffValue) }} {{ displayDiffValue(it.diffValue) }}
</td> </td>
</tr> </tr>
@ -844,11 +795,7 @@ const demandWithdraws = async (obj) => {
> >
<td>{{ it.channel }}</td> <td>{{ it.channel }}</td>
<td>{{ it.negAmount }}</td> <td>{{ it.negAmount }}</td>
<td <td :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
:class="
it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'
"
>
{{ displayDiffValue(it.diffValue) }} {{ displayDiffValue(it.diffValue) }}
</td> </td>
</tr> </tr>
@ -885,15 +832,9 @@ const demandWithdraws = async (obj) => {
:key="index" :key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''" :class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
> >
<td> <td>{{ it.currencyCodeFrom }}-{{ it.currencyNameTo }}</td>
{{ it.currencyCodeFrom }}-{{ it.currencyNameTo }}
</td>
<td>{{ it.negAmount }}</td> <td>{{ it.negAmount }}</td>
<td <td :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
:class="
it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'
"
>
{{ displayDiffValue(it.diffValue) }} {{ displayDiffValue(it.diffValue) }}
</td> </td>
</tr> </tr>
@ -927,10 +868,7 @@ const demandWithdraws = async (obj) => {
> >
<span <span
@click=" @click="
openNewWindow( openNewWindow('App_E_Link_GPROC', 'https://edi.daikin.net.cn:8443/gproc/')
'App_E_Link_GPROC',
'https://edi.daikin.net.cn:8443/gproc/'
)
" "
class="text-#142142" class="text-#142142"
> >
@ -944,12 +882,7 @@ const demandWithdraws = async (obj) => {
>2</span >2</span
> >
<span <span
@click=" @click="openNewWindow('App_E_Link_DELTA', 'https://edi.daikin.net.cn')"
openNewWindow(
'App_E_Link_DELTA',
'https://edi.daikin.net.cn'
)
"
class="text-#142142" class="text-#142142"
> >
DELTA</span DELTA</span
@ -981,10 +914,7 @@ const demandWithdraws = async (obj) => {
> >
<span <span
@click=" @click="
openNewWindow( openNewWindow('App_E_Link_DaiKin_Site', 'https://www.daikin-china.com.cn/')
'App_E_Link_DaiKin_Site',
'https://www.daikin-china.com.cn/'
)
" "
class="text-#142142" class="text-#142142"
> >
@ -1001,9 +931,7 @@ const demandWithdraws = async (obj) => {
@click="openNewWindow('App_E_Link_DaiKin_CAN', 'shorm')" @click="openNewWindow('App_E_Link_DaiKin_CAN', 'shorm')"
class="text-#142142" class="text-#142142"
> >
<a target="_blank" style="color: inherit" <a target="_blank" style="color: inherit">大金空调中国相关</a></span
>大金空调中国相关</a
></span
> >
</div> </div>
</div> </div>
@ -1085,26 +1013,10 @@ const demandWithdraws = async (obj) => {
'font-size': '18px' 'font-size': '18px'
}" }"
> >
<el-table-column <el-table-column property="title" label="调查表名称" align="left" />
property="title" <el-table-column property="fillCTime" label="填表日期" align="center" />
label="调查表名称" <el-table-column property="fillRangeDate" label="填表期间" align="center" />
align="left" <el-table-column property="status" label="填报状态" align="center" />
/>
<el-table-column
property="fillCTime"
label="填表日期"
align="center"
/>
<el-table-column
property="fillRangeDate"
label="填表期间"
align="center"
/>
<el-table-column
property="status"
label="填报状态"
align="center"
/>
</el-table> </el-table>
</div> </div>
</div> </div>
@ -1170,13 +1082,7 @@ const demandWithdraws = async (obj) => {
<!-- lujinli --> <!-- lujinli -->
<span v-if="flgs == 1" class="text-18px">{{ i.number }}</span> <span v-if="flgs == 1" class="text-18px">{{ i.number }}</span>
<span v-if="flgs == 2" class="text-18px">{{ <span v-if="flgs == 2" class="text-18px">{{
i.demand + i.demand + ' ' + i.location + ' ' + i.remark + ': ' + i.usdObj
' ' +
i.location +
' ' +
i.remark +
': ' +
i.usdObj
}}</span> }}</span>
<span v-if="flgs == 3" class="text-18px">{{ i.title }}</span> <span v-if="flgs == 3" class="text-18px">{{ i.title }}</span>
</div> </div>
@ -1216,9 +1122,7 @@ const demandWithdraws = async (obj) => {
@click="deleteMSG(i)" @click="deleteMSG(i)"
/> />
</div> </div>
<span v-if="flgs == 3" class="absolute right-0px top-18px">{{ <span v-if="flgs == 3" class="absolute right-0px top-18px">{{ i.createTime }}</span>
i.createTime
}}</span>
<span v-if="flgs == 2" class="absolute right-80px top-10px">{{ <span v-if="flgs == 2" class="absolute right-80px top-10px">{{
i.procureTime i.procureTime
}}</span> }}</span>
@ -1239,61 +1143,28 @@ const demandWithdraws = async (obj) => {
<div v-if="!msgList?.length" class="text-#808696 w515px"> <div v-if="!msgList?.length" class="text-#808696 w515px">
<div> <div>
<!-- lujinli --> <!-- lujinli -->
<span <span v-if="flgs == 1" class="text-18px" style="margin-left: 40%; display: flex">
v-if="flgs == 1" <div v-if="userCode" class="flex items-center justify-center flex-col">
class="text-18px" <img src="./images/zanwly.png" alt="" style="margin-right: 50px" />
style="margin-left: 40%; display: flex" <p style="text-align: center; color: #dde5fd">暂无供方留言</p>
>
<div
v-if="userCode"
class="flex items-center justify-center flex-col"
>
<img
src="./images/zanwly.png"
alt=""
style="margin-right: 50px"
/>
<p style="text-align: center; color: #dde5fd">
暂无供方留言
</p>
</div> </div>
<div <div v-else class="flex items-center justify-center flex-col">
v-else
class="flex items-center justify-center flex-col"
>
<img src="./images/zanwly2.png" alt="" /> <img src="./images/zanwly2.png" alt="" />
<span <span style="display: flex; margin: 5px auto; color: #dde5fd"
style="display: flex; margin: 5px auto; color: #dde5fd"
>您暂未留言</span >您暂未留言</span
> >
</div> </div>
</span> </span>
<span <span v-if="flgs == 2" class="text-18px" style="margin-left: 40%; display: flex">
v-if="flgs == 2" <div v-if="userCode" class="flex items-center justify-center flex-col">
class="text-18px" <img src="./images/zanwly.png" alt="" style="margin-right: 50px" />
style="margin-left: 40%; display: flex" <span style="display: flex; margin: 5px auto; color: #dde5fd"
>
<div
v-if="userCode"
class="flex items-center justify-center flex-col"
>
<img
src="./images/zanwly.png"
alt=""
style="margin-right: 50px"
/>
<span
style="display: flex; margin: 5px auto; color: #dde5fd"
>暂无提供方留言</span >暂无提供方留言</span
> >
</div> </div>
<div <div v-else class="flex items-center justify-center flex-col">
v-else
class="flex items-center justify-center flex-col"
>
<img src="./images/zanwly2.png" alt="" /> <img src="./images/zanwly2.png" alt="" />
<span <span style="display: flex; margin: 5px auto; color: #dde5fd"
style="display: flex; margin: 5px auto; color: #dde5fd"
>您暂未留言</span >您暂未留言</span
> >
</div> </div>
@ -1307,10 +1178,7 @@ const demandWithdraws = async (obj) => {
</div> </div>
</div> </div>
<n-modal <n-modal v-model:show="shormA" class="w-940px h740px rd-20px relative bg-#fff">
v-model:show="shormA"
class="w-940px h740px rd-20px relative bg-#fff"
>
<div> <div>
<div <div
style=" style="
@ -1330,13 +1198,7 @@ const demandWithdraws = async (obj) => {
<div <div
size="40" size="40"
color="#ccc" color="#ccc"
style=" style="font-size: 20px; margin: 10px; width: 18.09px; height: 18.21px; color: #b2b2b2"
font-size: 20px;
margin: 10px;
width: 18.09px;
height: 18.21px;
color: #b2b2b2;
"
@click="close1" @click="close1"
> >
<svg <svg
@ -1353,12 +1215,7 @@ const demandWithdraws = async (obj) => {
</div> </div>
<!-- 内容区 --> <!-- 内容区 -->
<div <div
style=" style="border-top: 1px solid #e1e1e1; width: 100%; padding-top: 38px; padding-left: 38px"
border-top: 1px solid #e1e1e1;
width: 100%;
padding-top: 38px;
padding-left: 38px;
"
> >
<span <span
style=" style="
@ -1487,12 +1344,7 @@ const demandWithdraws = async (obj) => {
<span <span
class="inline-block w80px h25px text-#bfbfbf border border-solid text-center rounded-5px cursor-pointer" class="inline-block w80px h25px text-#bfbfbf border border-solid text-center rounded-5px cursor-pointer"
@click="shormA = false" @click="shormA = false"
style=" style="width: 100px; height: 38px; border-radius: 5px 5px 5px 5px; background: #ffffff"
width: 100px;
height: 38px;
border-radius: 5px 5px 5px 5px;
background: #ffffff;
"
> >
<div <div
style=" style="
@ -1511,12 +1363,7 @@ const demandWithdraws = async (obj) => {
</span> </span>
<span <span
class="inline-block w80px h25px text-#fff bg-#236EED ml5px text-center rounded-5px cursor-pointer" class="inline-block w80px h25px text-#fff bg-#236EED ml5px text-center rounded-5px cursor-pointer"
style=" style="width: 100px; height: 38px; border-radius: 5px 5px 5px 5px; background: #3870e5"
width: 100px;
height: 38px;
border-radius: 5px 5px 5px 5px;
background: #3870e5;
"
@click="addClickA" @click="addClickA"
> >
<div <div
@ -1568,13 +1415,7 @@ const demandWithdraws = async (obj) => {
<div <div
size="40" size="40"
color="#ccc" color="#ccc"
style=" style="font-size: 20px; margin: 10px; width: 18.09px; height: 18.21px; color: #b2b2b2"
font-size: 20px;
margin: 10px;
width: 18.09px;
height: 18.21px;
color: #b2b2b2;
"
@click="close1" @click="close1"
> >
<svg <svg
@ -1589,9 +1430,7 @@ const demandWithdraws = async (obj) => {
</svg> </svg>
</div> </div>
</div> </div>
<div <div style="border-top: 1px solid #e1e1e1; width: 100%; padding-left: 38px">
style="border-top: 1px solid #e1e1e1; width: 100%; padding-left: 38px"
>
<div <div
style=" style="
font-weight: 700; font-weight: 700;
@ -1738,12 +1577,7 @@ const demandWithdraws = async (obj) => {
<span <span
class="inline-block w80px h25px text-#bfbfbf border border-solid text-center rounded-5px cursor-pointer" class="inline-block w80px h25px text-#bfbfbf border border-solid text-center rounded-5px cursor-pointer"
@click="shormB = false" @click="shormB = false"
style=" style="width: 100px; height: 38px; border-radius: 5px 5px 5px 5px; background: #ffffff"
width: 100px;
height: 38px;
border-radius: 5px 5px 5px 5px;
background: #ffffff;
"
> >
<div <div
style=" style="
@ -1762,12 +1596,7 @@ const demandWithdraws = async (obj) => {
</span> </span>
<span <span
class="inline-block w80px h25px text-#fff bg-#236EED ml5px text-center rounded-5px cursor-pointer" class="inline-block w80px h25px text-#fff bg-#236EED ml5px text-center rounded-5px cursor-pointer"
style=" style="width: 100px; height: 38px; border-radius: 5px 5px 5px 5px; background: #3870e5"
width: 100px;
height: 38px;
border-radius: 5px 5px 5px 5px;
background: #3870e5;
"
@click="addClickB" @click="addClickB"
> >
<div <div
@ -1793,11 +1622,7 @@ const demandWithdraws = async (obj) => {
<div class="w700px h430px bg-#fff rd-15px"> <div class="w700px h430px bg-#fff rd-15px">
<div <div
class="py5px px15px" class="py5px px15px"
style=" style="border-bottom: 1px solid #dadada; font-weight: bold; color: #494a63"
border-bottom: 1px solid #dadada;
font-weight: bold;
color: #494a63;
"
> >
大金空调中国相关 大金空调中国相关
<img <img
@ -1809,17 +1634,13 @@ const demandWithdraws = async (obj) => {
<div class="flex mt70px text-center"> <div class="flex mt70px text-center">
<div class="w-full text-center"> <div class="w-full text-center">
<img src="@/assets/images/ewm1@2x.png" class="w200px" /> <img src="@/assets/images/ewm1@2x.png" class="w200px" />
<div <div class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto">
class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto"
>
大金空调中国视频号 大金空调中国视频号
</div> </div>
</div> </div>
<div class="w-full"> <div class="w-full">
<img src="@/assets/images/ewm2@2x.png" class="w200px" /> <img src="@/assets/images/ewm2@2x.png" class="w200px" />
<div <div class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto">
class="py10px bg-#377CFF text-#fff w200px rd-20px mt35px mx-auto"
>
大金空调抖音号 大金空调抖音号
</div> </div>
</div> </div>

View File

@ -1,15 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
import { getImg } from "./images"; import { getImg } from './images'
import { import {
getNoticeList, getNoticeList,
deleteWithdraw, deleteWithdraw,
getManagerList, getManagerList,
getExternalManagerDetail, // news/- getExternalManagerDetail, // news/-
externalWithdraw, // news/- externalWithdraw, // news/-
getExternalManagerList, // news/- getExternalManagerList // news/-
} from "@/api/daikin/base"; } from '@/api/daikin/base'
import Editor from "@/views/home/intelligence/components/TinyECE.vue"; import Editor from '@/views/home/intelligence/components/TinyECE.vue'
import UserPage from "../../home/intelligence/process/UserPages.vue"; import UserPage from '../../home/intelligence/process/UserPages.vue'
import { import {
NModal, NModal,
NCard, NCard,
@ -24,137 +24,137 @@ import {
useMessage, useMessage,
treeDark, treeDark,
NTag NTag
} from "naive-ui"; } from 'naive-ui'
import { useUserStore } from "@/stores/modules/user"; import { useUserStore } from '@/stores/modules/user'
import HomeHead from "@/views/home/components/HomeHead.vue"; import HomeHead from '@/views/home/components/HomeHead.vue'
import { noticeld } from "@/stores/modules/noticeId"; import { noticeld } from '@/stores/modules/noticeId'
import { saveArticle } from "@/api/daikin/base"; import { saveArticle } from '@/api/daikin/base'
const editorContent = ref(); import { useDate } from '@/views/home/hooks/useDate'
const { push } = useRouter(); const editorContent = ref()
const message = useMessage(); const { push } = useRouter()
const not = noticeld(); const message = useMessage()
const not = noticeld()
const route = useRoute() const route = useRoute()
const activeNames = ref("2"); const activeNames = ref('2')
const Status = reactive({ const Status = reactive({
reviewStatus: 1, reviewStatus: 1,
reviewSource: 2, reviewSource: 2
}); })
const cate = ref('7') const cate = ref('7')
const activeName = ref("0"); const activeName = ref('0')
const tabIndex = ref("0"); const tabIndex = ref('0')
const tabs = ref([ const tabs = ref([
{ {
name: "审核中", name: '审核中',
icon: getImg("shhz2@2x.png"), icon: getImg('shhz2@2x.png'),
icons: getImg("shhz1@2x.png"), icons: getImg('shhz1@2x.png'),
id: 0, id: 0
}, },
{ {
name: "已审核", name: '已审核',
icon: getImg("wanc2@2x.png"), icon: getImg('wanc2@2x.png'),
icons: getImg("wanc1@2x.png"), icons: getImg('wanc1@2x.png'),
id: 1, id: 1
}, },
{ {
name: "驳回/撤回", name: '驳回/撤回',
icon: getImg("boh2@2x.png"), icon: getImg('boh2@2x.png'),
icons: getImg("boh1@2x.png"), icons: getImg('boh1@2x.png'),
id: 2, id: 2
}, }
]); ])
const listData = ref<any>([]); const listData = ref<any>([])
const store2 = useUserStore(); const store2 = useUserStore()
// //
const handleClick = (tab: TabsPaneContext, event: Event) => { const handleClick = (tab: TabsPaneContext, event: Event) => {
tabIndex.value = tab.index; tabIndex.value = tab.index
switch (tab.index) { switch (tab.index) {
case "0": case '0':
getPageList("1"); getPageList('1')
break; break
case "1": case '1':
// //
getPageList("3"); getPageList('3')
break; break
case "2": case '2':
// //
getPageList("4"); getPageList('4')
break; break
default: default:
getPageList("1"); getPageList('1')
break; break
}
} }
};
async function getPageList(reviewStatus: string) { async function getPageList(reviewStatus: string) {
const { pageNum, pageSize } = pageInfo; const { pageNum, pageSize } = pageInfo
const resp = await getExternalManagerList({ const resp = await getExternalManagerList({
pageNum, pageNum,
pageSize, pageSize,
reviewStatus, reviewStatus,
cate: cate.value, cate: cate.value
}); })
// listData.value = []; // listData.value = [];
listData.value = resp?.rows || []; listData.value = resp?.rows || []
} }
// //
const clickCancel = (data: any) => { const clickCancel = (data: any) => {
const { id, noticeId, reviewStatus } = data; const { id, noticeId, reviewStatus } = data
externalWithdraw(id).then((res) => { externalWithdraw(id).then((res) => {
console.log(res, "删除结果"); console.log(res, '删除结果')
getPageList("1"); getPageList('1')
}); })
}; }
let formValue: any = ref({ let formValue: any = ref({
type: "1", type: '1',
cate: not.article.cate, cate: not.article.cate,
title: "", title: '',
tag: "", tag: '',
source: "", source: '',
content: "", content: '',
reviewSource: "3", reviewSource: '3',
isTop: "N", isTop: 'N',
treeSource: "1", treeSource: '1'
}); })
const pageInfo = reactive({ const pageInfo = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
type: "1", type: '1',
cate: "7", cate: '7',
total: 10, total: 10
}); })
onMounted(async () => { onMounted(async () => {
cate.value = route.query.cate cate.value = route.query.cate
getPageList("1"); getPageList('1')
}); })
function escapeHTML(html: string): string { function escapeHTML(html: string): string {
const tempElement = document.createElement("div"); const tempElement = document.createElement('div')
tempElement.textContent = html; tempElement.textContent = html
return tempElement.innerHTML; return tempElement.innerHTML
} }
const handleClose = (tag: any) => { const handleClose = (tag: any) => {
dataList.value.splice(dataList.value.indexOf(tag), 1); dataList.value.splice(dataList.value.indexOf(tag), 1)
}; }
// //
async function save() { async function save() {
let userIdList: any[] = []; let userIdList: any[] = []
const cont = editorContent.value; const cont = editorContent.value
const content = escapeHTML(cont); const content = escapeHTML(cont)
const { title, reviewSource, tag, treeSource, source, type, isTop } = const { title, reviewSource, tag, treeSource, source, type, isTop } = formValue.value
formValue.value; const cate = not.article.cate
const cate = not.article.cate;
// console.log(formValue.value, content,cate) // console.log(formValue.value, content,cate)
if (dataList.value) { if (dataList.value) {
dataList.value.forEach((i: { userId: any }) => { dataList.value.forEach((i: { userId: any }) => {
console.log(dataList.value); console.log(dataList.value)
userIdList.push(i.userId); userIdList.push(i.userId)
}); })
} }
// console.log(formValue.value) // console.log(formValue.value)
// if(userIdList.length<0) return // if(userIdList.length<0) return
const { msg, code } = await saveArticle({ const { msg, code } = await saveArticle({
title, title,
tag: "", tag: '',
isTop, isTop,
treeSource, treeSource,
reviewSource, reviewSource,
@ -162,54 +162,57 @@ async function save() {
cate, cate,
type, type,
content, content,
userIdList, userIdList
}); })
if (code === 200) { if (code === 200) {
message.success("新增成功"); message.success('新增成功')
} else { } else {
message.success(msg); message.success(msg)
} }
push({ name: "external" }); push({ name: 'external' })
} }
// //
const handleChild = (data: string) => { const handleChild = (data: string) => {
editorContent.value = data; editorContent.value = data
// console.log(data) // console.log(data)
}; }
// //
const saveThis = (e: { preventDefault: () => void }) => { const saveThis = (e: { preventDefault: () => void }) => {
e.preventDefault(); e.preventDefault()
save(); save()
}; }
const stores = noticeld(); const { day, week } = useDate()
const showModal = ref(false); const stores = noticeld()
const setUserList = ref(); const showModal = ref(false)
const dataList = ref(); const setUserList = ref()
const dataList = ref()
const thisClick = () => { const thisClick = () => {
showModal.value = true; showModal.value = true
setUserList.value = dataList.value; setUserList.value = dataList.value
stores.article.reviewSource = formValue.value.reviewSource; stores.article.reviewSource = formValue.value.reviewSource
}; }
const CloseThis = (data: boolean) => { const CloseThis = (data: boolean) => {
showModal.value = data; showModal.value = data
}; }
const handleChild1 = (data: any) => { const handleChild1 = (data: any) => {
const { showModal: show, multipleSelection } = data; const { showModal: show, multipleSelection } = data
console.log("🚀 ~ file: index.vue:197 ~ data:", data) console.log('🚀 ~ file: index.vue:197 ~ data:', data)
// showModal.value = unref(show); // showModal.value = unref(show);
// dataList.value = unref(multipleSelection); // dataList.value = unref(multipleSelection);
}; }
</script> </script>
<template> <template>
<div class="page"> <HomeHead class="top"> </HomeHead>
<HomeHead class="top"> <div class="h-full relative flex flex-col">
<!-- <template #content> <div class="font-600 flex items-end mt30px">
<HomeHeadSearch /> <div class="text-36px">{{ cate == 7 ? '外部审批流程-News' : '外部审批流程-重要通知' }}</div>
</template> --> <div class="text-18px ml40px mr25px">{{ day }}</div>
</HomeHead> <div class="text-18px">{{ week }}</div>
<div class="back" @click="push({ name: 'external' })">返回首页</div> </div>
<div class="bg-#fff p30px rounded-5px mt40px overflow-y-scroll h900px"> <div
class="q-wrapper flex-1 rounded-5px mt30px overflow-y-scroll h900px text-#142142 flex flex-col bg-#fff p30px"
>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabs" :key="item"> <el-tab-pane v-for="item in tabs" :key="item">
<template #label> <template #label>
@ -263,28 +266,20 @@ const handleChild1 = (data: any) => {
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="i.firstReviewName"> <el-dropdown-item v-if="i.firstReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">初审人{{ i.firstReviewName }}</span>
>初审人{{ i.firstReviewName }}</span
>
<span class="ml20px">初审时间{{ i.firstReviewTime }}</span> <span class="ml20px">初审时间{{ i.firstReviewTime }}</span>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="i.ultimateReviewName"> <el-dropdown-item v-if="i.ultimateReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">终审人{{ i.ultimateReviewName }}</span>
>终审人{{ i.ultimateReviewName }}</span <span class="ml20px">终审时间{{ i.ultimateReviewTime }}</span>
>
<span class="ml20px"
>终审时间{{ i.ultimateReviewTime }}</span
>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<span class="shrink-0 ml38px text-#808696 w220px">{{ <span class="shrink-0 ml38px text-#808696 w220px">{{ i.createTime }}</span>
i.createTime
}}</span>
<span <span
v-if="store2.user.isReview > 0 && i.publishName" v-if="store2.user.isReview > 0 && i.publishName"
class="ml20px text-#808696 text-16px flex-1" class="ml20px text-#808696 text-16px flex-1"
@ -314,16 +309,28 @@ const handleChild1 = (data: any) => {
justify-content: center; justify-content: center;
} }
.top { .top {
position: absolute;
right: 30px; right: 30px;
top: 0px; top: -92px;
}
::-webkit-scrollbar {
width: 1px;
}
.q-wrapper {
border-radius: 18px;
border: 1px solid #e7ebf5;
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
overflow: auto;
} }
.page { .page {
width: 100%; width: 100%;
// height: 100px; // height: 100px;
font-family: "PingFang SC"; font-family: 'PingFang SC';
user-select: none; user-select: none;
background-image: url("@/assets/images/bg.jpg"); background-image: url('@/assets/images/bg.jpg');
background-color: #000; background-color: #000;
background-position: 0 0; background-position: 0 0;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -353,7 +360,7 @@ const handleChild1 = (data: any) => {
} }
} }
.main { .main {
background-image: url("@/assets/images/bg-rs-main.svg"); background-image: url('@/assets/images/bg-rs-main.svg');
background-position: 0 0; background-position: 0 0;
background-repeat: repeat-x; background-repeat: repeat-x;
background-size: auto; background-size: auto;

1123
src/views/home/Home-bak.vue Executable file

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,32 @@ import { useChart1, useChart22, useChart21, useChart3, useChart23 } from './Home
import AppHeadUserInfo from '@/components/AppHeadUserInfo.vue' import AppHeadUserInfo from '@/components/AppHeadUserInfo.vue'
import { NSelect } from 'naive-ui' import { NSelect } from 'naive-ui'
import News from './components/New.vue' import News from './components/New.vue'
import { homePageMarket, homePageRate, report, getHomeList, amountList } from '@/api/daikin/base' import { useMessage } from 'naive-ui'
import {
homePageMarket,
homePageRate,
report,
getHomeList,
amountList,
fetchHomeSmmExInfo,
fetchExchangeInfo,
fetchMarketUpdateTime
} from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { groupBy } from 'lodash-es'
const store = useUserStore() const store = useUserStore()
const message = useMessage()
const isUpPwds = ref(false) const isUpPwds = ref(false)
const userCode = ref(false) const userCode = ref(false)
const useCdView = ref(false)
watchEffect(() => { watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].includes(store.user.roleCode) userCode.value = ['admin', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
useCdView.value = ['admin', 'cd_view', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
isUpPwds.value = store.user.isUpPwd === 2 ? true : false isUpPwds.value = store.user.isUpPwd === 2 ? true : false
}) })
const activeCard5NavKey = ref('DIS') const activeCard5NavKey = ref('DIS')
@ -50,6 +68,8 @@ const addDISH3 = ref()
const timeObj = ref<any>({}) const timeObj = ref<any>({})
onMounted(async () => { onMounted(async () => {
try { try {
getHomeSmmExInfo()
// getHomeExInfo()
const { const {
data: { ailist, culist, lastUTime }, data: { ailist, culist, lastUTime },
data data
@ -168,7 +188,7 @@ onMounted(async () => {
addDISH3.value > 0 ? (addDISH3.value = addDISH3.value.toFixed(2)) : 0 addDISH3.value > 0 ? (addDISH3.value = addDISH3.value.toFixed(2)) : 0
} }
if (isUpPwds.value) { if (isUpPwds.value) {
ElMessageBox.alert('为了您的帐号安全,首次登录必须更改初始密码', '重要提醒', { ElMessageBox.alert('为了您的帐号安全,此次登录必须更改密码', '重要提醒', {
confirmButtonText: 'OK', confirmButtonText: 'OK',
showClose: false, showClose: false,
showCancelButton: false showCancelButton: false
@ -188,19 +208,26 @@ const { chartRef: chartRef2, option: chartOption2, state } = useChart21()
const { chartRef: chartRef22, option: chartOption22 } = useChart22() const { chartRef: chartRef22, option: chartOption22 } = useChart22()
const { chartRef: chartRef23, option: chartOption23 } = useChart23() const { chartRef: chartRef23, option: chartOption23 } = useChart23()
const { chartRef: chartRef3, option: chartOption3 } = useChart3() const { chartRef: chartRef3, option: chartOption3 } = useChart3()
const displayDiffValue = (diffValue: number) => { const displayDiffValue = (diffValue: number) => {
// return diffValue + '%'
if (diffValue > 0) { if (diffValue > 0) {
return `+${diffValue} %` return `+${diffValue}`
} else if (diffValue < 0) { } else if (diffValue < 0) {
return `-${Math.abs(diffValue)} %` // return `-${Math.abs(diffValue)}`
return `${diffValue}`
} else { } else {
return `${diffValue} %` // return `${formatNumber(diffValue)} %`
return `${diffValue}`
} }
} }
async function setModule(codes: any, names: any) { async function setModule(codes: any, names: any) {
const moduleCode = codes const moduleCode = codes
console.log(codes, names) console.log(codes, names)
if (names == 'CD' && !useCdView.value) {
return message.info('没有访问权限!')
}
push({ name: names }) push({ name: names })
const { code } = await report({ moduleCode }) const { code } = await report({ moduleCode })
} }
@ -236,6 +263,31 @@ function formatNumber(num = 0) {
const formattedDecimalPart = decimalPart.padEnd(2, '0') const formattedDecimalPart = decimalPart.padEnd(2, '0')
return `${wholePart}.${formattedDecimalPart}` return `${wholePart}.${formattedDecimalPart}`
} }
const homeSmmExInfo = ref<any>({:[],:[]})
async function getHomeSmmExInfo() {
// const { data } = await fetchHomeSmmExInfo()
// console.log("🚀 ~ file: Home.vue:268 ~ data:", groupBy(data,'instrumentName'))
// homeSmmExInfo.value = groupBy(data,'instrumentName')
const { data } = await homePageMarket()
homeSmmExInfo.value = data
delete homeSmmExInfo.value.lastUTime
}
const homeExchangeInfo = ref<any>([])
async function getHomeExInfo() {
const { data } = await fetchExchangeInfo()
homeExchangeInfo.value = data
console.log('🚀 ~ file: Home.vue:252 ~ }):', data)
}
getLastTime()
const updateTime = ref<any>({})
async function getLastTime() {
const { data } = await fetchMarketUpdateTime()
// homeExchangeInfo.value = data
updateTime.value = data
}
</script> </script>
<template> <template>
@ -266,9 +318,9 @@ function formatNumber(num = 0) {
</div> </div>
<!-- <div class="card_sub-title">责任者调达中心 Device变革T/原材料变革T</div> --> <!-- <div class="card_sub-title">责任者调达中心 Device变革T/原材料变革T</div> -->
<div class="card_content"> <div class="card_content px-30px overflow-y-scroll">
<!-- <VChart :option="chartOption1" autoresize /> --> <!-- <VChart :option="chartOption1" autoresize /> -->
<div class="flex pl15px pr10px pt15px text-#898F9F-1 text-#152242"> <!-- <div class="flex pl15px pr10px pt15px text-#898F9F-1 text-#152242">
<div class=""> <div class="">
<span class="icoT">市况</span> <span class="icoT">市况</span>
<span class="ml10px text-14px">更新时间{{ timeA }}</span> <span class="ml10px text-14px">更新时间{{ timeA }}</span>
@ -384,7 +436,122 @@ function formatNumber(num = 0) {
</table> </table>
</div> </div>
</div> </div>
</div> -->
<!-- <div class="flex flex-col">
<div class="flex justify-end items-center text-#ACACAC mb6px">
<div class="text-#fff bg-#002FA7 rounded-5px px18px py6px">市况</div>
<div class="min-w-180px text-end">更新时间{{ timeA }}</div>
</div> </div>
<div class="flex justify-end items-center text-#ACACAC mb6px">
<div class="text-#fff bg-#99aff6 rounded-5px px18px py6px">汇率</div>
<div class="min-w-180px text-end">更新时间{{ timeB }}</div>
</div>
</div> -->
<div class="flex justify-between items-center">
<div class="text-#fff bg-#002FA7 rounded-5px px18px py6px">市况</div>
<div class="flex flex-col text-#ACACAC flex-1 justify-end text-end text-13px">
<div class="text- flex justify-end">更新时间<p class="min-w-100px text-start">{{ updateTime.SMM }}</p > (SMM)</div>
<div class="text- my4px flex justify-end"><p class="min-w-100px text-start">{{ updateTime.LME }}</p> (LME)</div>
</div>
</div>
<table
v-if="Object.keys(homeSmmExInfo)?.length"
class="history w-full text-center text-16px border-spacing-0"
>
<thead
style="
background-color: #417bef;
color: #fff;
height: 30px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h30px">
<th colspan="2" class="w-22%">原材料</th>
<th class="w-32%">最新</th>
<th>前日差</th>
<th>前日比</th>
</tr>
</thead>
<!-- <tbody>
<tr v-for="it in homeSmmExInfo" :key="it.instrumentId" class="h32px bg-#fff">
<td class="text-14px text-#000">{{ it.instrumentName }}</td>
<td class="text-14px text-#000">{{ it.negAmount }}</td>
<td
class="text-14px text-#000"
:class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ it.diffValue }}%
</td>
<td
class="text-14px text-#000"
:class="it.diffRate < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ it.diffRate }}%
</td>
</tr>
</tbody> -->
<tbody v-for="(item, index) in Object.keys(homeSmmExInfo)" :key="item" >
<tr class="h30px bg-#fff">
<td rowspan="2" class="text-14px text-#000 bg-#EDF8FF">{{ item === 'ailist' ? '铝': '铜' }}</td>
<td class="text-14px text-#000">{{ homeSmmExInfo[item]?.[0]?.channel }}</td>
<td class="text-14px text-#000">{{ homeSmmExInfo[item]?.[0]?.negAmount }}</td>
<td class="text-14px text-#000" :class="homeSmmExInfo[item]?.[0]?.diffPrice < 0 ? 'text-#63BF8D' : 'text-red'">{{ displayDiffValue(homeSmmExInfo[item]?.[0]?.diffPrice || '') }}</td>
<td class="text-14px text-#000" :class="homeSmmExInfo[item]?.[0]?.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">{{ displayDiffValue(homeSmmExInfo[item]?.[0]?.diffValue || '') }}%</td>
</tr>
<tr class="h30px bg-#fff">
<!-- <td rowspan="2" class="text-14px text-#000 bg-#EDF8FF">{{ item }}</td> -->
<td class="text-14px text-#000">{{ homeSmmExInfo[item]?.[1]?.channel }}</td>
<td class="text-14px text-#000">{{ homeSmmExInfo[item]?.[1]?.negAmount }}</td>
<td class="text-14px text-#000" :class="homeSmmExInfo[item]?.[1]?.diffPrice < 0 ? 'text-#63BF8D' : 'text-red'">{{ displayDiffValue(homeSmmExInfo[item]?.[1]?.diffPrice || '') }}</td>
<td class="text-14px text-#000" :class="homeSmmExInfo[item]?.[1]?.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">{{ displayDiffValue(homeSmmExInfo[item]?.[1]?.diffValue || '') }}%</td>
</tr>
</tbody>
</table>
<div class="flex justify-between items-center my4px">
<div class="text-#fff bg-#002FA7 rounded-5px px18px py6px">汇率</div>
<div class="flex flex-col text-#ACACAC flex-1 justify-end text-end text-13px">
<div class="text- flex justify-end">更新时间<p class="">{{ timeB }}</p class="min-w-200px"></div>
</div>
</div>
<table class="mb10px history w-full text-center text-16px border-spacing-0">
<thead
style="
background-color: #417bef;
color: #fff;
height: 30px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h30px">
<th colspan="0" class="w-22%">币种</th>
<th class="w-32%">最新</th>
<th>前日差</th>
<th>前日比</th>
</tr>
</thead>
<tbody v-if="itemLists" class="">
<tr
class="h30px !text-14px text-center"
v-for="(it, index) in itemLists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="text-center text-#000">
{{ it.currencyNameFrom }}-{{ it.currencyNameTo }}
</td>
<td class="text-center text-#000">{{ it.negAmount }}</td>
<td class="text-center" :class="it.diffPrice < 0 ? 'text-#63BF8D' : 'text-red'">
{{ it.diffPrice > 0 ? "+" + it.diffPrice : it.diffPrice }}
</td>
<td class="text-center" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
{{ displayDiffValue(it.diffValue)+'%' }}
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
@ -704,7 +871,8 @@ function formatNumber(num = 0) {
<div class="item_title hover:underline">AI差别化LAB</div> <div class="item_title hover:underline">AI差别化LAB</div>
<div class="item_sub-title">责任者开发调达部</div> <div class="item_sub-title">责任者开发调达部</div>
<div class="item_sub-title">差别化研究T</div> <div class="item_sub-title">差别化研究T</div>
<img src="@/assets/images/img-43.png" class="item_img" /> <!-- <img src="@/assets/images/img-43.png" class="item_img" /> -->
<img src="./images/LAB.pic.png" class="item_img w-200px right--10px" />
</div> </div>
<div <div
class="item !w-full flex flex-col cursor-pointer" class="item !w-full flex flex-col cursor-pointer"

984
src/views/home/Home.vue-b Executable file
View File

@ -0,0 +1,984 @@
<script setup lang="ts">
import VChart from 'vue-echarts'
import { useChart1, useChart22, useChart21, useChart3, useChart23 } from './HomeData'
import AppHeadUserInfo from '@/components/AppHeadUserInfo.vue'
import { NSelect } from 'naive-ui'
import News from './components/New.vue'
import { homePageMarket, homePageRate, report, getHomeList, amountList } from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user'
import { useMessage } from 'naive-ui'
const store = useUserStore()
const message = useMessage()
const isUpPwds = ref(false)
const userCode = ref(false)
const useCdView = ref(false)
watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
useCdView.value = ['admin', 'cd_view', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
isUpPwds.value = store.user.isUpPwd === 2 ? true : false
})
const activeCard5NavKey = ref('DIS')
const Card5Navs = [
{ key: 'DIS', name: 'DIS' },
{ key: 'DSZ', name: 'DSZ' },
{ key: 'DISH', name: 'DISH' }
]
const ailists = ref()
const culists = ref()
const itemLists = ref()
const timeA = ref()
const timeB = ref()
const disList = ref<any>([{}, {}, {}, {}])
const dszList = ref<any>([{}, {}, {}, {}])
const dishList = ref<any>([{}, {}, {}, {}])
const month_1 = ref()
const month_2 = ref()
const month_3 = ref()
let now = new Date().getMonth() + 13
month_2.value = (now - 2) % 12
month_1.value = (now - 1) % 12
const dataDIS = ref()
const dataDSZ = ref()
const dataDISH = ref()
const addDSZ1 = ref()
const addDIS1 = ref()
const addDISH1 = ref()
const addDSZ2 = ref()
const addDIS2 = ref()
const addDISH2 = ref()
const addDSZ3 = ref()
const addDIS3 = ref()
const addDISH3 = ref()
const timeObj = ref<any>({})
onMounted(async () => {
try {
const {
data: { ailist, culist, lastUTime },
data
} = await homePageMarket() //市况
const {
data: { itemList, lastUTime: _lastUTime }
} = await homePageRate() //汇率
const { data: _disList } = await getHomeList({ number: 'DIS' }) //汇率
const { data: _dszList } = await getHomeList({ number: 'DSZ' }) //汇率
const { data: _dishList } = await getHomeList({ number: 'DISH' }) //汇率
const { data: fazhu } = await amountList()
fazhu.forEach((i: { number: string; amount: any }) => {
// timeObj.value[i.number] = i.modifyTime?.substring(0, 10) || ''
timeObj.value[i.number] = i.updateDate || ''
if (i.number == 'DIS') {
dataDIS.value = i.amount
}
if (i.number == 'DSZ') {
dataDSZ.value = i.amount
}
if (i.number == 'DISH') {
dataDISH.value = i.amount
}
})
ailists.value = ailist
culists.value = culist
itemLists.value = itemList
timeA.value = lastUTime
timeB.value = _lastUTime
disList.value = _disList
dszList.value = _dszList
dishList.value = _dishList
month_1.value = _disList[0].monthDate?.split('-')[1]
month_2.value = _dszList[0].monthDate?.split('-')[1]
month_3.value = _dishList[0].monthDate?.split('-')[1]
addDIS1.value = _disList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_disList[0].budget == _disList[1].budget && addDIS1.value > 0) {
addDIS1.value -= _disList[0].budget
addDIS1.value > 0 ? (addDIS1.value = addDIS1.value.toFixed(2)) : 0
}
addDSZ1.value = _dszList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dszList[0].budget == _dszList[1].budget && addDSZ1.value > 0) {
addDSZ1.value -= _dszList[0].budget
addDSZ1.value > 0 ? (addDSZ1.value = addDSZ1.value.toFixed(2)) : 0
}
addDISH1.value = _dishList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dishList[0].budget == _dishList[1].budget && addDISH1.value > 0) {
addDISH1.value -= _dishList[0].budget
addDISH1.value > 0 ? (addDISH1.value = addDISH1.value.toFixed(2)) : 0
}
addDIS2.value = _disList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_disList[0].monthOne == _disList[1].monthOne && addDIS2.value > 0) {
addDIS2.value -= _disList[0].monthOne
addDIS2.value > 0 ? (addDIS2.value = addDIS2.value.toFixed(2)) : 0
}
addDSZ2.value = _dszList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dszList[0].monthOne == _dszList[1].monthOne && addDSZ2.value > 0) {
addDSZ2.value -= _dszList[0].monthOne
addDSZ2.value > 0 ? (addDSZ2.value = addDSZ2.value.toFixed(2)) : 0
}
addDISH2.value = _dishList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dishList[0].monthOne == _dishList[1].monthOne && addDISH2.value > 0) {
addDISH2.value -= _dishList[0].monthOne
addDISH2.value > 0 ? (addDISH2.value = addDISH2.value.toFixed(2)) : 0
}
addDIS3.value = _disList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_disList[0].monthTwo == _disList[1].monthTwo && addDIS3.value > 0) {
addDIS3.value -= _disList[0].monthTwo
addDIS3.value > 0 ? (addDIS3.value = addDIS3.value.toFixed(2)) : 0
}
addDSZ3.value = _dszList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dszList[0].monthTwo == _dszList[1].monthTwo && addDSZ3.value > 0) {
addDSZ3.value -= _dszList[0].monthTwo
addDSZ3.value > 0 ? (addDSZ3.value = addDSZ3.value.toFixed(2)) : 0
}
addDISH3.value = _dishList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) + parseFloat(previousValue)
// return sum > 0 ? sum.toFixed(2) : 0
return sum
}, 0)
if (_dishList[0].monthTwo == _dishList[1].monthTwo && addDISH3.value > 0) {
addDISH3.value -= _dishList[0].monthTwo
addDISH3.value > 0 ? (addDISH3.value = addDISH3.value.toFixed(2)) : 0
}
if (isUpPwds.value) {
ElMessageBox.alert('为了您的帐号安全,此次登录必须更改密码', '重要提醒', {
confirmButtonText: 'OK',
showClose: false,
showCancelButton: false
}).then(() => {
push({ name: 'modifys' })
})
}
report({ moduleCode: 'App_Home' })
} catch (error) {}
})
const { push } = useRouter()
const route = useRoute()
const timeNow = useDateFormat(useNow(), 'YYYY-MM-DD')
const { chartRef: chartRef1, option: chartOption1 } = useChart1()
const { chartRef: chartRef2, option: chartOption2, state } = useChart21()
const { chartRef: chartRef22, option: chartOption22 } = useChart22()
const { chartRef: chartRef23, option: chartOption23 } = useChart23()
const { chartRef: chartRef3, option: chartOption3 } = useChart3()
const displayDiffValue = (diffValue: number) => {
// return diffValue + '%'
if (diffValue > 0) {
return `+${diffValue}%`
} else if (diffValue < 0) {
return `-${Math.abs(diffValue)}%`
} else {
// return `${formatNumber(diffValue)} %`
return `${diffValue}%`
}
}
async function setModule(codes: any, names: any) {
const moduleCode = codes
console.log(codes, names)
if (names == 'CD' && !useCdView.value) {
return message.info('没有访问权限!')
}
push({ name: names })
const { code } = await report({ moduleCode })
}
const selectData = ref('原材料')
const option = [
{
label: '全部数据',
value: 'quanbu'
},
{
label: '原材料',
value: 'yuancailiao'
},
{
label: '加工品',
value: 'jiagongping'
},
{
label: '机能部品',
value: 'jineng'
}
]
const thisSelect = (e) => {
console.log(e)
state.title = e
}
function formatNumber(num = 0) {
num = +num
const roundedNum: string = num.toFixed(2)
const [wholePart, decimalPart] = roundedNum.split('.')
const formattedDecimalPart = decimalPart.padEnd(2, '0')
return `${wholePart}.${formattedDecimalPart}`
}
</script>
<template>
<div class="top flex items-center text-20px">
<div class="flex-1 font-800 text-30px"></div>
<AppHeadUserInfo />
</div>
<div class="page-wrapper h-full flex-1 flex flex-col flex-wrap">
<div class="font-800 text-30px mt39px">
<!-- FY23年度调达本部方针创新实干勇毅前行以综合实力挑战变革提升存在感 -->
FY24年度公司方针提升全员价值直击一切困难
</div>
<div class="mt30px flex-1 flex flex-wrap justify-between">
<News></News>
<div class="card">
<div
class="card_title cursor-pointer hover:underline"
@click="setModule('App_Market', 'Market')"
>
市况汇率 每日更新
</div>
<div class="card_nav card_nav2 !top--3px !right--1px">
<div class="!text-14px w260px top--4px text-right leading-18px">
出处:市况-SMM/LME<br />
汇率-外汇管理局
</div>
</div>
<!-- <div class="card_sub-title">责任者:调达中心 Device变革T/原材料变革T</div> -->
<div class="card_content">
<!-- <VChart :option="chartOption1" autoresize /> -->
<div class="flex pl15px pr10px pt15px text-#898F9F-1 text-#152242">
<div class="">
<span class="icoT">市况</span>
<span class="ml10px text-14px">更新时间:{{ timeA }}</span>
<div class="h150px overflow-auto">
<table class="history w-full text-center mt18px text-16px border-spacing-0 w219px">
<thead
style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px">
<th>铜</th>
<th>最新</th>
<th>前日差</th>
</tr>
</thead>
<tbody v-if="culists">
<tr
class="h45px"
v-for="(it, index) in culists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="text-14px">{{ it.channel }}</td>
<td class="text-14px">{{ it.negAmount }}</td>
<td class="text-14px" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
{{ displayDiffValue(it.diffValue) }}
</td>
</tr>
</tbody>
</table>
</div>
<div class="h150px overflow-auto">
<table
class="history w-full text-center mt15px text-16px border-spacing-0 overflow-auto w219px"
>
<thead
style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px">
<th>铝</th>
<th>最新</th>
<th>前日差</th>
</tr>
</thead>
<tbody v-if="ailists">
<tr
class="h45px"
v-for="(it, index) in ailists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="text-14px">{{ it.channel }}</td>
<td class="text-14px">{{ it.negAmount }}</td>
<td class="text-14px" :class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">
{{ displayDiffValue(it.diffValue) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="ml10px">
<span class="icoT">汇率</span>
<span class="ml10px text-14px">更新时间:{{ timeB }}</span>
<div class="h282px pt18px">
<table class="history w-full text-center text-16px border-spacing-0 w219px">
<thead
style="
background-color: #417bef;
color: #fff;
height: 42px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="h41px">
<th class="w75px">币种</th>
<th>最新</th>
<th class="w65px">前日差</th>
</tr>
</thead>
<tbody v-if="itemLists" class="h238px overflow-auto absolute">
<tr
class="h60px !text-14px"
v-for="(it, index) in itemLists"
:key="index"
:class="index % 2 !== 0 ? 'bg-#f9f9f9' : ''"
>
<td class="w75px text-center">
{{ it.currencyNameFrom }}-{{ it.currencyNameTo }}
</td>
<td class="w85px text-center">{{ it.negAmount }}</td>
<td
class="w65px text-center"
:class="it.diffValue < 0 ? 'text-#63BF8D' : 'text-red'"
>
{{ displayDiffValue(it.diffValue) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div
class="card_title cursor-pointer hover:underline"
@click="setModule('App_data_platform', 'CD')"
>
数据平台
</div>
<!-- <div class="card_sub-title">责任者:调达中心 企画变革T</div> -->
<div class="card_nav card_nav1">
<div
class="card_nav_item cursor-pointer hover:underline"
:class="activeCard5NavKey === i.key && 'active'"
v-for="i in Card5Navs"
:key="i.name"
@click="() => (activeCard5NavKey = i.key)"
>
{{ i.name }}
</div>
</div>
<div class="table-container">
<el-button
v-if="userCode"
type="primary"
class="button abs-top"
@click="push({ name: 'dataPlatform' })"
>数据管理</el-button
>
<div
class="block p-[10px] pr-0 absolute top-[4px] right-[36px] font-normal h-[20px] !text-[16px] text-[#000]"
>
更新日:{{ timeObj[activeCard5NavKey] }}
</div>
<table class="data-table" border v-if="activeCard5NavKey === 'DIS'">
<colgroup>
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
</colgroup>
<tr class="header">
<th rowspan="2" colspan="2">拠点</th>
<td colspan="3">
<div class="tab-header">
<div class="tb-title">DIS</div>
<div class="tb-subtitle">发注金额:{{ dataDIS }}百万元</div>
</div>
</td>
</tr>
<tr class="header">
<td>年初予算</td>
<!-- <td>{{month_2}}月</td> -->
<td>改订</td>
<td>{{ +month_1 }}月</td>
</tr>
<tr>
<th colspan="2">合计</th>
<td>{{ formatNumber(addDIS1) }}%</td>
<td>{{ formatNumber(addDIS2) }}%</td>
<td>{{ formatNumber(addDIS3) }}%</td>
</tr>
<tr>
<th rowspan="2">C/D</th>
<th>交涉</th>
<td :rowspan="disList[0].budget == disList[1].budget ? '2' : ''">
{{ formatNumber(disList[0].budget) }}%
</td>
<td :rowspan="disList[0].monthOne == disList[1].monthOne ? '2' : ''">
{{ formatNumber(disList[0].monthOne) }}%
</td>
<td :rowspan="disList[0].monthTwo == disList[1].monthTwo ? '2' : ''">
{{ formatNumber(disList[0].monthTwo) }}%
</td>
</tr>
<tr>
<th>THEME</th>
<td v-if="disList[1].budget != disList[0].budget">
{{ formatNumber(disList[1].budget) }}%
</td>
<td v-if="disList[1].monthOne != disList[0].monthOne">
{{ formatNumber(disList[1].monthOne) }}%
</td>
<td v-if="disList[1].monthTwo != disList[0].monthTwo">
{{ formatNumber(disList[1].monthTwo) }}%
</td>
</tr>
<tr>
<th colspan="2">市况</th>
<td>{{ formatNumber(disList[2].budget) }}%</td>
<td>{{ formatNumber(disList[2].monthOne) }}%</td>
<td>{{ formatNumber(disList[2].monthTwo) }}%</td>
</tr>
<tr>
<th colspan="2">為替レート</th>
<td>{{ formatNumber(disList[3].budget) }}%</td>
<td>{{ formatNumber(disList[3].monthOne) }}%</td>
<td>{{ formatNumber(disList[3].monthTwo) }}%</td>
</tr>
</table>
<table class="data-table" border v-if="activeCard5NavKey === 'DSZ'">
<colgroup>
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
</colgroup>
<tr class="header">
<th rowspan="2" colspan="2">抛点</th>
<td colspan="3">
<div class="tab-header">
<div class="tb-title">DSZ</div>
<div class="tb-subtitle">发注金额:{{ dataDSZ }}百万元</div>
</div>
</td>
</tr>
<tr class="header">
<td>年初予算</td>
<!-- <td>{{month_2}}月</td> -->
<td>改订</td>
<td>{{ +month_2 }}月</td>
</tr>
<tr>
<th colspan="2">合计</th>
<td>{{ formatNumber(addDSZ1) }}%</td>
<td>{{ formatNumber(addDSZ2) }}%</td>
<td>{{ formatNumber(addDSZ3) }}%</td>
</tr>
<tr>
<th rowspan="2">C/D</th>
<th>交涉</th>
<td :rowspan="dszList[0].budget == dszList[1].budget ? '2' : ''">
{{ formatNumber(dszList[0].budget) }}%
</td>
<td :rowspan="dszList[0].monthOne == dszList[1].monthOne ? '2' : ''">
{{ formatNumber(dszList[0].monthOne) }}%
</td>
<td :rowspan="dszList[0].monthTwo == dszList[1].monthTwo ? '2' : ''">
{{ formatNumber(dszList[0].monthTwo) }}%
</td>
</tr>
<tr>
<th>THEME</th>
<td v-if="dszList[1].budget != dszList[0].budget">
{{ formatNumber(dszList[1].budget) }}%
</td>
<td v-if="dszList[1].monthOne != dszList[0].monthOne">
{{ formatNumber(dszList[1].monthOne) }}%
</td>
<td v-if="dszList[1].monthTwo != dszList[0].monthTwo">
{{ formatNumber(dszList[1].monthTwo) }}%
</td>
</tr>
<tr>
<th colspan="2">市况</th>
<td>{{ formatNumber(dszList[2].budget) }}%</td>
<td>{{ formatNumber(dszList[2].monthOne) }}%</td>
<td>{{ formatNumber(dszList[2].monthTwo) }}%</td>
</tr>
<tr>
<th colspan="2">為替レート</th>
<td>{{ formatNumber(dszList[3].budget) }}%</td>
<td>{{ formatNumber(dszList[3].monthOne) }}%</td>
<td>{{ formatNumber(dszList[3].monthTwo) }}%</td>
</tr>
</table>
<table class="data-table" border v-if="activeCard5NavKey === 'DISH'">
<colgroup>
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
<col width="20%" />
</colgroup>
<tr class="header">
<th rowspan="2" colspan="2">抛点</th>
<td colspan="3">
<div class="tab-header">
<div class="tb-title">DISH</div>
<div class="tb-subtitle">发注金额:{{ dataDISH }}百万元</div>
</div>
</td>
</tr>
<tr class="header">
<td>年初予算</td>
<!-- <td>{{month_2}}月</td> -->
<td>改订</td>
<td>{{ +month_3 }}月</td>
</tr>
<tr>
<th colspan="2">合计</th>
<td>{{ formatNumber(addDISH1) }}%</td>
<td>{{ formatNumber(addDISH2) }}%</td>
<td>{{ formatNumber(addDISH3) }}%</td>
</tr>
<tr>
<th rowspan="2">C/D</th>
<th>交涉</th>
<td :rowspan="dishList[0].budget == dishList[1].budget ? '2' : ''">
{{ formatNumber(dishList[0].budget) }}%
</td>
<td :rowspan="dishList[0].monthOne == dishList[1].monthOne ? '2' : ''">
{{ formatNumber(dishList[0].monthOne) }}%
</td>
<td :rowspan="dishList[0].monthTwo == dishList[1].monthTwo ? '2' : ''">
{{ formatNumber(dishList[0].monthTwo) }}%
</td>
</tr>
<tr>
<th>THEME</th>
<td v-if="dishList[1].budget != dishList[0].budget">
{{ formatNumber(dishList[1].budget) }}%
</td>
<td v-if="dishList[1].monthOne != dishList[0].monthOne">
{{ formatNumber(dishList[1].monthOne) }}%
</td>
<td v-if="dishList[1].monthTwo != dishList[0].monthTwo">
{{ formatNumber(dishList[1].monthTwo) }}%
</td>
</tr>
<tr>
<th colspan="2">市况</th>
<td>{{ formatNumber(dishList[2].budget) }}%</td>
<td>{{ formatNumber(dishList[2].monthOne) }}%</td>
<td>{{ formatNumber(dishList[2].monthTwo) }}%</td>
</tr>
<tr>
<th colspan="2">為替レート</th>
<td>{{ formatNumber(dishList[3].budget) }}%</td>
<td>{{ formatNumber(dishList[3].monthOne) }}%</td>
<td>{{ formatNumber(dishList[3].monthTwo) }}%</td>
</tr>
</table>
<!-- <img src="@/assets/images/xiaogouzi1.jpg" class="w-full h-full cover" v-if="activeCard5NavKey === 'DSZ'"/>
<img src="@/assets/images/xiaogouzi2.jpg" class="w-full h-full cover" v-if="activeCard5NavKey === 'DISH'"/> -->
<!-- <img src="@/assets/images/xiaogouzi3.jpg" class="w-full h-full cover" v-if="activeCard5NavKey === 'DIS'"/> -->
</div>
<!-- <div class="card_content">
<VChart ref="chartRef3" :option="chartOption3" autoresize />
</div> -->
</div>
<div class="card" @click="setModule('App_BCP', 'BCP')">
<div class="card_title cursor-pointer hover:underline">调达BCP管理</div>
<div class="card_sub-title">责任者:调达部 加工品变革T</div>
<div class="card_content">
<img src="@/assets/images/img-11.png" class="w-full h-full object-cover" />
</div>
</div>
<div class="card relative">
<!-- <img src="@/assets/images/img-42.png" class="absolute top-10px right-0" /> -->
<div class="card_title cursor-pointer hover:underline" @click="setModule('App_CSR', 'CSR')">
SCM碳中和活动
</div>
<div class="card_sub-title" @click="setModule('App_CSR', 'CSR')">
责任者:开发调达部 调达机能研究T
</div>
<div class="card_content px20px" @click="setModule('App_CSR', 'CSR')">
<img src="../../assets/images/scmtzh@2x.png" class="w-full h-96% cover" />
<!-- <div class="flex text-center">
<div class="bg-#F4F8FF text-#000 h30px w-full pt5px font-bold">F25碳减排目标 <el-icon class="!text-#004DE1">
<CaretTop />
</el-icon>30%</div>
<div class="bg-#F4F8FF text-#000 h30px w-full pt5px font-bold">F23碳减排目标 <el-icon class="!text-#004DE1">
<CaretTop />
</el-icon>15%</div>
</div>
<div class="flex text-center">
<div class=" text-#677BB2 h30px w-full pt5px font-500">供方碳排放推移表</div>
<div class=" text-#677BB2 h30px w-full pt5px font-500 flex"><span>重点供方碳排放情况</span>
<n-select v-model:value="selectData" :options="option" class="w80px !text-12px h20px mt--4px" :show-checkmark="false" size="tiny"
@update:value="thisSelect" />
</div>
</div>
<div class="flex w-full h-full">
<div class="w150px h-full">
<VChart :option="chartOption1" />
</div>
<div class="w280px h275px overflow-y-auto">
<VChart :option="chartOption2" />
</div>
</div> -->
<!-- <div class="mt25px text-#142142"> -->
<!-- <img src="@/assets/images/tiad@2x.png" class="w100% h96%" /> -->
<!-- <div class="text-#002fa7 text-18px">大金中国调达本部紧扣大金集团2050愿景中CO2“零”排放目标展开调达碳中和活动</div>
<AppNewsBox class="mt10px" text="脱碳素供应链管理(原材料排放,部品加工·部品运输过程中的排放)
空调解决方案(部品碳足迹管理,贩促活动,案例情报共享)" date="2023-05-22" /> -->
<!-- </div> -->
<!-- <div class="mt25px text-#142142">
<div class="text-#002fa7 text-18px">人材育成</div>
<AppNewsBox class="mt10px" text="FY22年度集团新年方针:领先时代的变化开创崭新的未来变化开 创崭新的未来" date="2023-05-22" />
</div>
<div class="mt25px text-#142142">
<div class="text-#002fa7 text-18px">工作模式变革</div>
<AppNewsBox class="mt10px" text="FY22年度集团新年方针:领先时代的变化开创崭新的未来变化开 创崭新的未来" date="2023-05-22" />
</div> -->
</div>
</div>
<div class="card topics">
<div class="card_title cursor-pointer hover:underline">重点Theme取组</div>
<div class="card_content p20px pt10px">
<div
class="w-full h-full flex flex-wrap content-between justify-between text-18px font-bold"
>
<div class="item !h-188px cursor-pointer" @click="setModule('App_Quality', 'Quality')">
<div class="item_title hover:underline">品质</div>
<div class="item_sub-title">责任者:调达部 企画管理T</div>
<!-- <img src="@/assets/images/img-45.svg" class="item_img pb13px pr20px" /> -->
<img src="@/assets/images/img-41.png" class="item_img b !bottom--20px" />
</div>
<div class="item !h-188px cursor-pointer" @click="setModule('App_Lab', 'Diffspace')">
<div class="item_title hover:underline">AI差别化LAB</div>
<div class="item_sub-title">责任者:开发调达部</div>
<div class="item_sub-title">差别化研究T</div>
<!-- <img src="@/assets/images/img-43.png" class="item_img" /> -->
<img src="./images/LAB.pic.png" class="item_img w-200px right--10px" />
</div>
<div
class="item !w-full flex flex-col cursor-pointer"
@click="push({ name: 'StrategicPlanning' })"
>
<div class="item_title hover:underline">战略企划</div>
<div class="item_sub-title">责任者:调达本部 管理G</div>
<!-- <img src="./images/home-1.svg" /> -->
<div class="flex mt20px items-center justify-center">
<div class="bg-#0038BE w210px px15px py7px rounded-30px">
<img src="@/assets/images/biaoq2@2x.png" class="w25px h21px" />
重点Theme管理
</div>
<span class="text-#000 font-thin underline-text mx23px hover:underline-solid"
>开发调达部</span
>
<span class="text-#000 font-thin underline-text hover:underline-solid">调达部</span>
<!-- <VChart :option="chartOption2" autoresize /> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<style scoped lang="less">
.tab-header {
display: flex;
.tb-title {
margin: 0 auto;
}
.tb-subtitle {
margin-right: 8px;
font-size: 0.75em;
}
}
.table-container {
padding: 0 36px;
padding-top: 40px;
position: relative;
}
.data-table {
width: 100%;
color: #808696;
border-collapse: collapse;
line-height: 2.3rem;
text-align: center;
border-color: #e0e0e0;
background: white;
}
.table-container .abs-top {
position: absolute;
left: 36px;
top: 4px;
}
.data-table tr:nth-child(2n + 1) {
background: #f9f9f9;
}
.data-table th {
background: #f4f5ff;
color: #142142;
}
.data-table tr.header,
.data-table tr.header th {
background: #417bef;
color: white;
}
::-webkit-scrollbar {
width: 1px;
}
::v-deep .n-base-select .n-base-select-option {
font-size: 12px; /* 设置字体大小 */
}
.naive-select .n-select-dropdown {
font-size: 12px; /* 设置字体大小 */
}
.underline-text {
border-bottom: 1px solid black;
padding-bottom: 2px;
}
.icoT {
padding: 5px;
color: #fff;
background-color: #002aae;
border-radius: 5px;
}
.top {
position: absolute;
right: 30px;
top: -70px;
}
.page-wrapper {
.card {
// width: 480px;
// height: 428px;
width: 480px;
height: 395px;
border-radius: 18px;
overflow: hidden;
background-color: #fff;
// border: 1px solid #e7ebf5;
box-shadow: 1px 2px 12px rgba(14, 86, 221, 0.32);
position: relative;
display: flex;
flex-direction: column;
position: relative;
&::after {
content: ' ';
background-image: url('@/assets/images/bg-card.svg');
pointer-events: none;
display: block;
width: 100%;
height: 127px;
background-size: cover;
position: absolute;
left: 0;
top: -1px;
}
.card_title {
flex-shrink: 0;
font-size: 28px;
color: #142142;
padding: 20px;
padding-bottom: 0;
}
.card_sub-title {
color: rgba(128, 134, 150, 0.8);
font-size: 16px;
padding: 0 20px;
padding-bottom: 0;
margin-top: 10px;
}
.card_nav1 {
background-image: url('@/assets/images/bg-card-nav.svg');
}
.card_nav2 {
background-image: url('@/assets/images/youj@2x.png');
}
.card_nav {
position: absolute;
top: 0;
right: 0;
width: 276px;
height: 66px;
background-position: top right;
background-repeat: no-repeat;
background-size: contain;
font-size: 20px;
color: #fff;
display: flex;
justify-content: space-between;
align-items: flex-end;
padding-left: 38px;
padding-right: 22px;
padding-bottom: 20px;
.card_nav_item {
width: 80px;
height: 36px;
text-align: center;
padding-top: 8px;
cursor: pointer;
&.active {
color: #032fa0;
background-image: url('@/assets/images/bg-card-nav-item.svg');
background-position: bottom;
background-repeat: no-repeat;
background-size: contain;
}
}
}
.card_content {
flex: 1;
margin-top: 10px;
}
}
.topics {
.item {
border-radius: 8px;
width: 210px;
height: 155px;
box-shadow: inset 1.4px 1.4px 0px 0px rgba(255, 255, 255, 0.004);
overflow: hidden;
background-image: url('@/assets/images/bg-card4.svg');
background-position: -2px -2px;
background-repeat: no-repeat;
background-size: 215px 165px;
position: relative;
.item_title {
padding-left: 16px;
padding-top: 22px;
color: #002fa7;
position: relative;
// z-index: 9;
}
.item_sub-title {
color: rgba(128, 134, 150, 0.8);
font-size: 12px;
font-weight: normal;
padding: 0 16px;
padding-bottom: 0;
margin-top: 10px;
z-index: 9;
}
.item_img {
position: absolute;
bottom: -10px;
right: 0;
// z-index: 5;
transition: transform 0.3s;
&:hover {
transform: scale(1.2);
}
}
}
}
.news {
.card_content {
padding: 20px;
padding-top: 0;
}
.news_card {
// width: 442px;
height: 180px;
padding: 16px;
font-size: 14px;
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;
}
}
}
</style>

View File

@ -13,8 +13,8 @@ import { Swiper, SwiperSlide } from 'swiper/vue'
import { Autoplay, Navigation, Pagination, A11y } from 'swiper' import { Autoplay, Navigation, Pagination, A11y } from 'swiper'
const modules = [Autoplay, Pagination, Navigation, A11y] const modules = [Autoplay, Pagination, Navigation, A11y]
const store = useUserStore() const store = useUserStore()
const userCode = ['admin', 'bcp_dandnag', 'tech_service'].includes( const userCode = ['admin', 'bcp_dandnag', 'tech_service'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
// import { da } from 'element-plus/es/locale/index.js' // import { da } from 'element-plus/es/locale/index.js'
@ -166,20 +166,14 @@ const download = async (row) => {
return return
} }
let { briefingPath, filePath } = row let { briefingPath, filePath } = row
console.log( console.log('🚀 ~ file: BCP.vue:169 ~ briefingPath ,filePath:', briefingPath, filePath)
'🚀 ~ file: BCP.vue:169 ~ briefingPath ,filePath:',
briefingPath,
filePath
)
if (!briefingPath && !filePath) { if (!briefingPath && !filePath) {
message.info('没有可预览文件!') message.info('没有可预览文件!')
return return
} }
srcType.value = getLastSubstring(briefingPath || filePath) srcType.value = getLastSubstring(briefingPath || filePath)
if ( if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
let url = 'https://view.xdocin.com/view?src=' + (briefingPath || filePath) let url = 'https://view.xdocin.com/view?src=' + (briefingPath || filePath)
@ -188,14 +182,7 @@ const download = async (row) => {
window.open( window.open(
url, url,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
// window.open( // window.open(
// briefingPath, // briefingPath,
@ -210,9 +197,7 @@ const download = async (row) => {
// 0 // 0
// ) // )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
@ -308,11 +293,7 @@ const isChart = (content) => {
</el-icon> </el-icon>
</div> </div>
<div <div class="new-content overflow-hidden" id="newContent" v-if="dataA.length > 0">
class="new-content overflow-hidden"
id="newContent"
v-if="dataA.length > 0"
>
<!-- <div v-for="it in dataA" class="new-item h20px mb-10px overflow-hidden" :key="it"> <!-- <div v-for="it in dataA" class="new-item h20px mb-10px overflow-hidden" :key="it">
<div class="news1 w340px h38px text-16px lh-22px" @click="showDetail(it, 1)"> <div class="news1 w340px h38px text-16px lh-22px" @click="showDetail(it, 1)">
<span v-if="it.status === 'New'" class="tit bg-#2CBA06" style="color: white">{{ it.status }}:</span> <span v-if="it.status === 'New'" class="tit bg-#2CBA06" style="color: white">{{ it.status }}:</span>
@ -335,8 +316,7 @@ const isChart = (content) => {
}" }"
:cell-style="{}" :cell-style="{}"
> >
<el-table-column prop="" label="时间" width="70px"> <el-table-column prop="" label="时间" width="70px"> </el-table-column>
</el-table-column>
<el-table-column prop="" label="情报内容"> </el-table-column> <el-table-column prop="" label="情报内容"> </el-table-column>
<el-table-column prop="" label="风险评估"> </el-table-column> <el-table-column prop="" label="风险评估"> </el-table-column>
</el-table> </el-table>
@ -417,11 +397,7 @@ const isChart = (content) => {
<template #default="scope"> <template #default="scope">
<div <div
class="h-45px p0 m0" class="h-45px p0 m0"
:class=" :class="isChart(scope.row.riskEstimation) ? 'two-line-header ' : ''"
isChart(scope.row.riskEstimation)
? 'two-line-header '
: ''
"
:title="scope.row.riskEstimation" :title="scope.row.riskEstimation"
> >
{{ scope.row.riskEstimation }} {{ scope.row.riskEstimation }}
@ -432,10 +408,7 @@ const isChart = (content) => {
</div> </div>
<div v-if="dataA.length == 0" class="empty-content"></div> <div v-if="dataA.length == 0" class="empty-content"></div>
</div> </div>
<img <img src="./images/yojjt@2x.png" class="w-18px h18px absolute left-49.5% top-20% ml--8px" />
src="./images/yojjt@2x.png"
class="w-18px h18px absolute left-49.5% top-20% ml--8px"
/>
<div class="summary absolute"> <div class="summary absolute">
<!-- <div class="arrow"></div> --> <!-- <div class="arrow"></div> -->
<div <div
@ -492,10 +465,7 @@ const isChart = (content) => {
</div> --> </div> -->
<swiper-slide v-for="i in dataC" :key="i.id"> <swiper-slide v-for="i in dataC" :key="i.id">
<div class="py22px item-row items-center flex"> <div class="py22px item-row items-center flex">
<div <div class="inline-flex cur_p file-icon text-16px" @click="download(i)">
class="inline-flex cur_p file-icon text-16px"
@click="download(i)"
>
{{ i.title }} {{ i.title }}
</div> </div>
</div> </div>
@ -514,12 +484,7 @@ const isChart = (content) => {
运营守则 运营守则
</div> </div>
<div class="operate-content overflow-y-auto" v-if="dataB.length > 0"> <div class="operate-content overflow-y-auto" v-if="dataB.length > 0">
<div <div v-if="dataB" v-for="it in dataB" class="py12px h34px overflow-hidden" :key="it">
v-if="dataB"
v-for="it in dataB"
class="py12px h34px overflow-hidden"
:key="it"
>
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
<div <div
@ -542,7 +507,7 @@ const isChart = (content) => {
<div class="gen w293px h92px absolute"> <div class="gen w293px h92px absolute">
<div class="ring-gen"></div> <div class="ring-gen"></div>
<div class="text-23px text-#00E4FF font-500 gen-title">供方SCM</div> <div class="text-23px text-#00E4FF font-500 gen-title">供方SCM</div>
<div class="gen-content overflow-y-auto" v-if="true"> <div class="gen-content overflow-y-auto relative" v-if="true">
<!-- <div v-if="dataC" v-for="it in dataC" class="py8px h28px overflow-hidden" :key="it"> <!-- <div v-if="dataC" v-for="it in dataC" class="py8px h28px overflow-hidden" :key="it">
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
@ -556,6 +521,14 @@ const isChart = (content) => {
</n-popover> </n-popover>
</div> --> </div> -->
<img src="./images/ss.png" class="w-388px" /> <img src="./images/ss.png" class="w-388px" />
<div
class="absolute flex flex-col w-97% rounded-md overflow-hidden h-full z-200 top-0 left-0 right-50px text-center bg-red justify-center items-center"
style="background-color: rgba(255, 255, 255, 0.9)"
>
<img src="@/assets/images/chah.png" />
<br />
<div class="text-#5683DB text-36px">做成中,敬请期待</div>
</div>
</div> </div>
<div v-else class="empty-content"> <div v-else class="empty-content">
<div class="content"></div> <div class="content"></div>
@ -571,10 +544,7 @@ const isChart = (content) => {
> >
BCP情报 BCP情报
</div> </div>
<div <div class="supplier-content overflow-y-auto text-16px" v-if="dataD.length > 0">
class="supplier-content overflow-y-auto text-16px"
v-if="dataD.length > 0"
>
<s-tree <s-tree
:data="dataD" :data="dataD"
@changeIsShow="changeIsShowFn" @changeIsShow="changeIsShowFn"

View File

@ -7,69 +7,66 @@
</li> </li>
<div id="earth" class="earth"></div> <div id="earth" class="earth"></div>
</ul> </ul>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const numCards = ref(9)
const numCards = ref(9); const mouseX = ref(0)
const mouseX = ref(0); const mouseY = ref(0)
const mouseY = ref(0); const isDragging = ref(false)
const isDragging = ref(false);
const handleMouseMove = (event) => { const handleMouseMove = (event) => {
const rect = event.currentTarget.getBoundingClientRect(); const rect = event.currentTarget?.getBoundingClientRect()
mouseX.value = event.clientX - rect.left; mouseX.value = event.clientX - rect.left
mouseY.value = event.clientY - rect.top; mouseY.value = event.clientY - rect.top
}; }
const updateRotation = () => { const updateRotation = () => {
const cardRefs = ref([]); const cardRefs = ref([])
const earth = ref(null); const earth = ref(null)
onMounted(() => { onMounted(() => {
cardRefs.value = document.querySelectorAll('#ul1 li'); cardRefs.value = document.querySelectorAll('#ul1 li')
earth.value = document.getElementById('earth'); earth.value = document.getElementById('earth')
setInterval(() => { setInterval(() => {
cardRefs.value.forEach((card, index) => { cardRefs.value.forEach((card, index) => {
const d = (360 / numCards.value) * index + mouseX.value / 10; const d = (360 / numCards.value) * index + mouseX.value / 10
card.style.transform = `rotateY(${d}deg) translateZ(350px)`; card.style.transform = `rotateY(${d}deg) translateZ(350px)`
if (Math.abs(d) < 30) { if (Math.abs(d) < 30) {
card.style.zIndex = 2; card.style.zIndex = 2
if (earth.value) { if (earth.value) {
earth.value.style.transform = 'translateZ(-400px)'; earth.value.style.transform = 'translateZ(-400px)'
} }
} else { } else {
card.style.zIndex = -1; card.style.zIndex = -1
if (earth.value) { if (earth.value) {
earth.value.style.transform = 'translateZ(400px)'; earth.value.style.transform = 'translateZ(400px)'
} }
} }
}); })
}, 30); }, 30)
}); })
}; }
const autoRotate = () => { const autoRotate = () => {
const interval = setInterval(() => { const interval = setInterval(() => {
if (!isDragging.value) { if (!isDragging.value) {
// //
rotationY.value += 1; rotationY.value += 1
} }
}, 30); }, 30)
onMounted(() => { onMounted(() => {
clearInterval(interval); clearInterval(interval)
}); })
}; }
updateRotation(); updateRotation()
autoRotate(); autoRotate()
</script> </script>
<style lang="less"> <style lang="less">
* { * {
margin: 0; margin: 0;
@ -112,7 +109,6 @@ body {
/* font-size: 30px; */ /* font-size: 30px; */
p { p {
font-size: 15px; font-size: 15px;
} }
} }
@ -137,4 +133,3 @@ body {
transition: transform 0.5s ease; transition: transform 0.5s ease;
} }
</style> </style>

View File

@ -3,11 +3,12 @@
<ul id="ul1"> <ul id="ul1">
<li class="ation-li" v-for="(item, index) in props.dataE" :key="index" ref="cards"> <li class="ation-li" v-for="(item, index) in props.dataE" :key="index" ref="cards">
<div class="pt10px pb10px text-15px title">{{ item.title }}</div> <div class="pt10px pb10px text-15px title">{{ item.title }}</div>
<div class="text-12px leading-15px sub-title" @click="downloadHandle(item)">{{item.content}}</div> <div class="text-12px leading-15px sub-title" @click="downloadHandle(item)">
{{ item.content }}
</div>
</li> </li>
<div id="earth" class="earth"></div> <div id="earth" class="earth"></div>
</ul> </ul>
</div> </div>
</template> </template>
@ -19,86 +20,80 @@ const downloadHandle = (item) => {
emit('downloadHandle', item, 5) emit('downloadHandle', item, 5)
} }
const props = defineProps({
const props = defineProps({// //
dataE: { dataE: {
type: Array, // type: Array, //
default:[],// default: [] //
} }
}) })
const numCards = ref(10)
const mouseX = ref(0)
const numCards = ref(10); const mouseY = ref(0)
const mouseX = ref(0); const isDragging = ref(false)
const mouseY = ref(0);
const isDragging = ref(false);
const handleMouseMove = (event) => { const handleMouseMove = (event) => {
const rect = event.currentTarget.getBoundingClientRect(); const rect = event.currentTarget?.getBoundingClientRect()
mouseX.value = event.clientX - rect.left; mouseX.value = event.clientX - rect.left
mouseY.value = event.clientY - rect.top; mouseY.value = event.clientY - rect.top
}; }
watch( watch(
() => props.dataE, () => props.dataE,
(newValue, oldValue) => { (newValue, oldValue) => {
nextTick(() => { nextTick(() => {
updateRotation(); updateRotation()
// autoRotate(); // autoRotate();
}) })
} }
) )
const updateRotation = () => { const updateRotation = () => {
const cardRefs = ref([]); const cardRefs = ref([])
const earth = ref(null); const earth = ref(null)
cardRefs.value = document.querySelectorAll('#ul1 li'); cardRefs.value = document.querySelectorAll('#ul1 li')
earth.value = document.getElementById('earth'); earth.value = document.getElementById('earth')
console.log(cardRefs, 1111) console.log(cardRefs, 1111)
setInterval(() => { setInterval(() => {
numCards.value = cardRefs.value.length; numCards.value = cardRefs.value.length
cardRefs.value.forEach((card, index) => { cardRefs.value.forEach((card, index) => {
const d = (360 / numCards.value) * index + mouseX.value / 10; const d = (360 / numCards.value) * index + mouseX.value / 10
let radian = d * Math.PI / 180; let radian = (d * Math.PI) / 180
let opacity = (Math.cos(radian) + 1) / 2; let opacity = (Math.cos(radian) + 1) / 2
card.style.transform = `rotateY(${d}deg) translateZ(280px) rotateY(${-d}deg)`; card.style.transform = `rotateY(${d}deg) translateZ(280px) rotateY(${-d}deg)`
card.style.opacity = opacity * opacity; card.style.opacity = opacity * opacity
if (Math.abs(d) < 30) { if (Math.abs(d) < 30) {
card.style.zIndex = 2; card.style.zIndex = 2
if (earth.value) { if (earth.value) {
earth.value.style.transform = 'translateZ(-400px)'; earth.value.style.transform = 'translateZ(-400px)'
} }
} else { } else {
card.style.zIndex = -1; card.style.zIndex = -1
if (earth.value) { if (earth.value) {
earth.value.style.transform = 'translateZ(400px)'; earth.value.style.transform = 'translateZ(400px)'
} }
} }
}); })
}, 30); }, 30)
}; }
const autoRotate = () => { const autoRotate = () => {
const interval = setInterval(() => { const interval = setInterval(() => {
if (!isDragging.value) { if (!isDragging.value) {
// //
mouseY.value += 1; mouseY.value += 1
} }
}, 30); }, 30)
onMounted(() => { onMounted(() => {
clearInterval(interval); clearInterval(interval)
}); })
}; }
</script> </script>
<style lang="less"> <style lang="less">
* { * {
margin: 0; margin: 0;
@ -135,7 +130,7 @@ body {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
// background: rgba(14, 116, 238, 0.8); // background: rgba(14, 116, 238, 0.8);
background-image: url("./images/biaoq.png"); background-image: url('./images/biaoq.png');
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
line-height: 10px; line-height: 10px;
text-align: center; text-align: center;
@ -143,7 +138,6 @@ body {
/* font-size: 30px; */ /* font-size: 30px; */
p { p {
font-size: 15px; font-size: 15px;
} }
} }
@ -176,7 +170,7 @@ body {
color: white; color: white;
} }
.sub-title { .sub-title {
color: #00E4FF; color: #00e4ff;
text-align: start; text-align: start;
} }
} }

View File

@ -6,7 +6,15 @@ import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { getBPCUser, BPCSaveUser, getBPCEditList,updateBPC,updateBPCOne,delBPCActList, BPCDownload } from '@/api/daikin/base' import {
getBPCUser,
BPCSaveUser,
getBPCEditList,
updateBPC,
updateBPCOne,
delBPCActList,
BPCDownload
} from '@/api/daikin/base'
const message = useMessage() const message = useMessage()
const store = useUserStore() const store = useUserStore()
@ -24,7 +32,6 @@ const editC = ref()
const editD = ref() const editD = ref()
const editE = ref() const editE = ref()
const shomkA = ref(false) const shomkA = ref(false)
const shomkB = ref(false) const shomkB = ref(false)
const shomkC = ref(false) const shomkC = ref(false)
@ -36,8 +43,8 @@ async function setDataFiles(arr, _row) {
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -47,61 +54,68 @@ async function setDataFiles(arr, _row) {
async function getDataA() { async function getDataA() {
const { rows: dataArr } = await getBPCEditList({ moduleId: 1 }) const { rows: dataArr } = await getBPCEditList({ moduleId: 1 })
dataA.value = dataArr dataA.value = dataArr
setDataFiles(dataArr); setDataFiles(dataArr)
} }
async function getDataB() { async function getDataB() {
const { rows: dataBrr } = await getBPCEditList({ moduleId: 2 }) const { rows: dataBrr } = await getBPCEditList({ moduleId: 2 })
dataB.value = dataBrr dataB.value = dataBrr
setDataFiles(dataBrr); setDataFiles(dataBrr)
} }
async function getDataC() { async function getDataC() {
const { rows: dataCrr } = await getBPCEditList({ moduleId: 3 }) const { rows: dataCrr } = await getBPCEditList({ moduleId: 3 })
dataC.value = dataCrr dataC.value = dataCrr
setDataFiles(dataCrr); setDataFiles(dataCrr)
} }
async function getDataD() { async function getDataD() {
const { rows: dataDrr } = await getBPCEditList({ moduleId: 4 }) const { rows: dataDrr } = await getBPCEditList({ moduleId: 4 })
dataD.value = dataDrr dataD.value = dataDrr
setDataFiles(dataDrr); setDataFiles(dataDrr)
} }
async function getDataE() { async function getDataE() {
const { rows: dataErr } = await getBPCEditList({ moduleId: 5 }) const { rows: dataErr } = await getBPCEditList({ moduleId: 5 })
dataE.value = dataErr dataE.value = dataErr
setDataFiles(dataErr); setDataFiles(dataErr)
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
getDataB(); getDataB()
getDataC(); getDataC()
getDataD(); getDataD()
getDataE(); getDataE()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { if (index > -1) {
return title.slice(0, index - 1); return title.slice(0, index - 1)
} }
return title; return title
} }
async function onSubmitA(row: { filePathList?: any; id?: any; indexId?: any; title?: any; proportion?: any; partSum?: any; badSum?: any }) { async function onSubmitA(row: {
filePathList?: any
id?: any
indexId?: any
title?: any
proportion?: any
partSum?: any
badSum?: any
}) {
console.log(row, 444) console.log(row, 444)
const { id, status, title, type } = row const { id, status, title, type } = row
let moduleId = 1; let moduleId = 1
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -112,27 +126,29 @@ async function onSubmitA(row: { filePathList?: any; id?: any; indexId?: any; tit
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
} else {
message.error(msg)
}
shomkA.value = false shomkA.value = false
getDataA(); getDataA()
} }
async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) { async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 2; let moduleId = 2
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -143,28 +159,30 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
} else {
message.error(msg)
}
shomkB.value = false shomkB.value = false
getDataB(); getDataB()
} }
async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) { async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 3; let moduleId = 3
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -175,26 +193,26 @@ async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; titl
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else message.error(msg) message.success('修改成功!')
} else message.error(msg)
shomkC.value = false shomkC.value = false
getDataC() getDataC()
} }
async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) { async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 4; let moduleId = 4
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -205,8 +223,9 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.success('修改成功!')
} else {
message.error(msg) message.error(msg)
} }
shomkD.value = false shomkD.value = false
@ -214,18 +233,17 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
} }
async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) { async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) {
const { id, title, type } = row const { id, title, type } = row
let moduleId = 5; let moduleId = 5
let sendData = [] let sendData = []
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => { row.fileList.map((item) => {
let obj = { id, status, moduleId }; let obj = { id, status, moduleId }
if (item.response) { if (item.response) {
obj.filePath = item.response.url; obj.filePath = item.response.url
obj.title = title || computedName(item.response.originalFilename); obj.title = title || computedName(item.response.originalFilename)
} } else {
else { obj.filePath = item.url
obj.filePath = item.url; obj.title = title || computedName(item.originalFilename)
obj.title = title || computedName(item.originalFilename);
} }
sendData.push(obj) sendData.push(obj)
}) })
@ -236,31 +254,33 @@ async function onSubmitE(row: { filePathList?: any; id?: any; title?: any }) {
} else { } else {
var { code, msg } = await updateBPCOne(sendData[0]) var { code, msg } = await updateBPCOne(sendData[0])
} }
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.success('修改成功!')
} else {
message.error(msg) message.error(msg)
} }
shomkE.value = false shomkE.value = false
getDataE() getDataE()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
editA.value = { editA.value = {
type: type, type: type,
status: '紧急', status: '紧急',
title: '', title: '',
fileList: [], fileList: []
} }
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.type = type; editA.value.type = type
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editA.value.fileList = [res.data] // editA.value.fileList = [res.data]
// }) // })
@ -269,17 +289,19 @@ const handleEditB = (type: string, row: any) => {
editB.value = { editB.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkB.value = true shomkB.value = true
if (!row) return if (!row) return
editB.value = row editB.value = row
editB.value.type = type; editB.value.type = type
editB.value.fileList = [{ editB.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// editB.value.fileList = [row.filePath] // editB.value.fileList = [row.filePath]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editB.value.fileList = [res.data] // editB.value.fileList = [res.data]
@ -289,17 +311,19 @@ const handleEditC = (type: string, row: any) => {
editC.value = { editC.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkC.value = true shomkC.value = true
if (!row) return if (!row) return
editC.value = row editC.value = row
editC.value.type = type; editC.value.type = type
editC.value.fileList = [{ editC.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// editC.value.fileList = [row.filePath] // editC.value.fileList = [row.filePath]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editC.value.fileList = [res.data] // editC.value.fileList = [res.data]
@ -309,17 +333,19 @@ const handleEditD = (type: string, row: any) => {
editD.value = { editD.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkD.value = true shomkD.value = true
if (!row) return if (!row) return
editD.value = row editD.value = row
editD.value.type = type; editD.value.type = type
editD.value.fileList = [{ editD.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editD.value.fileList = [res.data] // editD.value.fileList = [res.data]
// }) // })
@ -328,67 +354,82 @@ const handleEditE = (type: string, row: any) => {
editE.value = { editE.value = {
type: type, type: type,
title: '', title: '',
fileList: [], fileList: []
} }
shomkE.value = true shomkE.value = true
if (!row) return if (!row) return
editE.value = row editE.value = row
editE.value.type = type; editE.value.type = type
editE.value.fileList = [{ editE.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
// BPCDownload({ id: row.id }).then(res => { // BPCDownload({ id: row.id }).then(res => {
// editE.value.fileList = [res.data] // editE.value.fileList = [res.data]
// }) // })
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
async function handleDeleteB(index: number, row: any) { async function handleDeleteB(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
} else {
message.error(msg)
}
getDataB(); getDataB()
} }
async function handleDeleteC(index: number, row: any) { async function handleDeleteC(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
} else {
message.error(msg)
}
getDataC() getDataC()
} }
async function handleDeleteD(index: number, row: any) { async function handleDeleteD(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataD(); } else {
message.error(msg)
}
getDataD()
} }
async function handleDeleteE(index: number, row: any) { async function handleDeleteE(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await delBPCActList({ id }) const { code, msg } = await delBPCActList({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataE(); } else {
message.error(msg)
}
getDataE()
} }
const activeName = ref("first") const activeName = ref('first')
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -398,11 +439,10 @@ async function getUser(moduleId: any) {
flg.value = moduleId flg.value = moduleId
const { data: userArr } = await getBPCUser({ moduleId }) const { data: userArr } = await getBPCUser({ moduleId })
setUserList.value = userArr setUserList.value = userArr
} }
// //
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
// userList.value = multipleSelection // userList.value = multipleSelection
@ -421,6 +461,35 @@ async function getUser(moduleId: any) {
showModal.value = data showModal.value = data
} }
const pickerOptions = {
disabledDate(time) {
return time.getTime() > Date.now()
},
shortcuts: [
{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date())
}
},
{
text: '昨天',
onClick(picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
picker.$emit('pick', date)
}
},
{
text: '一周前',
onClick(picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', date)
}
}
]
}
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -433,20 +502,35 @@ async function getUser(moduleId: any) {
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> --> <!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
<div class="text-36px text-#000">BCP内容管理</div> <div class="text-36px text-#000">BCP内容管理</div>
</div> </div>
<el-tabs type="card" v-model="activeName" class="demo-tabs mt30px text-20px" @tab-click="handleClick"> <el-tabs
type="card"
v-model="activeName"
class="demo-tabs mt30px text-20px"
@tab-click="handleClick"
>
<el-tab-pane name="first"> <el-tab-pane name="first">
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<span class="text-20px">BCP今日简报模块</span> <span class="text-20px">BCP今日简报模块</span>
</span> </span>
</template> </template>
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA('add')" class="my20px">BCP今日简报新增</el-button> <el-button type="primary" @click="handleEditA('add')" class="my20px"
>BCP今日简报新增</el-button
>
<el-button type="primary" @click="getUser(1)"> </el-button> <el-button type="primary" @click="getUser(1)"> </el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="级别" prop="status" /> <el-table-column label="级别" prop="status" />
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -462,7 +546,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -476,10 +565,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditB('add')" class="my20px">运营守则新增</el-button> <el-button type="primary" @click="handleEditB('add')" class="my20px"
>运营守则新增</el-button
>
<el-button type="primary" @click="getUser(2)"> </el-button> <el-button type="primary" @click="getUser(2)"> </el-button>
<el-table :data="dataB" style="width: 95%" :header-cell-style="{ background:'#2A7BF7',color:'#fff',height:'60px',textAlign: 'center','font-size':'24px'}" :cell-style="{ 'text-align': 'center'}"> <el-table
:data="dataB"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList" > <!-- <el-table-column label="文件列表" prop="filePathList" >
<template #default="scope"> <template #default="scope">
@ -493,7 +594,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditB('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditB('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteB(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteB(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -503,17 +609,27 @@ async function getUser(moduleId: any) {
<el-tab-pane name="third"> <el-tab-pane name="third">
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<span class="text-20px">供方SCM模块</span> <span class="text-20px">供方SCM模块</span>
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditC('add')" class="my20px">供方SCM新增</el-button> <el-button type="primary" @click="handleEditC('add')" class="my20px"
>供方SCM新增</el-button
>
<el-button type="primary" @click="getUser(3)"> </el-button> <el-button type="primary" @click="getUser(3)"> </el-button>
<el-table :data="dataC" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataC"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="fileList"> <!-- <el-table-column label="文件列表" prop="fileList">
<template #default="scope"> <template #default="scope">
@ -527,7 +643,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditC('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditC('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteC(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteC(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -541,13 +662,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditD('add')" class="my20px">BCP情报新增</el-button> <el-button type="primary" @click="handleEditD('add')" class="my20px"
>BCP情报新增</el-button
>
<el-button type="primary" @click="getUser(4)"> </el-button> <el-button type="primary" @click="getUser(4)"> </el-button>
<el-table :data="dataD" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataD"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList"> <!-- <el-table-column label="文件列表" prop="filePathList">
<template #default="scope"> <template #default="scope">
@ -561,7 +691,12 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditD('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditD('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteD(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteD(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -575,13 +710,22 @@ async function getUser(moduleId: any) {
</span> </span>
</template> </template>
<div> <div>
<el-button type="primary" @click="handleEditE('add')" class="my20px">底部滚动新增</el-button> <el-button type="primary" @click="handleEditE('add')" class="my20px"
>底部滚动新增</el-button
>
<el-button type="primary" @click="getUser(5)"> </el-button> <el-button type="primary" @click="getUser(5)"> </el-button>
<el-table :data="dataE" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataE"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <el-table-column label="文件列表" prop="filePathList"> <!-- <el-table-column label="文件列表" prop="filePathList">
<template #default="scope"> <template #default="scope">
@ -595,15 +739,19 @@ async function getUser(moduleId: any) {
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditE('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditE('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteE(scope.$index, scope.row)">删除</el-button> <el-button
size="small"
type="danger"
@click="handleDeleteE(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-form-item> <el-form-item> </el-form-item>
</el-form-item>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -616,19 +764,26 @@ async function getUser(moduleId: any) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item v-if="editA.type !== 'add'" label="标题"> <el-form-item v-if="editA.type !== 'add'" label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>
@ -639,15 +794,22 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editB.type !== 'add'" label="标题"> <el-form-item v-if="editB.type !== 'add'" label="标题">
<el-input v-model="editB.title" /> <el-input v-model="editB.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editB.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editB.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editB.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editB.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitB(editB)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitB(editB)"></el-button>
</div> </div>
@ -658,15 +820,22 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editC.type !== 'add'" label="标题"> <el-form-item v-if="editC.type !== 'add'" label="标题">
<el-input v-model="editC.title" /> <el-input v-model="editC.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editC.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editC.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editC.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editC.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitC(editC)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitC(editC)"></el-button>
</div> </div>
@ -677,16 +846,52 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editD.type !== 'add'" label="标题"> <el-form-item v-if="editD.type !== 'add'" label="标题">
<el-input v-model="editD.title" /> <el-input v-model="editD.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editD.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editD.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editD.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editD.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="是否置顶">
<el-switch
v-model="editD.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editD.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editD.isPublish == 1">
<el-date-picker
v-model="editD.publishTime"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitD(editD)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitD(editD)"></el-button>
</div> </div>
@ -697,16 +902,53 @@ async function getUser(moduleId: any) {
<el-form-item v-if="editE.type !== 'add'" label="标题"> <el-form-item v-if="editE.type !== 'add'" label="标题">
<el-input v-model="editE.title" /> <el-input v-model="editE.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editE.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editE.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editE.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editE.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editE.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editE.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editE.isPublish == 1">
<el-date-picker
v-model="editE.publishTime"
align="right"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitE(editE)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitE(editE)"></el-button>
</div> </div>

File diff suppressed because it is too large Load Diff

479
src/views/home/cd/CD-bak1.vue Executable file
View File

@ -0,0 +1,479 @@
<!-- C/D数据 -->
<script setup lang="ts">
import { hisYearData, curYearData, useChart3, defineCompont } from './CdData'
import { treeList } from '@/api/daikin/base'
import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import CDSide from './CDSide.vue'
import { NForm, NFormItem, useMessage, NSelect, NButton } from 'naive-ui'
import develop from '../develop.vue'
import type { FormInst } from 'naive-ui'
const { push } = useRouter()
const message = useMessage()
const radioss = ref(2020)
const { chartRef: chartRef1, option: chartOption1 } = curYearData()
const { chartRef: chartRef2, option: chartOption2, state } = hisYearData()
const { chartRef: chart1, option: chartOp1 } = useChart3()
const { clickData, toYearData, hisData } = defineCompont()
const treeData = ref<any>()
async function getData() {
const { data } = await treeList()
const dataList = transformData(data)
console.log(dataList)
treeData.value = dataList
}
function transformData(data, parentKey = '') {
let keyIndex = 1
return data.map((item) => {
const key = parentKey ? `${parentKey}-${keyIndex}` : `${item.id}`
keyIndex++
const transformedItem = {
label: item.name,
key: key,
level: parentKey ? parentKey.split('-').length + 1 : 1,
id: item.id
}
const treeList = transformTreeList(item.treeList, key)
if (treeList.length > 0) {
transformedItem.treeList = treeList
}
return transformedItem
})
}
function transformTreeList(treeList, parentKey) {
if (!treeList || treeList.length === 0) {
return []
}
let keyIndex = 1
return treeList.map((item) => {
const key = `${parentKey.split('-').length + 1}-${keyIndex}`
keyIndex++
const transformedItem = {
label: item.name,
key: key,
level: parentKey.split('-').length + 1,
id: item.id
}
const childTreeList = transformTreeList(item.treeList, key)
if (childTreeList.length > 0) {
transformedItem.treeList = childTreeList
}
return transformedItem
})
}
let formValue = ref({
name: '',
age: '',
phone: '',
phone1: ''
})
const formRef = ref<FormInst | null>(null)
const handleValidateClick = (e: MouseEvent) => {
e.preventDefault()
formRef.value?.validate((errors) => {
if (!errors) {
// message.success('Valid')
} else {
console.log(errors)
// message.error('Invalid')
}
})
}
let options = [
{
label: '据点总体',
value: 'song0'
},
{
label: 'DIS',
value: 'song1'
}
]
const checkedValueRef = ref<string | null>(null)
const handleChange = (e: Event) => {
state.cateId = 1
state.yearTime = e
console.log(e)
}
//
const handleChild = (id: any) => {
// console.log(data)
clickData.id = id
}
getData()
</script>
<template>
<!-- <develop/> -->
<HomeHead class="top"> </HomeHead>
<div class="h-full relative flex flex-col">
<div class="font-600 text-36px mt29px">C/D数据11</div>
<div class="q-wrapper flex-1 h957.9px mt30px text-#142142 flex flex-col gap-22px bg-#fff">
<div class="data1 flex gap-26px">
<div class="cd_plan flex-1 pl32px pr33px pt25px pb10px">
<div class="title ml19px font-bold text-24px">FY23 中国域各据点 C/D进度</div>
<div class="text-20px mt21px mb17px font-600">发注金额</div>
<div class="">
<table
style="border: 1px solid #ededed"
class="w-full text-center h295px border-spacing-0 text-16px fazhu"
>
<thead style="background-color: #417bef; color: #fff">
<tr class="h41px">
<th rowspan="2" colspan="2">据点</th>
<th colspan="2">据点</th>
<th colspan="2">苏州</th>
<th colspan="2">惠州</th>
</tr>
<tr class="h41px">
<th>FY23</th>
<th>FY22</th>
<th>FY23</th>
<th>FY22</th>
<th>FY23</th>
<th>FY22</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="text-#142142">合计</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
</tr>
<tr>
<td rowspan="2" class="text-#142142">C/D</td>
<td class="text-#142142">交涉</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
</tr>
<tr>
<td class="text-#142142">THEME</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
</tr>
<tr>
<td colspan="2" class="text-#142142">市况</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
</tr>
<tr>
<td colspan="2" class="text-#142142">汇率</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
<td>55.40%</td>
</tr>
</tbody>
</table>
</div>
<div class="flex h55px">
<n-form ref="formRef" inline :label-width="55" :model="formValue" class="!items-center">
<n-form-item path="name">
<n-select
style="width: 148px"
v-model:value="formValue.name"
placeholder="请选择"
:options="options"
/>
</n-form-item>
<n-form-item path="age">
<n-select
style="width: 148px"
v-model:value="formValue.age"
placeholder="请选择"
:options="options"
/>
</n-form-item>
<n-form-item path="phone">
<n-select
style="width: 148px"
v-model:value="formValue.phone"
placeholder="请选择"
:options="options"
/>
</n-form-item>
<n-form-item path="phone">
<n-select
style="width: 148px"
v-model:value="formValue.phone1"
placeholder="请选择"
:options="options"
/>
</n-form-item>
<n-form-item>
<n-button
style="background-color: #417bef; color: #fff"
attr-type="button"
@click="handleValidateClick"
>
检索
</n-button>
</n-form-item>
</n-form>
</div>
</div>
<div class="amount flex-1 pl32px pr33px pt27px pb0px">
<div class="flex gap-49px">
<div class="flex-1">
<div class="title ml19px font-bold text-24px">发注金额推移</div>
<div class="w330px h199px mt22px">
<img src="./images/fazhuje.png" alt="" />
</div>
</div>
<div class="flex-1">
<div class="title ml19px font-bold text-24px">CD堆积</div>
<div class="w330px h199px mt22px">
<img src="./images/cddj.png" alt="" />
</div>
</div>
<div class="flex-1">
<div class="title ml19px font-bold text-24px">发注金额推移</div>
<div class="w100% h199px mt22px">
<VChart ref="chart1" :option="chartOp1" autoresize />
</div>
<div class="title ml19px font-bold text-24px !absolute top-0 left-50%">CD堆积</div>
</div>
</div>
<div class="h152px mt20px" style="border: 1px solid #d3d3d3">
<div class="mt13px ml17px text-16px font-bold">年度重点</div>
<div class="h112px ml17px mt10px mr15px text-14px lh-22px overflow-y-auto">
年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点The
年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点The
年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点The
年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点The
年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重点Theme年度重
</div>
</div>
</div>
</div>
<div class="data2 flex flex-col">
<div class="flex min-h280px">
<div class="w148px">
<div class="title ml19px font-bold text-24px">按业绩</div>
<div class="max-h-236px overflow-y-auto mt100px">
<CDSide :treeData="treeData" @clickChliden="handleChild"></CDSide>
</div>
</div>
<div class="ml24px w485px">
<div class="ml19px font-bold text-24px">当年度</div>
<table
class="dangnian w485px text-center mt23px text-18px border-spacing-0 overflow-auto min-h-100px"
>
<thead style="background-color: #417bef; color: #fff; height: 42px">
<tr class="h41px">
<th colspan="4">FY2023</th>
</tr>
<tr class="h35px">
<th>供方</th>
<th>发注金额</th>
<th>交涉</th>
<th>Theme</th>
</tr>
</thead>
<tbody>
<tr v-for="i in toYearData" key="i" class="!h35px text-16px">
<td>{{ i.supplierName }}</td>
<td>{{ i.publishAmount }}</td>
<td>{{ i.negAmount }}</td>
<td>{{ i.themeRate }}%</td>
</tr>
</tbody>
</table>
</div>
<div class="ml89px flex-1">
<div class="title ml19px font-bold text-24px">历史数据</div>
<div class="flex">
<table
class="history w-full text-center mt23px text-18px border-spacing-0 overflow-auto"
>
<thead style="background-color: #417bef; color: #fff; height: 42px">
<tr class="h41px">
<th colspan="3">FY2023</th>
</tr>
<tr class="h41px">
<th>发注</th>
<th>交涉</th>
<th>Theme</th>
</tr>
</thead>
<tbody>
<tr v-for="i in hisData['2023']" key="i" class="!h35px text-16px">
<td>{{ i.publishAmount }}</td>
<td>{{ i.negAmount }}</td>
<td>{{ i.themeRate }}%</td>
</tr>
</tbody>
</table>
<table
class="history w-full text-center mt23px text-18px border-spacing-0 overflow-auto"
>
<thead style="background-color: #417bef; color: #fff; height: 42px">
<tr class="h41px">
<th colspan="3">FY2022</th>
</tr>
<tr class="h41px">
<th>发注</th>
<th>交涉</th>
<th>Theme</th>
</tr>
</thead>
<tbody>
<tr v-for="i in hisData['2022']" key="i" class="!h35px text-16px">
<td>{{ i.publishAmount }}</td>
<td>{{ i.negAmount }}</td>
<td>{{ i.themeRate }}%</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="flex gap-101px mt29px">
<div class="w634px h243px">
<VChart ref="chartRef1" :option="chartOption1" autoresize />
</div>
<div class="w634px h243px">
<VChart ref="chartRef2" :option="chartOption2" autoresize />
<div class="w634px pl30px h30px">
<el-radio-group v-model="radioss" @change="handleChange">
<el-radio :label="2020">FY2020</el-radio>
<el-radio :label="2021"> FY2021</el-radio>
<el-radio :label="2022">FY2022</el-radio>
</el-radio-group>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="absolute flex flex-col w-full h-full z-200 top-0 left-0 text-center bg-red justify-center items-center"
style="background-color: rgba(255, 255, 255, 0.8)"
>
<img src="@/assets/images/chah.png" />
<br />
<div class="text-#5683DB text-36px">做成中,敬请期待</div>
</div>
</template>
<style scoped lang="less">
.top {
position: absolute;
right: 30px;
top: -92px;
}
.fazhu {
td {
border: 1px solid #e0e0e0;
color: #808696;
}
}
.dangnian {
td {
border: 1px solid #e0e0e0;
color: #808696;
}
}
.history {
td {
border: 1px solid #e0e0e0;
color: #808696;
}
}
.menu {
position: absolute;
background: #fff;
border: 1px solid #333;
}
.menu li {
list-style: none;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
::-webkit-scrollbar {
width: 1px;
}
.q-wrapper {
overflow-y: scroll;
border-radius: 20px;
.cd_plan,
.amount,
.data2 {
border: 1px solid #e7ebf5;
border-radius: 18px;
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
}
.data2 {
// height: 600.9px;
padding: 28px;
}
.title {
position: relative;
&::before {
content: '';
width: 8px;
height: 30px;
background-color: #003ab5;
position: absolute;
left: -15px;
top: -3px;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,300 @@
import { color, type EChartsOption } from 'echarts'
//数字转千分位
export function formatNum(num: any) {
const n = String(num.toFixed(0)).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
return n
}
export function totalPieCharData(arr: any = [], colorList: any = {}) {
// const color: any = []
// const data = arr.map((item: any) => {
// color.push(colorList[item.moduleCode])
// return {
// name: item.moduleName,
// value: item.visitCount,
// _code: item.moduleCode
// }
// })
const option: EChartsOption = {
tooltip: {
// formatter: '{b} : {c}百万 ({d}%)',
// formatter: '{b} : {c} ({d}%)',
formatter: function (params: any) {
return (
params.data.name +
' : ' +
formatNum(params.data.value) +
'\n' +
'(' +
params.percent.toFixed(0) +
'%' +
')'
)
},
trigger: 'item'
},
legend: {
show: false,
// top: '5%',
left: 'center',
textStyle: {
fontSize: 12,
color: '#fff'
}
},
graphic: {
type: 'text',
left: 'center',
top: 'center',
style: {
text:
'总计' + //圆饼中心显示数据,这里是显示得总数
'\n',
fill: '#fff',
fontSize: 14,
lineHeight: 20,
width: 30,
height: 30,
textAlign: 'center'
}
},
grid: {
containLabel: true
},
series: [
{
// name: 'Access',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
color: '#fff',
fontSize: 12,
// formatter: '{b} ({d}%)'
formatter: function (params: any) {
return params.data.name + ': ' + params.percent.toFixed(0) + '%'
}
// position: 'center'
},
// emphasis: {
// label: {
// show: true,
// fontSize: 40,
// fontWeight: 'bold',
// color: '#fff'
// }
// },
// labelLine: {
// show: true
// },
data: []
}
]
}
return option
}
export function totalBarCharData(params: any = {}) {
const option = {
tooltip: {
trigger: 'axis'
// axisPointer: {
// type: 'cross',
// crossStyle: {
// color: '#999'
// }
// }
},
legend: {
// type: 'scroll',
data: ['Evaporation', 'Precipitation', 'Temperature'],
textStyle: {
fontSize: 12,
color: '#fff'
}
},
grid: {
left: '7%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: [],
axisPointer: {
type: 'shadow'
},
axisLabel: {
color: '#fff'
}
}
],
// graphic: {
// type: 'text',
// left: '0',
// top: 'center',
// rotation: 90,
// style: {
// text: '千元',
// fill: '#fff',
// fontSize: 14,
// textAlign: 'center'
// }
// },
yAxis: [
{
type: 'value',
name: '千元',
// min: 0,
// max: 250,
// interval: 50,
axisLabel: {
formatter: '{value}',
color: '#fff'
},
nameTextStyle: {
color: '#fff',
align: 'right',
padding: [0, 8, 0, 0]
},
// nameRotate: 90,
// nameTruncate: {
// maxWidth: 80,
// ellipsis: '...'
// },
// nameLocation: 'left',
// nameGap: 50,
axisLine: {
show: false,
lineStyle: {
color: '#1f78af',
width: 2 //y轴宽度这里是为了突出显示加上的
},
onZero: false
}
},
{
type: 'value',
// name: 'Temperature',
// min: 0,
// max: 25,
// interval: 5,
axisLabel: {
formatter: '{value}',
color: '#fff'
}
}
],
series: []
}
return option
}
export function disBarCharData(params: any = {}) {
const option = {
minBusSeeds: '',
tooltip: {
trigger: 'axis',
axisPointer: {
// Use axis to trigger tooltip
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
}
// position: function (pos, params, el, elRect, size) {
// const obj: any = {
// top: -10
// }
// obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30
// return obj
// }
},
legend: {
left: 'center',
right: 'center',
type: 'scroll',
pageIconInactiveColor: '#aaa',
pageIconColor: '#fff',
selector: [
// {
// // 全选
// type: 'all',
// // 可以是任意你喜欢的标题
// title: '全选'
// }
// {
// // 反选
// type: 'inverse',
// // 可以是任意你喜欢的标题
// title: '反选'
// }
],
selectorLabel: {
backgroundColor: '#fff',
color: '#000'
},
pageTextStyle: {
color: '#fff'
},
data: [],
textStyle: {
fontSize: 12,
color: '#fff'
}
},
grid: {
left: '6%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
name: '千元',
axisLabel: {
color: '#fff'
},
nameTextStyle: {
color: '#fff',
align: 'right',
padding: [0, 8, 0, 0]
}
// nameRotate: 90,
// nameTruncate: {
// maxWidth: 80,
// ellipsis: '...'
// },
// nameLocation: 'end'
// nameGap: 50
},
xAxis: {
type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: [],
axisLabel: {
color: '#fff'
}
},
series: []
// series: [
// {
// name: 'Direct',
// type: 'bar',
// stack: 'total',
// label: {
// show: true
// },
// emphasis: {
// focus: 'series'
// },
// data: [320, 302, 301, 334, 390, 330, 320]
// },
// ]
}
return option
}

BIN
src/views/home/cd/img/1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 KiB

BIN
src/views/home/cd/img/2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

BIN
src/views/home/cd/img/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 KiB

BIN
src/views/home/cd/img/h.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 KiB

BIN
src/views/home/cd/img/y.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/views/home/cd/img/you.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/views/home/cd/img/z.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/views/home/cd/img/zt.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

BIN
src/views/home/cd/img/zuo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -104,9 +104,17 @@ const codePath: any = {
modulePath: '/DataBase' modulePath: '/DataBase'
} }
} }
const toDetail2 = (n: any) => { const toDetail2 = (n: any, flag: boolean = false) => {
console.log(n) console.log(n)
if (n.id === 0) return if (n.id === 0) return
if (flag) {
if (n.isSelect === 1) {
push(`/intelligence/${n.type == 2 ? 'within' : 'outside'}/` + n.id)
} else {
message.info('您没有权限查看!')
}
return
}
// if (n.isSelect === 1) { // if (n.isSelect === 1) {
if (n.moduleCode === 'App_Database') { if (n.moduleCode === 'App_Database') {
return push('/DataBase?id=' + n.cateId) return push('/DataBase?id=' + n.cateId)
@ -187,11 +195,11 @@ fetchNewDataList()
<div <div
class="text-black p-20px text-28px w-1/3 transition-all" class="text-black p-20px text-28px w-1/3 transition-all"
:class="[{ 'text-#fff': curTab == 1 }]" :class="[{ 'text-#fff': curTab == 1 }]"
@click="curTab = 0" @mouseenter="curTab = 0"
> >
最近更新 最近更新
</div> </div>
<div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @click="curTab = 1"> <div class="card_title !pt-10px !pl-30px flex-1 !pb-10px" @mouseenter="curTab = 1">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<p <p
class="text-22px cursor-pointer hover:underline transition-all" class="text-22px cursor-pointer hover:underline transition-all"
@ -377,7 +385,7 @@ fetchNewDataList()
<div class="mt-10px"> <div class="mt-10px">
<div class="text-#142142 truncate text-16px"> <div class="text-#142142 truncate text-16px">
<a <a
@click="toDetail2(i)" @click="toDetail2(i, true)"
:href="i.url" :href="i.url"
class="no-underline text-#142142 cursor-pointer hover:underline" class="no-underline text-#142142 cursor-pointer hover:underline"
>{{ i.title }}</a >{{ i.title }}</a

View File

@ -15,7 +15,9 @@ const store = useUserStore()
const { push } = useRouter() const { push } = useRouter()
const route = useRoute() const route = useRoute()
const userCode = ['admin', 'csr_dandang', 'tech_service'].includes(store.user.roleCode) const userCode = ['admin', 'csr_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const Navs = [ const Navs = [
{ name: '集团*部门方针' }, { name: '集团*部门方针' },
{ name: '年度活动日程表' }, { name: '年度活动日程表' },

View File

@ -10,7 +10,9 @@ import ModifyB from './modifyB.vue'
import { message } from '@/utils/message'; import { message } from '@/utils/message';
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
const store = useUserStore() const store = useUserStore()
const userCode = ['admin','csr_dandang','tech_service'].includes(store.user.roleCode) const userCode = ['admin','csr_dandang','tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const { chartRef, option } = charData() const { chartRef, option } = charData()
const { chartRef: chartRefP1, option: optionP1 } = pieData1() const { chartRef: chartRefP1, option: optionP1 } = pieData1()

View File

@ -16,8 +16,8 @@ const store = useUserStore()
const { push } = useRouter() const { push } = useRouter()
const message = useMessage() const message = useMessage()
const userCode = ['admin', 'csr_dandang', 'tech_service'].includes( const userCode = ['admin', 'csr_dandang', 'tech_service'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
const swipeRef = ref<any>(null) const swipeRef = ref<any>(null)
const dataList = ref([]) const dataList = ref([])
@ -85,9 +85,7 @@ const openUrl = async (url) => {
return return
} }
srcType.value = getLastSubstring(url) srcType.value = getLastSubstring(url)
if ( if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url url = 'https://view.xdocin.com/view?src=' + url
@ -96,19 +94,10 @@ const openUrl = async (url) => {
window.open( window.open(
url, url,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
@ -126,9 +115,7 @@ const toDetail = (obj) => {
message.info('没有访问权限') message.info('没有访问权限')
return return
} else { } else {
obj.filePath?.[0]?.url obj.filePath?.[0]?.url ? openUrl(obj.filePath[0].url) : message.info('没有可预览文件!')
? openUrl(obj.filePath[0].url)
: message.info('没有可预览文件!')
} }
} }
async function down(data: { async function down(data: {
@ -185,8 +172,7 @@ const handleVisitsScoll = () => {
// if(pageNum >= 1) return // if(pageNum >= 1) return
const container = msgScoll.value const container = msgScoll.value
if (container) { if (container) {
const isAtBottom = const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
container.scrollHeight - container.scrollTop === container.clientHeight
if (isAtBottom) { if (isAtBottom) {
if (pageNum < maxMsgLingth) { if (pageNum < maxMsgLingth) {
++pageNum ++pageNum
@ -218,9 +204,7 @@ const scroll = ({ scrollTop }: any) => {
> >
PLUS活动相关 PLUS活动相关
</div> </div>
<el-button v-if="userCode" type="primary" class="button" @click="shomks" <el-button v-if="userCode" type="primary" class="button" @click="shomks"></el-button>
>管理</el-button
>
<div class="text-#142142 text-20px font-extrabold flex p20px"> <div class="text-#142142 text-20px font-extrabold flex p20px">
<!-- <div class=""></div> --> <!-- <div class=""></div> -->
<div class="w-70% text-24px font-bold p20px pb-0px"> <div class="w-70% text-24px font-bold p20px pb-0px">
@ -233,10 +217,7 @@ const scroll = ({ scrollTop }: any) => {
@click="push({ name: 'modifyCsrList' })" @click="push({ name: 'modifyCsrList' })"
class="w-145px px15px text-#fff !rd-22px !bg-gradient-to-r !from-#34a6d9/90 !to-#23d1c6/70 p10px" class="w-145px px15px text-#fff !rd-22px !bg-gradient-to-r !from-#34a6d9/90 !to-#23d1c6/70 p10px"
> >
查看更多<img 查看更多<img src="../../../assets/images/ckgduo@2x.png" class="w25px ml-10px mt--5px" />
src="../../../assets/images/ckgduo@2x.png"
class="w25px ml-10px mt--5px"
/>
</div> </div>
</div> </div>
</div> </div>
@ -342,16 +323,10 @@ const scroll = ({ scrollTop }: any) => {
> >
<div class="max-w500px text-16px flex flex-col"> <div class="max-w500px text-16px flex flex-col">
<div class="flex items-center max-w-[84%]"> <div class="flex items-center max-w-[84%]">
<img <img src="../../../assets/images/lvbiao@2x.png" class="mr-5px" />
src="../../../assets/images/lvbiao@2x.png"
class="mr-5px"
/>
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
<span <span class="truncate text-18px !min-w-[auto]" @click="toDetail(i)">
class="truncate text-18px !min-w-[auto]"
@click="toDetail(i)"
>
{{ i.filePath[0]?.originalFileName }} {{ i.filePath[0]?.originalFileName }}
</span> </span>
</template> </template>
@ -365,11 +340,7 @@ const scroll = ({ scrollTop }: any) => {
title="查看更多" title="查看更多"
@click="toDetail(i)" @click="toDetail(i)"
class="absolute cursor-pointer right--14px top-0px w60px pt-3px flex items-center ml-auto text-right" class="absolute cursor-pointer right--14px top-0px w60px pt-3px flex items-center ml-auto text-right"
style=" style="color: #4d7ee8; text-align: center; font-size: 16px"
color: #4d7ee8;
text-align: center;
font-size: 16px;
"
> >
更多<el-icon> 更多<el-icon>
<DArrowRight class="" /> <DArrowRight class="" />
@ -421,12 +392,7 @@ const scroll = ({ scrollTop }: any) => {
</el-icon> </el-icon>
</div> --> </div> -->
<span <span
style=" style="border: #417bef 1px solid; color: #417bef; border-radius: 5px; height: 30px"
border: #417bef 1px solid;
color: #417bef;
border-radius: 5px;
height: 30px;
"
class="absolute right-25px top-16px w80px h50px flex justify-center items-center cursor-pointer" class="absolute right-25px top-16px w80px h50px flex justify-center items-center cursor-pointer"
@click="push({ name: 'CSRList' })" @click="push({ name: 'CSRList' })"
>更多<el-icon> <DArrowRight class="" /> </el-icon >更多<el-icon> <DArrowRight class="" /> </el-icon
@ -436,13 +402,7 @@ const scroll = ({ scrollTop }: any) => {
ref="msgScoll" ref="msgScoll"
class="px20px h280px cent_box overflow-y-scroll" class="px20px h280px cent_box overflow-y-scroll"
> --> > -->
<el-scrollbar <el-scrollbar class="px20px" ref="" height="280px" always @scroll="scroll">
class="px20px"
ref=""
height="280px"
always
@scroll="scroll"
>
<!-- <div class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" v-for="(i, key) in dataList" :key="i"> --> <!-- <div class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" v-for="(i, key) in dataList" :key="i"> -->
<div <div
class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px" class="text-#808696 bg-#F4F8FF py10px rd-5px mt10px"
@ -450,10 +410,9 @@ const scroll = ({ scrollTop }: any) => {
:key="i" :key="i"
> >
<div class="truncate2 flex items-center" @click="toDetail(i)"> <div class="truncate2 flex items-center" @click="toDetail(i)">
<span <span class="text-#fff bg-#407DF1 px5px text-18px rounded-20px mr-5px inlineFlex">{{
class="text-#fff bg-#407DF1 px5px text-18px rounded-20px mr-5px inlineFlex" ++key
>{{ ++key }}</span }}</span>
>
<span class="text-18px mr-2">{{ i.title }}</span> <span class="text-18px mr-2">{{ i.title }}</span>
<img <img
v-if="isNotOneWeekAgo(i.createTime)" v-if="isNotOneWeekAgo(i.createTime)"
@ -462,9 +421,7 @@ const scroll = ({ scrollTop }: any) => {
alt="" alt=""
/> />
</div> </div>
<span class="absolute right-10px top-24px text-18px">{{ <span class="absolute right-10px top-24px text-18px">{{ i.createTime }}</span>
i.createTime
}}</span>
</div> </div>
</el-scrollbar> </el-scrollbar>
<!-- </div> --> <!-- </div> -->

View File

@ -13,7 +13,7 @@ const query = ref<any>({
}) })
const year = new Date().getFullYear() const year = new Date().getFullYear()
const month = new Date().getMonth() const month = new Date().getMonth()
const jpMonth = (month < 3 ? year - 1 : year) + '' const jpMonth = (month < 4 ? year - 1 : year) + ''
query.value.year = jpMonth query.value.year = jpMonth
const calendar = [4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3] const calendar = [4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3]
const calendarShow = new Date().getMonth() + 1 const calendarShow = new Date().getMonth() + 1
@ -43,8 +43,11 @@ const getCsrSupplier = () => {
try { try {
csrSupplier.value = resData.length csrSupplier.value = resData.length
? resData.map((key) => { ? resData.map((key) => {
const obj = data[key] || {} const arr = String(key).split('-')
const month = String(key).split('-')?.[1] || '' const month = arr?.[1] || ''
// const year = arr?.[0] || ''
const obj =
data[+month < 4 ? +req.year + 1 + '-' + month : req.year + '-' + month] || {}
Object.assign(csrSupplierObj.value[month], obj) Object.assign(csrSupplierObj.value[month], obj)
return { return {
key, key,
@ -66,20 +69,26 @@ const getCsrSupplier = () => {
} }
const csrSupplierList = ref<any>([]) const csrSupplierList = ref<any>([])
// const selMonth = ref((new Date().getMonth() + 1).toString())
const selMonth = ref('') const selMonth = ref('')
const getCsrSupplierList = (index?: any) => { const getCsrSupplierList = (index?: any) => {
const month = index || index === 0 ? query.value.year + '-' + months[index] : '' const _m = +months[index]
const month =
index || index === 0
? (_m < 4 ? +query.value.year + 1 : query.value.year) + '-' + months[index]
: ''
csrSupplierList.value = [] csrSupplierList.value = []
selMonth.value = '' selMonth.value = ''
const req = { pageNum: 1, pageSize: 10, ...query.value, month } const req = { pageNum: 1, pageSize: 10, ...query.value, month }
req.year = _m < 4 ? +req.year + 1 : req.year
req.supplierName req.supplierName
? fetchCsrSupplierList(req).then((res: any) => { ? fetchCsrSupplierList(req).then((res: any) => {
csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0) csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0)
}) })
: fetchCsrSupplierTopList(req).then((res: any) => { : fetchCsrSupplierTopList({ ...req }).then((res: any) => {
csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0) csrSupplierList.value = (res.rows || []).filter((item: any) => item.submitunCount > 0)
}) })
selMonth.value = month ? +months[index] + '月' : '' selMonth.value = month ? months[index] : ''
} }
const getCsrSupplierTaskInfo = () => { const getCsrSupplierTaskInfo = () => {
@ -173,19 +182,17 @@ getCsrSupplierTaskInfo()
<el-col :span="8" v-for="(it, i) in months" :key="i"> <el-col :span="8" v-for="(it, i) in months" :key="i">
<div <div
v-show="!loading" v-show="!loading"
:class="i <= nowIndexMonth && query.year == jpMonth ? 'times' : 'time'" :class="csrSupplierObj[it]?.submitedCount !== undefined ? 'times' : 'time'"
@click="handleMonth(i)" @click="handleMonth(i)"
> >
<div <div
v-if="i > nowIndexMonth || query.year != jpMonth" v-if="csrSupplierObj[it]?.submitedCount === undefined"
class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%" class="text-#d3d2d2 text-18px font-bold absolute left-40% top-45%"
> >
<span class="text-60px">{{ +it }}</span <span class="text-60px">{{ +it }}</span
> >
</div> </div>
<template <template v-if="csrSupplierObj[it]?.submitedCount !== undefined">
v-if="i <= nowIndexMonth && (query.year == jpMonth || !!csrSupplierObj[it])"
>
<div class="text-#fff text-18px font-bold absolute left-40% top-24px"> <div class="text-#fff text-18px font-bold absolute left-40% top-24px">
<span class="text-24px">{{ +it }}</span <span class="text-24px">{{ +it }}</span
> >
@ -325,7 +332,11 @@ getCsrSupplierTaskInfo()
</div> </div>
</div> </div>
<div class="cards"> <div class="cards">
<div class="cards_title relative">未提交供应商明细({{ query.year }}{{ selMonth }})</div> <div class="cards_title relative">
未提交供应商明细({{ selMonth && +selMonth < 4 ? +query.year + 1 : query.year }}{{
selMonth
}}{{ selMonth ? '月' : '' }})
</div>
<div class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8"> <div class="absolute top-24px !text-18px right-20px pt30px text-#4E7EE8">
<span class="text-#ababab">更新时间{{ updateTime }}</span> <span class="text-#ababab">更新时间{{ updateTime }}</span>
</div> </div>

View File

@ -12,9 +12,7 @@
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> <el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon>
</el-button> </el-button>
<el-tab-pane label="banner管理" name="first"> <el-tab-pane label="banner管理" name="first">
<el-button type="primary" @click="editClickA('add')" class="mb-20px"> <el-button type="primary" @click="editClickA('add')" class="mb-20px"> 新增 </el-button>
新增
</el-button>
<el-button <el-button
class="button mt--20px" class="button mt--20px"
@ -72,19 +70,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button type="primary" @click="editClickA('edit', scope.row)" class="mb-20px">
type="primary"
@click="editClickA('edit', scope.row)"
class="mb-20px"
>
编辑</el-button 编辑</el-button
> >
<el-button <el-button type="danger" @click="deleteClickA(scope.row)" class="mb-20px">
type="danger"
@click="deleteClickA(scope.row)"
class="mb-20px"
>
删除</el-button 删除</el-button
> >
</template> </template>
@ -93,9 +83,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="足迹管理" name="second"> <el-tab-pane label="足迹管理" name="second">
<el-button type="primary" @click="editClickB('add')" class="mb-20px"> <el-button type="primary" @click="editClickB('add')" class="mb-20px"> 新增 </el-button>
新增
</el-button>
<el-button <el-button
class="button mt--20px" class="button mt--20px"
@ -130,11 +118,7 @@
</el-table-column> --> </el-table-column> -->
<el-table-column prop="title" label="标题" align="center" /> <el-table-column prop="title" label="标题" align="center" />
<el-table-column <el-table-column prop="createTime" label="上传时间" align="center" />
prop="createTime"
label="上传时间"
align="center"
/>
<el-table-column prop="filePath" label="文件列表" align="center"> <el-table-column prop="filePath" label="文件列表" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.filePath" v-for="i in scope.row.filePath" <span v-if="scope.row.filePath" v-for="i in scope.row.filePath"
@ -144,19 +128,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button type="primary" @click="editClickB('edit', scope.row)" class="mb-20px">
type="primary"
@click="editClickB('edit', scope.row)"
class="mb-20px"
>
编辑</el-button 编辑</el-button
> >
<el-button <el-button type="danger" @click="deleteClickB(scope.row)" class="mb-20px">
type="danger"
@click="deleteClickB(scope.row)"
class="mb-20px"
>
删除</el-button 删除</el-button
> >
</template> </template>
@ -209,20 +185,14 @@
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="addClickA(editA)" class="mb-20px"> <el-button type="primary" @click="addClickA(editA)" class="mb-20px"> 确认</el-button>
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<NModal v-model:show="dialogVisible" :z-index="999999"> <NModal v-model:show="dialogVisible" :z-index="999999">
<img <img class="object-contain max-w-65%" :src="dialogImageUrl" alt="选择图片" />
class="object-contain max-w-65%"
:src="dialogImageUrl"
alt="选择图片"
/>
</NModal> </NModal>
<NModal v-model:show="shomkB"> <NModal v-model:show="shomkB">
@ -246,21 +216,49 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <el-form-item label="是否置顶">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> <el-switch
确认</el-button v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
> >
</el-date-picker>
</el-form-item>
<br />
<div class="text-center">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<UserList <UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
</template> </template>
@ -276,6 +274,7 @@ import {
} from '@/api/daikin/base' } from '@/api/daikin/base'
import { NModal, useMessage, NSelect } from 'naive-ui' import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
@ -526,7 +525,7 @@ const deleteClickB = async (row: any) => {
async function addClickB(row: any) { async function addClickB(row: any) {
console.log(row) console.log(row)
if (!row) return if (!row) return
const { id, moduleId, title, fileList, imgFile } = row const { id, moduleId, title, fileList, imgFile, isPublish, publishTime, isTop } = row
let filePath: any[] = [] let filePath: any[] = []
let url: any[] = [] let url: any[] = []
if (fileList && fileList.length > 0) { if (fileList && fileList.length > 0) {
@ -548,7 +547,10 @@ async function addClickB(row: any) {
id, id,
moduleId, moduleId,
title, title,
filePath filePath,
isPublish,
publishTime,
isTop
}) })
if (code === 200) { if (code === 200) {
message.success('新增成功') message.success('新增成功')
@ -558,7 +560,10 @@ async function addClickB(row: any) {
id, id,
moduleId, moduleId,
title, title,
filePath filePath,
isPublish,
publishTime,
isTop
}) })
if (code === 200) { if (code === 200) {
message.success('修改成功') message.success('修改成功')
@ -579,10 +584,7 @@ const handleChange = (e: string | any[]) => {
} }
// console.log(e,editB.value.cateId,99999) // console.log(e,editB.value.cateId,99999)
} }
const handOnExceed: UploadProps['onExceed'] = ( const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传5张图片') message.warning('最多只能上传5张图片')
} }

View File

@ -30,8 +30,8 @@ const listData = ref<any>([])
const message = useMessage() const message = useMessage()
const activeName = ref(1) const activeName = ref(1)
const flg = ref(false) const flg = ref(false)
const userCode = ['admin', 'database_dandang', 'tech_service'].includes( const userCode = ['admin', 'database_dandang', 'tech_service'].some((item) =>
store2.user.roleCode store2.user.roleCode?.includes(item)
) )
const isDbReview = computed(() => !!user?.isDbReview) const isDbReview = computed(() => !!user?.isDbReview)
const isDbUpload = computed(() => !!user?.isDbUpload) const isDbUpload = computed(() => !!user?.isDbUpload)
@ -60,9 +60,7 @@ const handleDialogConfirm = async () => {
} }
const handleCommand = (command: number, row: any) => { const handleCommand = (command: number, row: any) => {
selCommand.value = command selCommand.value = command
dialogText.value = `确认${command === 2 ? '通过' : '驳回'}标题为 ${ dialogText.value = `确认${command === 2 ? '通过' : '驳回'}标题为 ${row.title} 的文件发布吗?`
row.title
} 的文件发布吗?`
dialogVisible.value = true dialogVisible.value = true
selItemId.value = row.id selItemId.value = row.id
} }
@ -203,19 +201,10 @@ const openUrl = async (it: any) => {
window.open( window.open(
filePath, filePath,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
@ -433,25 +422,13 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
hasChildren: 'hasChildren' hasChildren: 'hasChildren'
}" }"
> >
<el-table-column <el-table-column prop="cateName" label="所属分类" show-overflow-tooltip>
prop="cateName"
label="所属分类"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="title" label="标题名称" show-overflow-tooltip />
prop="title"
label="标题名称"
show-overflow-tooltip
/>
<el-table-column prop="deptName" label="上传科室" /> <el-table-column prop="deptName" label="上传科室" />
<el-table-column prop="parentDeptName" label="上传部门" /> <el-table-column prop="parentDeptName" label="上传部门" />
<el-table-column prop="createTime" label="上传日期" /> <el-table-column prop="createTime" label="上传日期" />
<el-table-column <el-table-column label="文件列表" prop="filePath" show-overflow-tooltip />
label="文件列表"
prop="filePath"
show-overflow-tooltip
/>
<!-- <el-table-column label="排序" prop="sort" show-overflow-tooltip/> --> <!-- <el-table-column label="排序" prop="sort" show-overflow-tooltip/> -->
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
@ -467,9 +444,7 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
<div class="descStyle max-w-60vw !h-46px"> <div class="descStyle max-w-60vw !h-46px">
<p <p
v-for="(it, e) in scope.row.userList" v-for="(it, e) in scope.row.userList"
:class=" :class="scope.row.userList.length < 2 ? '!leading-46px' : ''"
scope.row.userList.length < 2 ? '!leading-46px' : ''
"
> >
{{ it.nickName }} {{ it.nickName }}
<span v-if="e == 1 && scope.row.userList.length > 2" <span v-if="e == 1 && scope.row.userList.length > 2"
@ -493,21 +468,11 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
v-if="(row.fileCommon?.fileSize || 0) > 25 * 1024 * 1024" v-if="(row.fileCommon?.fileSize || 0) > 25 * 1024 * 1024"
> >
<template #trigger> <template #trigger>
<el-button style="color: #000" @click="downloads(row)" <el-button style="color: #000" @click="downloads(row)"></el-button>
>查看</el-button
>
</template> </template>
<span <span>该文件超过25MB无法进行预览请点击 查看 进行下载</span>
>该文件超过25MB无法进行预览请点击 查看
进行下载</span
>
</n-popover> </n-popover>
<el-button <el-button v-else style="color: #000" @click="downloads(row)"></el-button>
v-else
style="color: #000"
@click="downloads(row)"
>查看</el-button
>
</div> </div>
<el-dropdown <el-dropdown
v-if="activeName === 1 && isDbReview" v-if="activeName === 1 && isDbReview"
@ -524,13 +489,8 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item :command="2" :icon="Check" <el-dropdown-item :command="2" :icon="Check">同意</el-dropdown-item>
>同意</el-dropdown-item <el-dropdown-item :command="3" :icon="Close" type="danger"
>
<el-dropdown-item
:command="3"
:icon="Close"
type="danger"
>驳回</el-dropdown-item >驳回</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
@ -544,17 +504,10 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
> >
编辑</el-button 编辑</el-button
> >
<template <template v-if="(activeName === 1 || activeName === 3) && isDbUpload">
v-if="(activeName === 1 || activeName === 3) && isDbUpload" <el-popconfirm title="确认撤回该文件?" @confirm="handleWithdraw(row)">
>
<el-popconfirm
title="确认撤回该文件?"
@confirm="handleWithdraw(row)"
>
<template #reference> <template #reference>
<el-button class="ml-16px" type="danger"> <el-button class="ml-16px" type="danger"> 撤回</el-button>
撤回</el-button
>
</template> </template>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -606,30 +559,20 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="i.firstReviewName"> <el-dropdown-item v-if="i.firstReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">初审人{{ i.firstReviewName }}</span>
>初审人{{ i.firstReviewName }}</span <span class="ml20px">初审时间{{ i.firstReviewTime }}</span>
>
<span class="ml20px"
>初审时间{{ i.firstReviewTime }}</span
>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="i.ultimateReviewName"> <el-dropdown-item v-if="i.ultimateReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">终审人{{ i.ultimateReviewName }}</span>
>终审人{{ i.ultimateReviewName }}</span <span class="ml20px">终审时间{{ i.ultimateReviewTime }}</span>
>
<span class="ml20px"
>终审时间{{ i.ultimateReviewTime }}</span
>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<span class="shrink-0 ml38px text-#808696 w220px">{{ <span class="shrink-0 ml38px text-#808696 w220px">{{ i.createTime }}</span>
i.createTime
}}</span>
<span <span
v-if="store2.user.isReview > 0 && i.publishName" v-if="store2.user.isReview > 0 && i.publishName"
class="ml20px text-#808696 text-16px flex-1" class="ml20px text-#808696 text-16px flex-1"
@ -642,11 +585,7 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
</div> </div>
</div> </div>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<UserList <UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
<NModal v-model:show="shomk" :z-index="99999"> <NModal v-model:show="shomk" :z-index="99999">
<div class="bg-#FFF p30px"> <div class="bg-#FFF p30px">
@ -695,34 +634,19 @@ function getParentIds(id: number, list: any[] = tableData.value): any {
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="handleEditClick" class="mb-20px"> <el-button type="primary" @click="handleEditClick" class="mb-20px"> 确认</el-button>
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<el-dialog <el-dialog v-model="dialogVisible" title="提示" width="30%" top="40vh" center>
v-model="dialogVisible"
title="提示"
width="30%"
top="40vh"
center
>
<span class="text-18px"> <span class="text-18px">
{{ dialogText }} {{ dialogText }}
</span> </span>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button size="large" @click="dialogVisible = false" <el-button size="large" @click="dialogVisible = false">取消</el-button>
>取消</el-button <el-button class="!ml-50px" size="large" type="primary" @click="handleDialogConfirm">
>
<el-button
class="!ml-50px"
size="large"
type="primary"
@click="handleDialogConfirm"
>
确认 确认
</el-button> </el-button>
</span> </span>

View File

@ -19,7 +19,7 @@ import { isNotOneWeekAgo } from '@/utils'
const store: any = useUserStore() const store: any = useUserStore()
const message = useMessage() const message = useMessage()
const userCode = ['admin', 'database_dandang'].includes(store.user.roleCode) const userCode = ['admin', 'database_dandang'].some((item) => store.user.roleCode?.includes(item))
const isDbReview = store.user?.isDbReview === 1 const isDbReview = store.user?.isDbReview === 1
const isDbUpload = store.user?.isDbUpload === 1 const isDbUpload = store.user?.isDbUpload === 1
const user: any = store.user const user: any = store.user
@ -132,9 +132,7 @@ const openUrl = async (it) => {
return return
} }
srcType.value = getLastSubstring(filePath) srcType.value = getLastSubstring(filePath)
if ( if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
filePath = 'https://view.xdocin.com/view?src=' + filePath filePath = 'https://view.xdocin.com/view?src=' + filePath
@ -143,19 +141,10 @@ const openUrl = async (it) => {
window.open( window.open(
filePath, filePath,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
@ -233,17 +222,9 @@ async function getAuth() {
</div> --> </div> -->
<div class="bg-#fff rd-15px px30px pt30px w-full h930px"> <div class="bg-#fff rd-15px px30px pt30px w-full h930px">
<div <div class="rd-15px w-full h870px" style="box-shadow: 1px 2px 26px -3px #cdcccc">
class="rd-15px w-full h870px" <div class="h80px rd-t-15px bg-#4877FB leading-80px text-#fff text-20px">
style="box-shadow: 1px 2px 26px -3px #cdcccc" <img src="@/assets/images/Shape7@2x.png" class="w50px ml-30px mr10px mt--20px" />
>
<div
class="h80px rd-t-15px bg-#4877FB leading-80px text-#fff text-20px"
>
<img
src="@/assets/images/Shape7@2x.png"
class="w50px ml-30px mr10px mt--20px"
/>
{{ title }} {{ title }}
<div class="float-right top-0 right-30px"> <div class="float-right top-0 right-30px">
<el-button <el-button
@ -277,28 +258,16 @@ async function getAuth() {
> >
<tr class="text-20px leading-50px"> <tr class="text-20px leading-50px">
<th width="20%"> <th width="20%">
<img <img src="@/assets/images/baiot@2x.png" class="w35px mt--7px mr-5px" />标题
src="@/assets/images/baiot@2x.png"
class="w35px mt--7px mr-5px"
/>
</th> </th>
<th width="20%"> <th width="20%">
<img <img src="@/assets/images/scbmm@2x.png" class="w35px mt--7px mr-5px" />上传科室
src="@/assets/images/scbmm@2x.png"
class="w35px mt--7px mr-5px"
/>
</th> </th>
<th width="20%"> <th width="20%">
<img <img src="@/assets/images/scbmm@2x.png" class="w35px mt--7px mr-5px" />上传部门
src="@/assets/images/scbmm@2x.png"
class="w35px mt--7px mr-5px"
/>
</th> </th>
<th width="20%"> <th width="20%">
<img <img src="@/assets/images/riqii@2x.png" class="w35px mt--7px mr-5px" />上传日期
src="@/assets/images/riqii@2x.png"
class="w35px mt--7px mr-5px"
/>
</th> </th>
<th width="20% text-center">操作</th> <th width="20% text-center">操作</th>
</tr> </tr>
@ -327,24 +296,14 @@ async function getAuth() {
<n-popover <n-popover
trigger="hover" trigger="hover"
placement="top-start" placement="top-start"
v-if=" v-if="arr.includes(it.id) || (it.fileCommon?.fileSize || 0) > 25 * 1024 * 1024"
arr.includes(it.id) ||
(it.fileCommon?.fileSize || 0) > 25 * 1024 * 1024
"
> >
<template #trigger> <template #trigger>
<el-button style="color: #000" @click="downloads(it)" <el-button style="color: #000" @click="downloads(it)"></el-button>
>查看</el-button
>
</template> </template>
<span <span>该文件超过25MB无法进行预览请点击 查看 进行下载</span>
>该文件超过25MB无法进行预览请点击 查看
进行下载</span
>
</n-popover> </n-popover>
<el-button v-else style="color: #000" @click="downloads(it)" <el-button v-else style="color: #000" @click="downloads(it)"></el-button>
>查看</el-button
>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -365,11 +324,7 @@ async function getAuth() {
</div> </div>
<n-modal v-model:show="pdfShow"> <n-modal v-model:show="pdfShow">
<div class="w100% h100%"> <div class="w100% h100%">
<el-icon <el-icon color="#fff" size="26px" @click="pdfShow = false" class="absolute left-92% bg-#F43"
color="#fff"
size="26px"
@click="pdfShow = false"
class="absolute left-92% bg-#F43"
><Close ><Close
/></el-icon> /></el-icon>
<Amtion :data="src" :datas="srcType" /> <Amtion :data="src" :datas="srcType" />

View File

@ -23,12 +23,7 @@
</div> </div>
<el-tab-pane v-if="userCode" label="分类管理" name="first"> <el-tab-pane v-if="userCode" label="分类管理" name="first">
<div class="h-52px"> <div class="h-52px">
<el-button <el-button v-if="userCode" type="primary" @click="editClickA('add')" class="mb-20px">
v-if="userCode"
type="primary"
@click="editClickA('add')"
class="mb-20px"
>
新增 新增
</el-button> </el-button>
</div> </div>
@ -56,36 +51,20 @@
<!-- <el-table-column prop="sort" label="排序" align="center"/> --> <!-- <el-table-column prop="sort" label="排序" align="center"/> -->
<el-table-column prop="address" label="操作" align="center"> <el-table-column prop="address" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button type="primary" @click="editClickA('edit', scope.row)" class="my-10px">
type="primary"
@click="editClickA('edit', scope.row)"
class="my-10px"
>
编辑</el-button 编辑</el-button
> >
<el-button <el-button
type="success" type="success"
v-if=" v-if="scope.row.level === 1 || scope.row.level === 2 || scope.row.level === 3"
scope.row.level === 1 ||
scope.row.level === 2 ||
scope.row.level === 3
"
@click="editClickA('add', scope.row)" @click="editClickA('add', scope.row)"
class="my-10px" class="my-10px"
> >
新增{{ 新增{{
scope.row.level === 1 scope.row.level === 1 ? '二' : scope.row.level === 2 ? '三' : '四'
? '二'
: scope.row.level === 2
? '三'
: '四'
}}</el-button }}</el-button
> >
<el-button <el-button type="danger" @click="deleteClickA(scope.row)" class="my-10px">
type="danger"
@click="deleteClickA(scope.row)"
class="my-10px"
>
删除</el-button 删除</el-button
> >
</template> </template>
@ -103,12 +82,7 @@
> >
新增</el-button 新增</el-button
> >
<el-button <el-button v-if="userCode" type="primary" @click="getAll" class="mb-20px">
v-if="userCode"
type="primary"
@click="getAll"
class="mb-20px"
>
查看所有</el-button 查看所有</el-button
> >
<template v-if="false"> <template v-if="false">
@ -155,26 +129,14 @@
hasChildren: 'hasChildren' hasChildren: 'hasChildren'
}" }"
> >
<el-table-column <el-table-column prop="cateName" label="所属分类" show-overflow-tooltip>
prop="cateName"
label="所属分类"
show-overflow-tooltip
>
<!-- <template #default="scope"> <!-- <template #default="scope">
<span v-if="scope.row.cateId==="></span> <span v-if="scope.row.cateId==="></span>
</template> --> </template> -->
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="title" label="标题名称" show-overflow-tooltip />
prop="title"
label="标题名称"
show-overflow-tooltip
/>
<!-- <el-table-column prop="deptName" label="排序" /> --> <!-- <el-table-column prop="deptName" label="排序" /> -->
<el-table-column <el-table-column label="文件列表" prop="filePath" show-overflow-tooltip />
label="文件列表"
prop="filePath"
show-overflow-tooltip
/>
<!-- <el-table-column label="排序" prop="sort" show-overflow-tooltip/> --> <!-- <el-table-column label="排序" prop="sort" show-overflow-tooltip/> -->
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
@ -183,19 +145,12 @@
<!-- <span class="descStyle" v-if="scope.row.userList" v-for="it in scope.row.userList"> &nbsp;&nbsp; {{it.nickName}}</span> --> <!-- <span class="descStyle" v-if="scope.row.userList" v-for="it in scope.row.userList"> &nbsp;&nbsp; {{it.nickName}}</span> -->
<!-- <span>{{ scope.row.userList }}</span> --> <!-- <span>{{ scope.row.userList }}</span> -->
<p v-if="scope.row.userList.length"> <p v-if="scope.row.userList.length">
<el-tooltip <el-tooltip :content="handTooltip(scope.row.userList)" placement="top">
:content="handTooltip(scope.row.userList)"
placement="top"
>
<div class="!h-50px descStyle"> <div class="!h-50px descStyle">
<div class="descStyle max-w-60vw !h-46px"> <div class="descStyle max-w-60vw !h-46px">
<p <p
v-for="(it, e) in scope.row.userList" v-for="(it, e) in scope.row.userList"
:class=" :class="scope.row.userList.length < 2 ? '!leading-46px' : 'xx'"
scope.row.userList.length < 2
? '!leading-46px'
: 'xx'
"
> >
{{ it.nickName || undefined }} {{ it.nickName || undefined }}
<span v-if="e == 1 && scope.row.userList.length > 2" <span v-if="e == 1 && scope.row.userList.length > 2"
@ -209,11 +164,7 @@
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="address" label="操作" show-overflow-tooltip>
prop="address"
label="操作"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<div v-if="userCode || hasUpload || hasReview"> <div v-if="userCode || hasUpload || hasReview">
<el-button <el-button
@ -223,19 +174,12 @@
> >
编辑</el-button 编辑</el-button
> >
<el-button <el-button type="danger" @click="deleteClickB(scope.row)" class="w45px my-10px">
type="danger"
@click="deleteClickB(scope.row)"
class="w45px my-10px"
>
删除</el-button 删除</el-button
> >
<div <div
style="float: right; margin: 10px 0" style="float: right; margin: 10px 0"
v-if=" v-if="scope.$index !== 0 && scope.$index !== infoData.length - 1"
scope.$index !== 0 &&
scope.$index !== infoData.length - 1
"
> >
<el-button <el-button
style="color: #000; width: 45px; height: 33px" style="color: #000; width: 45px; height: 33px"
@ -256,9 +200,7 @@
</el-table> </el-table>
</div> </div>
<div <div class="float-right absolute bottom-0px right-30px z-2000 bg-#fff">
class="float-right absolute bottom-0px right-30px z-2000 bg-#fff"
>
<el-pagination <el-pagination
v-model:current-page="pageInfo.currentPage" v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize" v-model:page-size="pageInfo.pageSize"
@ -271,11 +213,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="权限管理" name="three" v-if="userCode"> <el-tab-pane label="权限管理" name="three" v-if="userCode">
<div class="h-52px"> <div class="h-52px">
<el-button <el-button type="primary" @click="handleAuthClick('add')" class="mb-20px">
type="primary"
@click="handleAuthClick('add')"
class="mb-20px"
>
新增审批关系</el-button 新增审批关系</el-button
> >
</div> </div>
@ -298,27 +236,12 @@
}" }"
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }" :cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
> >
<el-table-column <el-table-column prop="cateName" label="所属分类" show-overflow-tooltip>
prop="cateName"
label="所属分类"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="上传人员" prop="userIdList" show-overflow-tooltip>
label="上传人员"
prop="userIdList"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<p <p v-if="scope.row.uploadList.length" class="truncate text-ellipsis">
v-if="scope.row.uploadList.length" {{ scope.row.uploadList.map((item: any) => item.nickName).join('、') }}
class="truncate text-ellipsis"
>
{{
scope.row.uploadList
.map((item: any) => item.nickName)
.join('、')
}}
<el-tooltip <el-tooltip
v-if="false" v-if="false"
:content="handTooltip(scope.row.uploadList)" :content="handTooltip(scope.row.uploadList)"
@ -329,15 +252,10 @@
<p <p
v-for="(it, e) in scope.row.uploadList" v-for="(it, e) in scope.row.uploadList"
:key="e" :key="e"
:class=" :class="scope.row.uploadList.length < 2 ? '!leading-46px' : 'xx'"
scope.row.uploadList.length < 2
? '!leading-46px'
: 'xx'
"
> >
{{ it.nickName || undefined }} {{ it.nickName || undefined }}
<span <span v-if="e == 1 && scope.row.uploadList.length > 2"
v-if="e == 1 && scope.row.uploadList.length > 2"
>...{{ scope.row.uploadList.length }}</span >...{{ scope.row.uploadList.length }}</span
> >
</p> </p>
@ -348,21 +266,10 @@
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="审批人员" prop="userIdList" show-overflow-tooltip>
label="审批人员"
prop="userIdList"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<p <p v-if="scope.row.reviewList.length" class="truncate text-ellipsis">
v-if="scope.row.reviewList.length" {{ scope.row.reviewList.map((item: any) => item.nickName).join('、') }}
class="truncate text-ellipsis"
>
{{
scope.row.reviewList
.map((item: any) => item.nickName)
.join('、')
}}
<el-tooltip <el-tooltip
v-if="false" v-if="false"
:content="handTooltip(scope.row.reviewList)" :content="handTooltip(scope.row.reviewList)"
@ -373,15 +280,10 @@
<p <p
v-for="(it, e) in scope.row.reviewList" v-for="(it, e) in scope.row.reviewList"
:key="e" :key="e"
:class=" :class="scope.row.reviewList.length < 2 ? '!leading-46px' : 'xx'"
scope.row.reviewList.length < 2
? '!leading-46px'
: 'xx'
"
> >
{{ it.nickName || undefined }} {{ it.nickName || undefined }}
<span <span v-if="e == 1 && scope.row.reviewList.length > 2"
v-if="e == 1 && scope.row.reviewList.length > 2"
>...{{ scope.row.reviewList.length }}</span >...{{ scope.row.reviewList.length }}</span
> >
</p> </p>
@ -392,12 +294,7 @@
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="address" label="操作" show-overflow-tooltip width="180px">
prop="address"
label="操作"
show-overflow-tooltip
width="180px"
>
<template #default="scope"> <template #default="scope">
<div> <div>
<el-button <el-button
@ -412,13 +309,7 @@
@confirm="handleAuthClick('del', scope.row)" @confirm="handleAuthClick('del', scope.row)"
> >
<template #reference> <template #reference>
<el-button <el-button type="danger" @click="" class="w45px my-10px"> 删除</el-button>
type="danger"
@click=""
class="w45px my-10px"
>
删除</el-button
>
</template> </template>
</el-popconfirm> </el-popconfirm>
</div> </div>
@ -427,9 +318,7 @@
</el-table> </el-table>
</div> </div>
<div <div class="float-right absolute bottom-0px right-30px z-2000 bg-#fff">
class="float-right absolute bottom-0px right-30px z-2000 bg-#fff"
>
<el-pagination <el-pagination
v-model:current-page="pageInfo.currentPage" v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize" v-model:page-size="pageInfo.pageSize"
@ -454,9 +343,7 @@
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="addClickA(editA)" class="mb-20px"> <el-button type="primary" @click="addClickA(editA)" class="mb-20px"> 确认</el-button>
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -506,10 +393,42 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br /> <br />
<div class="text-center"> <el-form-item label="是否置顶">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> <el-switch
确认</el-button v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
> >
</el-date-picker>
</el-form-item>
<br />
<div class="text-center">
<el-button type="primary" @click="addClickB(editB)" class="mb-20px"> 确认</el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -548,19 +467,13 @@
<br /> <br />
<br /> <br />
<div class="text-center"> <div class="text-center">
<el-button type="primary" @click="handleSetAuth" class="mb-20px"> <el-button type="primary" @click="handleSetAuth" class="mb-20px"> 确认</el-button>
确认</el-button
>
</div> </div>
</el-form> </el-form>
</div> </div>
</NModal> </NModal>
<n-modal v-model:show="showModal" :z-index="99999"> <n-modal v-model:show="showModal" :z-index="99999">
<UserList <UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
</div> </div>
</template> </template>
@ -586,13 +499,14 @@ import {
import { NModal, useMessage, NSelect } from 'naive-ui' import { NModal, useMessage, NSelect } from 'naive-ui'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { databaseld } from '@/stores/modules/database' import { databaseld } from '@/stores/modules/database'
import { pickerOptions } from '@/utils/date'
const { push } = useRouter() const { push } = useRouter()
const database = databaseld() const database = databaseld()
const store: any = useUserStore() const store: any = useUserStore()
const message = useMessage() const message = useMessage()
const userCode = computed(() => const userCode = computed(() =>
['admin', 'database_dandang', 'tech_service'].includes(store.user.roleCode) ['admin', 'database_dandang', 'tech_service'].some((item) => store.user.roleCode?.includes(item))
) )
// 'tech_service' // 'tech_service'
const isDbReview = store.user?.isDbReview === 1 const isDbReview = store.user?.isDbReview === 1
@ -878,10 +792,7 @@ const handleChange = (e: string | any[]) => {
} }
// console.log(e,editB.value.cateId,99999) // console.log(e,editB.value.cateId,99999)
} }
const handOnExceed: UploadProps['onExceed'] = ( const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传一个文件!') message.warning('最多只能上传一个文件!')
} }
@ -895,12 +806,7 @@ const flg = ref()
const setUserList = ref() const setUserList = ref()
const dbAuthType = ref() const dbAuthType = ref()
const selSetAuthKey = ref('') const selSetAuthKey = ref('')
async function getUser(row: { async function getUser(row: { id?: any; userList?: any; type?: number; key?: string }) {
id?: any
userList?: any
type?: number
key?: string
}) {
showModal.value = !showModal.value showModal.value = !showModal.value
flg.value = row flg.value = row
if (showAuthModal.value) { if (showAuthModal.value) {

View File

@ -1,13 +1,6 @@
<!-- 差别化云空间 --> <!-- 差别化云空间 -->
<script setup lang="ts"> <script setup lang="ts">
import { import { NIcon, NModal, useMessage, NPopover, NCarousel, NCarouselItem } from 'naive-ui'
NIcon,
NModal,
useMessage,
NPopover,
NCarousel,
NCarouselItem
} from 'naive-ui'
import { ChevronBack, ChevronForward } from '@vicons/ionicons5' import { ChevronBack, ChevronForward } from '@vicons/ionicons5'
import AppBlock from '@/components/AppBlock.vue' import AppBlock from '@/components/AppBlock.vue'
import AppAlert from '@/components/AppAlert.vue' import AppAlert from '@/components/AppAlert.vue'
@ -26,8 +19,8 @@ import { isNotOneWeekAgo } from '@/utils'
const store = useUserStore() const store = useUserStore()
const myStore = useMyStore() const myStore = useMyStore()
const userCode = ['admin', 'theme_dandang', 'tech_service'].includes( const userCode = ['admin', 'theme_dandang', 'tech_service'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
const message = useMessage() const message = useMessage()
@ -199,9 +192,7 @@ const openUrl = async (url) => {
return return
} }
srcType.value = getLastSubstring(url) srcType.value = getLastSubstring(url)
if ( if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url url = 'https://view.xdocin.com/view?src=' + url
@ -210,19 +201,10 @@ const openUrl = async (url) => {
window.open( window.open(
url, url,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
@ -278,9 +260,7 @@ const handleSelect = (data: { id: any }) => {
message.info('没有访问权限') message.info('没有访问权限')
return return
} }
form.value.lable1 = dataLeft.value.find( form.value.lable1 = dataLeft.value.find((it: { id: any }) => it.id === data.id)
(it: { id: any }) => it.id === data.id
)
} }
const handleClick = () => { const handleClick = () => {
if (leftContentIsSelects.value === 2) { if (leftContentIsSelects.value === 2) {
@ -295,9 +275,7 @@ const handleSelect2 = (data: { id: any }) => {
return return
} }
console.log(dataRight.value) console.log(dataRight.value)
form.value.lable2 = dataRight.value.find( form.value.lable2 = dataRight.value.find((it: { id: any }) => it.id === data.id)
(it: { id: any }) => it.id === data.id
)
} }
const handleClick2 = () => { const handleClick2 = () => {
// console.log(dataBlist.value) // console.log(dataBlist.value)
@ -396,9 +374,7 @@ async function downs() {
originalFilename = dataBlist.value.originalFilename originalFilename = dataBlist.value.originalFilename
} else { } else {
url = dataBlist.value.map((ite) => ite.response.url) url = dataBlist.value.map((ite) => ite.response.url)
originalFilename = dataBlist.value.map( originalFilename = dataBlist.value.map((ite) => ite.response.originalFilename)
(ite) => ite.response.originalFilename
)
} }
} }
@ -437,9 +413,7 @@ const title = (tit) => {
<img src="./images/logo.svg" class="h56px mr21px" /> <img src="./images/logo.svg" class="h56px mr21px" />
<div class="text-36px">差别化研究</div> <div class="text-36px">差别化研究</div>
</div> </div>
<div <div class="w-full flex-1 flex flex-col mt17px text-#142142 gap-30px h-896px">
class="w-full flex-1 flex flex-col mt17px text-#142142 gap-30px h-896px"
>
<AppBlock class="w-full h241px box !b-0"> <AppBlock class="w-full h241px box !b-0">
<!-- @click="swipeRef && swipeRef.slideNext()" --> <!-- @click="swipeRef && swipeRef.slideNext()" -->
<div class="w1500px px68px relative" v-if="showSwiper"> <div class="w1500px px68px relative" v-if="showSwiper">
@ -499,19 +473,16 @@ const title = (tit) => {
<!-- <div class="text-16px mt6px">{{ i.time }}</div> --> <!-- <div class="text-16px mt6px">{{ i.time }}</div> -->
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
<div <div class="text-20px truncate leading-40px flex items-center">
class="text-20px truncate leading-40px flex items-center"
>
<img <img
v-if="isNotOneWeekAgo(i.createTime)" v-if="isNotOneWeekAgo(i.createTime)"
src="@/assets/images/NEW.gif" src="@/assets/images/NEW.gif"
class="!h-20px !w-auto mr-2" class="!h-20px !w-auto mr-2"
alt="" alt=""
/> />
<span <span class="overflow-hidden text-ellipsis truncate flex flex-1">{{
class="overflow-hidden text-ellipsis truncate flex flex-1" title(i) + '' + i.title
>{{ title(i) + '' + i.title }}</span }}</span>
>
</div> </div>
</template> </template>
<div class="max-w500px text-12px">{{ i.title }}</div> <div class="max-w500px text-12px">{{ i.title }}</div>
@ -524,25 +495,14 @@ const title = (tit) => {
</div> </div>
</AppBlock> </AppBlock>
<div class="flex-1 flex gap-26px"> <div class="flex-1 flex gap-26px">
<AppBlock <AppBlock class="box w-379px h-full relative !overflow-initial" v-if="form">
class="box w-379px h-full relative !overflow-initial" <img :src="form.lable1.url" class="w-full h-full absolute left-0 top-0 rounded-18px" />
v-if="form"
>
<img
:src="form.lable1.url"
class="w-full h-full absolute left-0 top-0 rounded-18px"
/>
<div <div
class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45" class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45"
> >
<p <p
:alt="form.lable1.title" :alt="form.lable1.title"
style=" style="width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
> >
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
@ -563,9 +523,7 @@ const title = (tit) => {
<div <div
class="absolute bottom-0 left-0 w-full h48px px28px flex items-center bg-#fff/67 cursor-pointer" class="absolute bottom-0 left-0 w-full h48px px28px flex items-center bg-#fff/67 cursor-pointer"
> >
<span class="text-#000 text-18px flex-1 font-600">{{ <span class="text-#000 text-18px flex-1 font-600">{{ form.lable1.titles }}</span>
form.lable1.titles
}}</span>
<el-icon <el-icon
v-if="showDropdown1 === true" v-if="showDropdown1 === true"
@ -587,11 +545,9 @@ const title = (tit) => {
</el-icon> </el-icon>
</div> </div>
<div class="bottomclom" v-if="showDropdown1"> <div class="bottomclom" v-if="showDropdown1">
<div v-if="dataLeft" v-for="item in dataLeft"> <div v-if="dataLeft" v-for="item in dataLeft[0].fileList">
<span class="container" @click="handleSelect(item)">{{ <span class="container" @click="down({ it: item })">{{ item.name }}</span>
item.title <!-- <el-dropdown max-height="100px" @command="down">
}}</span>
<el-dropdown max-height="100px" @command="down">
<el-icon size="25"> <el-icon size="25">
<CaretBottom /> <CaretBottom />
</el-icon> </el-icon>
@ -606,7 +562,7 @@ const title = (tit) => {
> >
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown> -->
</div> </div>
</div> </div>
</AppBlock> </AppBlock>
@ -619,13 +575,8 @@ const title = (tit) => {
class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45" class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45"
> >
<p <p
:alt="form.lable1.title" :alt="form.lable2.title"
style=" style="width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
> >
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
<template #trigger> <template #trigger>
@ -636,7 +587,7 @@ const title = (tit) => {
class="!h-20px !w-auto mr-2" class="!h-20px !w-auto mr-2"
alt="" alt=""
/> />
<span>{{ form.lable1.title }}</span> <span>{{ form.lable2.title }}</span>
</div> </div>
<!-- {{ form.lable2.title }} --> <!-- {{ form.lable2.title }} -->
</template> </template>
@ -647,9 +598,7 @@ const title = (tit) => {
<div <div
class="absolute bottom-0 left-0 w-full h48px px28px flex items-center bg-#fff/67 cursor-pointer" class="absolute bottom-0 left-0 w-full h48px px28px flex items-center bg-#fff/67 cursor-pointer"
> >
<span class="text-#000 text-18px flex-1 font-600">{{ <span class="text-#000 text-18px flex-1 font-600">{{ form.lable2.titles }}</span>
form.lable2.titles
}}</span>
<el-icon <el-icon
v-if="showDropdown2 === true" v-if="showDropdown2 === true"
size="25" size="25"
@ -670,16 +619,14 @@ const title = (tit) => {
</el-icon> </el-icon>
</div> </div>
<div class="bottomclom" v-if="showDropdown2"> <div class="bottomclom" v-if="showDropdown2">
<div v-if="dataRight" v-for="item in dataRight"> <div v-if="dataRight" v-for="ite in dataRight[0].fileList">
<span class="container" @click="handleSelect2(item)">{{ <span class="container" @click="down({ it: ite })">{{ ite.name }}</span>
item.title <!-- <el-dropdown max-height="100px" @command="down"> -->
}}</span> <!-- <el-icon size="25">
<el-dropdown max-height="100px" @command="down">
<el-icon size="25">
<CaretBottom /> <CaretBottom />
</el-icon> </el-icon> -->
<template #dropdown> <!-- <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item <el-dropdown-item
v-if="item.fileList" v-if="item.fileList"
@ -688,8 +635,8 @@ const title = (tit) => {
>{{ it.name }}</el-dropdown-item >{{ it.name }}</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
</template> </template> -->
</el-dropdown> <!-- </el-dropdown> -->
</div> </div>
</div> </div>
</AppBlock> </AppBlock>
@ -705,14 +652,7 @@ const title = (tit) => {
</AppAlert> </AppAlert>
<div class="h95px w100% min-h-125px" v-if="shutList1"> <div class="h95px w100% min-h-125px" v-if="shutList1">
<swiper <swiper
:autoplay=" :autoplay="false"
shutList1.length > 4
? {
delay: 1000,
disableOnInteraction: false
}
: false
"
:slides-per-view="3" :slides-per-view="3"
:slides-per-group="1" :slides-per-group="1"
:loopAdditionalSlides="3" :loopAdditionalSlides="3"
@ -725,9 +665,7 @@ const title = (tit) => {
style="height: 120px; width: 100%" style="height: 120px; width: 100%"
> >
<swiper-slide v-for="i in shutList1" :key="i.id"> <swiper-slide v-for="i in shutList1" :key="i.id">
<div <div class="w-full px12px line flex h40px flex items-center justify-between">
class="w-full px12px line flex h40px flex items-center justify-between"
>
<div <div
class="min-w67% max-w70% truncate text-left leading-40px h40px" class="min-w67% max-w70% truncate text-left leading-40px h40px"
@click="downClicks1(i)" @click="downClicks1(i)"
@ -740,9 +678,7 @@ const title = (tit) => {
class="!h-20px !w-auto" class="!h-20px !w-auto"
alt="" alt=""
/> />
<div <div class="min-w23% max-w30% text-right leading-40px h40px">
class="min-w23% max-w30% text-right leading-40px h40px"
>
{{ i.createTime }} {{ i.createTime }}
</div> </div>
</div> </div>
@ -759,17 +695,11 @@ const title = (tit) => {
</div> --> </div> -->
<div <div class="h95px w100% min-h125px max-h125px overflow-y-auto" v-if="shutList2">
class="h95px w100% min-h125px max-h125px overflow-y-auto"
v-if="shutList2"
>
<swiper <swiper
id="swiperList2" id="swiperList2"
:slides-per-view="3" :slides-per-view="3"
:autoplay="{ :autoplay="false"
delay: 1000,
disableOnInteraction: false
}"
:speed="500" :speed="500"
:space-between="1" :space-between="1"
:direction="'vertical'" :direction="'vertical'"
@ -779,9 +709,7 @@ const title = (tit) => {
style="height: 120px; width: 100%" style="height: 120px; width: 100%"
> >
<swiper-slide v-for="(i, index) in shutList2" :key="index"> <swiper-slide v-for="(i, index) in shutList2" :key="index">
<div <div class="w-full px12px line flex h40px flex items-center justify-between">
class="w-full px12px line flex h40px flex items-center justify-between"
>
<div <div
class="min-w67% max-w70% truncate text-left leading-40px h40px" class="min-w67% max-w70% truncate text-left leading-40px h40px"
@click="downClicks1(i)" @click="downClicks1(i)"
@ -794,9 +722,7 @@ const title = (tit) => {
class="!h-20px !w-auto" class="!h-20px !w-auto"
alt="" alt=""
/> />
<div <div class="min-w23% max-w30% text-right leading-40px h40px">
class="min-w23% max-w30% text-right leading-40px h40px"
>
{{ i.createTime }} {{ i.createTime }}
</div> </div>
</div> </div>
@ -808,17 +734,11 @@ const title = (tit) => {
<span class="flex-shrink" @click="bottomClick(3)"></span> <span class="flex-shrink" @click="bottomClick(3)"></span>
<!-- <span class="flex-shrink" ></span> --> <!-- <span class="flex-shrink" ></span> -->
</AppAlert> </AppAlert>
<div <div class="h145px w100% min-h135px max-h145px overflow-y-auto" v-if="shutList3">
class="h145px w100% min-h135px max-h145px overflow-y-auto"
v-if="shutList3"
>
<swiper <swiper
id="swiperList3" id="swiperList3"
:slides-per-view="3" :slides-per-view="3"
:autoplay="{ :autoplay="false"
delay: 1000,
disableOnInteraction: false
}"
:speed="500" :speed="500"
:space-between="1" :space-between="1"
:direction="'vertical'" :direction="'vertical'"
@ -828,9 +748,7 @@ const title = (tit) => {
style="height: 120px; width: 100%" style="height: 120px; width: 100%"
> >
<swiper-slide v-for="(i, index) in shutList3" :key="index"> <swiper-slide v-for="(i, index) in shutList3" :key="index">
<div <div class="w-full px12px line flex h40px flex items-center justify-between">
class="w-full px12px line flex h40px flex items-center justify-between"
>
<div <div
class="min-w67% max-w70% truncate text-left leading-40px h40px" class="min-w67% max-w70% truncate text-left leading-40px h40px"
@click="downClicks1(i)" @click="downClicks1(i)"
@ -843,9 +761,7 @@ const title = (tit) => {
class="!h-20px !w-auto" class="!h-20px !w-auto"
alt="" alt=""
/> />
<div <div class="min-w23% max-w30% text-right leading-40px h40px">
class="min-w23% max-w30% text-right leading-40px h40px"
>
{{ i.createTime }} {{ i.createTime }}
</div> </div>
</div> </div>
@ -863,11 +779,7 @@ const title = (tit) => {
class="my30px text-center text-12px text-#2c3e50" class="my30px text-center text-12px text-#2c3e50"
v-for="item in dogList" v-for="item in dogList"
> >
<img <img :src="item.url" class="w100px !border-0 dog_log" @click="handleSelectPor" />
:src="item.url"
class="w100px !border-0 dog_log"
@click="handleSelectPor"
/>
<div class="mt12px">姓名{{ item.title }}</div> <div class="mt12px">姓名{{ item.title }}</div>
<div class="my8px">职位{{ item.time }}</div> <div class="my8px">职位{{ item.time }}</div>

View File

@ -2,23 +2,30 @@
import HomeHead from '@/views/home/components/HomeHead.vue' import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { NModal, useMessage } from 'naive-ui' import { NModal, useMessage } from 'naive-ui'
import { getCateList, editCateItem,getCateItemList,deleteCateItem ,getLabActList} from '@/api/daikin/base' import {
getCateList,
editCateItem,
getCateItemList,
deleteCateItem,
getLabActList
} from '@/api/daikin/base'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { useMyStore } from '@/stores/modules/mystor' import { useMyStore } from '@/stores/modules/mystor'
const myStore = useMyStore(); const myStore = useMyStore()
const message = useMessage() const message = useMessage()
const store = useUserStore() const store = useUserStore()
const header = { 'token': store.user.token } const header = { 'token': store.user.token }
const userCode = ['admin', 'theme_dandang', 'tech_service'].includes(store.user.roleCode) const userCode = ['admin', 'theme_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const { day, week } = useDate() const { day, week } = useDate()
const route = useRoute() const route = useRoute()
const { push } = useRouter() const { push } = useRouter()
const dataA = ref([]) const dataA = ref([])
const shomkA = ref(false) const shomkA = ref(false)
const actMidIsSelects = ref() const actMidIsSelects = ref()
@ -28,7 +35,7 @@ const cateIds = ref()
const starId = ref() const starId = ref()
const state = reactive<any>({ const state = reactive<any>({
pageNum: 1, pageNum: 1,
cateId:route.params.id!==':id'?route.params.id:starId.value, cateId: route.params.id !== ':id' ? route.params.id : starId.value
}) })
onMounted(async () => { onMounted(async () => {
@ -41,13 +48,11 @@ onMounted(async () => {
tabsList.value = dataBot tabsList.value = dataBot
if (dataBot.length > 0) { if (dataBot.length > 0) {
starId.value = dataBot[0].id starId.value = dataBot[0].id
} }
console.log(starId.value) console.log(starId.value)
cateIds.value = route.params.id cateIds.value = route.params.id
activeName.value = route.params.id !== ':id' ? route.params.id : starId.value + '' activeName.value = route.params.id !== ':id' ? route.params.id : starId.value + ''
}) })
async function getItemList() { async function getItemList() {
const { rows } = await getCateItemList(state) const { rows } = await getCateItemList(state)
@ -55,11 +60,12 @@ async function getItemList() {
} }
const ss = computed(() => [state.pageNum, state.cateId]) const ss = computed(() => [state.pageNum, state.cateId])
watch(() => unref(ss), watch(
() => unref(ss),
async (v) => { async (v) => {
getItemList() getItemList()
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true }
) )
const handleClick = (tab: TabsPaneContext, event: Event) => { const handleClick = (tab: TabsPaneContext, event: Event) => {
@ -76,7 +82,15 @@ const editA = ref({
fileList: [] fileList: []
}) })
async function onSubmit(row: { id: number; url: any; title: string; time: string; dowhat: string; files: never[]; fileList: never[] }) { async function onSubmit(row: {
id: number
url: any
title: string
time: string
dowhat: string
files: never[]
fileList: never[]
}) {
console.log(row) console.log(row)
const { id, title, fileList } = row const { id, title, fileList } = row
@ -84,81 +98,76 @@ async function onSubmit(row: { id: number; url: any; title: string; time: string
let filePath let filePath
console.log(cateId) console.log(cateId)
if (fileList && fileList.length > 0) { if (fileList && fileList.length > 0) {
filePath = fileList.map(file => { filePath = fileList
.map((file) => {
if (file.response) { if (file.response) {
return file.response.url return file.response.url
} } else {
else{
return file.url return file.url
} }
}).join(',') })
.join(',')
} }
console.log({ id, title, cateId, filePath }) console.log({ id, title, cateId, filePath })
if (cateId && cateId == 'undefined') { if (cateId && cateId == 'undefined') {
message.error("请先添加类别!") message.error('请先添加类别!')
return return
} }
const { code, msg } = await editCateItem({ id, title, cateId, filePath }) const { code, msg } = await editCateItem({ id, title, cateId, filePath })
if (code === 200) { message.success("添加成功!") } if (code === 200) {
else { message.error(msg) } message.success('添加成功!')
} else {
message.error(msg)
}
window.location.reload(); window.location.reload()
shomkA.value = false shomkA.value = false
} }
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
console.log(row) console.log(row)
row.fileList = row.filePathList.map(item=>Object.assign(item,{ row.fileList = row.filePathList.map((item) =>
Object.assign(item, {
name: item.originalFileName name: item.originalFileName
})) })
)
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
} }
async function handleDelete(obj) { async function handleDelete(obj) {
const { id } = obj const { id } = obj
const { code, msg } = await deleteCateItem({ id }) const { code, msg } = await deleteCateItem({ id })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
window.location.reload(); } else {
message.error(msg)
}
window.location.reload()
} }
async function downloadFile(data) { async function downloadFile(data) {
// console.log(data) // console.log(data)
if (actMidIsSelects.value === 2) { if (actMidIsSelects.value === 2) {
message.info("没有访问权限") message.info('没有访问权限')
return return
} }
const url = data.it.url const url = data.it.url
try { try {
const response = await fetch(url); const response = await fetch(url)
const blob = await response.blob(); const blob = await response.blob()
const downloadUrl = URL.createObjectURL(blob); const downloadUrl = URL.createObjectURL(blob)
const link = document.createElement('a'); const link = document.createElement('a')
link.href = downloadUrl; link.href = downloadUrl
link.download = data.it.originalFileName; // link.download = data.it.originalFileName //
link.click(); link.click()
URL.revokeObjectURL(downloadUrl); URL.revokeObjectURL(downloadUrl)
} catch (error) { } catch (error) {
message.error('下载文件出错:', error); message.error('下载文件出错:', error)
} }
} }
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -176,7 +185,12 @@ async function downloadFile(data) {
</div> </div>
<div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px rounded-20px"> <div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px rounded-20px">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item,ind) in tabsList" :label="item.id" :name="item.id+''" :index="item.id"> <el-tab-pane
v-for="(item, ind) in tabsList"
:label="item.id"
:name="item.id + ''"
:index="item.id"
>
<template #label> <template #label>
<span class="custom-tabs-label"> <span class="custom-tabs-label">
<span class="text-20px">{{ item.cateName }}</span> <span class="text-20px">{{ item.cateName }}</span>
@ -188,15 +202,23 @@ async function downloadFile(data) {
<div> <div>
<div v-if="dataA" v-for="iet in dataA" class="py25px px10px text-18px"> <div v-if="dataA" v-for="iet in dataA" class="py25px px10px text-18px">
<span class="content">{{ iet.title }}</span> <span class="content">{{ iet.title }}</span>
<el-dropdown max-height="100px" @command="downloadFile" class="top--5px w50px block float-left"> <el-dropdown
max-height="100px"
@command="downloadFile"
class="top--5px w50px block float-left"
>
<el-icon size="25" color="#0054E4"> <el-icon size="25" color="#0054E4">
<CaretBottom /> <CaretBottom />
</el-icon> </el-icon>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="iet.filePathList" v-for="it in iet.filePathList" <el-dropdown-item
:command="{ it }">{{ it.originalFileName }}</el-dropdown-item> v-if="iet.filePathList"
v-for="it in iet.filePathList"
:command="{ it }"
>{{ it.originalFileName }}</el-dropdown-item
>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -205,35 +227,32 @@ async function downloadFile(data) {
<el-button size="small" @click="handleEdit(iet)"></el-button> <el-button size="small" @click="handleEdit(iet)"></el-button>
<el-button size="small" type="danger" @click="handleDelete(iet)"></el-button> <el-button size="small" type="danger" @click="handleDelete(iet)"></el-button>
</div> --> </div> -->
</div> </div>
</div> </div>
</div> </div>
<!-- <el-button v-if="userCode" type="primary" class="" @click="shomkA = !shomkA"></el-button> --> <!-- <el-button v-if="userCode" type="primary" class="" @click="shomkA = !shomkA"></el-button> -->
</div> </div>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
<div class="bg-#FFF p30px"> <div class="bg-#FFF p30px">
<el-form :model="editA" label-width="120px" :inline="true"> <el-form :model="editA" label-width="120px" :inline="true">
<br />
<br>
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit(editA)"></el-button> <el-button type="primary" @click="onSubmit(editA)"></el-button>
</el-form-item> </el-form-item>

View File

@ -26,41 +26,23 @@
> >
<img :src="item.url" class="max-w250px max-h350px min-w250px" /> <img :src="item.url" class="max-w250px max-h350px min-w250px" />
<span class="ml40px text-20px min-w845px max-w845px"> <span class="ml40px text-20px min-w845px max-w845px">
<span <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ item.title }}</span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ item.title }}</span
><br /><br /><br /> ><br /><br /><br />
<span <span
>相关文件 >相关文件
<span v-if="item.fileList?.[0]">{{ <span v-if="item.fileList?.[0]">{{ item.fileList[0].name }}</span></span
item.fileList[0].name
}}</span></span
> >
</span> </span>
<div class="w200px ml30px"> <div class="w200px ml30px">
<el-button <el-button size="small" type="primary" @click="handleEditC(item)"></el-button>
size="small" <el-button size="small" type="danger" @click="handleDeleteC(item)"></el-button>
type="primary"
@click="handleEditC(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteC(item)"
>删除</el-button
>
</div> </div>
</div> </div>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full"> <div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditC({})" <el-button type="primary" @click="handleEditC({})"></el-button>
>新增列表内容</el-button <el-button type="primary" @click="getUser(1)"> </el-button>
>
<el-button type="primary" @click="getUser(1)">
查看范围</el-button
>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -71,17 +53,12 @@
</span> </span>
</template> </template>
<div class="p30px cont relative w100% h800px overflow-y-auto"> <div class="p30px cont relative w100% h800px overflow-y-auto">
<div <div v-for="item in dataA" class="my20px bg-#f5f5f5 rounded-15px flex w-full">
v-for="item in dataA"
class="my20px bg-#f5f5f5 rounded-15px flex w-full"
>
<div> <div>
<img :src="item.url" class="max-w180px max-h350px min-w180px" /> <img :src="item.url" class="max-w180px max-h350px min-w180px" />
</div> </div>
<div class="min-w600px mt50px text-18px"> <div class="min-w600px mt50px text-18px">
<span class="ml40px text-20px" <span class="ml40px text-20px">底部大标题 {{ item.titles }}</span>
>底部大标题 {{ item.titles }}</span
>
<br /><br /> <br /><br />
<br /><br /> <br /><br />
@ -108,31 +85,15 @@
</div> </div>
<div class="w160px ml30px mt120px"> <div class="w160px ml30px mt120px">
<el-button <el-button size="small" type="primary" @click="handleEditA(item)"></el-button>
size="small" <el-button size="small" type="danger" @click="handleDeleteA(item)"></el-button>
type="primary"
@click="handleEditA(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteA(item)"
>删除</el-button
>
</div> </div>
</div> </div>
<!-- <el-button type="primary" @click="handleEditA(editA)" class="my20px fixed bottom-30px left-20% z-2000">新增年度内容</el-button> --> <!-- <el-button type="primary" @click="handleEditA(editA)" class="my20px fixed bottom-30px left-20% z-2000">新增年度内容</el-button> -->
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full"> <div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditA({})" <el-button type="primary" @click="handleEditA({})"></el-button>
>新增列表内容</el-button <el-button type="primary" @click="getUser(2)" @CloseThis="CloseThiss">
>
<el-button
type="primary"
@click="getUser(2)"
@CloseThis="CloseThiss"
>
查看范围</el-button 查看范围</el-button
> >
</div> </div>
@ -145,17 +106,12 @@
</span> </span>
</template> </template>
<div class="p30px cont relative w100% h800px overflow-y-auto"> <div class="p30px cont relative w100% h800px overflow-y-auto">
<div <div v-for="item in dataB" class="my20px bg-#f5f5f5 rounded-15px flex w-full">
v-for="item in dataB"
class="my20px bg-#f5f5f5 rounded-15px flex w-full"
>
<div> <div>
<img :src="item.url" class="max-w180px max-h350px min-w180px" /> <img :src="item.url" class="max-w180px max-h350px min-w180px" />
</div> </div>
<div class="min-w600px mt50px"> <div class="min-w600px mt50px">
<span class="ml40px text-20px" <span class="ml40px text-20px">底部大标题 {{ item.titles }}</span>
>底部大标题 {{ item.titles }}</span
>
<br /><br /> <br /><br />
<br /><br /> <br /><br />
@ -175,35 +131,21 @@
<span class="text-20px">文件列表:</span> <span class="text-20px">文件列表:</span>
</div> </div>
<div class="max-w250px min-w250px mt20px flex items-center"> <div class="max-w250px min-w250px mt20px flex items-center">
<sapn v-if="item.fileList" v-for="i in item.fileList" <span v-if="item.fileList" v-for="i in item.fileList"
><span class="mt5px">{{ i.name }}</span ><span class="mt5px">{{ i.name }}</span
><br /><br ><br /><br
/></sapn> /></span>
</div> </div>
<div class="w120px ml30px mt120px"> <div class="w120px ml30px mt120px">
<el-button <el-button size="small" type="primary" @click="handleEditB(item)"></el-button>
size="small" <el-button size="small" type="danger" @click="handleDeleteB(item)"></el-button>
type="primary"
@click="handleEditB(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteB(item)"
>删除</el-button
>
</div> </div>
</div> </div>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full"> <div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditB({})" <el-button type="primary" @click="handleEditB({})"></el-button>
>新增列表内容</el-button <el-button type="primary" @click="getUser(3)"> </el-button>
>
<el-button type="primary" @click="getUser(3)">
查看范围</el-button
>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -283,6 +225,40 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editC.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editC.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editC.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editC.isPublish == 1">
<el-date-picker
v-model="editC.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
@ -400,13 +376,44 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item class=""> <el-form-item class="">
<el-button <el-button type="primary" class="w88px justify-center" @click="onSubmitA(editA)"
type="primary"
class="w88px justify-center"
@click="onSubmitA(editA)"
>确认</el-button >确认</el-button
> >
</el-form-item> </el-form-item>
@ -455,6 +462,40 @@
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editB.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editB.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editB.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editB.isPublish == 1">
<el-date-picker
v-model="editB.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1" /> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
@ -463,11 +504,7 @@
</div> </div>
</n-modal> </n-modal>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<UserList <UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
</n-modal> </n-modal>
</template> </template>
@ -478,18 +515,14 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import type { UploadProps, UploadUserFile } from 'element-plus' import type { UploadProps, UploadUserFile } from 'element-plus'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { import { getLabActList, getLabCsrActList, addLab, getCateList } from '@/api/daikin/base'
getLabActList,
getLabCsrActList,
addLab,
getCateList
} from '@/api/daikin/base'
import Modify from './modifys.vue' import Modify from './modifys.vue'
import ModifyPor from './modify.vue' import ModifyPor from './modify.vue'
import ModifyList from './component/modify.vue' import ModifyList from './component/modify.vue'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
const ids = ref('') const ids = ref('')
const { push } = useRouter() const { push } = useRouter()
import { pickerOptions } from '@/utils/date'
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
@ -702,6 +735,9 @@ async function onSubmitB(row: {
time: string time: string
files: never[] files: never[]
fileList: never[] fileList: never[]
isTop?: any
isPublish?: any
publishTime?: any
}) { }) {
// console.log(dataB.value, row.id) // console.log(dataB.value, row.id)
dataB.value.map((obj) => { dataB.value.map((obj) => {
@ -885,16 +921,10 @@ const handleDeleteC = (row: any) => {
) )
} }
const handleRemove: UploadProps['onRemove'] = ( const handleRemove: UploadProps['onRemove'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
// console.log(uploadFile, uploadFiles) // console.log(uploadFile, uploadFiles)
} }
const handOnExceed: UploadProps['onExceed'] = ( const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
message.warning('最多只能上传一张图片!') message.warning('最多只能上传一张图片!')
} }
const handlePreview: UploadProps['onSuccess'] = (uploadFile: any) => { const handlePreview: UploadProps['onSuccess'] = (uploadFile: any) => {
@ -958,7 +988,7 @@ const getUser = (id: any) => {
// //
const handleChild = (data: any) => { const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(Boolean(show))
// userList.value = multipleSelection // userList.value = multipleSelection
let userIdList: any[] = [] let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => { multipleSelection.value.forEach((i: { userId: any }) => {

View File

@ -1,9 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { useMessage, NModal, NSelect } from 'naive-ui' import { useMessage, NModal, NSelect } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { getLabCsrActList, updateLab, getCateList, addLab, getLabActList,actLABDel,updateActOne,deleteCateItem ,editCateItem} from '@/api/daikin/base' import {
import { time } from 'echarts'; getLabCsrActList,
updateLab,
getCateList,
addLab,
getLabActList,
actLABDel,
updateActOne,
deleteCateItem,
editCateItem
} from '@/api/daikin/base'
import { time } from 'echarts'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
const ids = ref('') const ids = ref('')
const { push } = useRouter() const { push } = useRouter()
@ -19,7 +30,7 @@ onBeforeMount(async () => {
const { data: dataBot1 } = await getCateList({ indexId: 1 }) const { data: dataBot1 } = await getCateList({ indexId: 1 })
const { data: dataBot3 } = await getCateList({ indexId: 3 }) const { data: dataBot3 } = await getCateList({ indexId: 3 })
options.value = dataBot options.value = dataBot
list.value.map(item => { list.value.map((item) => {
if (item.id === 2) { if (item.id === 2) {
item.options = dataBot item.options = dataBot
} }
@ -53,11 +64,9 @@ onBeforeMount(async () => {
// console.log( swiperList.value ) // console.log( swiperList.value )
}) })
const store = useUserStore() const store = useUserStore()
const message = useMessage() const message = useMessage()
async function onSubmitAdd() { async function onSubmitAdd() {
console.log(swiperList.value) console.log(swiperList.value)
let newData = swiperList.value.map((item) => { let newData = swiperList.value.map((item) => {
@ -65,37 +74,36 @@ async function onSubmitAdd() {
const urls = item.fileList.map((file) => { const urls = item.fileList.map((file) => {
if (file.response) { if (file.response) {
return file.response.url return file.response.url
} } else {
else {
return file.url return file.url
} }
}); })
return { ...item, filePath: urls.join(",") }; return { ...item, filePath: urls.join(',') }
}); })
newData.forEach((item) => { newData.forEach((item) => {
delete item.fileList; delete item.fileList
}); })
// const data = JSON.stringify(newData) // const data = JSON.stringify(newData)
console.log(newData) console.log(newData)
const { code, msg } = await updateLab(newData) const { code, msg } = await updateLab(newData)
// const { code, msg } = await editCateItem(newData) // const { code, msg } = await editCateItem(newData)
if (code === 200) { message.success("修改成功") } if (code === 200) {
else message.warning(msg) message.success('修改成功')
} else message.warning(msg)
// getSwiperList() // getSwiperList()
// push({name:'Diffspace'}) // push({name:'Diffspace'})
} }
async function onSubmit(row) { async function onSubmit(row) {
// swiperList.value.push(row) // swiperList.value.push(row)
console.log(row) console.log(row)
if (row.indexId === '') { if (row.indexId === '') {
message.info("请选择分类选项!") message.info('请选择分类选项!')
return return
} }
if (!row.catId || row.catId === '') { if (!row.catId || row.catId === '') {
message.info("请选择所属模块!") message.info('请选择所属模块!')
return return
} }
@ -104,14 +112,13 @@ async function onSubmit(row) {
if (row.fileList && row.fileList.length > 0) { if (row.fileList && row.fileList.length > 0) {
if (row.fileList[0].response) { if (row.fileList[0].response) {
row.filePath = row.fileList[0].response.url row.filePath = row.fileList[0].response.url
} } else {
else {
row.filePath = row.fileList[0].url row.filePath = row.fileList[0].url
} }
} }
const { msg, code } = await updateActOne(row) const { msg, code } = await updateActOne(row)
if (code === 200) { if (code === 200) {
message.success("操作成功") message.success('操作成功')
getSwiperList() getSwiperList()
} }
// else message.warning(msg) // else message.warning(msg)
@ -130,19 +137,41 @@ async function onSubmit(row) {
// } // }
shomkB.value = false shomkB.value = false
console.log(swiperList.value) console.log(swiperList.value)
} }
async function onSubmitAdds() { async function onSubmitAdds() {
const actTopUserList = unref(actTopUserLists.value) const actTopUserList = unref(actTopUserLists.value)
const actMidUserList = unref(actMidUserLists.value) const actMidUserList = unref(actMidUserLists.value)
const actDownUserList = unref(actDownUserLists.value) const actDownUserList = unref(actDownUserLists.value)
const { id, bannerUserList, leftUserList, rightUserList, memberUserList, bannerContent, leftContent, rightContent, memberContent } = Data.value const {
const { code, msg } = await addLab({ id, bannerUserList, leftUserList, rightUserList, memberUserList, bannerContent, leftContent, rightContent, memberContent, actTopUserList, actMidUserList, actDownUserList }) id,
if (code === 200) { message.success("修改成功") } bannerUserList,
else message.warning(msg) leftUserList,
rightUserList,
memberUserList,
bannerContent,
leftContent,
rightContent,
memberContent
} = Data.value
const { code, msg } = await addLab({
id,
bannerUserList,
leftUserList,
rightUserList,
memberUserList,
bannerContent,
leftContent,
rightContent,
memberContent,
actTopUserList,
actMidUserList,
actDownUserList
})
if (code === 200) {
message.success('修改成功')
} else message.warning(msg)
} }
const shomkB = ref(false) const shomkB = ref(false)
@ -151,20 +180,16 @@ const shomksB = () => {
console.log(shomkB.value) console.log(shomkB.value)
} }
let swiperList = ref([])
let swiperList = ref([
])
const editList = ref() const editList = ref()
const handleEdit = (index: number, row: any) => { const handleEdit = (index: number, row: any) => {
console.log(row) console.log(row)
if (row && row.url) { if (row && row.url) {
console.log(row.files.length) console.log(row.files.length)
if (row.files.length <= 0) { if (row.files.length <= 0) {
row.files.push({ url: row.url }); row.files.push({ url: row.url })
} }
} } else {
else {
editList.value = { editList.value = {
id: '', id: '',
indexId: '1', indexId: '1',
@ -180,43 +205,53 @@ const handleEdit = (index: number, row: any) => {
console.log(row) console.log(row)
} }
const list = ref([{ const list = ref([
{
id: 1, id: 1,
title: '部品业种', title: '部品业种',
options: [{ id: '1', cateName: 'DEVICE' }, { id: '2', cateName: '加工品' }, { id: '3', cateName: '原材料' }] options: [
{ id: '1', cateName: 'DEVICE' },
{ id: '2', cateName: '加工品' },
{ id: '3', cateName: '原材料' }
]
}, },
{ {
id: 3, id: 3,
title: '走访类型', title: '走访类型',
options: [{ id: '1', cateName: '供方走访' }, { id: '2', cateName: '展会走访' }, { id: '3', cateName: '企业走访' }] options: [
{ id: '1', cateName: '供方走访' },
{ id: '2', cateName: '展会走访' },
{ id: '3', cateName: '企业走访' }
]
}, },
{ {
id: 2, id: 2,
title: '探索方向', title: '探索方向',
options: [] options: []
}, }
]) ])
const opt = ref() const opt = ref()
const radioClick = (e) => { const radioClick = (e) => {
opt.value = list.value.find(item => item.id == e) opt.value = list.value.find((item) => item.id == e)
// console.log(ll) // console.log(ll)
} }
const handleDelete = async (index: number, row: any) => { const handleDelete = async (index: number, row: any) => {
swiperList.value = swiperList.value.filter(item => item.id !== row.id); swiperList.value = swiperList.value.filter((item) => item.id !== row.id)
const id = row.id const id = row.id
if (!id) return if (!id) return
const { code, msg } = await actLABDel({ id }) const { code, msg } = await actLABDel({ id })
if(code===200){message.info("操作成功!")} if (code === 200) {
else{ message.info('操作成功!')
} else {
message.error(msg) message.error(msg)
} }
getSwiperList() getSwiperList()
} }
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => { const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning("最多只能上传一个文件!") message.warning('最多只能上传一个文件!')
} }
const header = { 'token': store.user.token } const header = { 'token': store.user.token }
@ -232,7 +267,6 @@ const getUser = (id: any) => {
} }
} }
// //
const handleChild = (data: any) => { const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
@ -240,32 +274,31 @@ const handleChild = (data: any) => {
// userList.value = multipleSelection // userList.value = multipleSelection
let userIdList: any[] = [] let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => { multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId) userIdList.push(i.userId)
}) })
if (flg.value === 1) { if (flg.value === 1) {
actTopUserLists.value = userIdList actTopUserLists.value = userIdList
// actDownUserLists.value = userIdList // actDownUserLists.value = userIdList
// actMidUserLists.value = userIdList // actMidUserLists.value = userIdList
} } else {
else {
actMidUserLists.value = userIdList actMidUserLists.value = userIdList
} }
console.log(userIdList) console.log(userIdList)
onSubmitAdds() onSubmitAdds()
} }
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
console.log(data) console.log(data)
showModal.value = data showModal.value = data
} }
const value = ref() const value = ref()
const optt = [{ id: '1', cateName: '核心部品强化' }, { id: '2', cateName: '新领域部材探索' }, { id: '3', cateName: '外部调研报告' }] const optt = [
{ id: '1', cateName: '核心部品强化' },
{ id: '2', cateName: '新领域部材探索' },
{ id: '3', cateName: '外部调研报告' }
]
const listData = ref() const listData = ref()
const thisSelect = (e) => { const thisSelect = (e) => {
pageInfo.index = e pageInfo.index = e
} }
const thisSelects = () => { const thisSelects = () => {
pageInfo.index = '' pageInfo.index = ''
@ -278,29 +311,36 @@ const pageInfo = reactive({
index: '' index: ''
}) })
const ss = computed(() => [pageInfo.index, pageInfo.currentPage]) const ss = computed(() => [pageInfo.index, pageInfo.currentPage])
watch(() => unref(ss), watch(
() => unref(ss),
async (v) => { async (v) => {
getSwiperList() getSwiperList()
}, },
{ immediate: true, deep: true }, { immediate: true, deep: true }
) )
async function getSwiperList() { async function getSwiperList() {
const indexId = pageInfo.index const indexId = pageInfo.index
const { rows,total } = await getLabCsrActList({ indexId,pageNum:pageInfo.currentPage,pageSize:pageInfo.pageSize }) const { rows, total } = await getLabCsrActList({
indexId,
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize
})
pageInfo.total = total pageInfo.total = total
if (!rows) return if (!rows) return
const datas = rows.map((item: any) => Object.assign(item, { const datas = rows.map((item: any) =>
indexId: item.indexId + '', Object.assign(item, {
})) indexId: item.indexId + ''
})
)
swiperList.value = datas swiperList.value = datas
swiperList.value = datas.map((item: { filePathList: any[] }) => { swiperList.value = datas.map((item: { filePathList: any[] }) => {
const fileList = item.filePathList.map((itt: any) => Object.assign(itt, { const fileList = item.filePathList.map((itt: any) =>
Object.assign(itt, {
name: itt.originalFileName, name: itt.originalFileName,
url: itt.url url: itt.url
})) })
)
return { ...item, fileList } return { ...item, fileList }
}) })
} }
@ -311,24 +351,40 @@ const handleSizeChange=(e)=>{
const handleCurrentChange = (e) => { const handleCurrentChange = (e) => {
console.log(e) console.log(e)
} }
</script> </script>
<template> <template>
<div class="relative w-full h-full"> <div class="relative w-full h-full">
<div class="flex my20px"> <div class="flex my20px">
<el-button type="primary" @click="handleEdit" class="mr-20px">新增研究方向内容</el-button> <el-button type="primary" @click="handleEdit" class="mr-20px">新增研究方向内容</el-button>
<div class="leading-30px w125px h50px ml20px">请选择类别</div> <div class="leading-30px w125px h50px ml20px">请选择类别</div>
<n-select class="w250px" size="large" v-if="optt" :show-arrow="false" :show-checkmark="false" v-model:value="value" :options="optt" label-field="cateName" <n-select
value-field="id" @update:value="thisSelect" /> class="w250px"
size="large"
v-if="optt"
:show-arrow="false"
:show-checkmark="false"
v-model:value="value"
:options="optt"
label-field="cateName"
value-field="id"
@update:value="thisSelect"
/>
<el-button type="primary" @click="thisSelects" class="ml-20px mt5px">重置</el-button> <el-button type="primary" @click="thisSelects" class="ml-20px mt5px">重置</el-button>
</div> </div>
<el-table :data="swiperList" style="width: 100%,height: 600px;overflow-y: auto;" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="swiperList"
:cell-style="{ 'text-align': 'center','overflow-y':'auto' }"> style="width: 100%,height: 600px;overflow-y: auto;"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
>
<el-table-column label="标题" prop="title" /> <el-table-column label="标题" prop="title" />
<el-table-column label="分类选项" width="280"> <el-table-column label="分类选项" width="280">
<template #default="scope"> <template #default="scope">
@ -345,7 +401,6 @@ const handleCurrentChange=(e)=>{
{{ it.name }} {{ it.name }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="通知范围" prop="fileList" > <!-- <el-table-column label="通知范围" prop="fileList" >
<template #default="scope"> <template #default="scope">
@ -358,14 +413,14 @@ const handleCurrentChange=(e)=>{
<el-table-column label="操作" :header-style="{ background: 'red' }"> <el-table-column label="操作" :header-style="{ background: 'red' }">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-form-item> <el-form-item>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-200px"> <div class="my20px fixed bottom-25px left-20% z-2000 h50px w-200px">
<!-- <el-button type="primary" @click="onSubmitAdd"></el-button> --> <!-- <el-button type="primary" @click="onSubmitAdd"></el-button> -->
@ -375,16 +430,17 @@ const handleCurrentChange=(e)=>{
</div> </div>
</el-form-item> </el-form-item>
<div class="fixed bottom-65px right-100px"> <div class="fixed bottom-65px right-100px">
<el-pagination v-model:current-page="pageInfo.currentPage" v-model:page-size="pageInfo.pageSize" <el-pagination
layout="prev, pager, next, jumper" :total="pageInfo.total" v-model:current-page="pageInfo.currentPage"
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper"
:total="pageInfo.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
<n-modal v-model:show="shomkB"> <n-modal v-model:show="shomkB">
<div class="bg-#FFF p30px"> <div class="bg-#FFF p30px">
<el-form :model="editList" label-width="120px" :inline="true"> <el-form :model="editList" label-width="120px" :inline="true">
<el-form-item label="分类选项"> <el-form-item label="分类选项">
@ -394,26 +450,72 @@ const handleCurrentChange=(e)=>{
<el-radio label="3" size="large">外部调研报告</el-radio> <el-radio label="3" size="large">外部调研报告</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item :label="opt.title"> <el-form-item :label="opt.title">
<n-select class="min-w220px" size="large" v-if="opt.options" v-model:value="editList.catId" <n-select
:options="opt.options" label-field="cateName" value-field="cateName" /> class="min-w220px"
v-if="opt.options"
v-model:value="editList.catId"
:options="opt.options"
label-field="cateName"
value-field="cateName"
/>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editList.title" /> <el-input v-model="editList.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editList.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" :on-change="handleChange" :on-exceed="handOnExceed" :limit="1"> v-model:file-list="editList.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
:on-change="handleChange"
:on-exceed="handOnExceed"
:limit="1"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editList.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editList.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editList.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editList.isPublish == 1">
<el-date-picker
v-model="editList.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit(editList)"></el-button> <el-button type="primary" @click="onSubmit(editList)"></el-button>
</el-form-item> </el-form-item>

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 KiB

View File

@ -30,8 +30,17 @@ const props = defineProps({
<div class="containers" v-html="content"></div> <div class="containers" v-html="content"></div>
</div> </div>
</template> </template>
<style>
.containers a {
line-break: anywhere;
}
</style>
<style scoped lang="less"> <style scoped lang="less">
::deep(.containers) {
a {
line-break: anywhere;
}
}
.news-wrapper { .news-wrapper {
.title { .title {
font-size: 22px; font-size: 22px;

View File

@ -1,9 +1,10 @@
<!-- 外部情报 --> <!-- 外部情报 -->
<script setup lang="ts"> <script setup lang="ts">
// import Vue3Tinymce from '@jsdawn/vue3-tinymce'; // import Vue3Tinymce from '@jsdawn/vue3-tinymce';
import HomeHead from "@/views/home/components/HomeHead.vue"; import HomeHead from '@/views/home/components/HomeHead.vue'
import UserPage from '../../../home/intelligence/process/UserPages.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from "@/views/home/hooks/useDate"; import { useDate } from '@/views/home/hooks/useDate'
import { import {
NModal, NModal,
NForm, NForm,
@ -14,37 +15,38 @@ import {
NSelect, NSelect,
NSpace, NSpace,
NRadioGroup, NRadioGroup,
useMessage, useMessage
// FormInst, // FormInst,
} from "naive-ui"; } from 'naive-ui'
import { saveArticle, trendsDetail } from "@/api/daikin/base"; import { saveArticle, trendsDetail } from '@/api/daikin/base'
import Editor from "../components/TinyECE.vue"; import Editor from '../components/TinyECE.vue'
import { useUserStore } from "@/stores/modules/user"; import { useUserStore } from '@/stores/modules/user'
import { useRoute } from "vue-router"; import { pickerOptions } from '@/utils/date'
const { day, week } = useDate(); import { useRoute } from 'vue-router'
const { push } = useRouter(); const { day, week } = useDate()
const store = useUserStore(); const { push } = useRouter()
let route = useRoute(); const store = useUserStore()
let cate = ref(1); let route = useRoute()
const fileList = ref<[]>(); let cate = ref(1)
const editorContent = ref(""); const fileList = ref<[]>()
const formRef = ref<any | null>(null); const editorContent = ref('')
const message = useMessage(); const formRef = ref<any | null>(null)
const message = useMessage()
const formValue: any = ref({ const formValue: any = ref({
type: "1", type: '1',
cate: "1", cate: '1',
title: "", title: '',
tag: "", tag: '',
source: "", source: '',
content: "", content: '',
reviewSource: "2", reviewSource: '2'
}); })
if (route.query.id) { if (route.query.id) {
trendsDetail(route.query.id).then((res) => { trendsDetail(route.query.id).then((res) => {
let data = res.data; let data = res.data
console.log(res); console.log(res)
formValue.value = { formValue.value = {
type: data.type, type: data.type,
cate: data.cate, cate: data.cate,
@ -52,34 +54,34 @@ if (route.query.id) {
tag: data.tag, tag: data.tag,
source: data.source, source: data.source,
content: unescapeHTML(data.content), content: unescapeHTML(data.content),
reviewSource: data.reviewSource, reviewSource: data.reviewSource
}; }
editorContent.value = unescapeHTML(data.content); editorContent.value = unescapeHTML(data.content)
if (data.type === 2) { if (data.type === 2) {
cate.value = 3; cate.value = 3
} else { } else {
} }
console.log(cate.value, data.cate); console.log(cate.value, data.cate)
rules = { rules = {
title: { title: {
required: false, required: false,
message: "请输入标题", message: '请输入标题',
trigger: "blur", trigger: 'blur'
}, },
tag: { tag: {
required: true, required: true,
message: "请输入标题", message: '请输入标题',
trigger: "blur", trigger: 'blur'
}, },
content: { content: {
required: false, required: false,
message: "请输入内容", message: '请输入内容',
trigger: "blur", trigger: 'blur'
}, }
}; }
}); })
} }
let rules: any = { let rules: any = {
// cate: { // cate: {
@ -89,123 +91,146 @@ let rules: any = {
// }, // },
title: { title: {
required: false, required: false,
message: "请输入标题", message: '请输入标题',
trigger: "blur", trigger: 'blur'
}, },
tag: { tag: {
required: true, required: true,
message: "请输入标题", message: '请输入标题',
trigger: "blur", trigger: 'blur'
}, },
content: { content: {
required: false, required: false,
message: "请输入内容", message: '请输入内容',
trigger: "blur", trigger: 'blur'
}, }
}; }
function change(i: any) { function change(i: any) {
// console.log(i) // console.log(i)
cate.value = i; cate.value = i
// console.log(formValue.cate) // console.log(formValue.cate)
formValue.cate = i; formValue.cate = i
// console.log(formValue.cate) // console.log(formValue.cate)
} }
function sure(e: MouseEvent) { function sure(e: MouseEvent) {
e.preventDefault(); e.preventDefault()
formRef.value?.validate((errors) => { formRef.value?.validate((errors) => {
if (!errors) { if (!errors) {
formValue.value.cate = cate.value; formValue.value.cate = cate.value
if (!formValue.value.type) { if (!formValue.value.type) {
message.success("请选择类型"); message.success('请选择类型')
return; return
} }
// console.log('555555', editorContent.value); // console.log('555555', editorContent.value);
save(); save()
} else { } else {
console.log(errors); console.log(errors)
message.error("请输入完整"); message.error('请输入完整')
} }
}); })
} }
function escapeHTML(html: string): string { function escapeHTML(html: string): string {
const tempElement = document.createElement("div"); const tempElement = document.createElement('div')
tempElement.textContent = html; tempElement.textContent = html
return tempElement.innerHTML; return tempElement.innerHTML
} }
function unescapeHTML(html: string) { function unescapeHTML(html: string) {
const doc = new DOMParser().parseFromString(html, "text/html"); const doc = new DOMParser().parseFromString(html, 'text/html')
return doc.documentElement.textContent; return doc.documentElement.textContent
} }
const header = { token: store.user.token }; const header = { token: store.user.token }
// console.log(store.user.token) // console.log(store.user.token)
const dialogImageUrl = ref(""); const dialogImageUrl = ref('')
const dialogVisible = ref(false); const dialogVisible = ref(false)
const handleRemove: UploadProps["onRemove"] = ( const handleRemove: UploadProps['onRemove'] = (uploadFile: any, uploadFiles: any) => {
uploadFile: any,
uploadFiles: any
) => {
// console.log(dialogImageUrl,dialogVisible) // console.log(dialogImageUrl,dialogVisible)
}; }
const handlePictureCardPreview: UploadProps["onPreview"] = (uploadFile: { const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile: { url: string }) => {
url: string; dialogImageUrl.value = uploadFile.url!
}) => { dialogVisible.value = true
dialogImageUrl.value = uploadFile.url!;
dialogVisible.value = true;
// console.log(dialogImageUrl.value) // console.log(dialogImageUrl.value)
}; }
async function save() { async function save() {
const cont = editorContent.value; const cont = editorContent.value
const content = escapeHTML(cont); const content = escapeHTML(cont)
const reviewSource = 2; const reviewSource = 2
// console.log(fileList.value) // console.log(fileList.value)
let bannerImg; let bannerImg
if (fileList.value && fileList.value.length > 0) { if (fileList.value && fileList.value.length > 0) {
bannerImg = fileList.value.map((item) => item.response.url).join(""); bannerImg = fileList.value.map((item) => item.response.url).join('')
} else { } else {
} }
console.log(formValue.value); let userIdList: any[] = []
if (dataList.value?.length > 0) {
dataList.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId)
})
}
const { title, tag, source, cate, type } = formValue.value; const { title, tag, source, cate, type, isTop, isPublish, publishTime } = formValue.value
console.log(cate); console.log(cate)
const { msg, code } = await saveArticle({ const { msg, code } = await saveArticle({
title, title,
tag: "", tag: '',
reviewSource, reviewSource,
source, source,
cate: formValue.cate || formValue.value.cate, cate: formValue.cate || formValue.value.cate,
type, type,
content, content,
bannerImg, bannerImg,
}); userIdList,
isTop,
isPublish,
publishTime
})
if (code === 200) { if (code === 200) {
message.success("新增成功"); message.success('新增成功')
// window.location.reload(); // window.location.reload();
history.back(); history.back()
} else { } else {
message.success(msg); message.success(msg)
} }
} }
// //
const handleChild = (data: string) => { const handleChild = (data: string) => {
editorContent.value = data; editorContent.value = data
}; }
const radios = (e: any) => { const radios = (e: any) => {
console.log(e.srcElement.value); console.log(e.srcElement.value)
if (e.srcElement.value === "1") { if (e.srcElement.value === '1') {
cate.value = 1; cate.value = 1
} else { } else {
cate.value = 4; cate.value = 4
}
}
const showModal = ref(false)
const showModal1 = ref(false)
const setUserList = ref()
const dataList = ref()
const thisClick = () => {
showModal1.value = true
setUserList.value = dataList.value || []
}
const CloseThis = (data: boolean) => {
showModal1.value = data
}
const handleChild1 = (data: any) => {
const { showModal: show, multipleSelection } = data
showModal1.value = unref(show)
dataList.value = unref(multipleSelection)
}
const handleClose = (tag: any) => {
dataList.value.splice(dataList.value.indexOf(tag), 1)
} }
};
const showModal = ref(false);
</script> </script>
<template> <template>
@ -332,16 +357,64 @@ const showModal = ref(false);
<n-input v-model:value="formValue.source" placeholder="" /> <n-input v-model:value="formValue.source" placeholder="" />
</n-form-item> </n-form-item>
<n-form-item label="情报内容" path="content"> <n-form-item label="情报内容" path="content">
<Editor <Editor @getChildData="handleChild" v-model="formValue.content"></Editor>
@getChildData="handleChild" </n-form-item>
v-model="formValue.content" <n-button @click="thisClick"> </n-button>
></Editor> <div class="mt15px h150px overflow-y-auto">
<el-tag
v-for="i in dataList"
:key="i"
class="mx-1 my5px"
closable
:disable-transitions="false"
@close="handleClose(i)"
type="info"
size="large"
>
{{ i.nickName }}
</el-tag>
</div>
<n-form-item label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
inactive-value="N"
active-value="Y"
></el-switch>
</n-form-item>
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<div> <div>
<n-button @click="showModal = true"> 文本内容预览</n-button> <n-button @click="showModal = true"> 文本内容预览</n-button>
</div> </div>
</n-form-item> </n-form-item>
<!-- <n-form-item>
<div>
<el-button type="primary" @click="thisClick"> {{''}}</el-button>
</div>
</n-form-item> -->
</n-form> </n-form>
<n-button <n-button
attr-type="button" attr-type="button"
@ -354,12 +427,19 @@ const showModal = ref(false);
</div> </div>
<n-modal v-model:show="showModal"> <n-modal v-model:show="showModal">
<div class="flex w80% p30px bg-#fff my40px rounded-30px"> <div class="flex w80% p30px bg-#fff my40px rounded-30px">
<div <div class="overflow-y-auto h800px container" v-html="editorContent"></div>
class="overflow-y-auto h800px container"
v-html="editorContent"
></div>
</div> </div>
</n-modal> </n-modal>
<n-modal v-model:show="showModal1">
<!-- <n-card style="width:1100px; height: 800px;" title="调达中心" :bordered="false" size="huge" role="dialog"
aria-modal="true"> -->
<UserPage
:userDataList="setUserList"
@clickChild="handleChild1"
@CloseThis="CloseThis"
></UserPage>
<!-- </n-card> -->
</n-modal>
</template> </template>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -4,6 +4,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import Editor from './TinyECE.vue' import Editor from './TinyECE.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { noticeld } from '@/stores/modules/noticeId'
import type { FormInst } from 'naive-ui' import type { FormInst } from 'naive-ui'
import { useMessage } from 'naive-ui' import { useMessage } from 'naive-ui'
import { ref } from 'vue' import { ref } from 'vue'
@ -25,6 +26,19 @@ import { useUserStore } from '@/stores/modules/user'
const store = useUserStore() const store = useUserStore()
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
const not = noticeld()
const toDetail2 = (id: any) => {
not.article.cate = id
console.log(not.article.cate)
// push(`${route.path.replace('/external','')}/info/${n.id}`)
push('/external/Board')
}
const userCode = ref(false)
userCode.value = ['admin', 'waibuyemianguanliyuan', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
</script> </script>
<template> <template>
@ -38,9 +52,34 @@ const { push } = useRouter()
<div class="text-36px">外部情报</div> <div class="text-36px">外部情报</div>
<div class="text-18px ml40px mr25px">{{ day }}</div> <div class="text-18px ml40px mr25px">{{ day }}</div>
<div class="text-18px flex-1">{{ week }}</div> <div class="text-18px flex-1">{{ week }}</div>
<el-dropdown>
<div class="text-#fff" style="margin-right: 8px" v-if="userCode">
<div class="add text-18px px13px py11px cursor-pointer">外部审批流程</div>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="push({ path: '/external/Process' })">News</el-dropdown-item>
<el-dropdown-item @click="push({ path: '/external/Process', query: { cate: '8' } })"
>重要通知</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-dropdown>
<div class="text-#fff" style="margin-right: 28px" v-if="userCode">
<div class="add text-18px px13px py11px cursor-pointer">外部新增 +</div>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="toDetail2(7)">News</el-dropdown-item>
<el-dropdown-item @click="toDetail2(8)"></el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<div <div
style="margin-right: 8px" style="margin-right: 8px"
v-if="store.user.isPublish === 1 || store.user.roleCode === 'zhuxi'" v-if="store.user.isPublish === 1 || store.user.roleCode?.includes('zhuxi')"
> >
<div <div
class="add text-18px px13px py11px cursor-pointer" class="add text-18px px13px py11px cursor-pointer"
@ -51,7 +90,7 @@ const { push } = useRouter()
</div> </div>
<div <div
style="margin-right: 8px" style="margin-right: 8px"
v-if="store.user.isPublish === 1 || store.user.roleCode === 'zhuxi'" v-if="store.user.isPublish === 1 || store.user.roleCode?.includes('zhuxi')"
> >
<div <div
class="add text-18px px13px py11px cursor-pointer" class="add text-18px px13px py11px cursor-pointer"

View File

@ -4,11 +4,7 @@ import { useUserStore } from '@/stores/modules/user'
import HomeHead from '@/views/home/components/HomeHead.vue' import HomeHead from '@/views/home/components/HomeHead.vue'
import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { import { getNoticeList, deleteWithdraw, getManagerList } from '@/api/daikin/base'
getNoticeList,
deleteWithdraw,
getManagerList
} from '@/api/daikin/base'
import { noticeld } from '@/stores/modules/noticeId' import { noticeld } from '@/stores/modules/noticeId'
import { getImg } from '../images' import { getImg } from '../images'
import { NTag } from 'naive-ui' import { NTag } from 'naive-ui'
@ -83,7 +79,7 @@ const clickTo = (data: any) => {
store.article.noticeld = noticeId store.article.noticeld = noticeId
if ( if (
[1, 2].includes(reviewStatus) && [1, 2].includes(reviewStatus) &&
['review_person', 'zhuxi', 'tech_service'].includes(store2.user.roleCode) ['review_person', 'zhuxi', 'tech_service'].some((item) => store2.user.roleCode?.includes(item))
) { ) {
push(`/Home/Process/ProcessInfo/${id}`) push(`/Home/Process/ProcessInfo/${id}`)
} else { } else {
@ -208,9 +204,7 @@ let tabs = store2.user.isReview > 0 ? tabsList2.value : tabsList.value
<div class="text-18px ml40px mr25px">{{ day }}</div> <div class="text-18px ml40px mr25px">{{ day }}</div>
<div class="text-18px">{{ week }}</div> <div class="text-18px">{{ week }}</div>
</div> </div>
<div <div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px">
class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px"
>
<div> <div>
<el-tabs type="card" v-model="activeNames" @tab-click="handleClicks"> <el-tabs type="card" v-model="activeNames" @tab-click="handleClicks">
<el-tab-pane name="2"> <el-tab-pane name="2">
@ -221,8 +215,8 @@ let tabs = store2.user.isReview > 0 ? tabsList2.value : tabsList.value
<el-tab-pane <el-tab-pane
name="3" name="3"
v-if=" v-if="
['review_person', 'zhuxi', 'tech_service'].includes( ['review_person', 'zhuxi', 'tech_service'].some((item) =>
store2.user.roleCode store2.user.roleCode?.includes(item)
) )
" "
> >
@ -348,28 +342,20 @@ let tabs = store2.user.isReview > 0 ? tabsList2.value : tabsList.value
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="i.firstReviewName"> <el-dropdown-item v-if="i.firstReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">初审人{{ i.firstReviewName }}</span>
>初审人{{ i.firstReviewName }}</span
>
<span class="ml20px">初审时间{{ i.firstReviewTime }}</span> <span class="ml20px">初审时间{{ i.firstReviewTime }}</span>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="i.ultimateReviewName"> <el-dropdown-item v-if="i.ultimateReviewName">
<div class="ml20px text-#808696 !text-12px flex"> <div class="ml20px text-#808696 !text-12px flex">
<span class="min-w120px" <span class="min-w120px">终审人{{ i.ultimateReviewName }}</span>
>终审人{{ i.ultimateReviewName }}</span <span class="ml20px">终审时间{{ i.ultimateReviewTime }}</span>
>
<span class="ml20px"
>终审时间{{ i.ultimateReviewTime }}</span
>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<span class="shrink-0 ml38px text-#808696 w220px">{{ <span class="shrink-0 ml38px text-#808696 w220px">{{ i.createTime }}</span>
i.createTime
}}</span>
<span <span
v-if="store2.user.isReview > 0 && i.publishName" v-if="store2.user.isReview > 0 && i.publishName"
class="ml20px text-#808696 text-16px flex-1" class="ml20px text-#808696 text-16px flex-1"
@ -377,7 +363,7 @@ let tabs = store2.user.isReview > 0 ? tabsList2.value : tabsList.value
> >
<span <span
v-if=" v-if="
['publish', 'tech_service'].includes(store2.user.roleCode) && ['publish', 'tech_service'].some((item) => store2.user.roleCode?.includes(item)) &&
Status.reviewStatus === 1 Status.reviewStatus === 1
" "
class="absolute right-10px top-18px" class="absolute right-10px top-18px"

View File

@ -6,6 +6,7 @@ import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import UserPage from './UserPages.vue' import UserPage from './UserPages.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import { getArticleDetail, review } from '@/api/daikin/base' import { getArticleDetail, review } from '@/api/daikin/base'
import { pickerOptions } from '@/utils/date'
import { import {
NModal, NModal,
NCard, NCard,
@ -59,6 +60,8 @@ let formValue: any = ref({
source: '', source: '',
content: '', content: '',
isTop: 'N', isTop: 'N',
isPublish: 0,
publishTime: '',
bannerImg: '' bannerImg: ''
}) })
@ -422,6 +425,37 @@ const showModalRefs = ref(false)
{{ i.nickName }} {{ i.nickName }}
</el-tag> </el-tag>
</div> </div>
<!-- <n-form-item label="是否置顶">
<el-switch
v-model="formValue.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</n-form-item> -->
<n-form-item label="是否定时发送">
<el-switch
v-model="formValue.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (formValue.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</n-form-item>
<n-form-item label="发布时间" v-if="formValue.isPublish == 1">
<el-date-picker
v-model="formValue.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</n-form-item>
<div class="text-end float-right block h50px pt10px"> <div class="text-end float-right block h50px pt10px">
<n-form-item> <n-form-item>
<n-button attr-type="button" style="padding: 0 20px" @click="submitSave(2)"> <n-button attr-type="button" style="padding: 0 20px" @click="submitSave(2)">

View File

@ -17,7 +17,6 @@ async function getTree() {
if (data && data != 'null' && data.length > 0) { if (data && data != 'null' && data.length > 0) {
treeData.value = data treeData.value = data
} }
console.log(data)
} }
const props = defineProps({ const props = defineProps({
@ -67,11 +66,13 @@ async function getUserPage() {
}, 150) }, 150)
} }
function selection(list = props.userDataList) { function selection(list = uniqBy(props.userDataList, 'userId')) {
console.log('🚀 ~ file: UserPages.vue:79 ~ list:', toRaw(list))
if (userData.value && list) { if (userData.value && list) {
const commonItems = userData.value.filter((item1: { userId: any }) => const commonItems = userData.value.filter((item1: { userId: any }) =>
list.some((item2) => item2.userId === item1.userId) list.some((item2) => item2.userId === item1.userId)
) )
toggleSelection(commonItems) toggleSelection(commonItems)
} }
} }
@ -108,7 +109,7 @@ const multipleSelection = ref<[]>([])
const multipleSelectionObj: any = {} const multipleSelectionObj: any = {}
const handleSelectionChange = (val) => { const handleSelectionChange = (val) => {
console.log(val) // console.log(val, 'val-')
multipleSelectionObj[da.deptId] = val multipleSelectionObj[da.deptId] = val
multipleSelection.value = uniqBy(Object.values(multipleSelectionObj).flat(), 'userId') multipleSelection.value = uniqBy(Object.values(multipleSelectionObj).flat(), 'userId')
} }
@ -210,7 +211,7 @@ const addGroupList = () => {
showModal2.value = true showModal2.value = true
} }
const deleteGroupp = (i: any) => { const deleteGroupp = (i: any) => {
console.log(i) // console.log(i)
deleteGroups(i.id) deleteGroups(i.id)
} }
async function deleteGroups(id) { async function deleteGroups(id) {

View File

@ -0,0 +1,556 @@
<!-- 市况 -->
<script setup lang="ts">
import { Chart1, Chart3, Chart4, Chart5, Chart6 } from './MarketData-bak'
import HomeHead from '@/views/home/components/HomeHead.vue'
import AppBlock from '@/components/AppBlock.vue'
import AppNewsBox from '@/components/AppNewsBox.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { getList ,marketPreADD,getMarketUser,saveMarketUser,MarketDownload,MarketPreview,getCurrencyList,getMetalList} from '@/api/daikin/base'
import { NModal,NCard } from 'naive-ui'
import {formatDate} from '@/utils/format'
import { message } from '@/utils/message'
import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
import Amtion from '@/components/amtion.vue'
import {noticeld} from '@/stores/modules/noticeId'
const store = useUserStore()
const stores = noticeld()
const userCode = ['admin','shikuang_dandang','tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const userCodes = ['admin','huilv_dandang','tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const { day, week } = useDate()
const { push } = useRouter()
const currentDate = new Date();
const currentDates = new Date();
const value1 = ref<[Date, Date]>([
currentDate.setMonth(currentDate.getMonth() - 11),
new Date()
])
const value2 = ref<[Date, Date]>([
currentDates.setMonth(currentDates.getMonth() - 11),
new Date()
])
const { chartRef: chartRef1, option: chartOption1,state } = Chart1()
const { chartRef: chartRef3, option: chartOption3 ,state2} = Chart3()
const { chartRef: chartRef4, option: chartOption4 ,state3} = Chart4()
const { chartRef: chartRef5, option: chartOption5,state4 } = Chart5()
const { chartRef: chartRef6, option: chartOption6 ,state5} = Chart6()
const listData = ref()
const listDatas = ref()
async function getData() {
const {data} = await getList({type:2})
const {data:ds} = await getList({type:1})
listData.value = data
listDatas.value = ds
}
const metal = ref()
const currency = ref()
onMounted(async ()=>{
getData()
const {data} =await getCurrencyList()
const {data:dat} =await getMetalList()
if(dat&&dat!='null'&&dat.length>0){
metal.value = dat
// .filter((item:any) => {
// if(["Fe","lengmei"].includes(item.value)){
// return false
// }else return item
// })
from.value.label.radio = dat[0].value
state4.number = dat[0].value
console.log("🚀 ~ file: Market.vue:56 ~ metal:", metal)
}
if(data&&data!='null'&&data.length>0){
currency.value = data
from.value.labe2.radio = data[0].value
const dat = data[0].value.split(',')
state5.currencyCodeFrom =dat[0]
state5.currencyCodeTo =dat[1]
state2.currencyCodeFrom =dat[0]
state2.currencyCodeTo =dat[1]
state3.currencyCodeFrom =dat[0]
state3.currencyCodeTo =dat[1]
}
})
const src = ref('');
const srcType = ref()
const showModalRef2 =ref(false)
const lokeFuck = async (n)=>{
const {id} =n
if(!id) return
let {data:{url}} = await MarketPreview({id})
if(!url) {
message.info("没有可预览文件!")
return
}
srcType.value = getLastSubstring(url)
if(['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'].includes(srcType.value)){
// src.value = filePath
// pdfShow.value = true
url='https://view.xdocin.com/view?src='+url
const screenWidth = window.screen.width;
const screenHeight = window.screen.height;
window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0)
}
else{
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
}
function getLastSubstring(str: string): string {
const lastIndex = str.lastIndexOf('.');
if (lastIndex !== -1) {
return str.substring(lastIndex + 1);
} else {
return '';
}
}
async function downloadFile(data: { id: any; title: string }) {
console.log(data)
if(!data.id) return
try {
const response = await MarketDownload({ id: data.id })
console.log(response)
var blob = new Blob([response.data]);
const downloadUrl = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.download = response.fileName; //
link.click();
URL.revokeObjectURL(downloadUrl);
} catch (error) {
message.error(error);
}
}
const tab = ref(false)
const tab1 = ref(false)
const tab2 = ref(false)
const names =ref('Cu')
const names1 =ref('100USD-CNY')
const names2 =ref('100USD-CNY')
const tabClick1 = (e)=>{
console.log(e.target.getAttribute('data-id'))
tab1.value=false
const dat =e.target.getAttribute('data-id').split(',')
names1.value =e.target.innerText
state2.currencyCodeFrom =dat[0]
state2.currencyCodeTo =dat[1]
}
const tabClick2 = (e)=>{
console.log(e.target.getAttribute('data-id'))
tab2.value=false
const dat =e.target.getAttribute('data-id').split(',')
names2.value =e.target.innerText
state3.currencyCodeFrom =dat[0]
state3.currencyCodeTo =dat[1]
}
const tabClick= (e)=>{
console.log(e.target)
tab.value=false
state.type =e.target.getAttribute('data-id')
names.value =e.target.innerText
}
const tabShow = (num)=>{
// console.log(num)
switch (num) {
case 0:
tab.value = tab.value === false?true:false
break;
case 1:
tab1.value = tab1.value === false?true:false
break;
case 2:
tab2.value = tab2.value === false?true:false
break;
}
}
const from = ref({
label:{
radio:''
},
labe2:{
radio:''
}
})
const shomk = ref(false)
const sdubList = ref({
title:'',
fileList:[],
})
const shomks=(it)=>{
sdubList.value.type = it
// console.log(sdubList.value)
shomk.value =true
}
async function onSubmit(){
const {type,title ,fileList} = sdubList.value
let filePath
if(fileList.length>0){
// console.log(fileList)
filePath = fileList[0].response.url
}
const {msg,code} = await marketPreADD({type,title,filePath})
if (code === 200) { message.success("修改成功") }
else message.warning(msg)
window.location.reload();
// console.log(sdubList.value)
}
const handleExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning("当前只支持上传一个文件")
}
const thisCka = (e)=>{
if(value1.value){
state4.startTime = formatDate(value1.value[0]).substring(0,10)
state4.endTime = formatDate(value1.value[1]).substring(0,10)
}
state4.number =e
console.log(e)
}
const thisCka2 = (e)=>{
const dat = e.split(',')
if(value2.value){
state5.startTime = formatDate(value2.value[0]).substring(0,10)
state5.endTime = formatDate(value2.value[1]).substring(0,10)
}
state5.currencyCodeFrom =dat[0]
state5.currencyCodeTo =dat[1]
}
const timenFirst=(e)=>{
// console.log(e)
state4.startTime = formatDate(value1.value[0]).substring(0,10)
state4.endTime = formatDate(value1.value[1]).substring(0,10)
}
const timenFirsts=(e)=>{
// console.log(e)
state5.startTime = formatDate(value2.value[0]).substring(0,10)
state5.endTime = formatDate(value2.value[1]).substring(0,10)
}
const header = { 'token': store.user.token }
const showModal = ref(false)
const flg = ref()
const setUserList =ref()
async function getUser(moduleId: any) {
showModal.value = !showModal.value
flg.value = moduleId
const {data: userArr} = await getMarketUser({moduleId})
stores.article.reviewSource = '2'
setUserList.value = userArr
}
//
const handleChild = (data: any) => {
console.log(data, 444);
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
// userList.value = multipleSelection
let userIdList: any[] =[]
multipleSelection.value.forEach((i: { userId: any })=>{
// console.log(dataList.value)
userIdList.push(i.userId)
})
saveMarketUser({
moduleId: flg.value,
userIdList: userIdList
})
}
const CloseThiss = (data: boolean)=>{
showModal.value = data
}
</script>
<template>
<HomeHead class="top">
<template #content>
<!-- <HomeHeadSearch /> -->
</template>
</HomeHead>
<div class="h-full relative flex flex-col overflow-y-auto scrollbar-width-1px">
<div class="pl12px mt30px flex w-full h-full gap-30px">
<!-- <img src="./images/shukuang.png" alt="" class="w-full h-full"> -->
<AppBlock class="flex-1 box">
<div class="box-title">市况</div>
<el-button type="primary" v-if="userCode" class="button !mr-30px !mt-[-30px] z-100" @click="push({name:'MarketDataModify'})"></el-button>
<div class="bgStyle mt30px">
<div class="mr25px relative w100%">
<span @click="tabShow(0)" class="title bg-#FF603A p5px pl10px pr20px">{{names}}<el-icon><CaretBottom /></el-icon></span>
<div v-if="tab" class="tab absolute bg-#fff w100px top-50px z-50 text-#112144 text-center leading-28px text-18px ">
<div v-if="metal" v-for="im in metal.filter((item:any) => !['Fe','lengmei'].includes(item.value))" class="py5px !rounded-none" :data-id="im.value" @click="tabClick" >{{im.title}}</div>
<!-- <div class="py5px !rounded-none" data-id="Fe" @click="tabClick">Fe</div>
<div class="py5px !rounded-none" data-id="Cu" @click="tabClick">Cu</div>
<div class="py5px !rounded-none" data-id="Re" @click="tabClick"></div> -->
</div>
<VChart class=" absolute z-22" ref="chartRef1" :option="chartOption1" autoresize />
</div>
<!-- <div>
<span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span>
<VChart class="absolute z-22" ref="chartRef2" :option="chartOption2" autoresize />
</div> -->
</div>
<div class="bgStyle !h250px mt20px">
<div >
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef5" :option="chartOption5" autoresize />
</div>
</div>
<div class="mt20px ml10px">
<div>
<span class="text-#000">日期:</span>
<el-config-provider :locale="zhCn">
<el-date-picker v-model="value1" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small" @change="timenFirst"/></el-config-provider>
</div>
<div class="mt10px">
<el-radio-group v-model="from.label.radio" class="ml-4" @change="thisCka">
<el-radio v-if="metal" v-for="im in metal" :label="im.value" size="large" >{{im.title}}</el-radio>
<!-- <el-radio label="Al" size="large" >Al</el-radio>
<el-radio label="Fe" size="large" >Fe</el-radio>
<el-radio label="Re" size="large" >稀土</el-radio> -->
</el-radio-group>
</div>
</div>
<div class="bgStyle !h165px mt15px mb10px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px b">市况预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(1)"></el-button> -->
<el-button type="primary" v-if="userCode" class="button" @click="push({name:'MarketModifys'})"></el-button>
<p class="mt40px p15px !border-none max-h120px overflow-auto">
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listDatas" :key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px">
<el-button type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p>
</p>
</p>
</div>
</div>
</AppBlock>
<AppBlock class="flex-1 box">
<div class="box-title ">汇率</div>
<div class="bgStyle mt30px">
<div class="mr25px">
<span @click="tabShow(1)" class="title bg-#FF603A !text-16px pl13px pr20px ">{{names1}}<el-icon><CaretBottom /></el-icon></span>
<div v-if="tab1" class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value" @click="tabClick1">{{it.title}}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick1">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick1">-</div> -->
</div>
<VChart class=" absolute z-22" ref="chartRef3" :option="chartOption3" autoresize />
</div>
<div>
<span @click="tabShow(2)" class="title bg-#70BFCD !text-16px pl13px pr20px ">{{names2}}<el-icon><CaretBottom /></el-icon></span>
<div v-if="tab2" class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value" @click="tabClick2">{{it.title}}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick2">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick2">-</div> -->
</div>
<VChart class="absolute z-22" ref="chartRef4" :option="chartOption4" autoresize />
</div>
</div>
<div class="bgStyle !h250px mt20px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef6" :option="chartOption6" autoresize />
</div>
</div>
<div class="mt20px ml10px">
<div>
<span class="text-#000">日期:</span>
<el-config-provider :locale="zhCn">
<el-date-picker v-model="value2" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small" @change="timenFirsts"/></el-config-provider>
</div>
<div class="mt10px">
<el-radio-group v-model="from.labe2.radio" class="ml-4" @change="thisCka2">
<el-radio v-if="currency" v-for="it in currency" :label="it.value" size="large" >{{it.title}}</el-radio>
<!-- <el-radio label="JPY,USD" size="large" >日元-美元</el-radio>
<el-radio label="CNA,USD" size="large" >人民币-美元</el-radio> -->
</el-radio-group>
</div>
</div>
<div class="bgStyle !h165px mt15px mb10px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">汇率预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(2)"></el-button> -->
<el-button type="primary" v-if="userCodes" class="button" @click="push({name:'MarketModify'})"></el-button>
<p class="mt40px p15px !border-none max-h120px overflow-auto">
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listData" :key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px">
<el-button type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p>
</p>
</p>
</div>
</div>
</AppBlock>
</div>
</div>
<!-- <div style="width: 1200px; height:800px ; position: fixed; z-index: 100; top:50px;;">
</div> -->
<n-modal :mask-closable="true" v-model:show="showModalRef2">
<div class="w90% h90% ">
<Amtion :data="src" :datas="srcType"/>
</div>
</n-modal>
<n-modal v-model:show="shomk">
<div class="py40px px30px bg-#fff">
<el-form :model="sdubList" label-width="120px" :inline="true">
<el-form-item label="标题" >
<el-input v-model="sdubList.title"/>
</el-form-item>
<br>
<el-form-item label="文件">
<el-upload v-model:file-list="sdubList.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" :on-change="handleChange">
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
<br>
<br>
<el-form-item class="ml80px">
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
</n-modal>
<n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/>
</n-modal>
</template>
<style scoped lang="less">
.button{
display: block;
float: right;
margin-right:20px ;
}
::-webkit-scrollbar{
width: 1px;
}
.top {
position: absolute;
right: 30px;
top: -92px;
}
.date-wrapper[data-v-c5c4f420] {
line-height: 1.5;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
color: #142142;
border: none;
}
.tab{
div:hover{
color: #0036BC;
}
}
.box {
padding: 23px 20px 0 20px;
.box-title {
font-size: 28px;
font-weight: 600;
position: relative;
padding-left: 24px;
color: black;
&::before {
content: " ";
display: block;
width: 8px;
height: 30px;
background-color: #003ab5;
position: absolute;
left: 0;
}
}
}
.bgStyle {
display: flex;
width: 100%;
height: 270px;
position: relative;
padding: 0 5px;
div {
flex: 1;
border: 1px solid rgb(236, 236, 236);
border-radius: 18px;
.title {
// width: 60px;
// height: 60px;
border-radius: 18px 0 50px 0;
color: aliceblue;
line-height: 40px;
font-size: 24px;
font-weight: 500;
z-index: 50;
position: absolute;
}
}
}
</style>

View File

@ -7,7 +7,7 @@ import AppNewsBox from '@/components/AppNewsBox.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { getList ,marketPreADD,getMarketUser,saveMarketUser,MarketDownload,MarketPreview,getCurrencyList,getMetalList} from '@/api/daikin/base' import { getList, marketPreADD, getMarketUser, saveMarketUser, MarketDownload, MarketPreview, getCurrencyList, getMetalList, fetchExchangeInfo,fetchTimeFuturecenterCu,fetchTimeFuturecenterAl } from '@/api/daikin/base'
import { NModal, NCard } from 'naive-ui' import { NModal, NCard } from 'naive-ui'
import { formatDate } from '@/utils/format' import { formatDate } from '@/utils/format'
import { message } from '@/utils/message' import { message } from '@/utils/message'
@ -17,8 +17,12 @@ import Amtion from '@/components/amtion.vue'
import { noticeld } from '@/stores/modules/noticeId' import { noticeld } from '@/stores/modules/noticeId'
const store = useUserStore() const store = useUserStore()
const stores = noticeld() const stores = noticeld()
const userCode = ['admin','shikuang_dandang','tech_service'].includes(store.user.roleCode) const userCode = ['admin', 'shikuang_dandang', 'tech_service'].some((item) =>
const userCodes = ['admin','huilv_dandang','tech_service'].includes(store.user.roleCode) store.user.roleCode?.includes(item)
)
const userCodes = ['admin', 'huilv_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
const currentDate = new Date(); const currentDate = new Date();
@ -32,6 +36,7 @@ const value2 = ref<[Date, Date]>([
new Date() new Date()
]) ])
const { chartRef: chartRef1, option: chartOption1, state } = Chart1() const { chartRef: chartRef1, option: chartOption1, state } = Chart1()
const { option: chartOption11 } = Chart1()
const { chartRef: chartRef3, option: chartOption3, state2 } = Chart3() const { chartRef: chartRef3, option: chartOption3, state2 } = Chart3()
const { chartRef: chartRef4, option: chartOption4, state3 } = Chart4() const { chartRef: chartRef4, option: chartOption4, state3 } = Chart4()
const { chartRef: chartRef5, option: chartOption5, state4 } = Chart5() const { chartRef: chartRef5, option: chartOption5, state4 } = Chart5()
@ -50,6 +55,7 @@ const currency = ref()
onMounted(async () => { onMounted(async () => {
getData() getData()
const { data } = await getCurrencyList() const { data } = await getCurrencyList()
console.log("🚀 ~ file: Market.vue:58 ~ data:", data)
const { data: dat } = await getMetalList() const { data: dat } = await getMetalList()
if (dat && dat != 'null' && dat.length > 0) { if (dat && dat != 'null' && dat.length > 0) {
metal.value = dat metal.value = dat
@ -159,7 +165,7 @@ const tabClick= (e)=>{
console.log(e.target) console.log(e.target)
tab.value = false tab.value = false
state.type = e.target.getAttribute('data-id') state.type = e.target.getAttribute('data-id')
names.value =e.target.innerText // names.value =e.target.innerText
} }
const tabShow = (num) => { const tabShow = (num) => {
@ -274,6 +280,21 @@ async function getUser(moduleId: any) {
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
getHomeExInfo()
getTimeFuturecenter()
const homeExchangeInfo = ref<any>([])
async function getHomeExInfo() {
const { data } = await fetchExchangeInfo()
homeExchangeInfo.value = data
console.log('🚀 ~ file: Home.vue:252 ~ }):', data)
}
async function getTimeFuturecenter() {
const { data } = await fetchTimeFuturecenterCu()
console.log("🚀 ~ file: Market.vue:293 ~ data:", data)
}
</script> </script>
<template> <template>
@ -288,62 +309,100 @@ async function getUser(moduleId: any) {
<AppBlock class="flex-1 box"> <AppBlock class="flex-1 box">
<div class="box-title">市况</div> <div class="box-title">市况</div>
<el-button type="primary" v-if="userCode" class="button !mr-30px !mt-[-30px] z-100" @click="push({name:'MarketDataModify'})"></el-button> <el-button type="primary" v-if="userCode" class="button !mr-30px !mt-[-30px] z-100"
<div class="bgStyle mt30px"> @click="push({ name: 'MarketDataModify' })">数据管理</el-button>
<div class="mr25px relative w100%"> <div class="bgStyle !h250px mt20px">
<div class=" relative w100%">
<span @click="tabShow(0)" class="title bg-#FF603A p5px pl10px pr20px">{{names}}<el-icon><CaretBottom /></el-icon></span> <span @click="tabShow(0)" class="title bg-#70BFCD pl18px pr24px">{{ names }}
<!-- <el-icon><CaretBottom /></el-icon> -->
</span>
<span class="absolute right-160px top-14px z-30 text-#000">最近7天数据</span>
<div v-if="tab" class="tab absolute bg-#fff w100px top-50px z-50 text-#112144 text-center leading-28px text-18px "> <div v-if="false && tab"
<div v-if="metal" v-for="im in metal.filter((item:any) => !['Fe','lengmei'].includes(item.value))" class="py5px !rounded-none" :data-id="im.value" @click="tabClick" >{{im.title}}</div> class="tab absolute bg-#fff w100px top-50px z-50 text-#112144 text-center leading-28px text-18px ">
<div v-if="metal"
v-for="im in metal.filter((item: any) => !['Fe', 'lengmei'].includes(item.value))"
class="py5px !rounded-none" :data-id="im.value" @click="tabClick">{{ im.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="Fe" @click="tabClick">Fe</div> <!-- <div class="py5px !rounded-none" data-id="Fe" @click="tabClick">Fe</div>
<div class="py5px !rounded-none" data-id="Cu" @click="tabClick">Cu</div> <div class="py5px !rounded-none" data-id="Cu" @click="tabClick">Cu</div>
<div class="py5px !rounded-none" data-id="Re" @click="tabClick"></div> --> <div class="py5px !rounded-none" data-id="Re" @click="tabClick"></div> -->
</div> </div>
<VChart class=" absolute z-22" ref="chartRef1" :option="chartOption1" autoresize /> <VChart class="absolute z-22 left-0 right-0 !w-full" ref="chartRef1" :option="chartOption1"
autoresize />
</div> </div>
<!-- <div> <!-- <div>
<span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span> <span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span>
<VChart class="absolute z-22" ref="chartRef2" :option="chartOption2" autoresize /> <VChart class="absolute z-22" ref="chartRef2" :option="chartOption2" autoresize />
</div> --> </div> -->
</div> </div>
<div class="bgStyle !h250px mt20px"> <div class="bgStyle !h250px mt10px">
<div class=" relative w100%">
<span class="title bg-#FF960F pl18px pr28px">{{ 'AI' }}
<!-- <el-icon><CaretBottom /></el-icon> -->
</span>
<span class="absolute right-160px top-14px z-30 text-#000">最近7天数据</span>
<VChart class="absolute z-22 left-0 right-0 !w-full" ref="chartRef1" :option="chartOption11"
autoresize />
</div>
<!-- <div>
<span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span>
<VChart class="absolute z-22" ref="chartRef2" :option="chartOption2" autoresize />
</div> -->
</div>
<div class="bgStyle !h240px mt10px">
<div> <div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span> <span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef5" :option="chartOption5" autoresize /> <VChart class=" absolute z-22" ref="chartRef5" :option="chartOption5" autoresize />
</div> </div>
</div> </div>
<div class="mt20px ml10px"> <div class="mt8px ml10px">
<div> <div class="flex items-center w-45%">
<span class="text-#000">日期:</span> <span class="text-#000 whitespace-nowrap">日期:</span>
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="value1" type="daterange" range-separator="" <el-date-picker v-model="value1" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small" @change="timenFirst"/></el-config-provider> start-placeholder="开始时间" end-placeholder="结束时间" size="small"
@change="timenFirst" /></el-config-provider>
</div> </div>
<div class="mt10px"> <div class="flex justify-between items-center">
<el-radio-group v-model="from.label.radio" class="ml-4" @change="thisCka"> <el-radio-group v-model="from.label.radio" class="ml-4" @change="thisCka">
<el-radio v-if="metal" v-for="im in metal" :label="im.value" size="large" >{{im.title}}</el-radio> <el-radio v-if="metal" v-for="im in metal" :label="im.value"
size="large">{{ im.title }}</el-radio>
<!-- <el-radio label="Al" size="large" >Al</el-radio> <!-- <el-radio label="Al" size="large" >Al</el-radio>
<el-radio label="Fe" size="large" >Fe</el-radio> <el-radio label="Fe" size="large" >Fe</el-radio>
<el-radio label="Re" size="large" >稀土</el-radio> --> <el-radio label="Re" size="large" >稀土</el-radio> -->
</el-radio-group> </el-radio-group>
<el-popover placement="top-end" trigger="click" :popper-style="{ width: '590px',borderRadius:'10px' }"
</div> :teleported="true">
<template #reference>
</div> <div
<div class="bgStyle !h165px mt15px mb10px"> class="bg-gr h-42px w115px flex justify-center items-center text-#fff rounded-10px text-18px cursor-pointer font-bold">
市况预测 <el-icon class="rotate-270deg">
<div> <CaretBottom />
</el-icon></div>
</template>
<!-- <Teleport to="v-screen-box"> -->
<!-- <VScaleScreen
ref="fitscreenRef"
:width="1920"
:height="1080"
mode="fit"
> -->
<div class="bgStyle h-250px w-690px mt15px mb10px">
<div class="w-full">
<span class="title bg-#003BB7 !text-16px pl13px pr20px b">市况预测</span> <span class="title bg-#003BB7 !text-16px pl13px pr20px b">市况预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(1)"></el-button> --> <!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(1)"></el-button> -->
<el-button type="primary" v-if="userCode" class="button" @click="push({name:'MarketModifys'})"></el-button> <el-button type="primary" size="small" v-if="userCode" class="button !mr-2%"
<p class="mt40px p15px !border-none max-h120px overflow-auto"> @click="push({ name: 'MarketModifys' })">管理</el-button>
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listDatas" :key="n"> <p class="mt40px p15px !border-none max-h250px overflow-auto">
<p class="!border-none w-98% !flex items-center pb10px news-item !pr30rpx"
v-for="n in listDatas" :key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" /> <AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px"> <p class="flex-shrink flex !border-none w35px ml20px">
<el-button type="primary" @click="lokeFuck(n)"></el-button> <el-button size="small" type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> --> <!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p> </p>
</p> </p>
@ -351,14 +410,25 @@ async function getUser(moduleId: any) {
</div> </div>
</div> </div>
<!-- </VScaleScreen> -->
<!-- </Teleport> -->
</el-popover>
</div>
</div>
</AppBlock> </AppBlock>
<AppBlock class="flex-1 box"> <AppBlock class="flex-1 box">
<div class="box-title ">汇率</div> <div class="box-title ">汇率</div>
<div class="bgStyle mt30px"> <div class="bgStyle !h250px mt20px">
<div class="mr25px"> <div class="mr25px">
<span @click="tabShow(1)" class="title bg-#FF603A !text-16px pl13px pr20px ">{{names1}}<el-icon><CaretBottom /></el-icon></span> <span @click="tabShow(1)"
<div v-if="tab1" class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px "> class="title bg-#FF603A !text-16px pl13px pr20px ">{{ names1 }}<el-icon>
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value" @click="tabClick1">{{it.title}}</div> <CaretBottom />
</el-icon></span>
<div v-if="tab1"
class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value"
@click="tabClick1">{{ it.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick1">-</div> <!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick1">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick1">-</div> --> <div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick1">-</div> -->
</div> </div>
@ -367,10 +437,15 @@ async function getUser(moduleId: any) {
<VChart class=" absolute z-22" ref="chartRef3" :option="chartOption3" autoresize /> <VChart class=" absolute z-22" ref="chartRef3" :option="chartOption3" autoresize />
</div> </div>
<div> <div>
<span @click="tabShow(2)" class="title bg-#70BFCD !text-16px pl13px pr20px ">{{names2}}<el-icon><CaretBottom /></el-icon></span> <span @click="tabShow(2)"
class="title bg-#70BFCD !text-16px pl13px pr20px ">{{ names2 }}<el-icon>
<CaretBottom />
</el-icon></span>
<div v-if="tab2" class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px "> <div v-if="tab2"
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value" @click="tabClick2">{{it.title}}</div> class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value"
@click="tabClick2">{{ it.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick2">-</div> <!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick2">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick2">-</div> --> <div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick2">-</div> -->
</div> </div>
@ -379,36 +454,40 @@ async function getUser(moduleId: any) {
</div> </div>
</div> </div>
<div class="bgStyle !h250px mt20px"> <div class="bgStyle !h250px mt10px">
<div> <div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span> <span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef6" :option="chartOption6" autoresize /> <VChart class=" absolute z-22" ref="chartRef6" :option="chartOption6" autoresize />
</div> </div>
</div> </div>
<div class="mt20px ml10px"> <div class="mt10px ml10px">
<div> <div class="flex items-center w-45%">
<span class="text-#000">日期:</span> <span class="text-#000 whitespace-nowrap">日期:</span>
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker v-model="value2" type="daterange" range-separator="" <el-date-picker v-model="value2" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small" @change="timenFirsts"/></el-config-provider> start-placeholder="开始时间" end-placeholder="结束时间" size="small"
@change="timenFirsts" /></el-config-provider>
</div> </div>
<div class="mt10px"> <div class="h-30px">
<el-radio-group v-model="from.labe2.radio" class="ml-4" @change="thisCka2"> <el-radio-group v-model="from.labe2.radio" class="ml-4" @change="thisCka2">
<el-radio v-if="currency" v-for="it in currency" :label="it.value" size="large" >{{it.title}}</el-radio> <el-radio v-if="currency" v-for="it in currency" :label="it.value"
size="large">{{ it.title }}</el-radio>
<!-- <el-radio label="JPY,USD" size="large" >日元-美元</el-radio> <!-- <el-radio label="JPY,USD" size="large" >日元-美元</el-radio>
<el-radio label="CNA,USD" size="large" >人民币-美元</el-radio> --> <el-radio label="CNA,USD" size="large" >人民币-美元</el-radio> -->
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
<div class="bgStyle !h165px mt15px mb10px"> <div class="bgStyle !h230px mt15px mb10px">
<div> <div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">汇率预测</span> <span class="title bg-#003BB7 !text-16px pl13px pr20px ">汇率预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(2)"></el-button> --> <!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(2)"></el-button> -->
<el-button type="primary" v-if="userCodes" class="button" @click="push({name:'MarketModify'})"></el-button> <el-button type="primary" v-if="userCodes" class="button"
<p class="mt40px p15px !border-none max-h120px overflow-auto"> @click="push({ name: 'MarketModify' })">管理</el-button>
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listData" :key="n"> <p class="mt40px p15px !border-none max-h-full overflow-auto">
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listData"
:key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" /> <AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px"> <p class="flex-shrink flex !border-none w35px ml20px">
<el-button type="primary" @click="lokeFuck(n)"></el-button> <el-button type="primary" @click="lokeFuck(n)"></el-button>
@ -465,6 +544,9 @@ async function getUser(moduleId: any) {
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.bg-gr {
background: linear-gradient(to left, #34A6D9 0%, #23D1C6 100%);
}
.button { .button {
display: block; display: block;
@ -478,11 +560,13 @@ async function getUser(moduleId: any) {
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 1px; width: 1px;
} }
.top { .top {
position: absolute; position: absolute;
right: 30px; right: 30px;
top: -92px; top: -92px;
} }
.date-wrapper[data-v-c5c4f420] { .date-wrapper[data-v-c5c4f420] {
line-height: 1.5; line-height: 1.5;
position: relative; position: relative;
@ -495,6 +579,7 @@ async function getUser(moduleId: any) {
color: #142142; color: #142142;
border: none; border: none;
} }
.tab { .tab {
div:hover { div:hover {
color: #0036BC; color: #0036BC;

View File

@ -0,0 +1,473 @@
import { historyStat,rateHistoryStat,historyMarketSevenDay,historyStatSevenDay} from '@/api/daikin/base'
import type { EChartsOption } from 'echarts'
import * as echarts from 'echarts'
import {calculateDateIntervals} from '@/utils/format'
const state = reactive<any>({
type: 'Cu',
})
const state1 = reactive<any>({
currencyCodeFrom:'CNA',
currencyCodeTo:'USD',
})
const state2 = reactive<any>({
currencyCodeFrom:'CNA',
currencyCodeTo:'USD',
})
const state3 = reactive<any>({
currencyCodeFrom:'USD',
currencyCodeTo:'CNA',
})
const state4 = reactive<any>({
number:'Cu',
type: '2',
dateList:calculateDateIntervals('','').list,
startTime:'',
endTime:'',
})
const state5 = reactive<any>({
currencyCodeFrom:'CNA',
currencyCodeTo:'JPY',
type: '2',
dateList:calculateDateIntervals('','').list,
startTime:'',
endTime:'',
})
function getDay(){
const today = new Date();
const pastSevenDays = [];
for (let i = 6; i >= 0; i--) {
const date = new Date(today);
date.setDate(today.getDate() - i);
pastSevenDays.push(date.toISOString().split('T')[0]);
}
return pastSevenDays;
}
function reverseArray(inputArray: string | any[],star: number,enc: number) {
const reversedArray = [];
for (let i = 0; i <= inputArray.length - 1; i++) {
reversedArray.push(inputArray[i].substring(star,enc));
}
return reversedArray;
}
export function Chart1() {
const chartRef = ref()
const optionRef = ref()
async function getDat() {
const { data } = await historyMarketSevenDay({ number: state.type })
if (!data) return
let { LME, SMM } = data[state.type]
SMM = SMM.map((item: any) => (item == 0 ? null : item))
LME = LME.map((item: any) => (item == 0 ? null : item))
const option = {
height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['SMM', 'LME'],
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: reverseArray(getDay(), 5, 10)
},
yAxis: [
{
type: 'value'
// name:'1',
},
{
// name:'2',
type: 'value'
}
],
series: [
{
name: 'SMM',
data: SMM,
color: '#8F97F8',
type: 'line',
yAxisIndex: 1,
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
},
{
name: 'LME',
data: LME,
type: 'line',
color: '#FF603A',
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
}
]
}
optionRef.value = option
}
const ss = computed(() => [state.type])
watch(
() => unref(ss),
async (v) => {
console.log(state.type)
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state }
}
export function Chart3() {
const chartRef = ref()
const optionRef = ref<any>({})
async function getDat() {
const { data } = await historyStatSevenDay({
currencyCodeFrom: state2.currencyCodeFrom,
currencyCodeTo: state2.currencyCodeTo
})
if (!data) return
const dat = (
data[state2.currencyCodeFrom + '-' + state2.currencyCodeTo] || []
).map((item: any) => (item == 0 ? null : item))
const option = {
height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
legend: {
data: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: reverseArray(getDay(), 8, 10)
},
yAxis: {
type: 'value'
},
series: [
{
name: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
data: dat,
color: '#8F97F8',
type: 'line',
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
}
]
}
optionRef.value = option
}
const ss = computed(() => [state2.currencyCodeFrom, state2.currencyCodeTo])
watch(
() => unref(ss),
async (v) => {
console.log(state2.type)
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state2 }
}
export function Chart4() {
const chartRef = ref()
const optionRef = ref<any>({})
async function getDat() {
const { data } = await historyStatSevenDay({
currencyCodeFrom: state3.currencyCodeFrom,
currencyCodeTo: state3.currencyCodeTo
})
if (!data) return
const dat = (
data[state3.currencyCodeFrom + '-' + state3.currencyCodeTo] || []
).map((item: any) => (item == 0 ? null : item))
const option = {
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
height: '150px', // 设置图表高度为 400 像素
tooltip: {
trigger: 'axis'
},
legend: {
data: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: reverseArray(getDay(), 8, 10)
},
yAxis: {
type: 'value'
},
series: [
{
name: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
data: dat,
color: '#8F97F8',
type: 'line',
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
}
]
}
optionRef.value = option
}
const ss = computed(() => [state3.currencyCodeFrom, state3.currencyCodeTo])
watch(
() => unref(ss),
async (v) => {
console.log(state3.type)
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state3 }
}
export function Chart5() {
const chartRef = ref()
const optionRef = ref<any>({})
let nameX: string[]
async function dataList() {
let SMM, LME
const { data } = await historyStat({
number: state4.number,
type: state4.type,
dateList: state4.dateList
})
if (data && data[state4.number]) {
SMM = data[state4.number].SMM || []
LME = data[state4.number].LME || []
SMM = SMM.map((item: any) => (item == 0 ? null : item))
LME = LME.map((item: any) => (item == 0 ? null : item))
}
const option = {
// width: '250px', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['SMM', 'LME'],
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: nameX
},
yAxis: [
{
type: 'value'
// name:'1',
},
{
// name:'2',
type: 'value'
}
],
series: [
{
name: 'SMM',
data: SMM,
color: '#FF9307',
type: 'line',
smooth: true,
showDataShadow: true,
connectNulls: true
},
{
name: 'LME',
data: LME,
type: 'line',
color: '#0063ED',
smooth: true,
yAxisIndex: 1,
showDataShadow: true,
connectNulls: true
}
]
}
optionRef.value = option
}
const ss = computed(() => [state4.number, state4.startTime, state4.endTime])
watch(
() => unref(ss),
async (v) => {
// console.log(calculateDateIntervals(state4.startTime,state4.endTime),88888)
const { type, list } = calculateDateIntervals(
state4.startTime,
state4.endTime
)
nameX = list
state4.dateList = list
state4.type = type
console.log(state4.number)
dataList()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state4 }
}
export function Chart6() {
const chartRef = ref()
const optionRef = ref<any>({})
let nameX: string[]
async function getDat() {
const { data } = await rateHistoryStat({
currencyCodeFrom: state5.currencyCodeFrom,
currencyCodeTo: state5.currencyCodeTo,
type: state5.type,
dateList: state5.dateList
})
const dat = (
data[state5.currencyCodeFrom + '-' + state5.currencyCodeTo] || []
).map((item: any) => (item == 0 ? null : item))
const option = {
// width: '250px', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
// legend: {
// data:state5.currencyCodeFrom-state5.currencyCodeTo,
// right: 20,
// top: 10,
// },
xAxis: {
type: 'category',
data: nameX
},
yAxis: {
type: 'value'
},
series: [
{
name: state5.currencyCodeFrom + '-' + state5.currencyCodeTo,
data: dat,
color: '#89DF75',
type: 'line',
smooth: true,
showDataShadow: true,
connectNulls: true
}
]
}
optionRef.value = option
}
const ss = computed(() => [
state5.currencyCodeFrom,
state5.currencyCodeTo,
state5.startTime,
state5.endTime
])
watch(
() => unref(ss),
async (v) => {
const { type, list } = calculateDateIntervals(
state5.startTime,
state5.endTime
)
nameX = list
state5.dateList = list
state5.type = type
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state5 }
}

View File

@ -0,0 +1,976 @@
import {
historyStat,
rateHistoryStat,
historyMarketSevenDay,
historyStatSevenDay,
fetchTimeFuturecenterCu,
fetchTimeFuturecenterAl
} from '@/api/daikin/base'
import { use } from 'echarts/core'
import type { EChartsOption } from 'echarts'
import * as echarts from 'echarts'
import { calculateDateIntervals } from '@/utils/format'
// import { CandlestickChart } from 'echarts/charts'
// use([CandlestickChart])
const state = reactive<any>({
type: 'Cu'
})
const state1 = reactive<any>({
currencyCodeFrom: 'CNA',
currencyCodeTo: 'USD'
})
const state2 = reactive<any>({
currencyCodeFrom: 'CNA',
currencyCodeTo: 'USD'
})
const state3 = reactive<any>({
currencyCodeFrom: 'USD',
currencyCodeTo: 'CNA'
})
const state4 = reactive<any>({
number: 'Cu',
type: '2',
dateList: calculateDateIntervals('', '').list,
startTime: '',
endTime: ''
})
const state5 = reactive<any>({
currencyCodeFrom: 'CNA',
currencyCodeTo: 'JPY',
type: '2',
dateList: calculateDateIntervals('', '').list,
startTime: '',
endTime: ''
})
function getDay() {
const today = new Date()
const pastSevenDays = []
for (let i = 6; i >= 0; i--) {
const date = new Date(today)
date.setDate(today.getDate() - i)
pastSevenDays.push(date.toISOString().split('T')[0])
}
return pastSevenDays
}
function reverseArray(inputArray: string | any[], star: number, enc: number) {
const reversedArray = []
for (let i = 0; i <= inputArray.length - 1; i++) {
reversedArray.push(inputArray[i].substring(star, enc))
}
return reversedArray
}
const cuType = reactive<any>({
type: 'cu0000'
})
export function Chart1(type = 'Cu') {
const chartRef = ref()
const optionRef = ref()
// const state = ref({
// type
// })
async function getDat() {
const { data = {} } =
type == 'Cu'
? await fetchTimeFuturecenterCu({ type: cuType.type })
: await fetchTimeFuturecenterAl({ type: cuType.type })
const { list = [] } = data
let xData: any = []
let lastPrice: any = []
let diff: any = []
let diffV: any = []
let tradingDay = ''
tradingDay = list[0]?.updateTime?.substr(0, 10) || ''
list.forEach((item: any) => {
xData.push(item.updateTime)
lastPrice.push(item.lastPrice)
diff.push(item.avgPrice)
diffV.push(parseFloat(item.diffValue).toFixed(2))
})
// console.log('🚀 ~ file: MarketData-new.ts:97 ~ diffV:', xData.at(-1), diffV.at(-1))
const option = {
// height: '270px', // 设置图表高度为 400 像素
height: '140px', // 设置图表高度为 400 像素
grid: {
left: '10',
right: '10',
// top: 90,
// bottom: '10',
containLabel: true
},
legend: {
data: ['SMM', 'LME'],
right: 20,
top: 10
},
tooltip: {
trigger: 'axis',
// position: function (pt) {
// return [pt[0], '10%']
// },
// backgroundColor: '#4c4c4c90',
zIndex: 50,
appendTo: 'body',
formatter: function (params: any) {
const { dataIndex } = params[0]
const val = list[dataIndex]
const style = 'display: flex;justify-content: space-between;align-items: center;'
const isUp = val.diffPrice > 0
const priceStyle = isUp ? 'color: #ec0000;' : 'color: #00da3c;'
return `
<div style="width:120px;font-size:12px;line-height:18px;">
<div style="${style}borderBottom: 1px solid #ccc">
<span>:</span>
<span>${val.updateTime?.substr(11, 5)}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.lastPrice}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.diffPrice}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.diffValue}%</span>
</div>
${
cuType.type
? `<div style="${style}">
<span>:</span>
<span>${val.donePrice ? (val.donePrice / 100000000).toFixed(2) : 0}亿</span>
</div>`
: ''
}
<div style="${style}">
<span>:</span>
<span>${val.doneNumber}</span>
</div>
${
cuType.type
? `<div style="${style}">
<span>:</span>
<span>${val.avgPrice}</span>
</div>`
: ''
}
</div>
`
},
position: function (pos, params, el, elRect, size) {
const obj: any = {
top: 10
}
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 60
return obj
},
axisPointer: {
type: 'cross',
animation: true,
link: [
{
xAxisIndex: 'all'
}
],
label: {
backgroundColor: '#505765'
// formatter: function (params: any) {
// const val = parseFloat(params.value).toFixed(0)
// return params.axisDimension == 'x' ? `${tradingDay} ${params.value}:00` : val
// }
}
}
},
xAxis: [
{
type: 'category',
data: xData,
boundaryGap: false,
splitLine: { show: false },
axisLine: { onZero: false },
axisLabel: {
formatter: function (value: any) {
return value.substr(11, 5)
}
}
}
],
yAxis: [
// {
// name: 'Dow-Jones index',
// type: 'candlestick',
// data: list,
// itemStyle: {
// color: '#00da3c',
// color0: '#ec0000',
// borderColor: undefined,
// borderColor0: undefined
// }
// },
{
type: 'value',
name: '',
min: 'dataMin',
max: 'dataMax',
scale: true,
// splitArea: {
// show: true
// },
boundaryGap: [0, '100%']
},
{
type: 'value',
name: '',
// min: 'dataMin',
// formatter: '{value} %',
// alignTicks: true,
// boundaryGap: [0, '100%'],
scale: true,
onZero: false,
minInterval: 0.1,
axisLabel: {
// formatter: '{value}%'
formatter: function (value, index) {
return value.toFixed(1) + '%'
},
color: function (value, index) {
return value > 0 ? '#ec0000' : value == 0 ? '#333' : '#00da3c' //改变颜色 '%'
}
// color: 'skyblue'
}
}
],
dataZoom: [
{
type: 'inside',
start: 80,
end: 100
},
{
start: 80,
end: 100
}
],
series: []
}
const series = [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
// markLine: {
// data: [
// {
// type: 'average',
// name: 'Avg'
// // coord: [diff.at(-1), lastPrice.at(-1)],
// // name: 'New'
// }
// ],
// symbol: 'none',
// label: {
// // color: '#ec0000',
// formatter: (params) => {
// console.log('🚀 ~ file: MarketData-new.ts:271 ~ params:', params)
// return 0
// }
// // formatter: '{b}: {@score}'
// },
// itemStyle: {
// // color: '#ec0000'
// }
// },
// areaStyle: {},
data: lastPrice
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
smooth: true,
symbol: 'none',
// yAxisIndex: 1,
// areaStyle: {},
data: diff,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
color: '#E08F2D'
}
}
}
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
smooth: true,
symbol: 'none',
yAxisIndex: 1,
// markLine: {
// type: 'average',
// lineStyle: {
// color: '#E08F2D30'
// }
// },
data: diffV,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
type: 'dotted',
color: 'transparent'
}
}
}
// markLine: {
// data: [
// {
// type: 'max',
// name: '111',
// coord: [xData.at(-1), diffV.at(-1)]
// // name: 'New'
// }
// ],
// symbol: 'none',
// label: {
// // color: '#ec0000',
// formatter: (params) => {
// console.log('🚀 ~ file: MarketData-new.ts:271 ~ params:', diffV.at(-1), params)
// // return 0
// }
// // formatter: '{b}: {@score}'
// },
// itemStyle: {
// // color: '#ec0000'
// }
// }
}
]
option.series = cuType.type == 'cu0000' ? series : series.filter((_, i) => i != 1)
optionRef.value = option
}
// const ss = computed(() => [state.type])
watch(
() => cuType,
async (v) => {
getDat()
},
{ immediate: true, deep: true }
)
// getDat()
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, cuType }
}
const alType = reactive<any>({
type: 'al0000'
})
export function Chart11(type = 'Al') {
const chartRef = ref()
const optionRef = ref()
// const state = ref({
// type
// })
async function getDat() {
const { data = {} } =
type == 'Cu'
? await fetchTimeFuturecenterCu({ type: alType.type })
: await fetchTimeFuturecenterAl({ type: alType.type })
const { list = [] } = data
let xData: any = []
let lastPrice: any = []
let diff: any = []
let diffV: any = []
let tradingDay = ''
tradingDay = list[0]?.updateTime?.substr(0, 10) || ''
list.forEach((item: any) => {
xData.push(item.updateTime)
lastPrice.push(item.lastPrice)
diff.push(item.avgPrice)
diffV.push(parseFloat(item.diffValue).toFixed(2))
})
const option = {
// height: '270px', // 设置图表高度为 400 像素
height: '140px', // 设置图表高度为 400 像素
grid: {
left: '10',
right: '10',
// top: 90,
// bottom: '10',
containLabel: true
},
legend: {
data: ['SMM', 'LME'],
right: 20,
top: 10
},
tooltip: {
trigger: 'axis',
// position: function (pt) {
// return [pt[0], '10%']
// },
// backgroundColor: '#4c4c4c90',
appendTo: 'body',
formatter: function (params: any) {
const { dataIndex } = params[0]
const val = list[dataIndex]
const style = 'display: flex;justify-content: space-between;align-items: center;'
const isUp = val.diffPrice > 0
const priceStyle = isUp ? 'color: #ec0000;' : 'color: #00da3c;'
return `
<div style="width:120px;font-size:12px;line-height:18px;">
<div style="${style}borderBottom: 1px solid #ccc">
<span>:</span>
<span>${val.updateTime?.substr(11, 5)}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.lastPrice}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.diffPrice}</span>
</div>
<div style="${style}">
<span>:</span>
<span style="${priceStyle}">${val.diffValue}%</span>
</div>
${
alType.type
? `<div style="${style}">
<span>:</span>
<span>${val.donePrice ? (val.donePrice / 100000000).toFixed(2) : 0}亿</span>
</div>`
: ''
}
<div style="${style}">
<span>:</span>
<span>${val.doneNumber}</span>
</div>
${
alType.type
? `<div style="${style}">
<span>:</span>
<span>${val.avgPrice}</span>
</div>`
: ''
}
</div>
`
},
position: function (pos, params, el, elRect, size) {
const obj: any = {
top: 10
}
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 100
return obj
},
axisPointer: {
type: 'cross',
animation: true,
link: [
{
xAxisIndex: 'all'
}
],
label: {
backgroundColor: '#505765'
// formatter: function (params: any) {
// const val = parseFloat(params.value).toFixed(0)
// return params.axisDimension == 'x' ? `${tradingDay} ${params.value}:00` : val
// }
}
}
},
xAxis: [
{
type: 'category',
data: xData,
boundaryGap: false,
splitLine: { show: false },
axisLine: { onZero: false },
axisLabel: {
formatter: function (value: any) {
return value.substr(11, 5)
}
}
}
],
yAxis: [
// {
// name: 'Dow-Jones index',
// type: 'candlestick',
// data: list,
// itemStyle: {
// color: '#00da3c',
// color0: '#ec0000',
// borderColor: undefined,
// borderColor0: undefined
// }
// },
{
type: 'value',
name: '',
min: 'dataMin',
max: 'dataMax',
scale: true,
// splitArea: {
// show: true
// },
boundaryGap: [0, '100%']
},
{
type: 'value',
name: '',
// min: 'dataMin',
// formatter: '{value} %',
// alignTicks: true,
// boundaryGap: [0, '100%'],
scale: true,
onZero: false,
minInterval: 0.1,
axisLabel: {
// formatter: '{value}%'
formatter: function (value, index) {
return value.toFixed(1) + '%'
},
color: function (value, index) {
return value > 0 ? '#ec0000' : value == 0 ? '#333' : '#00da3c' //改变颜色 '%'
}
}
}
],
dataZoom: [
{
type: 'inside',
start: 80,
end: 100
},
{
start: 80,
end: 100
}
],
series: []
}
const series = [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
// areaStyle: {},
data: lastPrice
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
show: false,
smooth: true,
symbol: 'none',
// yAxisIndex: 1,
// areaStyle: {},
data: diff,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
color: '#E08F2D'
}
}
}
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
smooth: true,
symbol: 'none',
yAxisIndex: 1,
// markLine: {
// type: 'average',
// lineStyle: {
// color: '#E08F2D30'
// }
// },
data: diffV,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
type: 'dotted',
color: 'transparent'
}
}
}
}
]
option.series = alType.type == 'al0000' ? series : series.filter((_: any, index) => index != 1)
optionRef.value = option
}
// const ss = computed(() => [state.type])
watch(
() => alType,
async (v) => {
getDat()
},
{ immediate: true, deep: true }
)
// getDat()
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, alType }
}
export function Chart3() {
const chartRef = ref()
const optionRef = ref<any>({})
async function getDat() {
const { data } = await historyStatSevenDay({
currencyCodeFrom: state2.currencyCodeFrom,
currencyCodeTo: state2.currencyCodeTo
})
if (!data) return
const dat = (data[state2.currencyCodeFrom + '-' + state2.currencyCodeTo] || []).map(
(item: any) => (item == 0 ? null : item)
)
const option = {
height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
legend: {
data: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: reverseArray(getDay(), 8, 10)
},
yAxis: {
type: 'value'
},
series: [
{
name: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
data: dat,
color: '#8F97F8',
type: 'line',
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
}
]
}
optionRef.value = option
}
const ss = computed(() => [state2.currencyCodeFrom, state2.currencyCodeTo])
watch(
() => unref(ss),
async (v) => {
console.log(state2.type)
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state2 }
}
export function Chart4() {
const chartRef = ref()
const optionRef = ref<any>({})
async function getDat() {
const { data } = await historyStatSevenDay({
currencyCodeFrom: state3.currencyCodeFrom,
currencyCodeTo: state3.currencyCodeTo
})
if (!data) return
const dat = (data[state3.currencyCodeFrom + '-' + state3.currencyCodeTo] || []).map(
(item: any) => (item == 0 ? null : item)
)
const option = {
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
height: '150px', // 设置图表高度为 400 像素
tooltip: {
trigger: 'axis'
},
legend: {
data: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: reverseArray(getDay(), 8, 10)
},
yAxis: {
type: 'value'
},
series: [
{
name: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
data: dat,
color: '#8F97F8',
type: 'line',
showDataShadow: true,
connectNulls: true,
label: {
show: true,
position: 'top'
}
}
]
}
optionRef.value = option
}
const ss = computed(() => [state3.currencyCodeFrom, state3.currencyCodeTo])
watch(
() => unref(ss),
async (v) => {
console.log(state3.type)
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state3 }
}
export function Chart5() {
const chartRef = ref()
const optionRef = ref<any>({})
let nameX: string[]
async function dataList() {
let SMM, LME
const { data } = await historyStat({
number: state4.number,
type: state4.type,
dateList: state4.dateList
})
if (data && data[state4.number]) {
SMM = data[state4.number].SMM || []
LME = data[state4.number].LME || []
SMM = SMM.map((item: any) => (item == 0 ? null : item))
LME = LME.map((item: any) => (item == 0 ? null : item))
}
const option = {
// width: '250px', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['SMM', 'LME'],
right: 20,
top: 10
},
xAxis: {
type: 'category',
data: nameX
},
yAxis: [
{
type: 'value'
// name:'1',
},
{
// name:'2',
type: 'value'
}
],
series: [
{
name: 'SMM',
data: SMM,
color: '#FF9307',
type: 'line',
smooth: true,
showDataShadow: true,
connectNulls: true
},
{
name: 'LME',
data: LME,
type: 'line',
color: '#0063ED',
smooth: true,
yAxisIndex: 1,
showDataShadow: true,
connectNulls: true
}
]
}
optionRef.value = option
}
const ss = computed(() => [state4.number, state4.startTime, state4.endTime])
watch(
() => unref(ss),
async (v) => {
// console.log(calculateDateIntervals(state4.startTime,state4.endTime),88888)
const { type, list } = calculateDateIntervals(state4.startTime, state4.endTime)
nameX = list
state4.dateList = list
state4.type = type
console.log(state4.number)
dataList()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state4 }
}
export function Chart6() {
const chartRef = ref()
const optionRef = ref<any>({})
let nameX: string[]
async function getDat() {
const { data } = await rateHistoryStat({
currencyCodeFrom: state5.currencyCodeFrom,
currencyCodeTo: state5.currencyCodeTo,
type: state5.type,
dateList: state5.dateList
})
const dat = (data[state5.currencyCodeFrom + '-' + state5.currencyCodeTo] || []).map(
(item: any) => (item == 0 ? null : item)
)
const option = {
// width: '250px', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素
grid: {
left: '10',
top: 90,
right: '10',
bottom: '10',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
// legend: {
// data:state5.currencyCodeFrom-state5.currencyCodeTo,
// right: 20,
// top: 10,
// },
xAxis: {
type: 'category',
data: nameX
},
yAxis: {
type: 'value'
},
series: [
{
name: state5.currencyCodeFrom + '-' + state5.currencyCodeTo,
data: dat,
color: '#89DF75',
type: 'line',
smooth: true,
showDataShadow: true,
connectNulls: true
}
]
}
optionRef.value = option
}
const ss = computed(() => [
state5.currencyCodeFrom,
state5.currencyCodeTo,
state5.startTime,
state5.endTime
])
watch(
() => unref(ss),
async (v) => {
const { type, list } = calculateDateIntervals(state5.startTime, state5.endTime)
nameX = list
state5.dateList = list
state5.type = type
getDat()
},
{ immediate: true, deep: true }
)
watchEffect(() => {
const option = chartRef.value
chartRef.value = option
})
return { chartRef, option: optionRef, state5 }
}

View File

@ -1,31 +1,34 @@
import { historyStat,rateHistoryStat,historyMarketSevenDay,historyStatSevenDay} from '@/api/daikin/base' import {
historyStat,
rateHistoryStat,
historyMarketSevenDay,
historyStatSevenDay
} from '@/api/daikin/base'
import type { EChartsOption } from 'echarts' import type { EChartsOption } from 'echarts'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { calculateDateIntervals } from '@/utils/format' import { calculateDateIntervals } from '@/utils/format'
const state = reactive<any>({ const state = reactive<any>({
type: 'Cu', type: 'Cu'
}) })
const state1 = reactive<any>({ const state1 = reactive<any>({
currencyCodeFrom: 'CNA', currencyCodeFrom: 'CNA',
currencyCodeTo:'USD', currencyCodeTo: 'USD'
}) })
const state2 = reactive<any>({ const state2 = reactive<any>({
currencyCodeFrom: 'CNA', currencyCodeFrom: 'CNA',
currencyCodeTo:'USD', currencyCodeTo: 'USD'
}) })
const state3 = reactive<any>({ const state3 = reactive<any>({
currencyCodeFrom: 'USD', currencyCodeFrom: 'USD',
currencyCodeTo:'CNA', currencyCodeTo: 'CNA'
}) })
const state4 = reactive<any>({ const state4 = reactive<any>({
number: 'Cu', number: 'Cu',
type: '2', type: '2',
dateList: calculateDateIntervals('', '').list, dateList: calculateDateIntervals('', '').list,
startTime: '', startTime: '',
endTime:'', endTime: ''
}) })
const state5 = reactive<any>({ const state5 = reactive<any>({
currencyCodeFrom: 'CNA', currencyCodeFrom: 'CNA',
@ -33,45 +36,47 @@ const state5 = reactive<any>({
type: '2', type: '2',
dateList: calculateDateIntervals('', '').list, dateList: calculateDateIntervals('', '').list,
startTime: '', startTime: '',
endTime:'', endTime: ''
}) })
function getDay() { function getDay() {
const today = new Date(); const today = new Date()
const pastSevenDays = []; const pastSevenDays = []
for (let i = 6; i >= 0; i--) { for (let i = 6; i >= 0; i--) {
const date = new Date(today); const date = new Date(today)
date.setDate(today.getDate() - i); date.setDate(today.getDate() - i)
pastSevenDays.push(date.toISOString().split('T')[0]); pastSevenDays.push(date.toISOString().split('T')[0])
} }
return pastSevenDays; return pastSevenDays
} }
function reverseArray(inputArray: string | any[], star: number, enc: number) { function reverseArray(inputArray: string | any[], star: number, enc: number) {
const reversedArray = []; const reversedArray = []
for (let i = 0; i <= inputArray.length - 1; i++) { for (let i = 0; i <= inputArray.length - 1; i++) {
reversedArray.push(inputArray[i].substring(star,enc)); reversedArray.push(inputArray[i].substring(star, enc))
} }
return reversedArray; return reversedArray
} }
export function Chart1() { export function Chart1(type = state.type) {
const chartRef = ref() const chartRef = ref()
const optionRef = ref() const optionRef = ref()
getDat()
async function getDat() { async function getDat() {
const { data } = await historyMarketSevenDay({ number: state.type }) const { data } = await historyMarketSevenDay({ number: type })
if (!data) return if (!data) return
let { LME, SMM } = data[state.type] let { LME, SMM } = data[type]
SMM = SMM.map((item: any) => (item == 0 ? null : item)) SMM = SMM.map((item: any) => (item == 0 ? null : item))
LME = LME.map((item: any) => (item == 0 ? null : item)) LME = LME.map((item: any) => (item == 0 ? null : item))
const option = { const option = {
height: '150px', // 设置图表高度为 400 像素 // width: '100%', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素
grid: { grid: {
left: '10', left: '10',
top: 90, top: 60,
right: '10', right: '10',
bottom: '10', bottom: '10',
containLabel: true containLabel: true
@ -128,15 +133,15 @@ export function Chart1() {
} }
optionRef.value = option optionRef.value = option
} }
const ss = computed(() => [state.type]) // const ss = computed(() => [state.type])
watch( // watch(
() => unref(ss), // () => unref(ss),
async (v) => { // async (v) => {
console.log(state.type) // console.log(state.type)
getDat() // getDat()
}, // },
{ immediate: true, deep: true } // { immediate: true, deep: true }
) // )
watchEffect(() => { watchEffect(() => {
const option = chartRef.value const option = chartRef.value
chartRef.value = option chartRef.value = option
@ -155,9 +160,9 @@ export function Chart3() {
currencyCodeTo: state2.currencyCodeTo currencyCodeTo: state2.currencyCodeTo
}) })
if (!data) return if (!data) return
const dat = ( const dat = (data[state2.currencyCodeFrom + '-' + state2.currencyCodeTo] || []).map(
data[state2.currencyCodeFrom + '-' + state2.currencyCodeTo] || [] (item: any) => (item == 0 ? null : item)
).map((item: any) => (item == 0 ? null : item)) )
const option = { const option = {
height: '150px', // 设置图表高度为 400 像素 height: '150px', // 设置图表高度为 400 像素
@ -227,9 +232,9 @@ export function Chart4() {
currencyCodeTo: state3.currencyCodeTo currencyCodeTo: state3.currencyCodeTo
}) })
if (!data) return if (!data) return
const dat = ( const dat = (data[state3.currencyCodeFrom + '-' + state3.currencyCodeTo] || []).map(
data[state3.currencyCodeFrom + '-' + state3.currencyCodeTo] || [] (item: any) => (item == 0 ? null : item)
).map((item: any) => (item == 0 ? null : item)) )
const option = { const option = {
grid: { grid: {
@ -371,10 +376,7 @@ export function Chart5() {
() => unref(ss), () => unref(ss),
async (v) => { async (v) => {
// console.log(calculateDateIntervals(state4.startTime,state4.endTime),88888) // console.log(calculateDateIntervals(state4.startTime,state4.endTime),88888)
const { type, list } = calculateDateIntervals( const { type, list } = calculateDateIntervals(state4.startTime, state4.endTime)
state4.startTime,
state4.endTime
)
nameX = list nameX = list
state4.dateList = list state4.dateList = list
state4.type = type state4.type = type
@ -402,9 +404,9 @@ export function Chart6() {
type: state5.type, type: state5.type,
dateList: state5.dateList dateList: state5.dateList
}) })
const dat = ( const dat = (data[state5.currencyCodeFrom + '-' + state5.currencyCodeTo] || []).map(
data[state5.currencyCodeFrom + '-' + state5.currencyCodeTo] || [] (item: any) => (item == 0 ? null : item)
).map((item: any) => (item == 0 ? null : item)) )
const option = { const option = {
// width: '250px', // 设置图表宽度为 800 像素 // width: '250px', // 设置图表宽度为 800 像素
// height: '150px', // 设置图表高度为 400 像素 // height: '150px', // 设置图表高度为 400 像素
@ -453,10 +455,7 @@ export function Chart6() {
watch( watch(
() => unref(ss), () => unref(ss),
async (v) => { async (v) => {
const { type, list } = calculateDateIntervals( const { type, list } = calculateDateIntervals(state5.startTime, state5.endTime)
state5.startTime,
state5.endTime
)
nameX = list nameX = list
state5.dateList = list state5.dateList = list

View File

@ -0,0 +1,721 @@
<!-- 市况 -->
<script setup lang="ts">
import { Chart1,Chart11, Chart3, Chart4, Chart5, Chart6 } from './MarketData-new'
import HomeHead from '@/views/home/components/HomeHead.vue'
import AppBlock from '@/components/AppBlock.vue'
import AppNewsBox from '@/components/AppNewsBox.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { getList, marketPreADD, getMarketUser, saveMarketUser, MarketDownload, MarketPreview, getCurrencyList, getMetalList, fetchExchangeInfo, fetchTimeFuturecenterCu, fetchTimeFuturecenterAl } from '@/api/daikin/base'
import { NModal, NCard } from 'naive-ui'
import { formatDate } from '@/utils/format'
import { message } from '@/utils/message'
import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
import Amtion from '@/components/amtion.vue'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { groupBy } from 'lodash-es'
import {
LegendComponent,
TooltipComponent,
GridComponent,
TitleComponent,
} from 'echarts/components'
import { PieChart, BarChart, LineChart, CandlestickChart } from 'echarts/charts'
import { noticeld } from '@/stores/modules/noticeId'
const store = useUserStore()
const stores = noticeld()
const userCode = ['admin', 'shikuang_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
const userCodes = ['admin', 'huilv_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
use([
CanvasRenderer,
LegendComponent,
TooltipComponent,
GridComponent,
TitleComponent,
PieChart,
BarChart,
LineChart,
CandlestickChart
])
const { day, week } = useDate()
const { push } = useRouter()
const currentDate = new Date();
const currentDates = new Date();
const value1 = ref<[Date, Date]>([
currentDate.setMonth(currentDate.getMonth() - 11),
new Date()
])
const value2 = ref<[Date, Date]>([
currentDates.setMonth(currentDates.getMonth() - 11),
new Date()
])
const { chartRef: chartRef1, option: chartOption1, cuType } = Chart1()
const { option: chartOption11,alType } = Chart11()
const { chartRef: chartRef3, option: chartOption3, state2 } = Chart3()
const { chartRef: chartRef4, option: chartOption4, state3 } = Chart4()
const { chartRef: chartRef5, option: chartOption5, state4 } = Chart5()
// const { state4 } = Chart5()
const { chartRef: chartRef6, option: chartOption6, state5 } = Chart6()
const listData = ref()
const listDatas = ref()
async function getData() {
const { data } = await getList({ type: 2 })
const { data: ds } = await getList({ type: 1 })
listData.value = data
listDatas.value = ds
}
const metal = ref()
const currency = ref()
onMounted(async () => {
getData()
const { data } = await getCurrencyList()
const { data: dat } = await getMetalList()
if (dat && dat != 'null' && dat.length > 0) {
metal.value = dat
// .filter((item:any) => {
// if(["Fe","lengmei"].includes(item.value)){
// return false
// }else return item
// })
from.value.label.radio = dat[0].value
state4.number = dat[0].value
console.log("🚀 ~ file: Market.vue:56 ~ metal:", metal)
}
if (data && data != 'null' && data.length > 0) {
currency.value = data
from.value.labe2.radio = data[0].value
const dat = data[0].value.split(',')
state5.currencyCodeFrom = dat[0]
state5.currencyCodeTo = dat[1]
state2.currencyCodeFrom = dat[0]
state2.currencyCodeTo = dat[1]
state3.currencyCodeFrom = dat[0]
state3.currencyCodeTo = dat[1]
}
})
const src = ref('');
const srcType = ref()
const showModalRef2 = ref(false)
const lokeFuck = async (n) => {
const { id } = n
if (!id) return
let { data: { url } } = await MarketPreview({ id })
if (!url) {
message.info("没有可预览文件!")
return
}
srcType.value = getLastSubstring(url)
if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
// src.value = filePath
// pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url
const screenWidth = window.screen.width;
const screenHeight = window.screen.height;
window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0)
}
else {
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
}
function getLastSubstring(str: string): string {
const lastIndex = str.lastIndexOf('.');
if (lastIndex !== -1) {
return str.substring(lastIndex + 1);
} else {
return '';
}
}
async function downloadFile(data: { id: any; title: string }) {
console.log(data)
if (!data.id) return
try {
const response = await MarketDownload({ id: data.id })
console.log(response)
var blob = new Blob([response.data]);
const downloadUrl = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.download = response.fileName; //
link.click();
URL.revokeObjectURL(downloadUrl);
} catch (error) {
message.error(error);
}
}
const tab = ref(false)
const tab1 = ref(false)
const tab2 = ref(false)
const names = ref('Cu')
const names1 = ref('100USD-CNY')
const names2 = ref('100USD-CNY')
const tabClick1 = (e) => {
console.log(e.target.getAttribute('data-id'))
tab1.value = false
const dat = e.target.getAttribute('data-id').split(',')
names1.value = e.target.innerText
state2.currencyCodeFrom = dat[0]
state2.currencyCodeTo = dat[1]
}
const tabClick2 = (e) => {
console.log(e.target.getAttribute('data-id'))
tab2.value = false
const dat = e.target.getAttribute('data-id').split(',')
names2.value = e.target.innerText
state3.currencyCodeFrom = dat[0]
state3.currencyCodeTo = dat[1]
}
const tabClick = (e) => {
console.log(e.target)
tab.value = false
state.type = e.target.getAttribute('data-id')
// names.value =e.target.innerText
}
const tabShow = (num) => {
console.log(num)
switch (num) {
case 0:
tab.value = tab.value === false ? true : false
break;
case 1:
tab1.value = tab1.value === false ? true : false
break;
case 2:
tab2.value = tab2.value === false ? true : false
break;
}
}
const from = ref({
label: {
radio: ''
},
labe2: {
radio: ''
}
})
const shomk = ref(false)
const sdubList = ref({
title: '',
fileList: [],
})
const shomks = (it) => {
sdubList.value.type = it
// console.log(sdubList.value)
shomk.value = true
}
async function onSubmit() {
const { type, title, fileList } = sdubList.value
let filePath
if (fileList.length > 0) {
// console.log(fileList)
filePath = fileList[0].response.url
}
const { msg, code } = await marketPreADD({ type, title, filePath })
if (code === 200) { message.success("修改成功") }
else message.warning(msg)
window.location.reload();
// console.log(sdubList.value)
}
const handleExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning("当前只支持上传一个文件")
}
const thisCka = (e) => {
if (value1.value) {
state4.startTime = formatDate(value1.value[0]).substring(0, 10)
state4.endTime = formatDate(value1.value[1]).substring(0, 10)
}
state4.number = e
console.log(e)
}
const thisCka2 = (e) => {
const dat = e.split(',')
if (value2.value) {
state5.startTime = formatDate(value2.value[0]).substring(0, 10)
state5.endTime = formatDate(value2.value[1]).substring(0, 10)
}
state5.currencyCodeFrom = dat[0]
state5.currencyCodeTo = dat[1]
}
const timenFirst = (e) => {
// console.log(e)
state4.startTime = formatDate(value1.value[0]).substring(0, 10)
state4.endTime = formatDate(value1.value[1]).substring(0, 10)
}
const timenFirsts = (e) => {
// console.log(e)
state5.startTime = formatDate(value2.value[0]).substring(0, 10)
state5.endTime = formatDate(value2.value[1]).substring(0, 10)
}
const header = { 'token': store.user.token }
const showModal = ref(false)
const flg = ref()
const setUserList = ref()
async function getUser(moduleId: any) {
showModal.value = !showModal.value
flg.value = moduleId
const { data: userArr } = await getMarketUser({ moduleId })
stores.article.reviewSource = '2'
setUserList.value = userArr
}
//
const handleChild = (data: any) => {
console.log(data, 444);
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
// userList.value = multipleSelection
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => {
// console.log(dataList.value)
userIdList.push(i.userId)
})
saveMarketUser({
moduleId: flg.value,
userIdList: userIdList
})
}
const CloseThiss = (data: boolean) => {
showModal.value = data
}
getHomeExInfo()
const exchangeInfo = ref({})
// getTimeFuturecenter()
const homeExchangeInfo = ref<any>([])
async function getHomeExInfo() {
const { data } = await fetchExchangeInfo()
exchangeInfo.value = groupBy(data,'channel')
console.log('🚀 ~ file: Home.vue:252 ~ }):', exchangeInfo.value)
}
async function getTimeFuturecenter() {
const { data } = await fetchTimeFuturecenterCu()
console.log("🚀 ~ file: Market.vue:293 ~ data:", data)
}
const cuTypeChange = (e) => {
}
</script>
<template>
<HomeHead class="top">
<template #content>
<!-- <HomeHeadSearch /> -->
</template>
</HomeHead>
<div class="h-full relative flex flex-col overflow-y-auto scrollbar-width-1px">
<div class="pl12px mt30px flex w-full h-full gap-30px">
<!-- <img src="./images/shukuang.png" alt="" class="w-full h-full"> -->
<AppBlock class="flex-1 box">
<div class="box-title">市况</div>
<el-button type="primary" v-if="userCode" class="button !mr-30px !mt-[-30px] z-100"
@click="push({ name: 'MarketDataModify' })">数据管理</el-button>
<div class="bgStyle !h250px mt20px">
<div class=" relative w100%">
<span @click="tabShow(0)" class="title bg-#70BFCD pl18px pr24px">{{ names }}
<!-- <el-icon><CaretBottom /></el-icon> -->
</span>
<!-- <span class="absolute right-160px top-14px z-30 text-#000">最近7天数据</span> -->
<span class="absolute right-10px top-6px z-30 text-#000">
<el-radio-group v-model="cuType.type">
<el-radio-button label="SMM" value="cu0000" />
<el-radio-button label="LME" value="LME_CA_3M" />
</el-radio-group></span>
<div v-if="false && tab"
class="tab absolute bg-#fff w100px top-50px z-50 text-#112144 text-center leading-28px text-18px ">
<div v-if="metal"
v-for="im in metal.filter((item: any) => !['Fe', 'lengmei'].includes(item.value))"
class="py5px !rounded-none" :data-id="im.value" @click="tabClick">{{ im.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="Fe" @click="tabClick">Fe</div>
<div class="py5px !rounded-none" data-id="Cu" @click="tabClick">Cu</div>
<div class="py5px !rounded-none" data-id="Re" @click="tabClick"></div> -->
</div>
<VChart class="absolute z-22 left-0 right-0 !w-full" ref="chartRef1" :option="chartOption1"
autoresize />
</div>
<!-- <div>
<span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span>
<VChart class="absolute z-22" ref="chartRef2" :option="chartOption2" autoresize />
</div> -->
</div>
<div class="bgStyle !h250px mt10px">
<div class=" relative w100%">
<span class="title bg-#FF960F pl18px pr28px">{{ 'AI' }}
<!-- <el-icon><CaretBottom /></el-icon> -->
</span>
<!-- <span class="absolute right-160px top-14px z-30 text-#000">最近7天数据</span> -->
<span class="absolute right-10px top-6px z-30 text-#000">
<el-radio-group v-model="alType.type">
<el-radio-button label="SMM" value="al0000" />
<el-radio-button label="LME" value="LME_AH_3M" />
</el-radio-group></span>
<VChart class="absolute z-22 left-0 right-0 !w-full" ref="chartRef11" :option="chartOption11"
autoresize />
</div>
<!-- <div>
<span class="title bg-#70BFCD p5px pl10px !pr25px">AI</span>
<VChart class="absolute z-22" ref="chartRef2" :option="chartOption1" autoresize />
</div> -->
</div>
<div class="bgStyle !h240px mt10px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef5" :option="chartOption5" autoresize />
</div>
</div>
<div class="mt8px ml10px">
<div class="flex items-center w-45%">
<span class="text-#000 whitespace-nowrap">日期:</span>
<el-config-provider :locale="zhCn">
<el-date-picker v-model="value1" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small"
@change="timenFirst" /></el-config-provider>
</div>
<div class="flex justify-between items-center">
<el-radio-group v-model="from.label.radio" class="ml-4" @change="thisCka">
<el-radio v-if="metal" v-for="im in metal" :label="im.value" size="large">{{ im.title
}}</el-radio>
<!-- <el-radio label="Al" size="large" >Al</el-radio>
<el-radio label="Fe" size="large" >Fe</el-radio>
<el-radio label="Re" size="large" >稀土</el-radio> -->
</el-radio-group>
<el-popover placement="top-end" trigger="click"
:popper-style="{ width: '590px', borderRadius: '10px' }" :teleported="true">
<template #reference>
<div
class="bg-gr h-42px w115px flex justify-center items-center text-#fff rounded-10px text-18px cursor-pointer font-bold">
市况预测 <el-icon class="rotate-270deg">
<CaretBottom />
</el-icon></div>
</template>
<!-- <Teleport to="v-screen-box"> -->
<!-- <VScaleScreen
ref="fitscreenRef"
:width="1920"
:height="1080"
mode="fit"
> -->
<div class="bgStyle h-250px w-690px mt15px mb10px">
<div class="w-full">
<span class="title bg-#003BB7 !text-16px pl13px pr20px b">市况预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(1)"></el-button> -->
<el-button type="primary" size="small" v-if="userCode" class="button !mr-2%"
@click="push({ name: 'MarketModifys' })">管理</el-button>
<p class="mt40px p15px !border-none max-h250px overflow-auto">
<p class="!border-none w-98% !flex items-center pb10px news-item !pr30rpx"
v-for="n in listDatas" :key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px">
<el-button size="small" type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p>
</p>
</p>
</div>
</div>
<!-- </VScaleScreen> -->
<!-- </Teleport> -->
</el-popover>
</div>
</div>
<div v-if="false" class="mt8px ml10px">
<div class="flex justify-between items-center">
<el-popover placement="top-end" trigger="click"
:popper-style="{ width: '590px', borderRadius: '10px' }" :teleported="true">
<template #reference>
<div
class="bg-gr h-42px w115px ml-auto flex justify-center items-center text-#fff rounded-10px text-18px cursor-pointer font-bold">
市况预测 <el-icon class="rotate-270deg">
<CaretBottom />
</el-icon></div>
</template>
<!-- <Teleport to="v-screen-box"> -->
<!-- <VScaleScreen
ref="fitscreenRef"
:width="1920"
:height="1080"
mode="fit"
> -->
<div class="bgStyle !h-284px w-690px mt15px mb10px">
<div class="w-full">
<span class="title bg-#003BB7 !text-16px pl13px pr20px b">市况预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(1)"></el-button> -->
<el-button type="primary" size="small" v-if="userCode" class="button !mr-2%"
@click="push({ name: 'MarketModifys' })">管理</el-button>
<p class="mt40px p15px !border-none max-h250px overflow-auto">
<p class="!border-none w-98% !flex items-center pb10px news-item !pr30rpx"
v-for="n in listDatas" :key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px">
<el-button size="small" type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p>
</p>
</p>
</div>
</div>
<!-- </VScaleScreen> -->
<!-- </Teleport> -->
</el-popover>
</div>
</div>
</AppBlock>
<AppBlock class="flex-1 box">
<div class="box-title ">汇率</div>
<div class="bgStyle !h250px mt20px z-100">
<div class="mr25px">
<span @click="tabShow(1)" class="title bg-#FF603A !text-16px pl13px pr20px cursor-pointer !z-100">{{ names1
}}<el-icon>
<CaretBottom />
</el-icon></span>
<div v-if="tab1"
class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value"
@click="tabClick1">{{ it.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick1">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick1">-</div> -->
</div>
<VChart class=" absolute z-22" ref="chartRef3" :option="chartOption3" autoresize />
</div>
<div>
<span @click="tabShow(2)" class="title bg-#70BFCD !text-16px pl13px pr20px !z-100 cursor-pointer">{{ names2
}}<el-icon>
<CaretBottom />
</el-icon></span>
<div v-if="tab2"
class="tab absolute bg-#fff w100px top-40px z-50 text-#112144 text-center leading-28px text-16px ">
<div v-if="currency" v-for="it in currency" class="py5px !rounded-none" :data-id="it.value"
@click="tabClick2">{{ it.title }}</div>
<!-- <div class="py5px !rounded-none" data-id="CNA,USD" @click="tabClick2">-</div>
<div class="py5px !rounded-none" data-id="JPY,USD" @click="tabClick2">-</div> -->
</div>
<VChart class="absolute z-22" ref="chartRef4" :option="chartOption4" autoresize />
</div>
</div>
<div class="bgStyle !h250px mt10px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">历年数据</span>
<VChart class=" absolute z-22" ref="chartRef6" :option="chartOption6" autoresize />
</div>
</div>
<div class="mt10px ml10px">
<div class="flex items-center w-45%">
<span class="text-#000 whitespace-nowrap">日期:</span>
<el-config-provider :locale="zhCn">
<el-date-picker v-model="value2" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" size="small"
@change="timenFirsts" /></el-config-provider>
</div>
<div class="h-30px">
<el-radio-group v-model="from.labe2.radio" class="ml-4" @change="thisCka2">
<el-radio v-if="currency" v-for="it in currency" :label="it.value" size="large">{{ it.title
}}</el-radio>
<!-- <el-radio label="JPY,USD" size="large" >日元-美元</el-radio>
<el-radio label="CNA,USD" size="large" >人民币-美元</el-radio> -->
</el-radio-group>
</div>
</div>
<div class="bgStyle !h230px mt15px mb10px">
<div>
<span class="title bg-#003BB7 !text-16px pl13px pr20px ">汇率预测</span>
<!-- <el-button type="primary" v-if="userCode" class="button" @click="getUser(2)"></el-button> -->
<el-button type="primary" v-if="userCodes" class="button"
@click="push({ name: 'MarketModify' })">管理</el-button>
<p class="mt40px p15px !border-none max-h-full overflow-auto">
<p class="!border-none w615px !flex items-center pb10px news-item " v-for="n in listData"
:key="n">
<AppNewsBox class="flex-1 !border-none" :text="n.title" :date="n.createTime" />
<p class="flex-shrink flex !border-none w35px ml20px">
<el-button type="primary" @click="lokeFuck(n)"></el-button>
<!-- <el-button type="primary" @click="downloadFile(n)"></el-button> -->
</p>
</p>
</p>
</div>
</div>
</AppBlock>
</div>
</div>
<!-- <div style="width: 1200px; height:800px ; position: fixed; z-index: 100; top:50px;;">
</div> -->
<n-modal :mask-closable="true" v-model:show="showModalRef2">
<div class="w90% h90% ">
<Amtion :data="src" :datas="srcType" />
</div>
</n-modal>
<n-modal v-model:show="shomk">
<div class="py40px px30px bg-#fff">
<el-form :model="sdubList" label-width="120px" :inline="true">
<el-form-item label="标题">
<el-input v-model="sdubList.title" />
</el-form-item>
<br>
<el-form-item label="文件">
<el-upload v-model:file-list="sdubList.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" :on-change="handleChange">
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
<br>
<br>
<el-form-item class="ml80px">
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
</n-modal>
<n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
</n-modal>
</template>
<style scoped lang="less">
.bg-gr {
background: linear-gradient(to left, #34A6D9 0%, #23D1C6 100%);
}
.button {
display: block;
float: right;
margin-right: 20px;
}
::-webkit-scrollbar {
width: 1px;
}
.top {
position: absolute;
right: 30px;
top: -92px;
}
.date-wrapper[data-v-c5c4f420] {
line-height: 1.5;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
color: #142142;
border: none;
}
.tab {
div:hover {
color: #0036BC;
}
}
.box {
padding: 23px 20px 0 20px;
.box-title {
font-size: 28px;
font-weight: 600;
position: relative;
padding-left: 24px;
color: black;
&::before {
content: " ";
display: block;
width: 8px;
height: 30px;
background-color: #003ab5;
position: absolute;
left: 0;
}
}
}
.bgStyle {
display: flex;
width: 100%;
height: 270px;
position: relative;
padding: 0 5px;
div {
flex: 1;
border: 1px solid rgb(236, 236, 236);
border-radius: 18px;
.title {
// width: 60px;
// height: 60px;
border-radius: 18px 0 50px 0;
color: aliceblue;
line-height: 40px;
font-size: 24px;
font-weight: 500;
z-index: 1;
position: absolute;
}
}
}
</style>

View File

@ -5,6 +5,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { useMessage, NModal } from 'naive-ui' import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base' import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base'
@ -15,7 +16,6 @@ const header = { 'token': store.user.token }
const dataA = ref([]) const dataA = ref([])
const editA = ref() const editA = ref()
const shomkA = ref(false) const shomkA = ref(false)
async function setDataFiles(arr, _row) { async function setDataFiles(arr, _row) {
@ -23,8 +23,8 @@ async function setDataFiles(arr, _row) {
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -37,85 +37,106 @@ async function getDataA() {
// setDataFiles(dataArr); // setDataFiles(dataArr);
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { if (index > -1) {
return title.slice(0, index - 1); return title.slice(0, index - 1)
} }
return title; return title
} }
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) { async function onSubmitA(row: {
id: any
fileList?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
console.log(row, 555) console.log(row, 555)
const { id, title } = row const { id, title, isTop, isPublish, publishTime } = row
// let moduleId = 1; // let moduleId = 1;
let sendData = {} let sendData = {}
if (!row.id) { if (!row.id) {
sendData = { title,type:type.value,userIdList:userData.value }; sendData = {
if (row.fileList && row.fileList.length > 0) { title,
row.fileList.map(item => { type: type.value,
userIdList: userData.value,
if(item.response) { isTop,
sendData.filePath = item.response.url; isPublish,
// obj.title = title || computedName(item.response.originalFilename); publishTime
} }
else { if (row.fileList && row.fileList.length > 0) {
sendData.filePath = item.url; row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename); // obj.title = title || computedName(item.originalFilename);
} }
}) })
} }
} else {
sendData = {
id,
title,
type: type.value,
userIdList: userData.value,
isTop,
isPublish,
publishTime
} }
else{
sendData = {id, title,type:type.value,userIdList:userData.value };
} }
console.log(sendData) console.log(sendData)
const { code, msg } = await marketPreADD(sendData) const { code, msg } = await marketPreADD(sendData)
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
shomkA.value = false } else {
getDataA(); message.error(msg)
}
shomkA.value = false
getDataA()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
console.log(row) console.log(row)
editA.value = { editA.value = {
title: '', title: '',
fileList: [], fileList: []
} }
setUserList.value = [] setUserList.value = []
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
setUserList.value = row.userIdList setUserList.value = row.userIdList
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await marketPreDelete({ id, type: type.value }) const { code, msg } = await marketPreDelete({ id, type: type.value })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
const activeName = ref('first')
const activeName = ref("first")
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -129,12 +150,11 @@ async function getUser(row) {
} }
// const {data: userArr} = await getBPCUser({moduleId}) // const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr // setUserList.value = userArr
} }
// //
const userData = ref() const userData = ref()
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
let userIdList: any[] = [] let userIdList: any[] = []
@ -144,7 +164,7 @@ async function getUser(row) {
if (flg.value.id) { if (flg.value.id) {
flg.value.userIdList = userIdList flg.value.userIdList = userIdList
marketPreADD(flg.value) marketPreADD(flg.value)
getDataA(); getDataA()
console.log(flg.value) console.log(flg.value)
} }
userData.value = userIdList userData.value = userIdList
@ -152,7 +172,6 @@ async function getUser(row) {
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -169,9 +188,18 @@ async function getUser(row) {
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button> <el-button type="primary" @click="handleEditA" class="my20px">汇率内容新增</el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<!-- <el-table-column label="级别" prop="status" /> --> <!-- <el-table-column label="级别" prop="status" /> -->
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -187,19 +215,21 @@ async function getUser(row) {
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> --> <!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> -->
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"> &nbsp;&nbsp; {{it.nickName}}</span> <span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList">
&nbsp;&nbsp; {{ it.nickName }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -212,23 +242,64 @@ async function getUser(row) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="查看范围"> <el-form-item label="查看范围">
<el-button class="button" @click="getUser(2)"></el-button> <el-button class="button" @click="getUser(2)"></el-button>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>

View File

@ -5,7 +5,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { useMessage, NModal } from 'naive-ui' import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue' import UserList from '@/views/home/intelligence/process/UserPages.vue'
import { pickerOptions } from '@/utils/date'
import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base' import { getList, marketPreDelete, marketPreADD } from '@/api/daikin/base'
const message = useMessage() const message = useMessage()
@ -15,7 +15,6 @@ const header = { 'token': store.user.token }
const dataA = ref([]) const dataA = ref([])
const editA = ref() const editA = ref()
const shomkA = ref(false) const shomkA = ref(false)
async function setDataFiles(arr, _row) { async function setDataFiles(arr, _row) {
@ -23,8 +22,8 @@ async function setDataFiles(arr, _row) {
arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => { arr.value = _row.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) { if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => { i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName; file.name = file.originalFileName
}); })
} }
return i return i
}) })
@ -37,85 +36,106 @@ async function getDataA() {
// setDataFiles(dataArr); // setDataFiles(dataArr);
} }
onMounted(async () => { onMounted(async () => {
getDataA(); getDataA()
}) })
function computedName(title) { function computedName(title) {
let index = title.indexOf("."); let index = title.indexOf('.')
if (index > -1) { if (index > -1) {
return title.slice(0, index - 1); return title.slice(0, index - 1)
} }
return title; return title
} }
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) { async function onSubmitA(row: {
id: any
fileList?: any
title?: any
isTop?: any
isPublish?: any
publishTime?: any
}) {
console.log(row, 555) console.log(row, 555)
const { id, title } = row const { id, title, isTop, isPublish, publishTime } = row
// let moduleId = 1; // let moduleId = 1;
let sendData = {} let sendData = {}
if (!row.id) { if (!row.id) {
sendData = { title,type:type.value,userIdList:userData.value }; sendData = {
if (row.fileList && row.fileList.length > 0) { title,
row.fileList.map(item => { type: type.value,
userIdList: userData.value,
if(item.response) { isTop,
sendData.filePath = item.response.url; isPublish,
// obj.title = title || computedName(item.response.originalFilename); publishTime
} }
else { if (row.fileList && row.fileList.length > 0) {
sendData.filePath = item.url; row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename); // obj.title = title || computedName(item.originalFilename);
} }
}) })
} }
} else {
sendData = {
id,
title,
type: type.value,
userIdList: userData.value,
isTop,
isPublish,
publishTime
} }
else{
sendData = {id, title,type:type.value,userIdList:userData.value };
} }
console.log(sendData) console.log(sendData)
const { code, msg } = await marketPreADD(sendData) const { code, msg } = await marketPreADD(sendData)
if (code === 200) { message.success("修改成功!") } if (code === 200) {
else { message.error(msg) } message.success('修改成功!')
shomkA.value = false } else {
getDataA(); message.error(msg)
}
shomkA.value = false
getDataA()
} }
const handleEditA = (type: string, row: any) => { const handleEditA = (type: string, row: any) => {
console.log(row) console.log(row)
editA.value = { editA.value = {
title: '', title: '',
fileList: [], fileList: []
} }
setUserList.value = [] setUserList.value = []
shomkA.value = true shomkA.value = true
if (!row) return if (!row) return
editA.value = row editA.value = row
editA.value.fileList = [{ editA.value.fileList = [
{
name: row.title, name: row.title,
originalFilename: row.title, originalFilename: row.title,
url: row.filePath, url: row.filePath
}] }
]
setUserList.value = row.userIdList setUserList.value = row.userIdList
} }
async function handleDeleteA(index: number, row: any) { async function handleDeleteA(index: number, row: any) {
const { id } = row const { id } = row
if (!id) return if (!id) return
const { code, msg } = await marketPreDelete({ id, type: type.value }) const { code, msg } = await marketPreDelete({ id, type: type.value })
if (code === 200) { message.success("删除成功!") } if (code === 200) {
else { message.error(msg) } message.success('删除成功!')
getDataA(); } else {
message.error(msg)
}
getDataA()
} }
const activeName = ref('first')
const activeName = ref("first")
const userList = ref() const userList = ref()
const showModal = ref(false) const showModal = ref(false)
const flg = ref() const flg = ref()
@ -129,12 +149,11 @@ async function getUser(row) {
} }
// const {data: userArr} = await getBPCUser({moduleId}) // const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr // setUserList.value = userArr
} }
// //
const userData = ref() const userData = ref()
const handleChild = (data: any) => { const handleChild = (data: any) => {
console.log(data, 444); console.log(data, 444)
const { showModal: show, multipleSelection } = data const { showModal: show, multipleSelection } = data
showModal.value = unref(show) showModal.value = unref(show)
let userIdList: any[] = [] let userIdList: any[] = []
@ -151,7 +170,6 @@ async function getUser(row) {
const CloseThiss = (data: boolean) => { const CloseThiss = (data: boolean) => {
showModal.value = data showModal.value = data
} }
</script> </script>
<template> <template>
<HomeHead class="top"> <HomeHead class="top">
@ -168,9 +186,18 @@ async function getUser(row) {
<div class="cont relative w100% h800px overflow-y-auto"> <div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button> <el-button type="primary" @click="handleEditA('add')" class="my20px">市况内容新增</el-button>
<el-table :data="dataA" style="width: 95%" <el-table
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }" :data="dataA"
:cell-style="{ 'text-align': 'center' }"> style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
>
<!-- <el-table-column label="级别" prop="status" /> --> <!-- <el-table-column label="级别" prop="status" /> -->
<el-table-column label="名称" prop="title" /> <el-table-column label="名称" prop="title" />
<!-- <!--
@ -186,19 +213,21 @@ async function getUser(row) {
<el-table-column label="查看范围" prop="userIdList"> <el-table-column label="查看范围" prop="userIdList">
<template #default="scope"> <template #default="scope">
<!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> --> <!-- <el-button type="primary" class="button" @click="getUser(scope.row)"></el-button> -->
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList">&nbsp;&nbsp;{{it.nickName}}</span> <span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"
>&nbsp;&nbsp;{{ it.nickName }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180px"> <el-table-column label="操作" width="180px">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button> <el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button> <el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</AppBlock> </AppBlock>
<n-modal v-model:show="shomkA"> <n-modal v-model:show="shomkA">
@ -211,23 +240,64 @@ async function getUser(row) {
<el-radio label="New" size="large">New</el-radio> <el-radio label="New" size="large">New</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<br> <br />
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="editA.title" /> <el-input v-model="editA.title" />
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="查看范围"> <el-form-item label="查看范围">
<el-button class="button" @click="getUser(2)"></el-button> <el-button class="button" @click="getUser(2)"></el-button>
</el-form-item> </el-form-item>
<br> <br />
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header" <el-upload
action="/test-api/common/upload" multiple :limit="editA.type == 'add' ? 3 : 1" :on-exceed="handleExceed"> v-model:file-list="editA.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
:limit="editA.type == 'add' ? 3 : 1"
:on-exceed="handleExceed"
>
<el-button type="primary">选择文件</el-button> <el-button type="primary">选择文件</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<br />
<el-form-item label="是否置顶">
<el-switch
v-model="editA.isTop"
active-text="置顶"
inactive-text="不置顶"
:inactive-value="0"
:active-value="1"
></el-switch>
</el-form-item>
<br />
<el-form-item label="是否定时发送">
<el-switch
v-model="editA.isPublish"
active-text="是"
inactive-text="否"
:inactive-value="0"
:active-value="1"
@change="(val) => (editA.publishTime = val ? pickerOptions.day : '')"
></el-switch>
</el-form-item>
<br />
<el-form-item label="发布时间" v-if="editA.isPublish == 1">
<el-date-picker
v-model="editA.publishTime"
align="right"
type="date"
placeholder="选择日期"
:disabledDate="pickerOptions.disabledDate"
:shortcuts="pickerOptions.shortcuts"
:value-format="pickerOptions.valueFormat"
>
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<hr class="mb15px border-#f1f1f1"> <hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button> <el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div> </div>

View File

@ -68,9 +68,17 @@ const num = ['', '第一周', '第二周', '第三周', '第四周', '第五周'
function groupDatesByWeek(dates = [], weekStartDay = 1) { function groupDatesByWeek(dates = [], weekStartDay = 1) {
return dates.reduce((acc: any, item: any) => { return dates.reduce((acc: any, item: any) => {
const date = dayjs(item.createTime) const date = dayjs(item.createTime)
const weekStart = date.startOf('week').add(weekStartDay, 'day').format('MM月DD日') const weekday = date.day() // 01
//
const mondayDistance = (weekday + 6) % 7
//
const sundayDistance = 7 - mondayDistance - 1
//
const weekStart = date.subtract(mondayDistance, 'day').format('MM月DD日')
const weekEnd = date.add(sundayDistance, 'day').format('MM月DD日')
// const weekStart = date.startOf('week').add(weekStartDay, 'day').format('MMDD')
// const weekEnd = date.endOf('week').add(weekStartDay, 'day').format('MMDD')
item.date = date.format('YYYY-MM-DD') item.date = date.format('YYYY-MM-DD')
const weekEnd = date.endOf('week').add(weekStartDay, 'day').format('MM月DD日')
const week = getWeekOfMonth(date) const week = getWeekOfMonth(date)
const month = date.format('MM') const month = date.format('MM')
const key = `${+month}${num[week]} ${weekStart} - ${weekEnd} ` const key = `${+month}${num[week]} ${weekStart} - ${weekEnd} `
@ -132,7 +140,6 @@ const codePath = {
const goModule = (item, type) => { const goModule = (item, type) => {
const { moduleCode, id, cateId } = item const { moduleCode, id, cateId } = item
const { modulePath, path } = codePath[moduleCode] const { modulePath, path } = codePath[moduleCode]
console.log('🚀 ~ file: News.vue:128 ~ modulePath, path:', modulePath, path)
if (modulePath) { if (modulePath) {
if (type === 'module') { if (type === 'module') {
push(modulePath) push(modulePath)

View File

@ -4,6 +4,10 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue' // import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate' import { useDate } from '@/views/home/hooks/useDate'
// import { NTimeline, NTimelineItem } from 'naive-ui' // import { NTimeline, NTimelineItem } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user'
import { fetchContactList } from '@/api/daikin/base'
import { groupBy } from 'lodash-es'
const store = useUserStore()
const { day, week } = useDate() const { day, week } = useDate()
const { push } = useRouter() const { push } = useRouter()
@ -46,6 +50,25 @@ let flag = ref(false)
const switchImg = () => { const switchImg = () => {
flag.value = !flag.value flag.value = !flag.value
} }
const userCode = ref(false)
watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
})
const contactList = ref<any>([])
const fetchDataList = async () => {
const { rows = [] } = await fetchContactList({
pageNum: 1,
pageSize: 1000
})
contactList.value = rows
console.log('🚀 ~ file: index.vue:68 ~ rows:', groupBy(rows, 'type'))
}
fetchDataList()
</script> </script>
<template> <template>
@ -74,21 +97,38 @@ const switchImg = () => {
</div> </div>
</div> </div>
</div> --> </div> -->
<div class="mt30px mr20px flex w100% relative overflow-hidden"> <div class="mt20px flex w100% relative pt-40px overflow-hidden">
<!-- <el-button
v-if="userCode"
type="primary"
class="button absolute top-0px right-50px"
@click="push({ name: 'phoneManage' })"
>数据管理</el-button
> -->
<!-- <img src="../../../assets/images/fzqiet3.png" class="w100%" /> --> <!-- <img src="../../../assets/images/fzqiet3.png" class="w100%" /> -->
<img <div class="h-full overflow-hidden w-1500px flex items-center">
src="../../../assets/images/jjllt.jpg" <div
class="w100% transition-all duration-500" class="w-1500px h-full transition-all duration-500 ease-out relative"
:class="flag ? '-translate-x-full' : 'mr0px'"
>
<img src="../../../assets/images/jjllt.jpg" class="w-1500px h-90%" />
<view
class="absolute top-24px right-40px w-300px h30px z-2 bg-#ffffff text-#000 text-end leading-30px text-18px font font-600"
>
更新日{{ new Date().toLocaleDateString() }}
</view>
</div>
<div
class="!w-1500px !h-full transition-all duration-500 ease-out relative"
:class="flag ? '-translate-x-full' : ''" :class="flag ? '-translate-x-full' : ''"
/> >
<img <img src="../../../assets/images/jjllt-right.jpg" class="!w-1500px !h-full" />
src="../../../assets/images/jjllt-right.jpg" </div>
class="w100% transition-all duration-500" </div>
:class="flag ? '-translate-x-full' : ''" <!-- 56px -->
/>
<div <div
@click="switchImg" @click="switchImg"
class="absolute top-56px right-40px w-300px h50px z-10 cursor-pointer" class="absolute top-96px right-40px w-300px h50px z-10 cursor-pointer"
></div> ></div>
</div> </div>
</template> </template>
@ -100,6 +140,10 @@ const switchImg = () => {
top: -92px; top: -92px;
} }
.font {
font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}
.g-wrapper { .g-wrapper {
border-radius: 18px; border-radius: 18px;
border: 1px solid #e7ebf5; border: 1px solid #e7ebf5;

View File

@ -0,0 +1,406 @@
<script setup lang="ts">
import AppBlock from '@/components/AppBlock.vue'
import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useMessage, NModal } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
import dayjs from 'dayjs'
import {
fetchDelHis,
marketPreADD,
getMetalList,
fetchGetHisPage,
fetchUpdateHis,
fetchSaveHis,
fetchContactList,
fetchContactEdit,
fetchContactDel,
fetchContactAdd
} from '@/api/daikin/base'
const message = useMessage()
const store = useUserStore()
const header = { token: store.user.token }
const pageInfo = reactive({
currentPage: 1,
pageSize: 15,
total: 0
})
const dataA = ref<any>([])
const editA = ref<any>({})
const metaList = ref<any>([])
const metaObj = ref<any>({})
const stDateList = ref<any>([])
const shomkA = ref(false)
const type = ref(2)
async function getDataA() {
const { data } = await fetchGetHisPage({})
dataA.value = Object.entries(data).map(([key, value]: any) => {
return {
stDate: key,
yearId: key,
children: value.map((item: any) => {
return {
...item,
numbers: metaObj.value[item.number]
}
})
}
})
// setDataFiles(dataArr);
}
onMounted(async () => {
// const { data = [] } = await getMetalList()
// metaList.value = data
// data.forEach((item: any) => {
// metaObj.value[item.value] = item.title
// })
// getDataA()
fetchDataList()
})
const contactList = ref<any>([])
const fetchDataList = async () => {
const { rows = [] } = await fetchContactList({
pageNum: pageInfo.currentPage,
pageSize: pageInfo.pageSize
})
contactList.value = rows
console.log('🚀 ~ file: manage.vue:66 ~ data:', rows)
}
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) {
console.log(row, 555)
const { id, title } = row
// let moduleId = 1;
let sendData = {}
if (!row.id) {
sendData = { title, type: type.value, userIdList: userData.value }
if (row.fileList && row.fileList.length > 0) {
row.fileList.map((item) => {
if (item.response) {
sendData.filePath = item.response.url
// obj.title = title || computedName(item.response.originalFilename);
} else {
sendData.filePath = item.url
// obj.title = title || computedName(item.originalFilename);
}
})
}
} else {
sendData = { id, title, type: type.value, userIdList: userData.value }
}
const { code, msg } = await marketPreADD(sendData)
if (code === 200) {
message.success('修改成功!')
} else {
message.error(msg)
}
shomkA.value = false
getDataA()
}
const handleEditA = (type: string, row: any = { type: 1 }) => {
if (!row) return
editA.value = { ...row }
// editA.value.stDateList = [row.stDate, row.stDate]
// stDateList.value = [row.stDate, row.stDate]
// setUserList.value =[]
shomkA.value = true
// editA.value.fileList = [{
// name: row.title,
// originalFilename: row.title,
// url: row.filePath,
// }]
// setUserList.value =row.userIdList
}
async function handleDeleteA(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await fetchContactDel(id)
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
fetchDataList()
}
const showModal = ref(false)
const flg = ref()
const setUserList = ref()
async function getUser(row) {
console.log(row)
showModal.value = !showModal.value
flg.value = row
if (row.id && row.userIdList) {
setUserList.value = row.userIdList
}
// const {data: userArr} = await getBPCUser({moduleId})
// setUserList.value = userArr
}
//
const userData = ref()
const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => {
userIdList.push(i.userId)
})
if (flg.value.id) {
flg.value.userIdList = userIdList
marketPreADD(flg.value)
getDataA()
console.log(flg.value)
}
userData.value = userIdList
}
const CloseThiss = (data: boolean) => {
showModal.value = data
}
const goBacks = () => {
history.back()
}
const editForm = ref(null)
const channelList = ref([
{
label: 'LME',
value: 'LME'
},
{
label: 'SMM',
value: 'SMM'
}
])
const handleClickA = async () => {
const req = { ...editA.value }
let flag = false
try {
} catch (error) {}
if (!req.type) {
message.error('请选择部门')
return
}
req.dept = typeList.find((i) => i.value == req.type)?.label
let res: any = req.id ? await fetchContactEdit(req) : await fetchContactAdd(req)
if (res.code == 200) {
shomkA.value = false
message.success('操作成功!')
fetchDataList()
} else {
message.error(res.msg)
}
}
function generateDateRange() {
const [startDate, endDate] = stDateList.value || []
if (!startDate || !endDate) return []
const dateFormat = 'YYYY-MM-DD'
const dates = []
const start = dayjs(startDate, dateFormat)
const end = dayjs(endDate, dateFormat)
//
dates.push(start.format(dateFormat))
//
let currentDate = start
while (currentDate.isSameOrBefore(end)) {
currentDate = currentDate.add(1, 'day')
dates.push(currentDate.format(dateFormat))
}
return dates
}
// 1 2: DSZ 3: DISH
const typeList = [
{
label: '调达本部',
value: 1
},
{
label: 'DSZ',
value: 2
},
{
label: 'DISH',
value: 3
}
]
const handleClose = (tag: any) => {
editA.value = { type: 1 }
}
</script>
<template>
<HomeHead class="top">
<template #content>
<!-- <HomeHeadSearch /> -->
</template>
</HomeHead>
<AppBlock class="w-full h-full p30px text-#000">
<div class="font-600 flex items-center">
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
<div class="text-36px text-#000">紧急联络人-数据管理</div>
</div>
<div class="cont relative w100% h900px overflow-y-auto">
<el-button type="primary" @click="handleEditA" class="my20px">新增紧急联络人</el-button>
<div
class="rounded-md cursor-pointer float-right mr-30px mt-20px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
@click="goBacks"
>
<el-icon><ArrowLeftBold size="18" /></el-icon>
</div>
<el-table
:data="contactList"
style="width: 100%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center' }"
height="740px"
>
<el-table-column label="部门" prop="dept" />
<el-table-column label="职位" prop="position" />
<el-table-column label="姓名" prop="realname" />
<el-table-column label="手机号" prop="mobile" />
<el-table-column label="行号" prop="rowIndex" />
<el-table-column label="排序" prop="sort" />
<el-table-column label="创建时间" prop="createTime">
<template #default="{ row }">
{{ dayjs(row.createTime).format('YYYY-MM-DD') }}
</template>
</el-table-column>
<!-- <el-table-column label="查看范围" prop="userIdList">
<template #default="scope">
<span v-if="scope.row.userIdList" v-for="it in scope.row.userIdList"> &nbsp;&nbsp; {{it.nickName}}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" width="180px">
<template #default="scope">
<template v-if="!scope.row.children?.length">
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template>
</template>
</el-table-column>
</el-table>
<div class="absolute bottom-50px left-50% translate-x-[-50%] z-11">
<el-pagination
background
v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, total,jumper,->"
:total="pageInfo.total"
@current-change="fetchDataList"
/>
<!-- @size-change="handleSizeChange" -->
</div>
</div>
</AppBlock>
<el-dialog
:z-index="200"
v-model="shomkA"
title=" "
width="30%"
:modal="false"
top="30vh"
@close="handleClose"
>
<div class="bg-#FFF">
<el-form ref="editForm" :model="editA" label-width="100px" size="large">
<el-form-item label="部门" prop="dept">
<!-- <el-input v-model="editA.dept" placeholder="请输入部门"></el-input> -->
<el-select v-model="editA.type" placeholder="选择部门" class="!w-100%">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<br />
<el-form-item label="职位" prop="position">
<el-input v-model="editA.position" placeholder="请输入职位"></el-input>
</el-form-item>
<br />
<el-form-item label="姓名" prop="position">
<el-input v-model="editA.realname" placeholder="请输入职位"></el-input>
</el-form-item>
<br />
<el-form-item label="手机号" prop="mobile">
<el-input v-model="editA.mobile" placeholder="请输入手机号"></el-input>
</el-form-item>
<br />
<el-form-item label="行号" prop="rowIndex">
<el-input-number v-model="editA.rowIndex" :controls="false" class="!w-100%" />
<!-- <el-input v-model="editA.rowIndex" placeholder="请输入行号"></el-input> -->
</el-form-item>
<br />
<el-form-item label="排序" prop="sort">
<el-input-number v-model="editA.sort" :controls="false" class="!w-100%" />
<!-- <el-input v-model="editA.sort" placeholder="请输入排序"></el-input> -->
</el-form-item>
<br />
<div class="text-center">
<el-button type="" @click="shomkA = false" class="mb-20px !mr-50rpx"> 取消</el-button>
<el-button type="primary" @click="handleClickA(editA)" class="mb-20px"> 确认</el-button>
</div>
</el-form>
</div>
</el-dialog>
<n-modal v-model:show="showModal">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
</n-modal>
</template>
<style lang="less" scoped>
.demo-tabs > .el-tabs__content {
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.top {
position: absolute;
right: 30px;
top: -92px;
}
.flex-center {
display: flex;
justify-content: center;
margin: 0 auto;
}
:deep(.el-input-number .el-input__inner) {
text-align: left !important;
}
:deep {
.el-dialog__body {
margin-top: 18px;
padding-top: 10px;
}
}
</style>

View File

@ -1,4 +1,4 @@
import * as echarts from "echarts"; import * as echarts from 'echarts'
import { topStat } from '@/api/daikin/base' import { topStat } from '@/api/daikin/base'
import { getPreviousMonths } from '@/utils/format' import { getPreviousMonths } from '@/utils/format'
function formatDate(inputDate: string) { function formatDate(inputDate: string) {
@ -25,7 +25,17 @@ export function useChart21() {
const { data } = await topStat() const { data } = await topStat()
const option = { const option = {
legend: {}, legend: {
orient: 'vertical',
right: 0,
top: '40%',
itemgrap: 10,
textStyle: {
width: 50,
overflow: 'break'
},
itemStyle: {}
},
title: { title: {
text: '件', text: '件',
textStyle: { fontSize: 14, fontWeight: 500 }, textStyle: { fontSize: 14, fontWeight: 500 },
@ -40,8 +50,9 @@ export function useChart21() {
} }
}, },
grid: { grid: {
top: '5%',
left: '6%', left: '6%',
right: '4%', right: '24%',
bottom: '5%', bottom: '5%',
containLabel: true containLabel: true
}, },

View File

@ -7,18 +7,12 @@ import { useChart21 } from './Quality'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import { NModal, useMessage } from 'naive-ui' import { NModal, useMessage } from 'naive-ui'
import Amtion from '@/components/amtion.vue' import Amtion from '@/components/amtion.vue'
import { import { topList, actList, highList, badartList, topStat } from '@/api/daikin/base'
topList,
actList,
highList,
badartList,
topStat
} from '@/api/daikin/base'
import { isNotOneWeekAgo } from '@/utils' import { isNotOneWeekAgo } from '@/utils'
// import { it } from "element-plus/es/locale/index.js"; // import { it } from "element-plus/es/locale/index.js";
const store = useUserStore() const store = useUserStore()
const userCode = ['admin', 'quality_dangdan', 'tech_service'].includes( const userCode = ['admin', 'quality_dangdan', 'tech_service'].some((item) =>
store.user.roleCode store.user.roleCode?.includes(item)
) )
const message = useMessage() const message = useMessage()
// console.log(userCode); // console.log(userCode);
@ -167,7 +161,11 @@ const value1 = ref(null)
const src = ref('') const src = ref('')
const srcType = ref() const srcType = ref()
const showModalRef2 = ref(false) const showModalRef2 = ref(false)
const openUrl = async (url) => { const openUrl = async (row: any) => {
if (row.isSelect === 2) {
return message.info('您没有权限查看!')
}
let url = row.filePath || row.filePathList[0].url
console.log(url) console.log(url)
if (!url) { if (!url) {
@ -175,30 +173,19 @@ const openUrl = async (url) => {
return return
} }
srcType.value = getLastSubstring(url) srcType.value = getLastSubstring(url)
if ( if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath // src.value = filePath
// pdfShow.value = true // pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url const _url = 'https://view.xdocin.com/view?src=' + url
const screenWidth = window.screen.width const screenWidth = window.screen.width
const screenHeight = window.screen.height const screenHeight = window.screen.height
window.open( window.open(
url, _url,
'', '',
'width=' + 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
) )
} else { } else {
message.error( message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
} }
} }
function getLastSubstring(str: string): string { function getLastSubstring(str: string): string {
@ -278,7 +265,7 @@ function getLastSubstring(str: string): string {
<span <span
v-if="row.filePathList.length > 0" v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px truncate" class="text-#5695FF underline text-16px truncate"
@click="openUrl(row.filePathList[0].url)" @click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span >{{ row.filePathList[0].originalFileName }}</span
> >
<el-dropdown <el-dropdown
@ -287,9 +274,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1" v-if="row.filePathList.length > 1"
> >
<span class="el-dropdown-link mt5px"> <span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right" <el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
><CaretBottom
/></el-icon>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
@ -391,9 +376,7 @@ function getLastSubstring(str: string): string {
<div class="flex flex-wrap"> <div class="flex flex-wrap">
<div class="h400px relative"> <div class="h400px relative">
<div class="box-title">品质情报</div> <div class="box-title">品质情报</div>
<div <div class="absolute right-0px top-10px w165px text-14px text-#B2B7BE">
class="absolute right-0px top-10px w165px text-14px text-#B2B7BE"
>
{{ dataC.length > 0 ? '更新时间:' + dataC[0].createTime : '' }} {{ dataC.length > 0 ? '更新时间:' + dataC[0].createTime : '' }}
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
@ -432,16 +415,12 @@ function getLastSubstring(str: string): string {
</el-table-column> </el-table-column>
<el-table-column prop="title" label="详情" width="110px" /> <el-table-column prop="title" label="详情" width="110px" />
<el-table-column prop="source" label="来源" width="60px" /> <el-table-column prop="source" label="来源" width="60px" />
<el-table-column <el-table-column prop="createTime" label="情报追踪" width="120px">
prop="createTime"
label="情报追踪"
width="120px"
>
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<span <span
v-if="row.filePathList.length > 0" v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px w-80px truncate" class="text-#5695FF underline text-16px w-80px truncate"
@click="openUrl(row.filePathList[0].url)" @click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span >{{ row.filePathList[0].originalFileName }}</span
> >
<el-dropdown <el-dropdown
@ -450,9 +429,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1" v-if="row.filePathList.length > 1"
> >
<span class="el-dropdown-link mt5px"> <span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right" <el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
><CaretBottom
/></el-icon>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
@ -472,9 +449,7 @@ function getLastSubstring(str: string): string {
<div class="relative"> <div class="relative">
<div class="box-title mt30px">活动进展</div> <div class="box-title mt30px">活动进展</div>
<div <div class="absolute right-0 top-40px w165px text-14px text-#B2B7BE">
class="absolute right-0 top-40px w165px text-14px text-#B2B7BE"
>
{{ dataB.length > 0 ? '更新时间:' + dataB[0].createTime : '' }} {{ dataB.length > 0 ? '更新时间:' + dataB[0].createTime : '' }}
</div> </div>
<div class="mt23px overflow-y-auto"> <div class="mt23px overflow-y-auto">
@ -514,16 +489,12 @@ function getLastSubstring(str: string): string {
</el-table-column> </el-table-column>
<el-table-column prop="title" label="内容" width="150px" /> <el-table-column prop="title" label="内容" width="150px" />
<el-table-column <el-table-column prop="createTime" label="活动追踪" width="140px">
prop="createTime"
label="活动追踪"
width="140px"
>
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<span <span
v-if="row.filePathList.length > 0" v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px w-80px truncate" class="text-#5695FF underline text-16px w-80px truncate"
@click="openUrl(row.filePathList[0].url)" @click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span >{{ row.filePathList[0].originalFileName }}</span
> >
<el-dropdown <el-dropdown
@ -532,9 +503,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1" v-if="row.filePathList.length > 1"
> >
<span class="el-dropdown-link mt5px"> <span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right" <el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
><CaretBottom
/></el-icon>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>

File diff suppressed because it is too large Load Diff

View File

@ -148,11 +148,11 @@ function getFileNameFromUrl(url: string) {
} }
const goModule = (item, type) => { const goModule = (item, type) => {
const { moduleCode, id } = item const { moduleCode, id, cateId } = item
const { modulePath, path } = codePath[moduleCode] const { modulePath, path } = codePath[moduleCode]
if (modulePath) { if (modulePath) {
if (type === 'module') { if (type === 'module') {
push(modulePath) moduleCode === 'App_Database' ? push(modulePath + `?id=${cateId}`) : push(modulePath)
} else { } else {
push(path + id) push(path + id)
} }

View File

@ -6,6 +6,7 @@ import { NModal, NPopover } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import Searchs from '@/components/search.vue' import Searchs from '@/components/search.vue'
import { report, treeDbList } from '@/api/daikin/base' import { report, treeDbList } from '@/api/daikin/base'
// import axios from 'axios'
useTitle('大金中国调达本部 HOMEPAGE') useTitle('大金中国调达本部 HOMEPAGE')
const { push } = useRouter() const { push } = useRouter()
const store = useUserStore() const store = useUserStore()
@ -69,7 +70,8 @@ const Menus = ref([
{ {
key: 'YCWZ', key: 'YCWZ',
name: '调达本部才望子', name: '调达本部才望子',
link: 'http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index' isClick: true
// link: 'http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index'
}, },
{ {
key: 'GCDB', key: 'GCDB',
@ -112,8 +114,10 @@ async function getDbTree() {
getDbTree() getDbTree()
let flag = false let flag = false
const onClick = ref(false)
function menuHandler(menu: any, index: number) { function menuHandler(menu: any, index: number) {
activeMenuKey.value = menu.key activeMenuKey.value = menu.key
onClick.value = true
console.log(menu, index) console.log(menu, index)
if (menu.key === 'DataBase' && idx.value === index) { if (menu.key === 'DataBase' && idx.value === index) {
report({ moduleCode: 'App_Database' }) report({ moduleCode: 'App_Database' })
@ -143,6 +147,14 @@ function menuHandler(menu: any, index: number) {
} }
push({ name: menu.key }) push({ name: menu.key })
} }
const handleExpand = (m, index) => {
if (m.key === activeMenuKey.value) {
onClick.value = !onClick.value
} else {
menuHandler(m, index)
}
}
const shorm = ref(false) const shorm = ref(false)
const { path } = useRoute() const { path } = useRoute()
@ -156,6 +168,10 @@ watchEffect(() => {
}, 0) }, 0)
}) })
function goChild(menu: any) { function goChild(menu: any) {
if (menu.isClick) {
goUrl()
return
}
activeItem = menu.key activeItem = menu.key
if (menu.key === 'CODE') { if (menu.key === 'CODE') {
shorm.value = true shorm.value = true
@ -166,6 +182,15 @@ function goChild(menu: any) {
push({ name: menu.key, query: menu.params || {} }) push({ name: menu.key, query: menu.params || {} })
} }
} }
const goUrl = () => {
const url = store.user?.cwzLoginUrl
const doman = url ? url.split('?')?.shift() : ''
if (!doman) return
fetch(url).then((res) => {
window.open(doman, '_blank')
})
}
var activeItem = 0 var activeItem = 0
</script> </script>
@ -184,15 +209,21 @@ var activeItem = 0
<!-- max-h-636px --> <!-- max-h-636px -->
<div class="pt10px pb10px flex-1 max-h-836px"> <div class="pt10px pb10px flex-1 max-h-836px">
<div <div
class="nav pl36px pr16px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#fff cursor-pointer hover:underline" class="nav pl20px pr16px py24px m10px mr0 rd-32px rd-r-0 flex flex-col text-#fff cursor-pointer hover:underline transition-all111"
v-for="(m, index) in Menus" v-for="(m, index) in Menus"
:key="m.key" :key="m.key"
:class="activeMenuKey === m.key ? (m.children ? 'actives' : 'active') : ''" :class="activeMenuKey === m.key ? (m.children ? 'actives' : 'active') : ''"
@click="() => menuHandler(m, index)" @click="() => menuHandler(m, index)"
> >
<div :class="activeMenuKey === m.key && 'onActive'"> <div class="relative" :class="activeMenuKey === m.key && 'onActive'">
<img v-if="activeMenuKey === m.key" :src="m.icon1" class="w22px h22px mr16px mt--5px" /> <p class="inline-block">
<img v-else :src="m.icon" class="w22px h22px mr16px mt--5px" /> <img
v-if="activeMenuKey === m.key"
:src="m.icon1"
class="w22px h22px mr12px mt--5px"
/>
<img v-else :src="m.icon" class="w22px h22px mr12px mt--5px" />
</p>
<span <span
class="text-22px font-900 leading-22px" class="text-22px font-900 leading-22px"
:class=" :class="
@ -209,9 +240,23 @@ var activeItem = 0
</span> </span>
<span class="text-18px italic font-500" v-if="m.other">{{ m.other }}</span> <span class="text-18px italic font-500" v-if="m.other">{{ m.other }}</span>
</span> </span>
<p
@click.stop="handleExpand(m, index)"
v-if="['DataBase', 'link', 'phone'].includes(m.key)"
class="inline-block ml-auto text-#FFF cursor-pointer p-2 float-right mr--10px mt--2"
:class="activeMenuKey === m.key && '!text-#4977FC'"
>
<el-icon size="26">
<CaretTop v-if="activeMenuKey === m.key && onClick" class="text-#4977FC" />
<CaretBottom v-else />
</el-icon>
</p>
</div> </div>
<div v-if="m.children && idx == index" class="pl40px"> <div
v-if="m.children && idx == index && onClick"
class="pl30px transition-all duration-300"
>
<div <div
class="my16px pl30px text-#fff activeChildren text-20px" class="my16px pl30px text-#fff activeChildren text-20px"
v-for="(item, ind) in m.children" v-for="(item, ind) in m.children"
@ -256,8 +301,11 @@ var activeItem = 0
</div> </div>
</n-popover> </n-popover>
<div class="p20px w270px rd-20px b-4px bg-#fff/4 b-4px b-solid b-#fff/23 text-14px relative"> <div class="p20px w270px rd-20px b-4px bg-#fff/4 b-4px b-solid b-#fff/23 text-14px relative">
<a <!-- href="http://106.14.114.146/scripts/cbgrn/grn.exe" -->
href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" <!-- href="http://172.31.119.37/scripts/cbgrn/grn.exe/portal/index" -->
<div
@click="goUrl"
:href="store.user?.cwzLoginUrl"
target="_blank" target="_blank"
class="no-underline text-#fff" class="no-underline text-#fff"
> >
@ -273,7 +321,7 @@ var activeItem = 0
src="@/assets/images/zhulj@2x.png" src="@/assets/images/zhulj@2x.png"
class="absolute w22px h22px mr10px top--15px right--20px" class="absolute w22px h22px mr10px top--15px right--20px"
/> />
</a> </div>
<div class="mt10px ml-30px opacity-70" @click="(e) => e.stopPropagation()"> <div class="mt10px ml-30px opacity-70" @click="(e) => e.stopPropagation()">
请点击上方链接登录cybouzu 请点击上方链接登录cybouzu
</div> </div>
@ -390,7 +438,7 @@ var activeItem = 0
background-color: #fff; background-color: #fff;
border-radius: 32px 0 0 32px; border-radius: 32px 0 0 32px;
padding: 24px 16px 24px 36px; padding: 24px 16px 24px 20px;
} }
} }
} }

View File

@ -13,6 +13,7 @@ import PurgeIcons from 'vite-plugin-purge-icons'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: '/',
server: { server: {
proxy: { proxy: {
'/test-api': { '/test-api': {