市况汇率更新

main
wenlong 2024-08-22 00:32:58 +08:00
parent ccdf3b458f
commit 0a9151eb3c
11 changed files with 1185 additions and 109 deletions

View File

@ -1470,3 +1470,51 @@ export async function fetchTimeFuturecenterAl(params?: any) {
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

@ -467,6 +467,12 @@ const router = createRouter({
name: 'Group',
component: () => import('@/views/company/index.vue')
},
{
path: '',
meta: { title: '集团方针管理' },
name: 'policyManage',
component: () => import('@/views/company/manage.vue')
},
{
path: 'company',
meta: { title: '公司方针' },
@ -491,6 +497,11 @@ const router = createRouter({
name: 'phone',
component: () => import('@/views/home/phone/index.vue')
},
{
path: 'manage',
name: 'phoneManage',
component: () => import('@/views/home/phone/manage.vue')
},
{
path: 'visit',
meta: { title: '拜访' },

View File

@ -5,6 +5,7 @@
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']

View File

@ -4,6 +4,9 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate'
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'
@ -75,6 +78,13 @@ const goFile = (row: any) => {
}
getFile()
const userCode = ref(false)
watchEffect(() => {
userCode.value = ['admin', 'cd_dandang', 'tech_service'].some((item) =>
store.user.roleCode?.includes(item)
)
})
</script>
<template>
@ -103,7 +113,14 @@ getFile()
</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/fzqiet.png" class="w100%" />
<div
@ -115,14 +132,14 @@ getFile()
</div> -->
<img src="../../assets/images/2024fz.jpg" class="w100%" />
<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)"
>
<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
2024年グループ年頭方针
</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)"
>
<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
@ -137,6 +154,9 @@ getFile()
right: 30px;
top: -92px;
}
.font {
font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}
.g-wrapper {
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

@ -214,7 +214,8 @@ const displayDiffValue = (diffValue: number) => {
if (diffValue > 0) {
return `+${diffValue}`
} else if (diffValue < 0) {
return `-${Math.abs(diffValue)}`
// return `-${Math.abs(diffValue)}`
return `${diffValue}`
} else {
// return `${formatNumber(diffValue)} %`
return `${diffValue}`
@ -265,9 +266,12 @@ function formatNumber(num = 0) {
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 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>([])
@ -490,7 +494,7 @@ async function getLastTime() {
</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 }}</td>
<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>
@ -500,8 +504,8 @@ async function getLastTime() {
<!-- <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]?.[0]?.diffPrice || '') }}</td>
<td class="text-14px text-#000" :class="homeSmmExInfo[item]?.[1]?.diffValue < 0 ? 'text-#63BF8D' : 'text-red'">{{ displayDiffValue(homeSmmExInfo[item]?.[0]?.diffValue || '') }}%</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>

View File

@ -55,6 +55,7 @@ const currency = ref()
onMounted(async () => {
getData()
const { data } = await getCurrencyList()
console.log("🚀 ~ file: Market.vue:58 ~ data:", data)
const { data: dat } = await getMetalList()
if (dat && dat != 'null' && dat.length > 0) {
metal.value = dat

View File

@ -86,12 +86,15 @@ export function Chart1(type = 'Cu') {
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.substr(11, 5))
xData.push(item.updateTime)
lastPrice.push(item.lastPrice)
diff.push(item.avgPrice)
diffV.push(parseFloat(item.diff).toFixed(2))
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 像素
@ -139,18 +142,26 @@ export function Chart1(type = 'Cu') {
<span>:</span>
<span style="${priceStyle}">${val.diffValue}%</span>
</div>
<div style="${style}">
${
cuType.type
? `<div style="${style}">
<span>:</span>
<span>${val.donePrice ? (val.donePrice / 100000000).toFixed(2) : 0}亿</span>
</div>
</div>`
: ''
}
<div style="${style}">
<span>:</span>
<span>${val.doneNumber}</span>
</div>
<div style="${style}">
${
cuType.type
? `<div style="${style}">
<span>:</span>
<span>${val.avgPrice}</span>
</div>
</div>`
: ''
}
</div>
`
},
@ -171,6 +182,10 @@ export function Chart1(type = 'Cu') {
],
label: {
backgroundColor: '#505765'
// formatter: function (params: any) {
// const val = parseFloat(params.value).toFixed(0)
// return params.axisDimension == 'x' ? `${tradingDay} ${params.value}:00` : val
// }
}
}
},
@ -180,7 +195,12 @@ export function Chart1(type = 'Cu') {
data: xData,
boundaryGap: false,
splitLine: { show: false },
axisLine: { onZero: false }
axisLine: { onZero: false },
axisLabel: {
formatter: function (value: any) {
return value.substr(11, 5)
}
}
}
],
yAxis: [
@ -218,9 +238,13 @@ export function Chart1(type = 'Cu') {
minInterval: 0.1,
axisLabel: {
// formatter: '{value}%'
// formatter: function (value, index) {
// return value.toFixed(1) + '%'
// }
formatter: function (value, index) {
return value.toFixed(1) + '%'
},
color: function (value, index) {
return value > 0 ? '#ec0000' : value == 0 ? '#333' : '#00da3c' //改变颜色 '%'
}
// color: 'skyblue'
}
}
],
@ -235,40 +259,112 @@ export function Chart1(type = 'Cu') {
end: 100
}
],
series: [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
// areaStyle: {},
data: lastPrice
series: []
}
const series = [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
smooth: true,
symbol: 'none',
yAxisIndex: 1,
// areaStyle: {},
data: diff,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
color: '#E08F2D'
}
// 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])
@ -306,11 +402,13 @@ export function Chart11(type = 'Al') {
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.substr(11, 5))
xData.push(item.updateTime)
lastPrice.push(item.lastPrice)
diff.push(item.avgPrice)
diffV.push(parseFloat(item.diff).toFixed(2))
diffV.push(parseFloat(item.diffValue).toFixed(2))
})
const option = {
// height: '270px', // 设置图表高度为 400 像素
@ -358,18 +456,26 @@ export function Chart11(type = 'Al') {
<span>:</span>
<span style="${priceStyle}">${val.diffValue}%</span>
</div>
<div style="${style}">
${
alType.type
? `<div style="${style}">
<span>:</span>
<span>${val.donePrice ? (val.donePrice / 100000000).toFixed(2) : 0}亿</span>
</div>
</div>`
: ''
}
<div style="${style}">
<span>:</span>
<span>${val.doneNumber}</span>
</div>
<div style="${style}">
${
alType.type
? `<div style="${style}">
<span>:</span>
<span>${val.avgPrice}</span>
</div>
</div>`
: ''
}
</div>
`
},
@ -390,6 +496,10 @@ export function Chart11(type = 'Al') {
],
label: {
backgroundColor: '#505765'
// formatter: function (params: any) {
// const val = parseFloat(params.value).toFixed(0)
// return params.axisDimension == 'x' ? `${tradingDay} ${params.value}:00` : val
// }
}
}
},
@ -399,7 +509,12 @@ export function Chart11(type = 'Al') {
data: xData,
boundaryGap: false,
splitLine: { show: false },
axisLine: { onZero: false }
axisLine: { onZero: false },
axisLabel: {
formatter: function (value: any) {
return value.substr(11, 5)
}
}
}
],
yAxis: [
@ -437,9 +552,12 @@ export function Chart11(type = 'Al') {
minInterval: 0.1,
axisLabel: {
// formatter: '{value}%'
// formatter: function (value, index) {
// return value.toFixed(1) + '%'
// }
formatter: function (value, index) {
return value.toFixed(1) + '%'
},
color: function (value, index) {
return value > 0 ? '#ec0000' : value == 0 ? '#333' : '#00da3c' //改变颜色 '%'
}
}
}
],
@ -454,40 +572,69 @@ export function Chart11(type = 'Al') {
end: 100
}
],
series: [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
// areaStyle: {},
data: lastPrice
series: []
}
const series = [
{
name: '',
type: 'line',
smooth: true,
symbol: 'none',
emphasis: {
focus: 'series'
},
{
name: '',
type: 'line',
emphasis: {
focus: 'series'
},
smooth: true,
symbol: 'none',
yAxisIndex: 1,
// areaStyle: {},
data: diff,
itemStyle: {
normal: {
// color: '#E08F2D',
lineStyle: {
color: '#E08F2D'
}
// 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])
@ -568,7 +715,7 @@ export function Chart3() {
() => unref(ss),
async (v) => {
console.log(state2.type)
// getDat()
getDat()
},
{ immediate: true, deep: true }
)
@ -643,7 +790,7 @@ export function Chart4() {
async (v) => {
console.log(state3.type)
// getDat()
getDat()
},
{ immediate: true, deep: true }
)
@ -817,7 +964,7 @@ export function Chart6() {
nameX = list
state5.dateList = list
state5.type = type
// getDat()
getDat()
},
{ immediate: true, deep: true }
)

View File

@ -192,7 +192,7 @@ const tabClick = (e) => {
}
const tabShow = (num) => {
// console.log(num)
console.log(num)
switch (num) {
case 0:
tab.value = tab.value === false ? true : false
@ -503,9 +503,9 @@ const cuTypeChange = (e) => {
</AppBlock>
<AppBlock class="flex-1 box">
<div class="box-title ">汇率</div>
<div class="bgStyle !h250px mt20px">
<div class="bgStyle !h250px mt20px z-100">
<div class="mr25px">
<span @click="tabShow(1)" class="title bg-#FF603A !text-16px pl13px pr20px ">{{ names1
<span @click="tabShow(1)" class="title bg-#FF603A !text-16px pl13px pr20px cursor-pointer !z-100">{{ names1
}}<el-icon>
<CaretBottom />
</el-icon></span>
@ -521,7 +521,7 @@ const cuTypeChange = (e) => {
<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
<span @click="tabShow(2)" class="title bg-#70BFCD !text-16px pl13px pr20px !z-100 cursor-pointer">{{ names2
}}<el-icon>
<CaretBottom />
</el-icon></span>

View File

@ -4,6 +4,10 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate'
// 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 { push } = useRouter()
@ -46,6 +50,25 @@ let flag = ref(false)
const switchImg = () => {
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>
<template>
@ -74,21 +97,38 @@ const switchImg = () => {
</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/jjllt.jpg"
class="w100% transition-all duration-500"
:class="flag ? '-translate-x-full' : ''"
/>
<img
src="../../../assets/images/jjllt-right.jpg"
class="w100% transition-all duration-500"
:class="flag ? '-translate-x-full' : ''"
/>
<div class="h-full overflow-hidden w-1500px flex items-center">
<div
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' : ''"
>
<img src="../../../assets/images/jjllt-right.jpg" class="!w-1500px !h-full" />
</div>
</div>
<!-- 56px -->
<div
@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>
</template>
@ -100,6 +140,10 @@ const switchImg = () => {
top: -92px;
}
.font {
font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}
.g-wrapper {
border-radius: 18px;
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>