Compare commits
5 Commits
37675c31ad
...
14fec77952
| Author | SHA1 | Date |
|---|---|---|
|
|
14fec77952 | |
|
|
9abadc86d8 | |
|
|
0ec6a2acc7 | |
|
|
2c92275290 | |
|
|
a10d0e32d1 |
33
11.txt
33
11.txt
|
|
@ -48,6 +48,39 @@ urfhsdkjdwerwnvsojj
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{
|
||||||
|
cateId:1,
|
||||||
|
uploadIds:[1,2,3],
|
||||||
|
reviewIds:[4,5,6]
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
id:1,
|
||||||
|
cateId:1,
|
||||||
|
cateName:'xxxx',
|
||||||
|
... 更新时间,修改时间等..
|
||||||
|
uploadIds:[
|
||||||
|
{ //上传者信息
|
||||||
|
id:1,
|
||||||
|
name:'xxxx',
|
||||||
|
... 用户信息
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:2,
|
||||||
|
name:'xxxx',
|
||||||
|
... 用户信息
|
||||||
|
},
|
||||||
|
...
|
||||||
|
],
|
||||||
|
reviewIds:[
|
||||||
|
{ //审核者信息
|
||||||
|
id:1,
|
||||||
|
name:'xxxx',
|
||||||
|
...审核者用户信息
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
审批流按钮权限对应显示
|
审批流按钮权限对应显示
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="src/assets/images/favicon.svg">
|
<link rel="icon" href="src/assets/images/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>大金中国调达本部网站</title>
|
<title>大金中国调达本部网站</title>
|
||||||
<style>
|
<style>
|
||||||
.n-modal-container {
|
.n-modal-container {
|
||||||
z-index: 999!important;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
"@vueuse/core": "^9.13.0",
|
"@vueuse/core": "^9.13.0",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"dayjs": "^1.11.10",
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"element-plus": "^2.3.7",
|
"element-plus": "^2.3.7",
|
||||||
|
|
|
||||||
|
|
@ -1304,12 +1304,18 @@ export async function fetchGetViewScope(params?: any) {
|
||||||
export async function fetchdbAuthAdd(data?: any) {
|
export async function fetchdbAuthAdd(data?: any) {
|
||||||
return http.post(`/dbAuth/add`, data)
|
return http.post(`/dbAuth/add`, data)
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* DB删除上传/审核者 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
|
||||||
|
*/
|
||||||
|
export async function fetchdbAuthDel(id?: any) {
|
||||||
|
return http.get(`/dbAuth/del?id=${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DB获取上传/审核者信息 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
|
* DB获取上传/审核者信息 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
|
||||||
*/
|
*/
|
||||||
export async function fetchdbAuthGetInfo(params?: any) {
|
export async function fetchdbAuthGetInfo(params?: any) {
|
||||||
return http.get(`/dbAuth/getInfo`, { params })
|
return http.get(`/dbAuth/getPerUserList`, { params })
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* DB撤回 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
|
* DB撤回 https://console-docs.apipost.cn/preview/9ac14c51f96ce4d8/75274687248efb1c?target_id=a11153dc-ab84-41ca-aa1c-45fda68c4156
|
||||||
|
|
@ -1374,3 +1380,7 @@ export async function fetchmoduleStatInternalPage(params?: any) {
|
||||||
export async function fetchPostList(params?: any) {
|
export async function fetchPostList(params?: any) {
|
||||||
return http.get(`/common/getPostList`, { params })
|
return http.get(`/common/getPostList`, { params })
|
||||||
}
|
}
|
||||||
|
// 内部足迹
|
||||||
|
export async function fetchInternalUserStat(params?: any) {
|
||||||
|
return http.get(`/moduleStat/internalUserStat`, { params })
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,102 +1,102 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NDropdown, NPopover } from "naive-ui";
|
import { NDropdown, NPopover } from 'naive-ui'
|
||||||
import { getAllNoticeList } from "@/api/daikin/base";
|
import { getAllNoticeList } from '@/api/daikin/base'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
|
|
||||||
|
|
||||||
// 全屏
|
// 全屏
|
||||||
const { toggle } = inject<any>("fullscreen");
|
const { toggle } = inject<any>('fullscreen')
|
||||||
const { push } = useRouter();
|
const { push } = useRouter()
|
||||||
const store = useUserStore();
|
const store = useUserStore()
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const noticeData = ref();
|
const noticeData = ref()
|
||||||
const flgs = ref(false);
|
const flgs = ref(false)
|
||||||
const userCode = ref(false)
|
const userCode = ref(false)
|
||||||
async function getNoticeList() {
|
async function getNoticeList() {
|
||||||
const { data } = await getAllNoticeList();
|
const { data } = await getAllNoticeList()
|
||||||
noticeData.value = data;
|
noticeData.value = data
|
||||||
|
console.log('🚀 ~ file: AppHeadUserInfo.vue:18 ~ data:', data)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getNoticeList();
|
getNoticeList()
|
||||||
|
|
||||||
// console.log( flgs.value,flg)
|
// console.log( flgs.value,flg)
|
||||||
});
|
})
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// console.log( flgs.value,store.user.type)
|
// console.log( flgs.value,store.user.type)
|
||||||
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'].includes(store.user.roleCode)
|
userCode.value = ['admin', 'tech_service'].includes(store.user.roleCode)
|
||||||
});
|
})
|
||||||
const options = [
|
const options = [
|
||||||
{ label: "个人中心", key: "ucenter" },
|
{ label: '个人中心', key: 'ucenter' },
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
label: "修改密码",
|
label: '修改密码',
|
||||||
key: "ChangePWD",
|
key: 'ChangePWD',
|
||||||
props: {
|
props: {
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
console.log(route.path);
|
console.log(route.path)
|
||||||
const pth = route.path === "/external" ? "modify" : "modifys";
|
const pth = route.path === '/external' ? 'modify' : 'modifys'
|
||||||
push({ name: pth });
|
push({ name: pth })
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "logout",
|
key: 'logout',
|
||||||
label: "退出登录",
|
label: '退出登录',
|
||||||
props: {
|
props: {
|
||||||
style: { width: "150px" },
|
style: { width: '150px' },
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
store.LogOut();
|
store.LogOut()
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
const noticeShow = ref(false);
|
const noticeShow = ref(false)
|
||||||
let showIs = false;
|
let showIs = false
|
||||||
//模块id,1-情报 2-市况汇率 3-数据平台 4-BCP管理 5-碳中和 6-品质 7-差别化LAB
|
//模块id,1-情报 2-市况汇率 3-数据平台 4-BCP管理 5-碳中和 6-品质 7-差别化LAB
|
||||||
const goModeuls = (obj) => {
|
const goModeuls = (obj) => {
|
||||||
const { moduleId } = obj;
|
const { moduleId } = 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) {
|
||||||
push("/Home/Process");
|
push('/Home/Process')
|
||||||
} else {
|
} else {
|
||||||
push("/Home/intelligence");
|
push('/Home/intelligence')
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 2:
|
case 2:
|
||||||
push({ name: "Market" });
|
push({ name: 'Market' })
|
||||||
break;
|
break
|
||||||
case 3:
|
case 3:
|
||||||
push({ name: "CD" });
|
push({ name: 'CD' })
|
||||||
break;
|
break
|
||||||
case 4:
|
case 4:
|
||||||
push({ name: "BCP" });
|
push({ name: 'BCP' })
|
||||||
break;
|
break
|
||||||
case 5:
|
case 5:
|
||||||
push({ name: "CSR" });
|
push({ name: 'CSR' })
|
||||||
break;
|
break
|
||||||
case 6:
|
case 6:
|
||||||
push({ name: "Quality" });
|
push({ name: 'Quality' })
|
||||||
break;
|
break
|
||||||
case 7:
|
case 7:
|
||||||
push({ name: "Diffspace" });
|
push({ name: 'Diffspace' })
|
||||||
break;
|
break
|
||||||
case 9:
|
case 9:
|
||||||
push({ name: "DataBaseReview" });
|
push({ name: 'DataBaseReview' })
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
push("/Home/intelligence");
|
push('/Home/intelligence')
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const noticeShows = () => {
|
const noticeShows = () => {
|
||||||
if (noticeData.value && noticeData.value.length > 0) {
|
if (noticeData.value && noticeData.value.length > 0) {
|
||||||
// console.log(noticeData.value)
|
// console.log(noticeData.value)
|
||||||
noticeShow.value = !noticeShow.value;
|
noticeShow.value = !noticeShow.value
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const toFootPrint = () => {
|
const toFootPrint = () => {
|
||||||
console.log(111)
|
console.log(111)
|
||||||
push('/Home/footprint')
|
push('/Home/footprint')
|
||||||
|
|
@ -107,7 +107,9 @@ 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" ><Platform /></el-icon>
|
<el-icon size="35" v-if="userCode" @click="toFootPrint"
|
||||||
|
><Platform
|
||||||
|
/></el-icon>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
|
||||||
<!-- 全屏小图标 -->
|
<!-- 全屏小图标 -->
|
||||||
|
|
@ -122,7 +124,6 @@ const toFootPrint = () => {
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
viewBox="0 0 20 20"
|
viewBox="0 0 20 20"
|
||||||
|
|
||||||
>
|
>
|
||||||
<g fill="none">
|
<g fill="none">
|
||||||
<path
|
<path
|
||||||
|
|
@ -215,7 +216,7 @@ const toFootPrint = () => {
|
||||||
class="ml40px mr16px w60px h60px"
|
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" />
|
||||||
</div>
|
</div>
|
||||||
</NDropdown>
|
</NDropdown>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const databaseld = defineStore('database', () => {
|
export const databaseld = defineStore('database', () => {
|
||||||
const database = ref({
|
const database = ref({
|
||||||
id:'',
|
id: '',
|
||||||
|
name: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
function setDataId(data: { id: string }){
|
function setDataId(data: { id: string }) {
|
||||||
database.value = data
|
database.value.id = data.id
|
||||||
}
|
}
|
||||||
|
|
||||||
return { database,setDataId }
|
return { database, setDataId }
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
@ -180,7 +180,7 @@ function findItemById(
|
||||||
|
|
||||||
<div v-if="ite.childList && idx == index" class="pl10px">
|
<div v-if="ite.childList && idx == index" class="pl10px">
|
||||||
<div
|
<div
|
||||||
class="my30px pl10px text-#000"
|
class="my20px py-10px pl10px text-#000"
|
||||||
v-for="(it, ind) in ite.childList"
|
v-for="(it, ind) in ite.childList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@click.stop="goChild(it)"
|
@click.stop="goChild(it)"
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,27 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<DataBaseHead />
|
<DataBaseHead />
|
||||||
<div class="w-full h-1px bg-#507FFD mt50px rd-b-20px"></div>
|
<div class="relative w-full h-1px bg-#507FFD mt50px rd-b-20px">
|
||||||
<div class="bg-#fff rd-15px px30px pt30px w-full h920px">
|
|
||||||
<el-tabs v-model="activeName" class="demo-tabs">
|
|
||||||
<div class="absolute z-200 right-0 flex items-center">
|
|
||||||
<el-button
|
<el-button
|
||||||
|
class="absolute z-200 right-30px top-[30px]"
|
||||||
v-if="isDbUpload || isDbReview"
|
v-if="isDbUpload || isDbReview"
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="handleClick"
|
@click="handleClick"
|
||||||
>
|
>
|
||||||
审批流程
|
审批流程
|
||||||
</el-button>
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="bg-#fff rd-15px px30px pt30px w-full h920px">
|
||||||
|
<el-tabs v-model="activeName" class="demo-tabs">
|
||||||
|
<div class="absolute z-200 right-0 flex items-center">
|
||||||
<div
|
<div
|
||||||
class="rounded-md ml-50px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
|
class="cursor-pointer rounded-md ml-50px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
|
||||||
@click="goBacks"
|
@click="goBacks"
|
||||||
>
|
>
|
||||||
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> 返回
|
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> 返回
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-tab-pane 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"
|
v-if="userCode"
|
||||||
|
|
@ -57,7 +59,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="editClickA('edit', scope.row)"
|
@click="editClickA('edit', scope.row)"
|
||||||
class="mb-20px"
|
class="my-10px"
|
||||||
>
|
>
|
||||||
编辑</el-button
|
编辑</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -69,7 +71,7 @@
|
||||||
scope.row.level === 3
|
scope.row.level === 3
|
||||||
"
|
"
|
||||||
@click="editClickA('add', scope.row)"
|
@click="editClickA('add', scope.row)"
|
||||||
class="mb-20px"
|
class="my-10px"
|
||||||
>
|
>
|
||||||
新增{{
|
新增{{
|
||||||
scope.row.level === 1
|
scope.row.level === 1
|
||||||
|
|
@ -82,7 +84,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="deleteClickA(scope.row)"
|
@click="deleteClickA(scope.row)"
|
||||||
class="mb-20px"
|
class="my-10px"
|
||||||
>
|
>
|
||||||
删除</el-button
|
删除</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -109,6 +111,7 @@
|
||||||
>
|
>
|
||||||
查看所有</el-button
|
查看所有</el-button
|
||||||
>
|
>
|
||||||
|
<template v-if="false">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="userCode"
|
v-if="userCode"
|
||||||
:type="setUpload ? 'success' : 'warning'"
|
:type="setUpload ? 'success' : 'warning'"
|
||||||
|
|
@ -127,6 +130,7 @@
|
||||||
>
|
>
|
||||||
{{ setReview ? '已设置审批人员' : '设置审批人员' }}</el-button
|
{{ setReview ? '已设置审批人员' : '设置审批人员' }}</el-button
|
||||||
>
|
>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="w100% h750px overflow-auto">
|
<div class="w100% h750px overflow-auto">
|
||||||
<el-table
|
<el-table
|
||||||
|
|
@ -136,6 +140,7 @@
|
||||||
row-key="id"
|
row-key="id"
|
||||||
border
|
border
|
||||||
default-expand-all
|
default-expand-all
|
||||||
|
height="710px"
|
||||||
:header-cell-style="{
|
:header-cell-style="{
|
||||||
background: '#2A7BF7',
|
background: '#2A7BF7',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
|
|
@ -201,7 +206,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</p>
|
</p>
|
||||||
<span v-else>''</span>
|
<span v-else></span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -214,19 +219,19 @@
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="editClickB('edit', scope.row)"
|
@click="editClickB('edit', scope.row)"
|
||||||
class="mb-20px w45px"
|
class="w45px my-10px"
|
||||||
>
|
>
|
||||||
编辑</el-button
|
编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="deleteClickB(scope.row)"
|
@click="deleteClickB(scope.row)"
|
||||||
class="mb-20px w45px"
|
class="w45px my-10px"
|
||||||
>
|
>
|
||||||
删除</el-button
|
删除</el-button
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style="float: right"
|
style="float: right; margin: 10px 0"
|
||||||
v-if="
|
v-if="
|
||||||
scope.$index !== 0 &&
|
scope.$index !== 0 &&
|
||||||
scope.$index !== infoData.length - 1
|
scope.$index !== infoData.length - 1
|
||||||
|
|
@ -251,6 +256,178 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="float-right absolute bottom-0px right-30px z-2000 bg-#fff"
|
||||||
|
>
|
||||||
|
<el-pagination
|
||||||
|
v-model:current-page="pageInfo.currentPage"
|
||||||
|
v-model:page-size="pageInfo.pageSize"
|
||||||
|
layout="prev, pager, next, jumper"
|
||||||
|
:total="pageInfo.total"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="权限管理" name="three" v-if="userCode">
|
||||||
|
<div class="h-52px">
|
||||||
|
<el-button
|
||||||
|
v-if="isDbReview || isDbUpload"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAuthClick('add')"
|
||||||
|
class="mb-20px"
|
||||||
|
>
|
||||||
|
新增审批关系</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="w100% h750px overflow-auto">
|
||||||
|
<el-table
|
||||||
|
class="tableClass"
|
||||||
|
:data="authData"
|
||||||
|
style="width: 100%; margin-bottom: 20px"
|
||||||
|
row-key="id"
|
||||||
|
border
|
||||||
|
default-expand-all
|
||||||
|
height="710px"
|
||||||
|
:header-cell-style="{
|
||||||
|
background: '#2A7BF7',
|
||||||
|
color: '#fff',
|
||||||
|
height: '60px',
|
||||||
|
lineHeight: '60px',
|
||||||
|
textAlign: 'center',
|
||||||
|
'font-size': '24px'
|
||||||
|
}"
|
||||||
|
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="cateName"
|
||||||
|
label="所属分类"
|
||||||
|
show-overflow-tooltip
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="上传人员"
|
||||||
|
prop="userIdList"
|
||||||
|
show-overflow-tooltip
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<p
|
||||||
|
v-if="scope.row.uploadList.length"
|
||||||
|
class="truncate text-ellipsis"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
scope.row.uploadList
|
||||||
|
.map((item: any) => item.nickName)
|
||||||
|
.join('、')
|
||||||
|
}}
|
||||||
|
<el-tooltip
|
||||||
|
v-if="false"
|
||||||
|
:content="handTooltip(scope.row.uploadList)"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<div class="!h-50px descStyle">
|
||||||
|
<div class="descStyle max-w-60vw !h-46px">
|
||||||
|
<p
|
||||||
|
v-for="(it, e) in scope.row.uploadList"
|
||||||
|
:key="e"
|
||||||
|
:class="
|
||||||
|
scope.row.uploadList.length < 2
|
||||||
|
? '!leading-46px'
|
||||||
|
: 'xx'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ it.nickName || undefined }}
|
||||||
|
<span
|
||||||
|
v-if="e == 1 && scope.row.uploadList.length > 2"
|
||||||
|
>...共{{ scope.row.uploadList.length }}人</span
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
|
</p>
|
||||||
|
<span v-else></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="审批人员"
|
||||||
|
prop="userIdList"
|
||||||
|
show-overflow-tooltip
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<p
|
||||||
|
v-if="scope.row.reviewList.length"
|
||||||
|
class="truncate text-ellipsis"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
scope.row.reviewList
|
||||||
|
.map((item: any) => item.nickName)
|
||||||
|
.join('、')
|
||||||
|
}}
|
||||||
|
<el-tooltip
|
||||||
|
v-if="false"
|
||||||
|
:content="handTooltip(scope.row.reviewList)"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<div class="!h-50px descStyle">
|
||||||
|
<div class="descStyle max-w-60vw !h-46px">
|
||||||
|
<p
|
||||||
|
v-for="(it, e) in scope.row.reviewList"
|
||||||
|
:key="e"
|
||||||
|
:class="
|
||||||
|
scope.row.reviewList.length < 2
|
||||||
|
? '!leading-46px'
|
||||||
|
: 'xx'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ it.nickName || undefined }}
|
||||||
|
<span
|
||||||
|
v-if="e == 1 && scope.row.reviewList.length > 2"
|
||||||
|
>...共{{ scope.row.reviewList.length }}人</span
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
|
</p>
|
||||||
|
<span v-else></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="address"
|
||||||
|
label="操作"
|
||||||
|
show-overflow-tooltip
|
||||||
|
width="180px"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-if="userCode">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="handleAuthClick('edit', scope.row)"
|
||||||
|
class="w45px my-10px"
|
||||||
|
>
|
||||||
|
编辑</el-button
|
||||||
|
>
|
||||||
|
<el-popconfirm
|
||||||
|
title="确认删除此条数据?"
|
||||||
|
@confirm="handleAuthClick('del', scope.row)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
@click=""
|
||||||
|
class="w45px my-10px"
|
||||||
|
>
|
||||||
|
删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</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"
|
||||||
>
|
>
|
||||||
|
|
@ -338,6 +515,47 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</NModal>
|
</NModal>
|
||||||
|
<NModal v-model:show="showAuthModal">
|
||||||
|
<div class="bg-#FFF p30px">
|
||||||
|
<el-form :model="authModel" label-width="120px" :inline="true">
|
||||||
|
<el-form-item v-if="false" label="所属类别">
|
||||||
|
<el-cascader
|
||||||
|
:modelValue="authModel.cateIds"
|
||||||
|
:options="tableData"
|
||||||
|
@change="handleChange"
|
||||||
|
:props="{ children: 'childList', label: 'name', value: 'id' }"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<br />
|
||||||
|
<el-form-item label="上传人员" class="w-300px">
|
||||||
|
<el-button
|
||||||
|
class="button"
|
||||||
|
@click="getUser({ userList: uploadIds, key: 'uploadIds' })"
|
||||||
|
:type="authModel.uploadIds?.length ? 'success' : ''"
|
||||||
|
:icon="authModel.uploadIds?.length ? 'Check' : ''"
|
||||||
|
>{{ authModel.uploadIds?.length ? '已设置' : '设置' }}</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<br />
|
||||||
|
<el-form-item label="审核人员" class="w-300px">
|
||||||
|
<el-button
|
||||||
|
class="button"
|
||||||
|
@click="getUser({ userList: reviewIds, key: 'reviewIds' })"
|
||||||
|
:type="authModel.reviewIds?.length ? 'success' : ''"
|
||||||
|
:icon="authModel.reviewIds?.length ? 'Check' : ''"
|
||||||
|
>{{ authModel.reviewIds?.length ? '已设置' : '设置' }}</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<div class="text-center">
|
||||||
|
<el-button type="primary" @click="handleSetAuth" class="mb-20px">
|
||||||
|
确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</NModal>
|
||||||
<n-modal v-model:show="showModal" :z-index="99999">
|
<n-modal v-model:show="showModal" :z-index="99999">
|
||||||
<UserList
|
<UserList
|
||||||
:userDataList="setUserList"
|
:userDataList="setUserList"
|
||||||
|
|
@ -360,7 +578,7 @@ import {
|
||||||
cateFileUpdate,
|
cateFileUpdate,
|
||||||
cateFileDel,
|
cateFileDel,
|
||||||
cateFileList,
|
cateFileList,
|
||||||
download,
|
fetchdbAuthDel,
|
||||||
dragFile,
|
dragFile,
|
||||||
fetchdbAuthAdd,
|
fetchdbAuthAdd,
|
||||||
fetchdbAuthGetInfo,
|
fetchdbAuthGetInfo,
|
||||||
|
|
@ -374,14 +592,21 @@ 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 = ['admin', 'database_dandang'].includes(store.user.roleCode)
|
const userCode = computed(() =>
|
||||||
|
['admin', 'database_dandang', 'tech_service'].includes(store.user.roleCode)
|
||||||
|
)
|
||||||
|
// 'tech_service'
|
||||||
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 tableData = ref([])
|
const tableData = ref([])
|
||||||
const tableDataAuth = ref([])
|
const tableDataAuth = ref([])
|
||||||
const infoData = ref()
|
const infoData = ref()
|
||||||
|
const authData = ref()
|
||||||
|
const showAuthModal = ref(false)
|
||||||
|
const authModel = ref<any>({})
|
||||||
|
|
||||||
|
const cateIds = ref()
|
||||||
const shomkA = ref(false)
|
const shomkA = ref(false)
|
||||||
const editA = ref()
|
const editA = ref()
|
||||||
const shomkB = ref(false)
|
const shomkB = ref(false)
|
||||||
|
|
@ -392,17 +617,60 @@ const pageInfo = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 10
|
total: 10
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const uploadIds = ref([])
|
||||||
|
const reviewIds = ref([])
|
||||||
|
const handleAuthClick = (type = '', data: any = {}) => {
|
||||||
|
if (type === 'add' || type === 'edit') {
|
||||||
|
delete authModel.value.id
|
||||||
|
const { cateId, uploadList = [], reviewList = [], id } = data
|
||||||
|
authModel.value.cateId = cateId
|
||||||
|
uploadIds.value = uploadList
|
||||||
|
reviewIds.value = reviewList
|
||||||
|
authModel.value.uploadIds = uploadList.map((item: any) => item.userId)
|
||||||
|
authModel.value.reviewIds = reviewList.map((item: any) => item.userId)
|
||||||
|
if (type === 'edit') authModel.value.id = id
|
||||||
|
showAuthModal.value = true
|
||||||
|
}
|
||||||
|
if (type === 'del') {
|
||||||
|
const { id } = data
|
||||||
|
if (!id) return
|
||||||
|
fetchdbAuthDel(id).then((res: any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
getAuth()
|
||||||
|
message.success('操作成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleSetAuth = async () => {
|
||||||
|
const req = { ...unref(authModel), cateId: cateIds.value }
|
||||||
|
if (!req.uploadIds?.length) {
|
||||||
|
message.warning('最少选择1名上传人员!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!req.reviewIds?.length) {
|
||||||
|
message.warning('最少选择1名审核人员!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code }: any = await fetchdbAuthAdd(req)
|
||||||
|
if (code === 200) {
|
||||||
|
getAuth()
|
||||||
|
showAuthModal.value = false
|
||||||
|
message.success('操作成功')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function getTree() {
|
async function getTree() {
|
||||||
const { data } = await treeDbList({})
|
const { data } = await treeDbList({})
|
||||||
tableData.value = data
|
tableData.value = data
|
||||||
console.log('🚀 ~ file: modify.vue:399 ~ data:', data)
|
|
||||||
const { data: auth = [] } = await fetchReviewAuthCateList()
|
const { data: auth = [] } = await fetchReviewAuthCateList()
|
||||||
tableDataAuth.value = auth
|
tableDataAuth.value = auth
|
||||||
}
|
}
|
||||||
let cateIds = ref()
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
activeName.value = userCode.value ? unref(activeName) : 'second'
|
||||||
cateIds.value = database.database.id
|
cateIds.value = database.database.id
|
||||||
// console.log(database.database.id)
|
console.log(database.database)
|
||||||
if (database.database.id) {
|
if (database.database.id) {
|
||||||
getInfo(database.database.id)
|
getInfo(database.database.id)
|
||||||
getAuth()
|
getAuth()
|
||||||
|
|
@ -479,7 +747,6 @@ async function addClickA(row: any) {
|
||||||
getTree()
|
getTree()
|
||||||
}
|
}
|
||||||
const editClickB = (edit: any, obj: any = {}) => {
|
const editClickB = (edit: any, obj: any = {}) => {
|
||||||
console.log(obj)
|
|
||||||
if (edit === 'add' && obj && obj.id) {
|
if (edit === 'add' && obj && obj.id) {
|
||||||
editB.value = {
|
editB.value = {
|
||||||
title: '',
|
title: '',
|
||||||
|
|
@ -616,7 +883,7 @@ const handOnExceed: UploadProps['onExceed'] = (
|
||||||
}
|
}
|
||||||
|
|
||||||
const header = { token: store.user.token }
|
const header = { token: store.user.token }
|
||||||
const goBacks = (e) => {
|
const goBacks = () => {
|
||||||
// console.log(444)
|
// console.log(444)
|
||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
@ -624,17 +891,27 @@ const showModal = ref(false)
|
||||||
const flg = ref()
|
const flg = ref()
|
||||||
const setUserList = ref()
|
const setUserList = ref()
|
||||||
const dbAuthType = ref()
|
const dbAuthType = ref()
|
||||||
async function getUser(row: { id?: any; userList?: any; type?: number }) {
|
const selSetAuthKey = ref('')
|
||||||
|
async function getUser(row: {
|
||||||
|
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) {
|
||||||
|
setUserList.value = row.userList || []
|
||||||
|
selSetAuthKey.value = row.key || ''
|
||||||
|
}
|
||||||
if (row.id && row.userList) {
|
if (row.id && row.userList) {
|
||||||
setUserList.value = row.userList
|
setUserList.value = row.userList
|
||||||
}
|
}
|
||||||
if (typeof row.type === 'number') {
|
if (typeof row.type === 'number') {
|
||||||
dbAuthType.value = row.type
|
dbAuthType.value = row.type
|
||||||
const { data: userArr } = await fetchdbAuthGetInfo({
|
const { data: userArr } = await fetchdbAuthGetInfo({
|
||||||
cateId: cateIds.value,
|
cateId: cateIds.value
|
||||||
type: row.type
|
// type: row.type
|
||||||
})
|
})
|
||||||
setUserList.value = userArr
|
setUserList.value = userArr
|
||||||
}
|
}
|
||||||
|
|
@ -649,6 +926,10 @@ const handleChild = async (data: any) => {
|
||||||
multipleSelection.value.forEach((i: { userId: any }) => {
|
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||||
userIdList.push(i.userId)
|
userIdList.push(i.userId)
|
||||||
})
|
})
|
||||||
|
if (authModel.value && selSetAuthKey.value) {
|
||||||
|
authModel.value[selSetAuthKey.value] = userIdList
|
||||||
|
return
|
||||||
|
}
|
||||||
if (dbAuthType.value) {
|
if (dbAuthType.value) {
|
||||||
const { code }: any = await fetchdbAuthAdd({
|
const { code }: any = await fetchdbAuthAdd({
|
||||||
cateId: cateIds.value,
|
cateId: cateIds.value,
|
||||||
|
|
@ -745,20 +1026,12 @@ const setReview = ref(false)
|
||||||
const hasReview = ref(false)
|
const hasReview = ref(false)
|
||||||
async function getAuth() {
|
async function getAuth() {
|
||||||
if (!cateIds.value) return
|
if (!cateIds.value) return
|
||||||
const { data: uploadUser = [] } = await fetchdbAuthGetInfo({
|
const { rows: data = [] }: any = await fetchdbAuthGetInfo({
|
||||||
cateId: cateIds.value,
|
cateId: cateIds.value
|
||||||
type: 1
|
// type: 1
|
||||||
})
|
})
|
||||||
setUpload.value = uploadUser.length > 0
|
// 所有的上传者 和 审核者
|
||||||
hasUpload.value =
|
authData.value = data || []
|
||||||
uploadUser.findIndex((x: any) => x.userId === store.user?.id) > -1
|
|
||||||
const { data: reviewUser = [] } = await fetchdbAuthGetInfo({
|
|
||||||
cateId: cateIds.value,
|
|
||||||
type: 2
|
|
||||||
})
|
|
||||||
setReview.value = reviewUser.length > 0
|
|
||||||
hasReview.value =
|
|
||||||
reviewUser.findIndex((x: any) => x.userId === store.user?.id) > -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@ import {
|
||||||
externalTimeStat,
|
externalTimeStat,
|
||||||
fetchmoduleStatExternalPage,
|
fetchmoduleStatExternalPage,
|
||||||
fetchPostList,
|
fetchPostList,
|
||||||
fetchmoduleStatInternalPage
|
fetchmoduleStatInternalPage,
|
||||||
|
fetchInternalUserStat,
|
||||||
|
deptTree as fetchDeptTree
|
||||||
} from '@/api/daikin/base'
|
} from '@/api/daikin/base'
|
||||||
import { formatDate } from '@/utils/format'
|
import { formatDate } from '@/utils/format'
|
||||||
import { Chart1 } from './indexData'
|
import { Chart1 } from './indexData'
|
||||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import { NModal } from 'naive-ui'
|
import { NModal } from 'naive-ui'
|
||||||
const currentDate = new Date()
|
const currentDate = new Date()
|
||||||
|
|
@ -36,6 +37,26 @@ const pageInfo = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 10
|
total: 10
|
||||||
})
|
})
|
||||||
|
const colorList: any = [
|
||||||
|
'#2592F3',
|
||||||
|
'#EF8C43',
|
||||||
|
'#5FCBC5',
|
||||||
|
'#E5B625',
|
||||||
|
'#E74848',
|
||||||
|
'#8E97F8',
|
||||||
|
'#73ECA5',
|
||||||
|
'#E7CD3B',
|
||||||
|
'#E04E89',
|
||||||
|
'#4EA4E0',
|
||||||
|
'#C34EE0',
|
||||||
|
'#8BCF54',
|
||||||
|
'#56B1FD',
|
||||||
|
'#24BFBA',
|
||||||
|
'#44CF8C',
|
||||||
|
'#6266F8',
|
||||||
|
'#FA6B39',
|
||||||
|
'#F05F96'
|
||||||
|
]
|
||||||
const moduleCode = ref()
|
const moduleCode = ref()
|
||||||
const imoduleCode = ref()
|
const imoduleCode = ref()
|
||||||
const visitDay = ref()
|
const visitDay = ref()
|
||||||
|
|
@ -45,6 +66,68 @@ const outDetail = ref([])
|
||||||
const postId = ref<any>([])
|
const postId = ref<any>([])
|
||||||
const nickName = ref()
|
const nickName = ref()
|
||||||
const postList = ref<any>([])
|
const postList = ref<any>([])
|
||||||
|
const barOption = {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
grid: {
|
||||||
|
top: 0,
|
||||||
|
left: 10,
|
||||||
|
right: 10,
|
||||||
|
bottom: 10,
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
data: [],
|
||||||
|
type: 'category',
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // 隐藏原始的 x 轴标签
|
||||||
|
interval: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'right',
|
||||||
|
// align: 'center',
|
||||||
|
color: '#333', // 标签文本颜色
|
||||||
|
fontSize: 12, // 标签文本字号
|
||||||
|
formatter: function (value: any) {
|
||||||
|
// console.log(value);
|
||||||
|
return value.name + ' ' + value.value
|
||||||
|
},
|
||||||
|
rotate: 0
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
|
},
|
||||||
|
formatter: function ([params]: any) {
|
||||||
|
const title = `<p>${params.name}</p>`
|
||||||
|
const colorDot =
|
||||||
|
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
||||||
|
params.color +
|
||||||
|
'"></span>'
|
||||||
|
return title + colorDot + params.value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: [],
|
||||||
|
type: 'bar',
|
||||||
|
sort: 'ascending',
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params: any) {
|
||||||
|
// console.log("🚀 ~ file: index.vue:365 ~ params.dataIndex:", params.dataIndex,params.data)
|
||||||
|
return colorList[9 - params.dataIndex]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
const itemDataList = ref<any>([])
|
||||||
const getPostList = async () => {
|
const getPostList = async () => {
|
||||||
const res: any = await fetchPostList()
|
const res: any = await fetchPostList()
|
||||||
postList.value = res.data || []
|
postList.value = res.data || []
|
||||||
|
|
@ -102,17 +185,102 @@ const state = reactive<any>({
|
||||||
endTime: formatDate(value1.value[1]).substring(0, 10)
|
endTime: formatDate(value1.value[1]).substring(0, 10)
|
||||||
// timeType:1
|
// timeType:1
|
||||||
})
|
})
|
||||||
const dataList = ref()
|
const colorListObj = ref<any>({})
|
||||||
|
const dataList = ref([])
|
||||||
const getDat = async () => {
|
const getDat = async () => {
|
||||||
const { data } = await timeStat(state)
|
const { data } = await timeStat(state)
|
||||||
dataList.value = data
|
dataList.value = data
|
||||||
let xAxisData: any[] = []
|
let xAxisData: any[] = []
|
||||||
let siomesData: any[] = []
|
let siomesData: any[] = []
|
||||||
data.forEach((item: { moduleName: any; visitCount: any }) => {
|
data.forEach(
|
||||||
|
(
|
||||||
|
item: { moduleName: any; visitCount: any; moduleCode: any },
|
||||||
|
i: number
|
||||||
|
) => {
|
||||||
xAxisData.push(item.moduleName)
|
xAxisData.push(item.moduleName)
|
||||||
siomesData.push(item.visitCount)
|
siomesData.push(item.visitCount)
|
||||||
|
colorListObj.value[item.moduleCode] = colorList[i]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
chartOption1.value = Chart1(xAxisData)
|
||||||
|
chartOption1.value.series[0] = {
|
||||||
|
data: siomesData,
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params: any) {
|
||||||
|
return colorList[params.dataIndex] || '#8F97F8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
type: 'bar'
|
||||||
|
}
|
||||||
|
getInternalUserStat(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const deptId = ref('')
|
||||||
|
let isLeaderFlag = 0
|
||||||
|
async function getInternalUserStat(
|
||||||
|
isLeader: number = 0,
|
||||||
|
flag: boolean = false
|
||||||
|
) {
|
||||||
|
if (!flag) {
|
||||||
|
pageInfo.currentPage = 1
|
||||||
|
pageInfo.pageSize = 10
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = pageInfo
|
||||||
|
const { rows = [], total }: any = await fetchInternalUserStat({
|
||||||
|
...state,
|
||||||
|
pageNum: currentPage,
|
||||||
|
pageSize: pageSize,
|
||||||
|
isLeader,
|
||||||
|
deptId: deptId.value || ''
|
||||||
|
})
|
||||||
|
isLeaderFlag = isLeader
|
||||||
|
// console.log('🚀 ~ file: index.vue:211 ~ rows:', rows)
|
||||||
|
pageInfo.total = total
|
||||||
|
// 10-100 之间的随机数生产
|
||||||
|
const roundMath = (min: number, max: number) => {
|
||||||
|
return Math.round(Math.random() * (max - min) + min)
|
||||||
|
}
|
||||||
|
// barOption.yAxis.data = data.map((item: any) => item.moduleName)
|
||||||
|
itemDataList.value = rows.map((item: any, index: number) => {
|
||||||
|
let itemData: any = {
|
||||||
|
nickName: item.nickName,
|
||||||
|
userId: item.userId,
|
||||||
|
sex: item.sex,
|
||||||
|
...barOption,
|
||||||
|
yAxis: {
|
||||||
|
data: item.moduleStatList.map((item: any) => item.moduleName).reverse(),
|
||||||
|
type: 'category',
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // 隐藏原始的 x 轴标签
|
||||||
|
interval: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
...{
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: item.moduleStatList
|
||||||
|
.map((item: any) => item.visitCount)
|
||||||
|
.reverse(),
|
||||||
|
// data: new Array(item.moduleStatList.length)
|
||||||
|
// .fill(0)
|
||||||
|
// .map(() => roundMath(10, 100)),
|
||||||
|
type: 'bar',
|
||||||
|
sort: 'descending', //ascending
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params: any) {
|
||||||
|
// console.log('🚀 ~ file: index.vue:255 ~ params:', params)
|
||||||
|
return colorList[8 - params.dataIndex]
|
||||||
|
// return colorListObj.value[item.moduleCode] || '#8F97F8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemData.index = index + 1
|
||||||
|
itemData.sortNum = (currentPage - 1) * pageSize + index + 1
|
||||||
|
return itemData
|
||||||
})
|
})
|
||||||
chartOption1.value = Chart1(xAxisData, siomesData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const externalList = ref<any>([])
|
const externalList = ref<any>([])
|
||||||
|
|
@ -123,17 +291,26 @@ const getExternalTimeStat = async () => {
|
||||||
let xAxisData: any[] = []
|
let xAxisData: any[] = []
|
||||||
let siomesData: any[] = []
|
let siomesData: any[] = []
|
||||||
data.forEach(
|
data.forEach(
|
||||||
(item: { moduleName: any; visitCount: any; moduleCode: any }) => {
|
(
|
||||||
|
item: { moduleName: any; visitCount: any; moduleCode: any },
|
||||||
|
i: number
|
||||||
|
) => {
|
||||||
externalObj.value[item.moduleCode] = item.moduleName
|
externalObj.value[item.moduleCode] = item.moduleName
|
||||||
|
externalObj.value[item.moduleCode + 'color'] = colorList[9 + i]
|
||||||
xAxisData.push(item.moduleName)
|
xAxisData.push(item.moduleName)
|
||||||
siomesData.push(item.visitCount)
|
siomesData.push(item.visitCount)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
chartOption2.value = Chart1(xAxisData, siomesData)
|
chartOption2.value = Chart1(xAxisData)
|
||||||
console.log(
|
chartOption2.value.series[0] = {
|
||||||
'🚀 ~ file: index.vue:131 ~ Chart1(xAxisData, siomesData):',
|
data: siomesData,
|
||||||
Chart1(xAxisData, siomesData)
|
itemStyle: {
|
||||||
)
|
color: function (params: any) {
|
||||||
|
return colorList[9 + params.dataIndex] || '#8F97F8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
type: 'bar'
|
||||||
|
}
|
||||||
// chartOption2.value.height=3000
|
// chartOption2.value.height=3000
|
||||||
// chartOption2.value.width=1000
|
// chartOption2.value.width=1000
|
||||||
}
|
}
|
||||||
|
|
@ -259,64 +436,9 @@ const echartsItemColor = [
|
||||||
'#6f5553',
|
'#6f5553',
|
||||||
'#c14089'
|
'#c14089'
|
||||||
]
|
]
|
||||||
const barOption = {
|
|
||||||
width: '100%',
|
// console.log(Object.assign(barOption.series[0], { data: [120, 200, 150, 80, 70, 110, 130, 123, 50] }));
|
||||||
height: '100%',
|
|
||||||
grid: {
|
|
||||||
top: 0,
|
|
||||||
left: 10,
|
|
||||||
right: 5,
|
|
||||||
bottom: 10,
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun','hour','month','year'],
|
|
||||||
axisLabel: {
|
|
||||||
show: false, // 隐藏原始的 x 轴标签
|
|
||||||
interval: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'inside',
|
|
||||||
align: 'center',
|
|
||||||
color: '#333', // 标签文本颜色
|
|
||||||
fontSize: 14, // 标签文本字号
|
|
||||||
formatter: function (value: any) {
|
|
||||||
// console.log(value);
|
|
||||||
return value.name + ' ' + value.value
|
|
||||||
},
|
|
||||||
rotate: 0
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow'
|
|
||||||
},
|
|
||||||
formatter: function ([params]: any) {
|
|
||||||
const title = `<p>${params.name}</p>`
|
|
||||||
const colorDot =
|
|
||||||
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
|
||||||
params.color +
|
|
||||||
'"></span>'
|
|
||||||
return title + colorDot + params.value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: [120, 200, 150, 80, 70, 110, 130,123,50,80],
|
|
||||||
type: 'bar',
|
|
||||||
itemStyle: {
|
|
||||||
color: function (params: any) {
|
|
||||||
return echartsItemColor[params.dataIndex]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
const showModal = ref(false)
|
const showModal = ref(false)
|
||||||
const setUserList = ref<any>([])
|
const setUserList = ref<any>([])
|
||||||
|
|
||||||
|
|
@ -327,14 +449,35 @@ const handleChild = async (data: any) => {
|
||||||
multipleSelection.value.forEach((i: { userId: any }) => {
|
multipleSelection.value.forEach((i: { userId: any }) => {
|
||||||
userIdList.push(i.userId)
|
userIdList.push(i.userId)
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ file: index.vue:328 ~ userIdList:", userIdList)
|
|
||||||
}
|
}
|
||||||
const CloseThiss = (data?: boolean) => {
|
const CloseThiss = (data?: boolean) => {
|
||||||
showModal.value = data || false
|
showModal.value = data || false
|
||||||
// setUserList.value = []
|
// setUserList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDev = false
|
const sortArr = [
|
||||||
|
'1ST',
|
||||||
|
'2ND',
|
||||||
|
'3RD',
|
||||||
|
'4TH',
|
||||||
|
'5TH',
|
||||||
|
'6TH',
|
||||||
|
'7TH',
|
||||||
|
'8TH',
|
||||||
|
'9TH',
|
||||||
|
'10TH'
|
||||||
|
]
|
||||||
|
|
||||||
|
const treeData = ref([])
|
||||||
|
const getdeptTree = async () => {
|
||||||
|
const { data = [] }: any = await fetchDeptTree({})
|
||||||
|
treeData.value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleChildChange = (data: any) => {
|
||||||
|
console.log('🚀 ~ file: index.vue:470 ~ data:', data)
|
||||||
|
}
|
||||||
|
getdeptTree()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -449,9 +592,10 @@ const isDev = false
|
||||||
<div class="overflow-auto h-720px">
|
<div class="overflow-auto h-720px">
|
||||||
<div class="mt20px w-full">
|
<div class="mt20px w-full">
|
||||||
<span
|
<span
|
||||||
class="cardfoot text-#000 p30px mx10px my10px text-center text-18px font-bold"
|
v-for="(i, e) in dataList"
|
||||||
|
class="cardfoot text-#fff bg-box p30px mx10px my10px text-center text-20px font-bold"
|
||||||
|
:style="{ 'background-color': colorList[e % colorList.length] }"
|
||||||
v-if="dataList"
|
v-if="dataList"
|
||||||
v-for="i in dataList"
|
|
||||||
>
|
>
|
||||||
<span>{{ i.moduleName }}</span
|
<span>{{ i.moduleName }}</span
|
||||||
><br />
|
><br />
|
||||||
|
|
@ -477,52 +621,74 @@ const isDev = false
|
||||||
<VChart key="yyy" ref="chartRef1" :option="chartOption1" />
|
<VChart key="yyy" ref="chartRef1" :option="chartOption1" />
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-30px">
|
<div class="mt-30px">
|
||||||
<div class="flex items-center" v-if="isDev">
|
<div class="flex items-center">
|
||||||
<span class="text-#000 mr-10px">模块: </span>
|
<span class="text-#000 mr-10px">部门: </span>
|
||||||
<el-select
|
<!-- <el-select v-model="moduleCode" placeholder="选择部门" clearable>
|
||||||
v-model="moduleCode"
|
|
||||||
placeholder="选择模块"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in externalList"
|
v-for="item in externalList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.moduleName"
|
:label="item.moduleName"
|
||||||
:value="item.moduleCode"
|
:value="item.moduleCode"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
|
<el-cascader
|
||||||
|
class="!w-380px"
|
||||||
|
v-model="deptId"
|
||||||
|
:options="treeData"
|
||||||
|
:props="{
|
||||||
|
expandTrigger: 'hover',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false,
|
||||||
|
value: 'id'
|
||||||
|
}"
|
||||||
|
@change="handleChildChange"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:icon="Search"
|
:icon="Search"
|
||||||
size="small"
|
size="small"
|
||||||
class="ml20px"
|
class="ml20px"
|
||||||
@click="handleClick({ paneName: activeName })"
|
@click="getInternalUserStat(0)"
|
||||||
>搜索</el-button
|
>搜索</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="warning"
|
||||||
:icon="Search"
|
:icon="Search"
|
||||||
size="small"
|
size="small"
|
||||||
class="ml20px"
|
class="!ml30px"
|
||||||
@click="showModal = true"
|
@click="getInternalUserStat(1)"
|
||||||
>部长以上人员足迹</el-button
|
>部长以上人员足迹</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="pb-14px" v-if="isDev">
|
<div class="pb-14px">
|
||||||
<div class=" flex flex-wrap mb-30px" >
|
<div class="flex flex-wrap mb-30px">
|
||||||
<div
|
<div
|
||||||
class=" m-4 flex items-center justify-between w-45% h-full"
|
class="m-4 flex items-center justify-between w-45% h-full"
|
||||||
v-for="i in 10"
|
v-for="(item, i) in itemDataList"
|
||||||
:key="i"
|
:key="i"
|
||||||
>
|
>
|
||||||
<div class="flex items-center text-#000 text-22px">
|
<div class="flex items-center text-#000 text-18px">
|
||||||
<p class="text-bold text-40px">{{ i }}TH</p>
|
<p class="text-bold text-40px mr-15px w-80px">
|
||||||
|
{{ sortArr[item.sortNum - 1] || item.sortNum + 'TH' }}
|
||||||
|
</p>
|
||||||
<div class="mx-10px flex-col items-center">
|
<div class="mx-10px flex-col items-center">
|
||||||
<img src="@/views/extermal/images/zanwly2.png" alt="" />
|
<img
|
||||||
<p class="text-center mt-10">测试 {{ i }}</p>
|
v-if="item.sex == 1"
|
||||||
|
class="rounded-md h-150px object-contain"
|
||||||
|
src="@/views/home/images/nv.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
class="rounded-md h-150px object-contain"
|
||||||
|
src="@/views/home/images/nan.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<p class="text-center mt-20px">{{ item.nickName }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<VChart class="h-300px w-65% pb-10px ml-auto" key="yyy1" :option="barOption" />
|
<VChart class="h-300px w-65% ml-auto" :option="item" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="absolute bottom-2px right-30px z-20 bg-#fff">
|
<div class="absolute bottom-2px right-30px z-20 bg-#fff">
|
||||||
|
|
@ -531,8 +697,8 @@ const isDev = false
|
||||||
v-model:page-size="pageInfo.pageSize"
|
v-model:page-size="pageInfo.pageSize"
|
||||||
layout="prev, pager, next, jumper"
|
layout="prev, pager, next, jumper"
|
||||||
:total="pageInfo.total"
|
:total="pageInfo.total"
|
||||||
@size-change="getInsideListPage"
|
@size-change="getInternalUserStat(isLeaderFlag, true)"
|
||||||
@current-change="getInsideListPage"
|
@current-change="getInternalUserStat(isLeaderFlag, true)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -557,7 +723,11 @@ const isDev = false
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
'font-size': '24px'
|
'font-size': '24px'
|
||||||
}"
|
}"
|
||||||
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
|
:cell-style="{
|
||||||
|
'text-align': 'center',
|
||||||
|
'overflow-y': 'auto',
|
||||||
|
height: '60px'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="moduleName" label="模块名称" />
|
<el-table-column prop="moduleName" label="模块名称" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -613,7 +783,11 @@ const isDev = false
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
'font-size': '24px'
|
'font-size': '24px'
|
||||||
}"
|
}"
|
||||||
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
|
:cell-style="{
|
||||||
|
'text-align': 'center',
|
||||||
|
'overflow-y': 'auto',
|
||||||
|
height: '60px'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="title"
|
prop="title"
|
||||||
|
|
@ -659,9 +833,10 @@ const isDev = false
|
||||||
<div>
|
<div>
|
||||||
<div class="mt20px w-full">
|
<div class="mt20px w-full">
|
||||||
<span
|
<span
|
||||||
class="cardfoot text-#000 p30px mx10px my10px text-center text-18px font-bold"
|
class="cardfoot text-#fff p30px mx10px my10px text-center text-18px font-bold"
|
||||||
|
:style="{ 'background-color': colorList[9 + e] }"
|
||||||
v-if="externalList"
|
v-if="externalList"
|
||||||
v-for="i in externalList"
|
v-for="(i, e) in externalList"
|
||||||
>
|
>
|
||||||
<span>{{ i.moduleName }}</span
|
<span>{{ i.moduleName }}</span
|
||||||
><br />
|
><br />
|
||||||
|
|
@ -687,12 +862,21 @@ const isDev = false
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
// .bg-box{
|
||||||
|
// background-image: url('@/views/home/images/bei.png');
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// background-size: 100% 100%;
|
||||||
|
// background-position: center right;
|
||||||
|
// }
|
||||||
.cardfoot {
|
.cardfoot {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
width: 220px;
|
width: 220px;
|
||||||
background-image: url('@/assets/images/bg-card.svg');
|
// background-image: url('@/assets/images/bg-card.svg');
|
||||||
background-size: cover;
|
background-image: url('@/views/home/images/bei.png');
|
||||||
|
background-size: 60% 100%;
|
||||||
|
background-position: center right;
|
||||||
|
background-repeat: no-repeat;
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
box-shadow: 0px 6px 10px -2px rgba(43, 42, 42, 0.25);
|
box-shadow: 0px 6px 10px -2px rgba(43, 42, 42, 0.25);
|
||||||
}
|
}
|
||||||
|
|
@ -700,7 +884,9 @@ const isDev = false
|
||||||
.cardfoot:hover {
|
.cardfoot:hover {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0px 9px 20px 7px rgba(92, 78, 218, 0.25);
|
box-shadow: 0px 9px 20px 7px rgba(92, 78, 218, 0.25);
|
||||||
color: #2042b4;
|
// color: #2042b4;
|
||||||
|
color: currentColor;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
|
|
|
||||||
|
|
@ -86,17 +86,23 @@ const states = reactive<any>({
|
||||||
// return { chartRef, option: optionRef, states }
|
// return { chartRef, option: optionRef, states }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export function Chart1(xAxisData:any =[],siomesData:any=[],options={}) {
|
export function Chart1(xAxisData: any = [], color = []) {
|
||||||
const option = {
|
const option = {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
// height: '450px', // 设置图表高度为 400 像素
|
// height: '450px', // 设置图表高度为 400 像素
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data:xAxisData
|
data: xAxisData
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
|
|
@ -105,13 +111,14 @@ export function Chart1(xAxisData:any =[],siomesData:any=[],options={}) {
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: siomesData,
|
data: [],
|
||||||
color: '#8F97F8',
|
color: function (params: any) {
|
||||||
type: 'bar',
|
return color[params.dataIndex] || '#8F97F8'
|
||||||
|
},
|
||||||
|
type: 'bar'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
return {...option,...options}
|
return { ...option }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
|
|
@ -53,8 +53,14 @@ onMounted(async ()=>{
|
||||||
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
|
||||||
|
// .filter((item:any) => {
|
||||||
|
// if(["Fe","lengmei"].includes(item.value)){
|
||||||
|
// return false
|
||||||
|
// }else return item
|
||||||
|
// })
|
||||||
from.value.label.radio = dat[0].value
|
from.value.label.radio = dat[0].value
|
||||||
state4.number = dat[0].value
|
state4.number = dat[0].value
|
||||||
|
console.log("🚀 ~ file: Market.vue:56 ~ metal:", metal)
|
||||||
}
|
}
|
||||||
if(data&&data!='null'&&data.length>0){
|
if(data&&data!='null'&&data.length>0){
|
||||||
currency.value = data
|
currency.value = data
|
||||||
|
|
@ -289,7 +295,7 @@ async function getUser(moduleId: any) {
|
||||||
<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-#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="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" class="py5px !rounded-none" :data-id="im.value" @click="tabClick" >{{im.title}}</div>
|
<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>
|
||||||
|
|
|
||||||
|
|
@ -59,39 +59,44 @@ function reverseArray(inputArray: string | any[],star: number,enc: number) {
|
||||||
return reversedArray;
|
return reversedArray;
|
||||||
}
|
}
|
||||||
export function Chart1() {
|
export function Chart1() {
|
||||||
|
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref()
|
const optionRef = ref()
|
||||||
async function getDat() {
|
async function getDat() {
|
||||||
const {data} = await historyMarketSevenDay({number:state.type})
|
const { data } = await historyMarketSevenDay({ number: state.type })
|
||||||
if(!data) return
|
if (!data) return
|
||||||
let {LME,SMM} = data[state.type]
|
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 = {
|
const option = {
|
||||||
|
|
||||||
height: '150px', // 设置图表高度为 400 像素
|
height: '150px', // 设置图表高度为 400 像素
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ["SMM", "LME"],
|
data: ['SMM', 'LME'],
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 10,
|
top: 10
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: reverseArray(getDay(),5,10)
|
data: reverseArray(getDay(), 5, 10)
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value'
|
||||||
// name:'1',
|
// name:'1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// name:'2',
|
// name:'2',
|
||||||
type: 'value',
|
type: 'value'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|
@ -100,118 +105,140 @@ async function getDat() {
|
||||||
color: '#8F97F8',
|
color: '#8F97F8',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top'
|
position: 'top'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'LME',
|
name: 'LME',
|
||||||
data: LME,
|
data: LME,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
color: '#FF603A',
|
color: '#FF603A',
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top'
|
position: 'top'
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
optionRef.value = option
|
optionRef.value = option
|
||||||
}
|
}
|
||||||
const ss = computed(() => [state.type])
|
const ss = computed(() => [state.type])
|
||||||
watch(() => unref(ss),
|
watch(
|
||||||
|
() => 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
|
||||||
});
|
})
|
||||||
|
|
||||||
return { chartRef, option: optionRef, state }
|
return { chartRef, option: optionRef, state }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function Chart3() {
|
export function Chart3() {
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref<any>({});
|
const optionRef = ref<any>({})
|
||||||
|
|
||||||
async function getDat() {
|
async function getDat() {
|
||||||
const {data} = await historyStatSevenDay({currencyCodeFrom:state2.currencyCodeFrom,currencyCodeTo:state2.currencyCodeTo})
|
const { data } = await historyStatSevenDay({
|
||||||
if(!data) return
|
currencyCodeFrom: state2.currencyCodeFrom,
|
||||||
const dat = data[state2.currencyCodeFrom+'-'+state2.currencyCodeTo]
|
currencyCodeTo: state2.currencyCodeTo
|
||||||
|
})
|
||||||
|
if (!data) return
|
||||||
|
const dat = (
|
||||||
|
data[state2.currencyCodeFrom + '-' + state2.currencyCodeTo] || []
|
||||||
|
).map((item: any) => (item == 0 ? null : item))
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
|
|
||||||
height: '150px', // 设置图表高度为 400 像素
|
height: '150px', // 设置图表高度为 400 像素
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data:state2.currencyCodeFrom+'-'+state2.currencyCodeTo,
|
data: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 10,
|
top: 10
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: reverseArray(getDay(),8,10)
|
data: reverseArray(getDay(), 8, 10)
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: state2.currencyCodeFrom+'-'+state2.currencyCodeTo,
|
name: state2.currencyCodeFrom + '-' + state2.currencyCodeTo,
|
||||||
data: dat,
|
data: dat,
|
||||||
color: '#8F97F8',
|
color: '#8F97F8',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top'
|
position: 'top'
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
optionRef.value = option
|
||||||
optionRef.value = option;
|
|
||||||
}
|
}
|
||||||
const ss = computed(() => [state2.currencyCodeFrom,state2.currencyCodeTo])
|
const ss = computed(() => [state2.currencyCodeFrom, state2.currencyCodeTo])
|
||||||
watch(() => unref(ss),
|
watch(
|
||||||
|
() => unref(ss),
|
||||||
async (v) => {
|
async (v) => {
|
||||||
console.log(state2.type)
|
console.log(state2.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
|
||||||
});
|
})
|
||||||
return { chartRef, option: optionRef, state2 }
|
return { chartRef, option: optionRef, state2 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function Chart4() {
|
export function Chart4() {
|
||||||
|
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref<any>({});
|
const optionRef = ref<any>({})
|
||||||
|
|
||||||
async function getDat() {
|
async function getDat() {
|
||||||
const {data} = await historyStatSevenDay({currencyCodeFrom:state3.currencyCodeFrom,currencyCodeTo:state3.currencyCodeTo})
|
const { data } = await historyStatSevenDay({
|
||||||
if(!data) return
|
currencyCodeFrom: state3.currencyCodeFrom,
|
||||||
const dat = data[state3.currencyCodeFrom+'-'+state3.currencyCodeTo]
|
currencyCodeTo: state3.currencyCodeTo
|
||||||
|
})
|
||||||
|
if (!data) return
|
||||||
|
const dat = (
|
||||||
|
data[state3.currencyCodeFrom + '-' + state3.currencyCodeTo] || []
|
||||||
|
).map((item: any) => (item == 0 ? null : item))
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
|
||||||
height: '150px', // 设置图表高度为 400 像素
|
height: '150px', // 设置图表高度为 400 像素
|
||||||
|
|
||||||
|
|
@ -219,91 +246,101 @@ export function Chart4() {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data:state3.currencyCodeFrom+'-'+state3.currencyCodeTo,
|
data: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 10,
|
top: 10
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: reverseArray(getDay(),8,10)
|
data: reverseArray(getDay(), 8, 10)
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: state3.currencyCodeFrom+'-'+state3.currencyCodeTo,
|
name: state3.currencyCodeFrom + '-' + state3.currencyCodeTo,
|
||||||
data: dat,
|
data: dat,
|
||||||
color: '#8F97F8',
|
color: '#8F97F8',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true,
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top'
|
position: 'top'
|
||||||
},
|
}
|
||||||
|
}
|
||||||
},
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
optionRef.value = option;
|
optionRef.value = option
|
||||||
}
|
}
|
||||||
const ss = computed(() => [state3.currencyCodeFrom,state3.currencyCodeTo])
|
const ss = computed(() => [state3.currencyCodeFrom, state3.currencyCodeTo])
|
||||||
watch(() => unref(ss),
|
watch(
|
||||||
|
() => unref(ss),
|
||||||
async (v) => {
|
async (v) => {
|
||||||
console.log(state3.type)
|
console.log(state3.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
|
||||||
});
|
})
|
||||||
return { chartRef, option: optionRef, state3 }
|
return { chartRef, option: optionRef, state3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Chart5() {
|
export function Chart5() {
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref<any>({});
|
const optionRef = ref<any>({})
|
||||||
let nameX: string[]
|
let nameX: string[]
|
||||||
async function dataList() {
|
async function dataList() {
|
||||||
let SMM,LME
|
let SMM, LME
|
||||||
const {data} = await historyStat({number:state4.number,type:state4.type,dateList:state4.dateList})
|
const { data } = await historyStat({
|
||||||
if(data&&data[state4.number]){
|
number: state4.number,
|
||||||
SMM=data[state4.number].SMM
|
type: state4.type,
|
||||||
LME = data[state4.number].LME
|
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 = {
|
const option = {
|
||||||
// width: '250px', // 设置图表宽度为 800 像素
|
// width: '250px', // 设置图表宽度为 800 像素
|
||||||
// height: '150px', // 设置图表高度为 400 像素
|
// height: '150px', // 设置图表高度为 400 像素
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ["SMM", "LME"],
|
data: ['SMM', 'LME'],
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 10,
|
top: 10
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data:nameX
|
data: nameX
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value'
|
||||||
// name:'1',
|
// name:'1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// name:'2',
|
// name:'2',
|
||||||
type: 'value',
|
type: 'value'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|
@ -311,7 +348,9 @@ async function dataList() {
|
||||||
data: SMM,
|
data: SMM,
|
||||||
color: '#FF9307',
|
color: '#FF9307',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: true
|
smooth: true,
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'LME',
|
name: 'LME',
|
||||||
|
|
@ -320,46 +359,62 @@ async function dataList() {
|
||||||
color: '#0063ED',
|
color: '#0063ED',
|
||||||
smooth: true,
|
smooth: true,
|
||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
|
showDataShadow: true,
|
||||||
|
connectNulls: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
optionRef.value = option;
|
optionRef.value = option
|
||||||
}
|
}
|
||||||
const ss = computed(() => [state4.number,state4.startTime,state4.endTime])
|
const ss = computed(() => [state4.number, state4.startTime, state4.endTime])
|
||||||
watch(() => unref(ss),
|
watch(
|
||||||
|
() => 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(state4.startTime,state4.endTime)
|
const { type, list } = calculateDateIntervals(
|
||||||
nameX =list
|
state4.startTime,
|
||||||
|
state4.endTime
|
||||||
|
)
|
||||||
|
nameX = list
|
||||||
state4.dateList = list
|
state4.dateList = list
|
||||||
state4.type = type
|
state4.type = type
|
||||||
console.log(state4.number)
|
console.log(state4.number)
|
||||||
dataList()
|
dataList()
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true },
|
{ immediate: true, deep: true }
|
||||||
)
|
)
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
const option = chartRef.value;
|
const option = chartRef.value
|
||||||
chartRef.value = option;
|
chartRef.value = option
|
||||||
});
|
})
|
||||||
return { chartRef, option: optionRef, state4 }
|
return { chartRef, option: optionRef, state4 }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Chart6() {
|
export function Chart6() {
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
const optionRef = ref<any>({});
|
const optionRef = ref<any>({})
|
||||||
|
|
||||||
let nameX: string[]
|
let nameX: string[]
|
||||||
async function getDat() {
|
async function getDat() {
|
||||||
const {data} = await rateHistoryStat({currencyCodeFrom:state5.currencyCodeFrom,currencyCodeTo:state5.currencyCodeTo,type:state5.type,dateList:state5.dateList})
|
const { data } = await rateHistoryStat({
|
||||||
const dat = data[state5.currencyCodeFrom+'-'+state5.currencyCodeTo]
|
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 = {
|
const option = {
|
||||||
// width: '250px', // 设置图表宽度为 800 像素
|
// width: '250px', // 设置图表宽度为 800 像素
|
||||||
// height: '150px', // 设置图表高度为 400 像素
|
// height: '150px', // 设置图表高度为 400 像素
|
||||||
grid: { left: '10', top: 90, right: '10', bottom: '10', containLabel: true },
|
grid: {
|
||||||
|
left: '10',
|
||||||
|
top: 90,
|
||||||
|
right: '10',
|
||||||
|
bottom: '10',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
|
|
@ -370,39 +425,49 @@ async function getDat() {
|
||||||
// },
|
// },
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data:nameX
|
data: nameX
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: state5.currencyCodeFrom+'-'+state5.currencyCodeTo,
|
name: state5.currencyCodeFrom + '-' + state5.currencyCodeTo,
|
||||||
data: dat,
|
data: dat,
|
||||||
color: '#89DF75',
|
color: '#89DF75',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: true
|
smooth: true,
|
||||||
},
|
showDataShadow: true,
|
||||||
|
connectNulls: true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
optionRef.value = option;
|
optionRef.value = option
|
||||||
}
|
}
|
||||||
const ss = computed(() => [state5.currencyCodeFrom,state5.currencyCodeTo,state5.startTime,state5.endTime])
|
const ss = computed(() => [
|
||||||
watch(() => unref(ss),
|
state5.currencyCodeFrom,
|
||||||
|
state5.currencyCodeTo,
|
||||||
|
state5.startTime,
|
||||||
|
state5.endTime
|
||||||
|
])
|
||||||
|
watch(
|
||||||
|
() => unref(ss),
|
||||||
async (v) => {
|
async (v) => {
|
||||||
const {type,list} = calculateDateIntervals(state5.startTime,state5.endTime)
|
const { type, list } = calculateDateIntervals(
|
||||||
|
state5.startTime,
|
||||||
|
state5.endTime
|
||||||
|
)
|
||||||
|
|
||||||
nameX =list
|
nameX = list
|
||||||
state5.dateList = list
|
state5.dateList = list
|
||||||
state5.type = type
|
state5.type = 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
|
||||||
});
|
})
|
||||||
return { chartRef, option: optionRef, state5 }
|
return { chartRef, option: optionRef, state5 }
|
||||||
}
|
}
|
||||||
|
|
@ -5,31 +5,40 @@ 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 dayjs from 'dayjs'
|
||||||
|
|
||||||
import { fetchDelHis,marketPreADD,getMetalList,fetchGetHisPage,fetchUpdateHis,fetchSaveHis } from '@/api/daikin/base'
|
import {
|
||||||
|
fetchDelHis,
|
||||||
|
marketPreADD,
|
||||||
|
getMetalList,
|
||||||
|
fetchGetHisPage,
|
||||||
|
fetchUpdateHis,
|
||||||
|
fetchSaveHis
|
||||||
|
} from '@/api/daikin/base'
|
||||||
|
|
||||||
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 dataA = ref<any>([])
|
const dataA = ref<any>([])
|
||||||
const editA = ref()
|
const editA = ref<any>({ stDateList: [] })
|
||||||
const metaList = ref<any>([])
|
const metaList = ref<any>([])
|
||||||
const metaObj = ref<any>({})
|
const metaObj = ref<any>({})
|
||||||
|
|
||||||
|
const stDateList = ref<any>([])
|
||||||
const shomkA = ref(false)
|
const shomkA = ref(false)
|
||||||
|
|
||||||
const type =ref(2)
|
const type = ref(2)
|
||||||
async function getDataA() {
|
async function getDataA() {
|
||||||
const {data} = await fetchGetHisPage({})
|
const { data } = await fetchGetHisPage({})
|
||||||
dataA.value = Object.entries(data).map(([key, value]:any) => {
|
dataA.value = Object.entries(data).map(([key, value]: any) => {
|
||||||
return {
|
return {
|
||||||
stDate: key,
|
stDate: key,
|
||||||
yearId: key,
|
yearId: key,
|
||||||
children: value.map((item: any) => {
|
children: value.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
numbers:metaObj.value[item.number]
|
numbers: metaObj.value[item.number]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -37,53 +46,51 @@ async function getDataA() {
|
||||||
// setDataFiles(dataArr);
|
// setDataFiles(dataArr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const {data = []} = await getMetalList()
|
const { data = [] } = await getMetalList()
|
||||||
metaList.value = data
|
metaList.value = data
|
||||||
data.forEach((item: any) => {
|
data.forEach((item: any) => {
|
||||||
metaObj.value[item.value] = item.title
|
metaObj.value[item.value] = item.title
|
||||||
})
|
})
|
||||||
getDataA();
|
getDataA()
|
||||||
})
|
})
|
||||||
|
|
||||||
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) {
|
async function onSubmitA(row: { id: any; fileList?: any; title?: any }) {
|
||||||
console.log(row, 555)
|
console.log(row, 555)
|
||||||
const { id, title } = row
|
const { id, title } = 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 = { title, type: type.value, userIdList: userData.value }
|
||||||
if (row.fileList && row.fileList.length > 0) {
|
if (row.fileList && row.fileList.length > 0) {
|
||||||
row.fileList.map(item => {
|
row.fileList.map((item) => {
|
||||||
|
if (item.response) {
|
||||||
if(item.response) {
|
sendData.filePath = item.response.url
|
||||||
sendData.filePath = item.response.url;
|
|
||||||
// obj.title = title || computedName(item.response.originalFilename);
|
// obj.title = title || computedName(item.response.originalFilename);
|
||||||
}
|
} else {
|
||||||
else {
|
sendData.filePath = item.url
|
||||||
sendData.filePath = item.url;
|
|
||||||
// obj.title = title || computedName(item.originalFilename);
|
// obj.title = title || computedName(item.originalFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
sendData = { id, title, type: type.value, userIdList: userData.value }
|
||||||
sendData = {id, title,type:type.value,userIdList:userData.value };
|
}
|
||||||
}
|
const { code, msg } = await marketPreADD(sendData)
|
||||||
const {code,msg} = await marketPreADD(sendData)
|
if (code === 200) {
|
||||||
if (code === 200) { message.success("修改成功!") }
|
message.success('修改成功!')
|
||||||
else { message.error(msg) }
|
} else {
|
||||||
|
message.error(msg)
|
||||||
|
}
|
||||||
shomkA.value = false
|
shomkA.value = false
|
||||||
getDataA();
|
getDataA()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleEditA = (type: string, row: any = {}) => {
|
const handleEditA = (type: string, row: any = {}) => {
|
||||||
if (!row) return
|
if (!row) return
|
||||||
editA.value = {...row}
|
editA.value = { ...row }
|
||||||
|
editA.value.stDateList = [row.stDate, row.stDate]
|
||||||
|
stDateList.value = [row.stDate, row.stDate]
|
||||||
// setUserList.value =[]
|
// setUserList.value =[]
|
||||||
shomkA.value = true
|
shomkA.value = true
|
||||||
|
|
||||||
|
|
@ -95,80 +102,106 @@ const handleEditA = (type: string, row: any = {}) => {
|
||||||
// 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 fetchDelHis({ id,type:type.value })
|
const { code, msg } = await fetchDelHis({ 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 showModal = ref(false)
|
const showModal = ref(false)
|
||||||
const flg = ref()
|
const flg = ref()
|
||||||
const setUserList =ref()
|
const setUserList = ref()
|
||||||
async function getUser(row) {
|
async function getUser(row) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
showModal.value = !showModal.value
|
showModal.value = !showModal.value
|
||||||
flg.value = row
|
flg.value = row
|
||||||
if(row.id&&row.userIdList){
|
if (row.id && row.userIdList) {
|
||||||
setUserList.value = row.userIdList
|
setUserList.value = row.userIdList
|
||||||
}
|
}
|
||||||
// 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);
|
|
||||||
const { showModal: show, multipleSelection } = data
|
const { showModal: show, multipleSelection } = data
|
||||||
showModal.value = unref(show)
|
showModal.value = unref(show)
|
||||||
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.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
|
||||||
}
|
}
|
||||||
const CloseThiss = (data: boolean)=>{
|
const CloseThiss = (data: boolean) => {
|
||||||
showModal.value = data
|
showModal.value = data
|
||||||
}
|
}
|
||||||
const goBacks = () => {
|
const goBacks = () => {
|
||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
const editForm = ref(null)
|
const editForm = ref(null)
|
||||||
const channelList = ref([{
|
const channelList = ref([
|
||||||
label:'LME',
|
{
|
||||||
value:'LME'
|
label: 'LME',
|
||||||
},
|
value: 'LME'
|
||||||
{
|
},
|
||||||
label:'SMM',
|
{
|
||||||
value:'SMM'
|
label: 'SMM',
|
||||||
}])
|
value: 'SMM'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
const handleClickA = async () => {
|
const handleClickA = async () => {
|
||||||
let res:any = {}
|
if (stDateList.length == 0) {
|
||||||
if(editA.value.id){
|
message.error('请选择日期!')
|
||||||
res = await fetchUpdateHis(editA.value)
|
return
|
||||||
}else{
|
|
||||||
res = await fetchSaveHis(editA.value)
|
|
||||||
}
|
}
|
||||||
if(res.code == 200){
|
const req = { ...editA.value }
|
||||||
|
req.stDateList = generateDateRange()
|
||||||
|
console.log('🚀 ~ file: dataModify.vue:173 ~ req:', req)
|
||||||
|
let res: any = await fetchSaveHis(req)
|
||||||
|
if (res.code == 200) {
|
||||||
shomkA.value = false
|
shomkA.value = false
|
||||||
message.success("操作成功!")
|
message.success('操作成功!')
|
||||||
getDataA();
|
getDataA()
|
||||||
}else{
|
} else {
|
||||||
message.error(res.msg)
|
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
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<HomeHead class="top">
|
<HomeHead class="top">
|
||||||
|
|
@ -181,17 +214,30 @@ const handleClickA = async () => {
|
||||||
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
|
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
|
||||||
<div class="text-36px text-#000">市况数据管理</div>
|
<div class="text-36px text-#000">市况数据管理</div>
|
||||||
</div>
|
</div>
|
||||||
<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
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="rounded-md float-right mr-80px mt-20px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
|
class="rounded-md float-right mr-80px mt-20px px20px py10px z-200 bg-#f5f5f5 flex items-center justify-center w-100px"
|
||||||
@click="goBacks"
|
@click="goBacks"
|
||||||
>
|
>
|
||||||
<el-icon><ArrowLeftBold size="18" /></el-icon> 返回
|
<el-icon><ArrowLeftBold size="18" /></el-icon> 返回
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dataA" style="width: 95%" row-key="id"
|
<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%"
|
||||||
|
row-key="yearId"
|
||||||
|
:header-cell-style="{
|
||||||
|
background: '#2A7BF7',
|
||||||
|
color: '#fff',
|
||||||
|
height: '60px',
|
||||||
|
textAlign: 'center',
|
||||||
|
'font-size': '24px'
|
||||||
|
}"
|
||||||
|
:cell-style="{ 'text-align': 'center' }"
|
||||||
|
height="700px"
|
||||||
|
>
|
||||||
<el-table-column label="日期" prop="stDate" />
|
<el-table-column label="日期" prop="stDate" />
|
||||||
<el-table-column label="渠道" prop="channel" />
|
<el-table-column label="渠道" prop="channel" />
|
||||||
<el-table-column label="编号" prop="numbers" />
|
<el-table-column label="编号" prop="numbers" />
|
||||||
|
|
@ -205,8 +251,15 @@ const handleClickA = async () => {
|
||||||
<el-table-column label="操作" width="180px">
|
<el-table-column label="操作" width="180px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.children?.length">
|
<template v-if="!scope.row.children?.length">
|
||||||
<el-button size="small" @click="handleEditA('edit', scope.row)">编辑</el-button>
|
<el-button size="small" @click="handleEditA('edit', scope.row)"
|
||||||
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button>
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteA(scope.$index, scope.row)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -226,17 +279,31 @@ const handleClickA = async () => {
|
||||||
<div class="bg-#FFF">
|
<div class="bg-#FFF">
|
||||||
<el-form ref="editForm" :model="editA" label-width="100px" size="large">
|
<el-form ref="editForm" :model="editA" label-width="100px" size="large">
|
||||||
<el-form-item label="日期" prop="stDate">
|
<el-form-item label="日期" prop="stDate">
|
||||||
<el-date-picker
|
<!-- <el-date-picker
|
||||||
class="!w-90%"
|
class="!w-90%"
|
||||||
v-model="editA.stDate"
|
v-model="editA.stDate"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
|
/> -->
|
||||||
|
<el-date-picker
|
||||||
|
v-model="stDateList"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
class="!w-90%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br />
|
<br />
|
||||||
<el-form-item label="渠道" prop="channel">
|
<el-form-item label="渠道" prop="channel">
|
||||||
<el-select :disabled="editA.id" v-model="editA.channel" placeholder="选择渠道" class="!w-90%">
|
<el-select
|
||||||
|
:disabled="editA.id"
|
||||||
|
v-model="editA.channel"
|
||||||
|
placeholder="选择渠道"
|
||||||
|
class="!w-100%"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in channelList"
|
v-for="item in channelList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
|
@ -247,7 +314,12 @@ const handleClickA = async () => {
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br />
|
<br />
|
||||||
<el-form-item label="编号" prop="number">
|
<el-form-item label="编号" prop="number">
|
||||||
<el-select :disabled="editA.id" v-model="editA.number" placeholder="选择类型" class="!w-90%">
|
<el-select
|
||||||
|
:disabled="editA.id"
|
||||||
|
v-model="editA.number"
|
||||||
|
placeholder="选择类型"
|
||||||
|
class="!w-100%"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in metaList"
|
v-for="item in metaList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
|
@ -261,12 +333,16 @@ const handleClickA = async () => {
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="editA.negAmount"
|
v-model="editA.negAmount"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
class="!w-90%"
|
class="!w-100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br />
|
<br />
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<el-button type="primary" @click="handleClickA(editA)" class="mb-20px">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="handleClickA(editA)"
|
||||||
|
class="mb-20px"
|
||||||
|
>
|
||||||
确认</el-button
|
确认</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -275,7 +351,11 @@ const handleClickA = async () => {
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<n-modal v-model:show="showModal">
|
<n-modal v-model:show="showModal">
|
||||||
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss"/>
|
<UserList
|
||||||
|
:userDataList="setUserList"
|
||||||
|
@clickChild="handleChild"
|
||||||
|
@CloseThis="CloseThiss"
|
||||||
|
/>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -295,11 +375,11 @@ const handleClickA = async () => {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
:deep(.el-input-number .el-input__inner){
|
:deep(.el-input-number .el-input__inner) {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
}
|
}
|
||||||
:deep{
|
:deep {
|
||||||
.el-dialog__body{
|
.el-dialog__body {
|
||||||
margin-top: 18px;
|
margin-top: 18px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue