Compare commits

...

13 Commits

Author SHA1 Message Date
‘937886381’
1e12b653d6 Merge branch 'projects/line-new' into projects/line-new-zhp 2025-12-09 16:59:54 +08:00
‘937886381’
b7ba173ca3 修改 2025-12-09 16:57:38 +08:00
c203f1e1dd Merge pull request 'projects/line-new-zhp' (#457) from projects/line-new-zhp into projects/line-new
Reviewed-on: #457
2025-12-09 13:11:32 +08:00
‘937886381’
ccb925003e Merge branch 'projects/line-new' into projects/line-new-zhp 2025-12-09 13:10:45 +08:00
‘937886381’
b9f286005c 生产 2025-12-09 13:07:09 +08:00
0e343279ac Merge pull request '更新' (#456) from projects/line-new-zwq into projects/line-new
Reviewed-on: #456
2025-12-01 14:52:38 +08:00
zwq
00ac3dec45 更新 2025-12-01 14:52:21 +08:00
a84f765e73 Merge pull request '班组bug' (#455) from projects/line-new-zwq into projects/line-new
Reviewed-on: #455
2025-11-28 16:29:25 +08:00
zwq
ffa0b2e8dd 班组bug 2025-11-28 16:29:06 +08:00
1e6c6c5656 Merge pull request '班组bug' (#448) from projects/line-new-zwq into projects/line-new
Reviewed-on: #448
2025-11-11 15:38:56 +08:00
zwq
0e76fe7dbf 班组bug 2025-11-11 15:38:31 +08:00
399e2bc965 Merge pull request '更新班组' (#447) from projects/line-new-zwq into projects/line-new
Reviewed-on: #447
2025-11-05 13:58:22 +08:00
zwq
7bee1f7863 更新班组 2025-11-05 13:57:58 +08:00
78 changed files with 11794 additions and 1410 deletions

View File

@@ -12,8 +12,10 @@ ENV = 'development'
VUE_APP_TITLE = 智能监控分析系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
VUE_APP_BASE_API = 'http://172.16.33.65:48082'
# VUE_APP_BASE_API = 'http://172.16.33.187:48082'
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
VUE_APP_BASE_API = 'http://172.16.32.79:48082'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

BIN
dist.zip Normal file

Binary file not shown.

View File

@@ -6,7 +6,7 @@
"license": "MIT",
"scripts": {
"local": "vue-cli-service serve --mode local",
"dev": "vue-cli-service serve --mode dev",
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
"front": "vue-cli-service serve --mode front",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
"build:stage": "vue-cli-service build --mode stage",

View File

@@ -59,3 +59,34 @@ export function getEquipmentAll() {
method: 'get'
})
}
export function getTree(query) {
return request({
url: '/base/factory/getTree',
method: 'get',
params: query
})
}
export function getEquipmentOverall(data) {
return request({
url: '/monitoring/equipment-overall/get',
method: 'post',
data: data,
});
}
export function getParamMonitor(data) {
return request({
url: '/monitoring/equipment-monitor/paramMonitor',
method: 'post',
data: data,
});
}
export function getAlarmDet(data) {
return request({
url: 'monitoring/equipment-overall/alarmDet',
method: 'post',
data: data,
});
}

View File

@@ -52,3 +52,5 @@ export function exportEquipmentTypeExcel(query) {
responseType: 'blob'
})
}

View File

@@ -50,6 +50,15 @@ export function getPdlAutoReportNewSearchNow(data) {
});
}
export function getPdlAutoReportNewSearchLastGroup(data) {
return request({
url: '/monitoring/production-monitor/getPdlAutoReportNewSearchLastGroup',
method: 'post',
data: data,
timeout: 60000,
});
}
// 班组自动报表分页
export function getTeamReportPage(data) {

View File

@@ -141,3 +141,13 @@ export function getPerView(data) {
data:data
})
}
// 导出 Excel
export function exportExcel(query) {
return request({
url: '/base/group-scheduling-plan/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@@ -26,6 +26,13 @@ export function getGroup(id) {
method: 'get'
})
}
// 检查更新-生产班组
export function updateIsProduction(id) {
return request({
url: '/base/group-team/updateIsProduction?id=' + id,
method: 'get'
})
}
// 获得班组基础信息分页
export function getGroupPage(query) {

View File

@@ -90,3 +90,29 @@ export function getEnableData() {
method: 'get',
})
}
// 解除继承节假日
export function disExtends(data) {
return request({
url: '/base/group-holiday/disExtends',
method: 'post',
data: data
})
}
// 恢复继承节假日
export function reExtends(data) {
return request({
url: '/base/group-holiday/reExtends',
method: 'post',
data: data
})
}
// 获得部门节假日继承设置信息设置
export function getSet(query) {
return request({
url: '/base/group-holiday-dept-set/getSet',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,56 @@
import request from '@/utils/request'
// 创建能源监控配置
export function getDefectSummaryTable(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryTable',
method: 'post',
data: data,
});
}
export function getTranslucentPage(data) {
return request({
url: '/monitoring/translucent/page',
method: 'get',
params: data,
});
}
export function exportTranslucent(data) {
return request({
url: '/monitoring/translucent/export-excel',
method: 'get',
params: data,
responseType: 'blob',
});
}
export function getDefectAnalysis(data) {
return request({
url: '/extend/check-gaozhun-record/defectAnalysis',
method: 'post',
data: data,
});
}
export function getSectionDefect(data) {
return request({
url: '/extend/check-gaozhun-record/sectionDefect',
method: 'post',
data: data,
});
}
export function getDefectSummaryChart(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryChart',
method: 'post',
data: data,
});
}
export function getDefectSummaryDet(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryDet',
method: 'post',
data: data,
});
}

View File

@@ -0,0 +1,63 @@
/*
* @Author: zhp
* @Date: 2023-12-08 15:26:59
* @LastEditTime: 2023-12-11 15:21:44
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
export function getQualityIsraPage(query) {
return request({
url: '/extend/check-isra-statistics/getIsraData',
method: 'get',
params: query,
});
}
export function getQualityIsraDayMap(query) {
return request({
url: '/base/quality-isra-statistics/dayMap',
method: 'get',
params: query
})
}
export function getQualityIsraWeekMap(query) {
return request({
url: '/base/quality-isra-statistics/weekMap',
method: 'get',
params: query
})
}
export function getQualityIsraMonthMap(query) {
return request({
url: '/base/quality-isra-statistics/monthMap',
method: 'get',
params: query
})
}
export function getQualityIsraDayList(query) {
return request({
url: '/base/quality-isra-statistics/dayList',
method: 'get',
params: query
})
}
export function getQualityIsraWeekList(query) {
return request({
url: '/base/quality-isra-statistics/weekList',
method: 'get',
params: query
})
}
export function getQualityIsraMonthList(query) {
return request({
url: '/base/quality-isra-statistics/monthList',
method: 'get',
params: query
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -6,104 +6,48 @@
-->
<template>
<el-form
ref="form"
:model="form"
:label-width="`${labelWidth}px`"
:size="size"
:label-position="labelPosition"
v-loading="formLoading">
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
<el-input
v-if="col.input"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-input
v-if="col.textarea"
type="textarea"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-select
v-if="col.select"
v-model="form[col.prop]"
:placeholder="`请选择${col.label}`"
@change="$emit('update', form)"
v-bind="col.bind">
<el-option
v-for="opt in optionListOf[col.prop]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
<el-date-picker
v-if="col.datetime"
v-model="form[col.prop]"
type="datetime"
:placeholder="`请选择${col.label}`"
value-format="timestamp"
v-bind="col.bind"></el-date-picker>
<el-switch
v-if="col.switch"
v-model="form[col.prop]"
active-color="#0b58ff"
inactive-color="#e1e1e1"
v-bind="col.bind"></el-switch>
<component
v-if="col.subcomponent"
:key="col.key"
:is="col.subcomponent"
:inlineStyle="col.style"></component>
<el-form ref="form" :model="form" :label-width="`${labelWidth}px`" :size="size" :label-position="labelPosition"
v-loading="formLoading">
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
<el-input v-if="col.input" v-model="form[col.prop]" @change="$emit('update', form)"
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
<el-input v-if="col.textarea" type="textarea" v-model="form[col.prop]" @change="$emit('update', form)"
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
<el-select v-if="col.select" v-model="form[col.prop]" :placeholder="`请选择${col.label}`"
@change="$emit('update', form)" v-bind="col.bind">
<el-option v-for="opt in optionListOf[col.prop]" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
<el-date-picker v-if="col.datetime" v-model="form[col.prop]" type="datetime" :placeholder="`请选择${col.label}`"
value-format="timestamp" v-bind="col.bind"></el-date-picker>
<el-switch v-if="col.switch" v-model="form[col.prop]" active-color="#0b58ff" inactive-color="#e1e1e1"
v-bind="col.bind" @change="handleSwitchChange(col.prop)"></el-switch>
<component v-if="col.subcomponent" :key="col.key" :is="col.subcomponent" :inlineStyle="col.style"></component>
<div
class="upload-area"
:class="uploadOpen ? '' : 'height-48'"
ref="uploadArea"
v-if="col.upload">
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
<el-button
type="text"
icon="el-icon-arrow-right"
@click="handleFilesOpen" />
</span>
<!-- :file-list="uploadedFileList" -->
<el-upload
class="upload-in-dialog"
v-if="col.upload"
:action="uploadUrl"
:headers="uploadHeaders"
:show-file-list="false"
icon="el-icon-upload2"
:before-upload="beforeUpload"
:on-success="handleUploadSuccess"
v-bind="col.bind">
<el-button size="mini" :disabled="col.bind?.disabled || false">
<svg-icon
icon-class="icon-upload"
style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile
class="file"
v-for="file in form[col.prop] || []"
:file="file"
:key="file.fileUrl"
@delete="handleDeleteFile(file)"
@Preview="handlePreview(file)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" v-if="col.upload">
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
<el-button type="text" icon="el-icon-arrow-right" @click="handleFilesOpen" />
</span>
<!-- :file-list="uploadedFileList" -->
<el-upload class="upload-in-dialog" v-if="col.upload" :action="uploadUrl" :headers="uploadHeaders"
:show-file-list="false" icon="el-icon-upload2" :before-upload="beforeUpload"
:on-success="handleUploadSuccess" v-bind="col.bind">
<el-button size="mini" :disabled="col.bind?.disabled || false">
<svg-icon icon-class="icon-upload" style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile class="file" v-for="file in form[col.prop] || []" :file="file" :key="file.fileUrl"
@delete="handleDeleteFile(file)" @Preview="handlePreview(file)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
@@ -134,7 +78,8 @@ const uploadedFile = {
data() {
return {};
},
methods: {
methods: {
handleDelete() {
this.$emit('delete', this.file);
},
@@ -251,7 +196,12 @@ export default {
// 处理 options
this.handleOptions();
},
methods: {
methods: {
handleSwitchChange(prop) {
// 触发 update 事件,将最新的 form 数据传递给父组件
this.$emit('update', { ...this.form });
console.log(`switch ${prop} 变化:`, this.form[prop]);
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);

View File

@@ -16,7 +16,7 @@ export default {
},
tableData: [], //table数据
listQuery: { //分页
pageSize: 10,
pageSize: 20,
pageNo: 1,
total: 1,
},

View File

@@ -1,10 +1,10 @@
import axios from 'axios'
import {Message, MessageBox, Notification, Loading} from 'element-ui'
import { Message, MessageBox, Notification, Loading } from 'element-ui'
import store from '@/store'
import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import {getPath, getTenantEnable} from "@/utils/ruoyi";
import {refreshToken} from "@/api/login";
import { getPath, getTenantEnable } from "@/utils/ruoyi";
import { refreshToken } from "@/api/login";
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
const ignoreMsgs = [
@@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
const part = encodeURIComponent(propName) + '='
if (value !== null && typeof(value) !== "undefined") {
if (value !== null && typeof (value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
@@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
}
return config
}, error => {
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
})
// 响应拦截器
@@ -176,36 +176,38 @@ service.interceptors.response.use(async res => {
+ '<div>5 分钟搭建本地环境</div>',
})
return Promise.reject(new Error(msg))
} else if (code === 400) {
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
return res.data
} else if (code !== 200) {
if (msg === '无效的刷新令牌') { // hard coding忽略这个提示直接登出
console.log(msg)
} else {
Notification.error({
title: msg
})
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
return res.data
}
return Promise.reject('error')
} else {
return res.data
}
}, error => {
tryHideFullScreenLoading()
console.log('err' + error)
let {message} = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
tryHideFullScreenLoading()
console.log('err' + error)
let { message } = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
)
export function getBaseHeader() {
@@ -219,10 +221,10 @@ function handleAuthorized() {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {

View File

@@ -6,35 +6,27 @@
-->
<template>
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
custom-class="mes-drawer"
:size="size || '50%'"
@closed="$emit('destroy')">
<SmallTitle slot="title">
{{
mode.includes('detail')
? '详情'
: mode.includes('edit')
? '编辑'
: '新增'
}}
</SmallTitle>
<el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" class="drawer" custom-class="mes-drawer"
:size="size || '50%'" @closed="$emit('destroy')">
<SmallTitle slot="title">
{{
mode.includes('detail')
? '详情'
: mode.includes('edit')
? '编辑'
: '新增'
}}
</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
<section v-for="(section, index) in sections" :key="section.key">
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
<section v-for="(section, index) in sections" :key="section.key">
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
<div
class="form-part"
v-if="section.key == 'base'"
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
<el-skeleton v-if="!showForm" animated />
<!-- <BaseInfoForm
<div class="form-part" v-if="section.key == 'base'"
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
<el-skeleton v-if="!showForm" animated />
<!-- <BaseInfoForm
key="drawer-dialog-form"
v-if="showForm"
ref="form"
@@ -42,141 +34,87 @@
v-model="form"
:rows="formRows" /> -->
<!-- if -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备名
</div>
<div class="value" style="font-size: 14px">
{{ form.equipmentName }}
</div>
</el-col>
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
关联表名
</div>
<div class="value" style="font-size: 14px">
{{ form.plcName }}
</div>
</el-col>
</el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备名"
style="font-size: 16px; margin: 8px 0">
<el-select
v-model="form.equipmentId"
filterable
clearable
placeholder="请选择设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:label="eq.name"
:value="eq.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备关联表名"
style="font-size: 16px; margin: 8px 0">
<el-select
v-model="form.plcId"
filterable
clearable
placeholder="请选择关联表">
<el-option
v-for="plc in plcList"
:key="plc.id"
:label="plc.plcTableName"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div>
<!-- if -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8">
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备名
</div>
<div class="value" style="font-size: 14px">
{{ form.equipmentName }}
</div>
</el-col>
<el-col :span="8">
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
关联表名
</div>
<div class="value" style="font-size: 14px">
{{ form.plcName }}
</div>
</el-col>
</el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item class="title" label="设备名" style="font-size: 16px; margin: 8px 0">
<el-select v-model="form.equipmentId" filterable clearable placeholder="请选择设备">
<el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="title" label="设备关联表名" style="font-size: 16px; margin: 8px 0">
<el-select v-model="form.plcId" filterable clearable placeholder="请选择关联表">
<el-option v-for="plc in plcList" :key="plc.id" :label="plc.plcTableName"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div>
<div
v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px">
<div
v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加参数
</el-button>
</div>
<base-table
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
@emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
<div v-if="section.key == 'attrs'" style="position: relative; margin-top: 12px">
<div v-if="!mode.includes('detail')" style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加参数
</el-button>
</div>
<base-table v-loading="attrListLoading" :table-props="section.props" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :table-data="list" @emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn
v-if="section.tableBtn && !mode.includes('detail')"
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<method-btn v-if="section.tableBtn && !mode.includes('detail')" slot="handleBtn" label="操作"
:method-list="tableBtn" @clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</section>
</div>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
</div>
</section>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleSave">
保存
</el-button>
</div>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="!mode.includes('detail')" @click="handleSave">
保存
</el-button>
</div>
</div>
<!-- 属性对话框 -->
<base-dialog
v-if="sections[1].allowAdd"
:dialogTitle="attrTitle"
:dialogVisible="attrFormVisible"
width="45%"
:append-to-body="true"
custom-class="baseDialog"
@close="closeAttrForm"
@cancel="closeAttrForm"
@confirm="submitAttrForm">
<!-- :disabled="mode.includes('detail')" -->
<DialogForm
v-if="attrFormVisible"
ref="attrForm"
v-model="attrForm"
:rows="attrRows" />
</base-dialog>
</el-drawer>
<!-- 属性对话框 -->
<base-dialog v-if="sections[1].allowAdd" :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="45%"
:append-to-body="true" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm"
@confirm="submitAttrForm">
<!-- :disabled="mode.includes('detail')" -->
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :data-form="attrForm"
:rows="attrRows"
@update="handleAttrFormUpdate"/>
</base-dialog>
</el-drawer>
</template>
<script>
@@ -232,7 +170,9 @@ export default {
defaultValue: '',
description: '',
remark: '',
alarmContent: '',
alarmContent: '',
displayTip: false,
alarmTip: false,
},
attrFormVisible: false,
attrRows: [
@@ -342,7 +282,27 @@ export default {
},
],
},
],
],
[
{
switch: true,
label: '是否展示',
prop: 'displayTip',
bind: {
'active-value': true,
'inactive-value': false,
},
},
{
switch: true,
label: '超出阈值是否报警',
prop: 'alarmTip',
bind: {
'active-value': true,
'inactive-value': false,
},
},
],
[
{
input: true,
@@ -436,7 +396,24 @@ export default {
}
}
},
methods: {
methods: {
handleAttrFormUpdate(updatedForm) {
console.log('updatedForm', updatedForm);
// 只同步需要的字段,避免覆盖其他数据
this.attrForm = {
...this.attrForm,
...updatedForm,
// 确保开关值是布尔类型(双重保险)
displayTip: Boolean(updatedForm.displayTip),
alarmTip: Boolean(updatedForm.alarmTip),
collection: Number(updatedForm.collection) // 采集开关保持数字类型
};
console.log('开关值同步:', {
displayTip: this.attrForm.displayTip,
alarmTip: this.attrForm.alarmTip
});
},
handleTableBtnClick({ type, data }) {
switch (type) {
case 'edit':
@@ -502,7 +479,8 @@ export default {
name: '',
plcParamName: '',
unit: '',
collection: 1,
collection: 1,
minValue: '',
maxValue: '',
defaultValue: '',
@@ -510,7 +488,9 @@ export default {
remark: '',
equipmentParamType: '',
productionParamType: '',
alarmContent: '',
alarmContent: '',
displayTip: false,
alarmTip: false,
};
this.attrTitle = '添加参数绑定信息';
this.attrFormVisible = true;
@@ -523,8 +503,15 @@ export default {
method: 'get',
params: { id: attrId },
});
if (res.code == 0) {
this.attrForm = res.data;
if (res.code == 0) {
console.log('res.data', res.data);
this.attrForm = {
...res.data,
// // 强制转为数字类型,避免字符串类型导致绑定失败
// displayTip: Number(res.data.displayTip) || 0,
// alarmTip: Number(res.data.alarmTip) || 0
};
this.attrTitle = '编辑参数绑定信息';
this.attrFormVisible = true;
}
@@ -563,7 +550,8 @@ export default {
this.$refs['attrForm'].validate(async (valid) => {
if (!valid) {
return;
}
}
console.log('this.attrForm', this.attrForm);
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
@@ -583,8 +571,9 @@ export default {
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
this.shouldRefreshPageView = true;
this.shouldRefreshPageView = true;
this.getAttrList();
},
});
}

View File

@@ -103,7 +103,7 @@ export default {
id: null,
code: '',
materialId: '',
price: '',
price: undefined,
startTime: new Date().getTime(),
endTime: null,
remark: '',

View File

@@ -47,15 +47,15 @@ const tableProps = [
prop: 'equipmentName',
label: '设备',
},
{
prop: 'size',
label: '规格',
showOverflowtooltip: true,
},
{
prop: 'process',
label: '产品工艺',
},
// {
// prop: 'size',
// label: '规格',
// showOverflowtooltip: true,
// },
// {
// prop: 'process',
// label: '产品工艺',
// },
{
prop: 'standardCt',
label: '标准节拍pcs/min',

View File

@@ -72,16 +72,6 @@ export default {
dateLabelList: [],
optionArrUrl: [getProductionLinePage],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineIds',
defaultSelect: [],
multiple: true,
filterable: true,
width: 200,
},
{
type: 'datePicker',
label: '时间',
@@ -92,7 +82,17 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'time',
},
},
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineIds',
defaultSelect: [],
multiple: true,
filterable: true,
width: 300,
},
{
type: 'button',
btnName: '查询',
@@ -113,7 +113,7 @@ export default {
};
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list;
this.formConfig[1].selectOptions = response.data.list;
// this.formConfig[0].defaultSelect = response.data.list[0].id
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
});

View File

@@ -279,7 +279,8 @@ export default {
filterable: true,
clearable: true,
},
},
},
// {
// select: true,
// label: '设备分组',

View File

@@ -92,7 +92,7 @@ export default {
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '设备类型名称' },
{ prop: 'code', label: '检测类型编码' },
{ prop: 'code', label: '设备类型编码' },
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [

View File

@@ -66,16 +66,16 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="完成单位产品用时" prop="processTime">
<el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
<el-form-item label="完成单位产品用时(S)" prop="processTime">
<el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时(S)" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" 加工属性" prop="processType">
<el-select v-model="dataForm.processType" clearable style="width: 100%" :disabled="isdetail"
placeholder="请选择加工属性">
<el-option v-for="dict in processTypeList" :key="dict.id" :label="dict.label"
:value="dict.id" />
<el-form-item label=" 产品工艺" prop="processTypes">
<el-select :disabled="isdetail" collapse-tags multiple v-model="dataForm.processTypes" clearable
style="width: 100%" placeholder="请选择产品工艺">
<el-option v-for="dict in processTypeList" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
@@ -191,7 +191,7 @@ export default {
unitDictValue: '', // 单位id
originalSpecifications: '', // 原片规格
originalArea: 0, // 原片单位平方数
processType:undefined,
processTypes: [],
},
listQuery: {
pageSize: 10,
@@ -200,18 +200,18 @@ export default {
},
processTypeList: [
{
id: '0',
value: '1',
label:'压花丝印'
},
{
id: '1',
value: '2',
label: '无印打孔'
},
{
id: '2',
value: '3',
label: '单层镀膜'
}, {
id: '3',
value: '4',
label: '双层镀膜'
}
],
@@ -276,7 +276,8 @@ export default {
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || null;
this.dataForm.id = id || null;
// this.dataForm.processTypes = [] // 清空工艺选择
this.visible = true;
this.$nextTick(() => {
@@ -284,9 +285,26 @@ export default {
if (this.dataForm.id) {
// 获取产品详情
getProduct(id).then((response) => {
this.dataForm = response.data;
});
getProduct(id).then((res) => {
const resData = res.data || {};
// 逐个字段赋值(保留响应式)
this.dataForm.name = resData.name || '';
this.dataForm.code = resData.code || '';
this.dataForm.area = resData.area || 0;
this.dataForm.typeDictValue = resData.typeDictValue || null;
this.dataForm.processTime = resData.processTime || null;
this.dataForm.specifications = resData.specifications || '';
this.dataForm.unitDictValue = resData.unitDictValue || '';
this.dataForm.originalSpecifications = resData.originalSpecifications || '';
this.dataForm.originalArea = resData.originalArea || 0;
// 处理工艺列表:确保是数组,过滤空值
this.dataForm.processTypes = resData.processType
? resData.processType.split(',').filter(Boolean)
: [];
console.log('工艺列表(编辑时):', this.dataForm.processTypes); // 验证是否为 ["1","2"] 格式
});
// 获取产品的属性列表
this.getList();
} else {
@@ -342,7 +360,7 @@ export default {
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (valid) {
// 修改的提交
if (this.dataForm.id) {
updateProduct(this.dataForm).then((response) => {

View File

@@ -1,139 +1,142 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-dialog v-loading="isLoading" loading-text="处理中..." loading-spinner="el-icon-loading"
loading-background="rgba(255, 255, 255, 0.7)" :visible.sync="visible" :width="'35%'" :append-to-body="true"
:close-on-click-modal="false" class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input
v-model="dataForm.value"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入属性名" clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input v-model="dataForm.value" placeholder="请输入属性" clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button :loading="isLoading" type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createProductAttr,
updateProductAttr,
getProductAttr,
createProductAttr,
updateProductAttr,
getProductAttr,
} from '@/api/core/base/productAttr';
export default {
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: 0,
name: '',
value: '',
},
dataRule: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getProductAttr(this.dataForm.id).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;
});
}
});
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
if (this.dataForm.id) {
updateProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
// 添加的提交
createProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
isLoading: false,
dataForm: {
id: 0,
name: '',
value: '',
},
dataRule: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getProductAttr(this.dataForm.id).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;
}).catch(err => {
console.error('获取属性详情失败:', err);
this.$modal.msgError('获取数据失败,请重试');
});
}
});
},
// 表单提交(优化加载状态和错误处理)
async dataFormSubmit() {
// 先验证表单
const valid = await new Promise((resolve) => {
this.$refs['dataForm'].validate((isValid) => resolve(isValid));
});
if (!valid) return;
this.isLoading = true; // 开始加载
try {
if (this.dataForm.id) {
// 编辑操作
await updateProductAttr({
...this.dataForm,
productId: this.productId,
});
this.$modal.msgSuccess('修改成功');
} else {
// 新增操作
await createProductAttr({
...this.dataForm,
productId: this.productId,
});
this.$modal.msgSuccess('新增成功');
}
this.visible = false;
this.$emit('refreshDataList');
} catch (error) {
// 错误处理
console.error('提交失败:', error);
this.$modal.msgError('操作失败,请重试');
} finally {
// 无论成功失败,都关闭加载状态
this.isLoading = false;
}
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
.dialog>>>.el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
.dialog>>>.el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
.dialog>>>.el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@@ -262,6 +262,14 @@ export default {
tooltip: {
valueFormatter: (value) => `${value} %`,
},
label: {
show: true,
position: 'top',
distance: 6,
fontSize: 11,
color: '#333333',
formatter: (params) => `${params.value}` // 显示单位
},
data: this.barData.map((item) => item.processingRatio),
},
],

View File

@@ -34,7 +34,7 @@
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="210" />
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
@@ -57,7 +57,7 @@
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="210" />
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
@@ -71,9 +71,55 @@
</el-row>
</div>
</div>
<div class="content-inner" v-if="listQuery.timeType === 3">
<!-- 当班数据占1/2剩余高度 -->
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip">上一班数据</span>
<el-row style="margin-top: 10px;">
<el-col class="custom-tabs">
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
<barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px"
:bar-data="tableData" />
<div v-else class="no-data-bg"></div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
<!-- 当天数据占1/2剩余高度 -->
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip">当天数据</span>
<el-row style="margin-top: 10px;">
<el-col class="custom-tabs">
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
<barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px"
:bar-data="tableData2" />
<div v-else class="no-data-bg"></div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
</div>
<!-- 3.2 时间维度为自定义时的内容两个平分高度的div -->
<div class="content-inner" v-else>
<div class="content-inner" v-if="listQuery.timeType === 2">
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
@@ -86,7 +132,7 @@
<span class="tip" v-else>生产表格数据 </span>
<div class="graph">
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="tableProps" :max-height="210" :table-data="tableDataCustom" />
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" />
</div>
</div>
@@ -113,7 +159,7 @@
<span class="tip">当班数据</span>
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
:max-height="210" />
:max-height="300" />
</div>
<!-- 当天数据占1/2剩余高度 -->
@@ -122,7 +168,7 @@
<span class="tip">当天数据</span>
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
:max-height="210" />
:max-height="300" />
</div>
</div>
</div>
@@ -142,7 +188,7 @@
</span>
<span class="tip" v-else>生产表格数据 </span>
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="210" />
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="300" />
</div>
</div>
</div>
@@ -154,7 +200,7 @@
import { parseTime } from '@/filter/code-filter';
import {
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew, getPdlAutoReportNewSearchLastGroup
} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import * as XLSX from 'xlsx';
@@ -165,11 +211,11 @@ import ButtonNav from '@/components/ButtonNav';
import { listData } from '@/api/system/dict/data';
// 表格列配置
const tableProps = [
// {
// prop: 'factoryName',
// label: '工厂',
// fixed: true
// },
{
prop: 'factoryName',
label: '工厂',
fixed: true
},
{
prop: 'lineName',
label: '产线',
@@ -368,15 +414,27 @@ export default {
productTableDataDay: [],
tableDataCustom: [],
list: [], // 折线图数据
timeTypeOptions: {
productLine: [ // 按产线监控(包含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
],
product: [ // 按产品监控(不含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' }
]
},
formConfig: [
{
type: 'select',
label: '时间维度',
selectOptions: [
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' }
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
],
width: 80,
width: 100,
onchange: true,
// defaultSelect: 1,
clearable: false,
@@ -437,6 +495,7 @@ export default {
{ id: 3, name: '月' },
{ id: 4, name: '年' }
],
onchange: true,
width: 80,
param: 'reportType'
},
@@ -467,6 +526,13 @@ export default {
productTableProps() {
// 当班数据的完整表头(基础列 + 当班动态表头)
const baseColumns = [
{
prop: 'sizes',
label: '规格',
width: 105,
showOverflowtooltip: true,
fixed: true
},
{
prop: 'process',
label: '产品工艺',
@@ -476,7 +542,8 @@ export default {
prop: 'processType',
label: '产品类型',
filter: (val) => (val != 1 ? '面板' : '背板'),
fixed: true
fixed: true,
sortable: true,
},
{
prop: 'factoryName',
@@ -513,13 +580,16 @@ export default {
this.$nextTick(() => {
if (this.$refs.buttonNav) {
this.$refs.buttonNav.currentMenu = '按产线监控';
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine;
}
if (this.$refs.searchBarForm) {
// this.$refs.searchBarForm.formInline.timeVal = [
// yesterday.getTime(),
// end.getTime()
// ];
this.$refs.searchBarForm.formInline.timeType = 1
}
});
@@ -576,18 +646,26 @@ export default {
// 3. 执行公共重置
resetCommon();
// if (this.activeName === 'productLine') {
// } else {
// }
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
if (isProductLine) {
// 按产线监控:显示产线,隐藏产品工艺和类型
// 按产线监控:显示产线,隐藏产品工艺和类型,时间维度包含上一班
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine; // 恢复上一班选项
this.formConfig[3].type = 'select'; // 显示产线
this.formConfig[4].type = ''; // 隐藏产品工艺
this.formConfig[5].type = ''; // 隐藏产品类型
this.getDayDataList();
} else {
// 按产品监控:显示产品工艺和类型,隐藏产线
// 按产品监控:显示产品工艺和类型,隐藏产线,时间维度移除上一班
this.formConfig[0].selectOptions = this.timeTypeOptions.product; // 不含上一班
this.formConfig[3].type = ''; // 隐藏产线
this.formConfig[4].type = 'select'; // 显示产品工艺
this.formConfig[5].type = 'select'; // 显示产品类型
this.getProductList();
}
},
@@ -601,6 +679,12 @@ export default {
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else if (this.listQuery.timeType === 1) {
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
this.exportMultipleTables([
{ ref: 'lineCurrentShiftTable', name: '产线监控_上一班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else {
// 产线-自定义:导出一个表格(自定义文件名)
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
@@ -801,31 +885,126 @@ export default {
this.formConfig[2].selectOptions = res.data.list || [];
});
},
getWeekTimeRange(date) {
const targetDate = new Date(date);
const day = targetDate.getDay() || 7; // 周日转为7
const year = targetDate.getFullYear();
const month = targetDate.getMonth();
const dateNum = targetDate.getDate();
// 本周一 00:00:00
const startDate = new Date(year, month, dateNum - day + 1);
startDate.setHours(0, 0, 0, 0);
// 本周日 23:59:59
const endDate = new Date(year, month, dateNum - day + 7);
endDate.setHours(23, 59, 59, 999);
return {
startTime: startDate.getTime(),
endTime: endDate.getTime()
};
},
// 辅助函数获取本年的开始和结束时间戳1月1日00:00:00 到 12月31日23:59:59
getYearTimeRange(date) {
const targetDate = new Date(date);
const year = targetDate.getFullYear();
// 本年1月1日 00:00:00
const startDate = new Date(year, 0, 1);
startDate.setHours(0, 0, 0, 0);
// 本年12月31日 23:59:59
const endDate = new Date(year, 11, 31);
endDate.setHours(23, 59, 59, 999);
return {
startTime: startDate.getTime(),
endTime: endDate.getTime()
};
},
// 搜索/导出按钮点击
buttonClick(val) {
if (this.activeName === 'productLine') {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
// 处理不同时间选择类型
if (val.timeVal) {
this.listQuery.startTime = val.timeVal[0];
this.listQuery.endTime = val.timeVal[1];
} else if (val.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(val.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (val.timeValMonth) {
// 月选择器
this.listQuery.startTime = val.timeValMonth[0];
this.listQuery.endTime = val.timeValMonth[1];
} else if (val.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(val.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
} else {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || []
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = undefined;
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
// 处理不同时间选择类型
if (val.timeVal) {
this.listQuery.startTime = val.timeVal[0];
this.listQuery.endTime = val.timeVal[1];
} else if (val.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(val.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (val.timeValMonth) {
// 月选择器
this.listQuery.startTime = val.timeValMonth[0];
this.listQuery.endTime = val.timeValMonth[1];
} else if (val.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(val.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
}
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
if (this.activeName === 'productLine') {
if (this.listQuery.timeType === 1) {
this.getDayDataList();
} else if (this.listQuery.timeType === 3) {
this.getLastDayDataList();
} else {
this.getDataList();
}
} else {
this.getProductList();
}
break;
case 'export':
@@ -834,6 +1013,9 @@ export default {
case 'reset':
this.$refs.searchBarForm.resetForm();
this.$refs.searchBarForm.formInline.timeType = 1;
this.formConfig[0].selectOptions = this.activeName === 'productLine'
? this.timeTypeOptions.productLine
: this.timeTypeOptions.product;
this.listQuery = {
pageSize: 100,
pageNo: 1,
@@ -842,12 +1024,9 @@ export default {
};
if (this.activeName === 'productLine') {
this.getDayDataList();
} else {
this.getProductList();
}
break;
default:
console.log(val);
@@ -1097,6 +1276,28 @@ export default {
return [...lineColumns, totalColumn];
},
// 为当天时调用的接口
getLastDayDataList() {
getPdlAutoReportNewSearchLastGroup().then((response) => {
this.tableData = response.data.classData.map((item, index) => {
item.originalLossNum = item.original?.lossNum;
item.originalLossArea = item.original?.lossArea;
item.edgeLossNum = item.edge?.lossNum;
item.edgeLossArea = item.edge?.lossArea;
item.drillLossNum = item.drill?.lossNum;
item.drillLossArea = item.drill?.lossArea;
item.coatingLossNum = item.coating?.lossNum;
item.coatingLossArea = item.coating?.lossArea;
item.silkLossNum = item.silk?.lossNum;
item.silkLossArea = item.silk?.lossArea;
item.temperingLossNum = item.tempering?.lossNum;
item.temperingLossArea = item.tempering?.lossArea;
item.packingLossNum = item.packing?.lossNum;
item.packingLossArea = item.packing?.lossArea;
return item;
});
// console.log(this.tableData, this.tableData2);
});
},
getDayDataList() {
getPdlAutoReportNewSearchNow().then((response) => {
this.tableData = response.data.classData.map((item, index) => {
@@ -1156,24 +1357,21 @@ export default {
console.log(value);
this.listQuery.timeType = value;
if (value === 1) {
// 切换为“当天”:隐藏查询类型、报表类型、时间范围
if (value === 2) {
// 切换为“自定义”:显示查询类型和时间范围
this.formConfig[1].type = 'select';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.formConfig[7].type = 'datePicker';
} else {
this.formConfig[1].type = '';
this.formConfig[6].type = '';
this.formConfig[7].type = '';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.$refs.searchBarForm.formInline.searchType = undefined;
this.$refs.searchBarForm.formInline.reportType = undefined;
this.$refs.searchBarForm.formInline.timeVal = undefined;
} else {
// 切换为“自定义”:显示查询类型和时间范围
this.formConfig[1].type = 'select';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.formConfig[7].type = 'datePicker';
}
} else if (param === 'searchType') {
if (value === 1) {
@@ -1187,7 +1385,74 @@ export default {
this.formConfig[7].type = 'datePicker';
}
} else if (param === 'reportType') {
this.$refs.searchBarForm.formInline.timeVal = undefined;
if (this.$refs.searchBarForm && this.$refs.searchBarForm.formInline) {
const formInline = this.$refs.searchBarForm.formInline;
// 精准判断只有字段存在时才置为undefined不存在则不处理
if ('timeVal' in formInline) {
formInline.timeVal = undefined;
}
if ('timeValWeek' in formInline) {
formInline.timeValWeek = undefined;
}
if ('timeValMonth' in formInline) {
formInline.timeValMonth = undefined;
}
if ('timeValYear' in formInline) {
formInline.timeValYear = undefined;
}
}
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
if (value === 1) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
};
} else if (value === 2) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'week',
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeValWeek',
width: 250,
};
} else if (value === 3) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'monthrange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeValMonth',
defaultTime: ['00:00:00', '23:59:59'],
width: 250,
};
} else if (value === 4) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'year',
placeholder: '选择年份',
format: 'yyyy',
valueFormat: 'timestamp',
param: 'timeValYear',
width: 250,
};
}
} else if (param === 'factoryId') {
// 切换工厂时刷新产线列表
this.listQuery.lineId = [];
@@ -1234,7 +1499,7 @@ export default {
.content-wrapper {
// flex: 1;
width: 100%;
height: calc(100vh - 303px);
height: calc(100vh - 280px);
// overflow: hidden;
}

View File

@@ -77,7 +77,7 @@ const tableProps = [
},
{
prop: 'palletNum',
label: '下片托数'
label: '一托玻璃数量/片'
},
{
prop: 'startTime',
@@ -92,7 +92,7 @@ const tableProps = [
width: 160
},
{
prop: 'outputNum',
prop: 'length',
label: '玻璃长度/mm'
},
{
@@ -314,9 +314,10 @@ export default {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.productId = val.productId ? val.productId : undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0]: undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1]: undefined;
this.listQuery.productionLineId = val.productionLineId ? val.productionLineId : undefined;
this.listQuery.thick = val.thick ? val.thick : undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
this.getDataList();

View File

@@ -77,7 +77,7 @@ const tableProps = [
},
{
prop: 'palletNum',
label: '下片托数'
label: '一托玻璃数量/片'
},
{
prop: 'startTime',
@@ -92,7 +92,7 @@ const tableProps = [
width: 160
},
{
prop: 'outputNum',
prop: 'length',
label: '玻璃长度/mm'
},
{

View File

@@ -262,6 +262,14 @@ export default {
tooltip: {
valueFormatter: (value) => `${value} %`,
},
label: {
show: true,
position: 'top',
distance: 6,
fontSize: 11,
color: '#333333',
formatter: (params) => `${params.value}` // 显示单位
},
data: this.barData.map((item) => item.processingRatio),
},
],

View File

@@ -34,7 +34,7 @@
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="210" />
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
@@ -57,7 +57,7 @@
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="210" />
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
@@ -71,22 +71,68 @@
</el-row>
</div>
</div>
<div class="content-inner" v-if="listQuery.timeType === 3">
<!-- 当班数据占1/2剩余高度 -->
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip">上一班数据</span>
<el-row style="margin-top: 10px;">
<el-col class="custom-tabs">
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
<barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px"
:bar-data="tableData" />
<div v-else class="no-data-bg"></div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
<!-- 当天数据占1/2剩余高度 -->
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip">当天数据</span>
<el-row style="margin-top: 10px;">
<el-col class="custom-tabs">
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
</el-tab-pane>
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
<barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px"
:bar-data="tableData2" />
<div v-else class="no-data-bg"></div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
</div>
<!-- 3.2 时间维度为自定义时的内容两个平分高度的div -->
<div class="content-inner" v-else>
<div class="content-inner" v-if="listQuery.timeType === 2">
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
<span>{{ reportTypeMap[listQuery.reportType] }}</span>
<span>
{{ parseTime(listQuery.startTime) }} {{
parseTime(listQuery.endTime) }}
parseTime(listQuery.endTime) }}
</span>
</span>
<span class="tip" v-else>生产表格数据 </span>
<div class="graph">
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="tableProps" :max-height="210" :table-data="tableDataCustom" />
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" />
</div>
</div>
@@ -113,7 +159,7 @@
<span class="tip">当班数据</span>
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
:max-height="210" />
:max-height="300" />
</div>
<!-- 当天数据占1/2剩余高度 -->
@@ -122,7 +168,7 @@
<span class="tip">当天数据</span>
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
:max-height="210" />
:max-height="300" />
</div>
</div>
</div>
@@ -142,7 +188,7 @@
</span>
<span class="tip" v-else>生产表格数据 </span>
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="210" />
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="300" />
</div>
</div>
</div>
@@ -154,7 +200,7 @@
import { parseTime } from '@/filter/code-filter';
import {
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew, getPdlAutoReportNewSearchLastGroup
} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import * as XLSX from 'xlsx';
@@ -165,11 +211,11 @@ import ButtonNav from '@/components/ButtonNav';
import { listData } from '@/api/system/dict/data';
// 表格列配置
const tableProps = [
// {
// prop: 'factoryName',
// label: '工厂',
// fixed: true
// },
{
prop: 'factoryName',
label: '工厂',
fixed: true
},
{
prop: 'lineName',
label: '产线',
@@ -368,15 +414,27 @@ export default {
productTableDataDay: [],
tableDataCustom: [],
list: [], // 折线图数据
timeTypeOptions: {
productLine: [ // 按产线监控(包含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
],
product: [ // 按产品监控(不含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' }
]
},
formConfig: [
{
type: 'select',
label: '时间维度',
selectOptions: [
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' }
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
],
width: 80,
width: 100,
onchange: true,
// defaultSelect: 1,
clearable: false,
@@ -438,6 +496,7 @@ export default {
{ id: 4, name: '年' }
],
width: 80,
onchange: true,
param: 'reportType'
},
{
@@ -513,17 +572,20 @@ export default {
this.$nextTick(() => {
if (this.$refs.buttonNav) {
this.$refs.buttonNav.currentMenu = '按产品监控';
this.formConfig[0].selectOptions = this.timeTypeOptions.product;
}
if (this.$refs.searchBarForm) {
// this.$refs.searchBarForm.formInline.timeVal = [
// yesterday.getTime(),
// end.getTime()
// ];
this.$refs.searchBarForm.formInline.timeType = 1
}
});
this.getProductList();
this.getDayDataList();
this.getPdLineList();
const queryParams = {
pageNo: 1,
@@ -579,15 +641,21 @@ export default {
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
if (isProductLine) {
// 按产线监控:显示产线,隐藏产品工艺和类型
// 按产线监控:显示产线,隐藏产品工艺和类型,时间维度包含上一班
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine; // 恢复上一班选项
this.formConfig[3].type = 'select'; // 显示产线
this.formConfig[4].type = ''; // 隐藏产品工艺
this.formConfig[5].type = ''; // 隐藏产品类型
this.getDayDataList();
} else {
// 按产品监控:显示产品工艺和类型,隐藏产线
// 按产品监控:显示产品工艺和类型,隐藏产线,时间维度移除上一班
this.formConfig[0].selectOptions = this.timeTypeOptions.product; // 不含上一班
this.formConfig[3].type = ''; // 隐藏产线
this.formConfig[4].type = 'select'; // 显示产品工艺
this.formConfig[5].type = 'select'; // 显示产品类型
this.getProductList();
}
},
@@ -596,48 +664,52 @@ export default {
// 按产线监控
if (this.activeName === 'productLine') {
if (this.listQuery.timeType === 1) {
// 产线-当天:导出当班 + 当天两个表格
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
this.exportMultipleTables([
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
]);
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else if (this.listQuery.timeType === 1) {
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
this.exportMultipleTables([
{ ref: 'lineCurrentShiftTable', name: '产线监控_上一班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else {
// 产线-自定义:导出一个表格
// 产线-自定义:导出一个表格(自定义文件名)
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
}
}
// 按产品监控
else {
if (this.listQuery.timeType === 1) {
// 产品-当天:导出当班 + 当天两个表格
// 产品-当天:导出当班 + 当天两个表格(自定义汇总文件名)
this.exportMultipleTables([
{ ref: 'productCurrentShiftTable', name: '产品监控_当班数据' },
{ ref: 'productTodayTable', name: '产品监控_当天数据' }
]);
], '产品监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else {
// 产品-自定义:导出一个表格
// 产品-自定义:导出一个表格(自定义文件名)
this.exportSingleTable('productCustomTable', '产品监控_自定义时间数据');
}
}
},
// 导出单个表格
// 导出单个表格(保持原有逻辑,文件名由调用方传入,已区分不同场景)
exportSingleTable(refName, fileName) {
const table = this.getTableDom(refName);
if (!table) return;
// 克隆表格并移除固定列
const clonedTable = table.cloneNode(true);
this.removeFixedColumns(clonedTable);
this.adjustTableForExport(clonedTable);
// 转换为工作簿并导出
const workbook = XLSX.utils.table_to_book(clonedTable);
const fullName = `${fileName}_${this.formatDate()}.xlsx`;
XLSX.writeFile(workbook, fullName);
},
// 导出多个表格(同一个Excel的不同sheet
exportMultipleTables(tables) {
// 导出多个表格(新增自定义汇总文件名参数,适配不同选项卡
exportMultipleTables(tables, customSummaryName) {
const workbook = XLSX.utils.book_new();
let hasValidTable = false;
@@ -646,11 +718,9 @@ export default {
if (!table) return;
hasValidTable = true;
// 克隆表格并移除固定列
const clonedTable = table.cloneNode(true);
this.removeFixedColumns(clonedTable);
this.adjustTableForExport(clonedTable);
// 转换为sheet并添加到工作簿
const worksheet = XLSX.utils.table_to_sheet(clonedTable);
XLSX.utils.book_append_sheet(workbook, worksheet, name);
});
@@ -660,31 +730,128 @@ export default {
return;
}
// 导出包含多个sheet的Excel
const fullName = `生产监控数据汇总_${this.formatDate()}.xlsx`;
// 动态生成汇总文件名:自定义名称 + 日期
const fullName = `${customSummaryName}_${this.formatDate()}.xlsx`;
XLSX.writeFile(workbook, fullName);
},
// 辅助方法获取表格DOM元素
// 辅助方法获取表格DOM元素包含表头
getTableDom(refName) {
const tableComponent = this.$refs[refName];
if (!tableComponent) {
this.$message.warning(`未找到${refName}表格`);
return null;
}
// 获取表格组件内部的el-table DOM
const tableDom = tableComponent.$el.querySelector('.el-table__body-wrapper table');
if (!tableDom) {
// 获取完整表格容器(包含表头和表体)
const tableContainer = tableComponent.$el.querySelector('.el-table');
if (!tableContainer) {
this.$message.warning(`${refName}表格数据为空`);
return null;
}
return tableDom;
return tableContainer;
},
// 辅助方法:移除固定列(避免重复导出
removeFixedColumns(table) {
const fixedColumns = table.querySelectorAll('.el-table__fixed, .el-table__fixed-right');
fixedColumns.forEach(col => col.remove());
// 重点修复:调整表格结构(解决表头重复问题
adjustTableForExport(tableContainer) {
// 1. 移除空表格提示和分页等无关元素
const emptyCells = tableContainer.querySelectorAll('.el-table__empty-block, .el-pagination');
emptyCells.forEach(cell => cell.remove());
// 2. 定位核心元素
const mainTable = tableContainer.querySelector('.el-table__body-wrapper table'); // 主表体
const fixedLeft = tableContainer.querySelector('.el-table__fixed'); // 左固定列容器
const fixedRight = tableContainer.querySelector('.el-table__fixed-right'); // 右固定列容器
// 3. 提取所有表头行(支持多级表头,按层级收集)
const allHeaderRows = []; // 存储所有层级的表头行(每行是一个单元格数组)
// 辅助函数:提取某个容器内的所有表头行(处理多级表头)
const extractHeaderRows = (container) => {
const headerWrapper = container?.querySelector('.el-table__header-wrapper table');
if (!headerWrapper) return [];
const thead = headerWrapper.querySelector('thead');
if (!thead) return [];
// 多级表头可能有多个tr
const headerRows = Array.from(thead.querySelectorAll('tr'));
return headerRows.map(row => Array.from(row.querySelectorAll('th'))); // 每行的单元格数组
};
// 收集左固定列的表头行(可能有多层)
const fixedLeftHeaderRows = extractHeaderRows(fixedLeft);
// 收集主表头的表头行(可能有多层)
const mainHeaderRows = extractHeaderRows(tableContainer);
// 收集右固定列的表头行(可能有多层)
const fixedRightHeaderRows = extractHeaderRows(fixedRight);
// 4. 合并表头行(按层级对齐,左固定列 → 主表头 → 右固定列)
// 确定最大表头层级(多级表头的行数)
const maxLevel = Math.max(
fixedLeftHeaderRows.length,
mainHeaderRows.length,
fixedRightHeaderRows.length
);
// 按层级合并每行的单元格
for (let i = 0; i < maxLevel; i++) {
const rowCells = [];
// 左固定列当前层级的单元格(不足则补空)
rowCells.push(...(fixedLeftHeaderRows[i] || []));
// 主表头当前层级的单元格(不足则补空)
rowCells.push(...(mainHeaderRows[i] || []));
// 右固定列当前层级的单元格(不足则补空)
rowCells.push(...(fixedRightHeaderRows[i] || []));
allHeaderRows.push(rowCells);
}
// 5. 清理所有原有表头和固定列容器(避免干扰)
tableContainer.querySelectorAll('thead').forEach(thead => thead.remove());
tableContainer.querySelectorAll('.el-table__header-wrapper').forEach(wrapper => wrapper.remove());
[fixedLeft, fixedRight].forEach(container => container?.remove());
// 6. 构建唯一表头并添加到主表体(支持多级表头)
if (mainTable && allHeaderRows.length > 0) {
const newThead = document.createElement('thead');
// 按层级添加表头行
allHeaderRows.forEach(cells => {
const newTr = document.createElement('tr');
cells.forEach(cell => {
// 复制单元格避免DOM残留引用问题
const clonedCell = cell.cloneNode(true);
newTr.appendChild(clonedCell);
});
newThead.appendChild(newTr);
});
// 将新表头插入主表体最前面
mainTable.insertBefore(newThead, mainTable.firstChild);
}
// 7. 合并固定列数据到主表体仅处理tbody数据
// 合并左固定列数据
if (fixedLeft && mainTable) {
const fixedLeftRows = fixedLeft.querySelectorAll('.el-table__body-wrapper tbody tr');
const mainRows = mainTable.querySelectorAll('tbody tr');
fixedLeftRows.forEach((fixedRow, index) => {
if (mainRows[index]) {
const fixedCells = Array.from(fixedRow.querySelectorAll('td'));
fixedCells.forEach(cell => {
mainRows[index].insertBefore(cell.cloneNode(true), mainRows[index].firstChild);
});
}
});
}
// 合并右固定列数据
if (fixedRight && mainTable) {
const fixedRightRows = fixedRight.querySelectorAll('.el-table__body-wrapper tbody tr');
const mainRows = mainTable.querySelectorAll('tbody tr');
fixedRightRows.forEach((fixedRow, index) => {
if (mainRows[index]) {
const fixedCells = Array.from(fixedRow.querySelectorAll('td'));
fixedCells.forEach(cell => {
mainRows[index].appendChild(cell.cloneNode(true));
});
}
});
}
},
// 辅助方法:格式化日期(用于文件名)
@@ -698,7 +865,6 @@ export default {
String(date.getMinutes()).padStart(2, '0')
].join('');
},
// 获取产线和工厂列表
getPdLineList() {
getPdList().then(res => {
@@ -712,28 +878,85 @@ export default {
// 搜索/导出按钮点击
buttonClick(val) {
if (this.activeName === 'productLine') {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
// 处理不同时间选择类型
if (val.timeVal) {
this.listQuery.startTime = val.timeVal[0];
this.listQuery.endTime = val.timeVal[1];
} else if (val.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(val.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (val.timeValMonth) {
// 月选择器
this.listQuery.startTime = val.timeValMonth[0];
this.listQuery.endTime = val.timeValMonth[1];
} else if (val.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(val.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
} else {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || []
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = undefined;
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
// 处理不同时间选择类型
if (val.timeVal) {
this.listQuery.startTime = val.timeVal[0];
this.listQuery.endTime = val.timeVal[1];
} else if (val.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(val.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (val.timeValMonth) {
// 月选择器
this.listQuery.startTime = val.timeValMonth[0];
this.listQuery.endTime = val.timeValMonth[1];
} else if (val.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(val.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
}
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.process = val.process ? val.process : [];
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.processType = val.processType ? val.processType : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.timeType = val.timeType || undefined;
this.listQuery.searchType = val.searchType || undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
if (this.activeName === 'productLine') {
if (this.listQuery.timeType === 1) {
this.getDayDataList();
} else if (this.listQuery.timeType === 3) {
this.getLastDayDataList();
} else {
this.getDataList();
}
} else {
this.getProductList();
this.getProductList();
}
break;
case 'export':
@@ -742,6 +965,9 @@ export default {
case 'reset':
this.$refs.searchBarForm.resetForm();
this.$refs.searchBarForm.formInline.timeType = 1;
this.formConfig[0].selectOptions = this.activeName === 'productLine'
? this.timeTypeOptions.productLine
: this.timeTypeOptions.product;
this.listQuery = {
pageSize: 100,
pageNo: 1,
@@ -750,12 +976,9 @@ export default {
};
if (this.activeName === 'productLine') {
this.getDayDataList();
} else {
this.getProductList();
}
break;
default:
console.log(val);
@@ -763,8 +986,8 @@ export default {
},
getDataList() {
if(!this.listQuery.startTime &&!this.listQuery.endTime ){
return this.$modal.msgError('请选择时间');
if (!this.listQuery.startTime && !this.listQuery.endTime) {
return this.$modal.msgError('请选择时间');
}
this.dataListLoading = true;
// const arr = ['日', '周', '月', '年'];
@@ -798,7 +1021,7 @@ export default {
console.log('resGroup');
if (this.listQuery.timeType === 2) {
const resGroup = await getProcessAutoReportNew(this.listQuery);
console.log('resGroup',resGroup);
console.log('resGroup', resGroup);
// 格式化数据lineDetList提取到外层键名加lineId前缀
const formatData = (rawList) => {
@@ -827,7 +1050,7 @@ export default {
// 处理当班和当天数据(分别存储)
this.productTableData = formatData(resGroup.data.list); // 当班数据
console.log(this.productTableData,'productTableData');
console.log(this.productTableData, 'productTableData');
// --------------------------
// 生成当班数据的动态表头
@@ -1005,6 +1228,28 @@ export default {
return [...lineColumns, totalColumn];
},
// 为当天时调用的接口
getLastDayDataList() {
getPdlAutoReportNewSearchLastGroup().then((response) => {
this.tableData = response.data.classData.map((item, index) => {
item.originalLossNum = item.original?.lossNum;
item.originalLossArea = item.original?.lossArea;
item.edgeLossNum = item.edge?.lossNum;
item.edgeLossArea = item.edge?.lossArea;
item.drillLossNum = item.drill?.lossNum;
item.drillLossArea = item.drill?.lossArea;
item.coatingLossNum = item.coating?.lossNum;
item.coatingLossArea = item.coating?.lossArea;
item.silkLossNum = item.silk?.lossNum;
item.silkLossArea = item.silk?.lossArea;
item.temperingLossNum = item.tempering?.lossNum;
item.temperingLossArea = item.tempering?.lossArea;
item.packingLossNum = item.packing?.lossNum;
item.packingLossArea = item.packing?.lossArea;
return item;
});
// console.log(this.tableData, this.tableData2);
});
},
getDayDataList() {
getPdlAutoReportNewSearchNow().then((response) => {
this.tableData = response.data.classData.map((item, index) => {
@@ -1060,28 +1305,26 @@ export default {
// 搜索栏下拉选择变化
handleSearchBarChanged({ param, value }) {
console.log(value, param);
if (param === 'timeType') {
console.log(value);
this.listQuery.timeType = value;
if (value === 1) {
// 切换为“当天”:隐藏查询类型、报表类型、时间范围
if (value === 2) {
// 切换为“自定义”:显示查询类型和时间范围
this.formConfig[1].type = 'select';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.formConfig[7].type = 'datePicker';
} else {
this.formConfig[1].type = '';
this.formConfig[6].type = '';
this.formConfig[7].type = '';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.$refs.searchBarForm.formInline.searchType = undefined;
this.$refs.searchBarForm.formInline.reportType = undefined;
this.$refs.searchBarForm.formInline.timeVal = undefined;
} else {
// 切换为“自定义”:显示查询类型和时间范围
this.formConfig[1].type = 'select';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.formConfig[7].type = 'datePicker';
}
} else if (param === 'searchType') {
if (value === 1) {
@@ -1095,7 +1338,74 @@ export default {
this.formConfig[7].type = 'datePicker';
}
} else if (param === 'reportType') {
this.$refs.searchBarForm.formInline.timeVal = undefined;
if (this.$refs.searchBarForm && this.$refs.searchBarForm.formInline) {
const formInline = this.$refs.searchBarForm.formInline;
// 精准判断只有字段存在时才置为undefined不存在则不处理
if ('timeVal' in formInline) {
formInline.timeVal = undefined;
}
if ('timeValWeek' in formInline) {
formInline.timeValWeek = undefined;
}
if ('timeValMonth' in formInline) {
formInline.timeValMonth = undefined;
}
if ('timeValYear' in formInline) {
formInline.timeValYear = undefined;
}
}
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
if (value === 1) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
};
} else if (value === 2) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'week',
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeValWeek',
width: 250,
};
} else if (value === 3) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'monthrange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeValMonth',
defaultTime: ['00:00:00', '23:59:59'],
width: 250,
};
} else if (value === 4) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'year',
placeholder: '选择年份',
format: 'yyyy',
valueFormat: 'timestamp',
param: 'timeValYear',
width: 250,
};
}
} else if (param === 'factoryId') {
// 切换工厂时刷新产线列表
this.listQuery.lineId = [];
@@ -1142,7 +1452,7 @@ export default {
.content-wrapper {
// flex: 1;
width: 100%;
height: calc(100vh - 303px);
height: calc(100vh - 280px);
// overflow: hidden;
}

View File

@@ -1,14 +1,8 @@
<!--
* @Author: Do not edit
* @Date: 2023-08-29 14:59:29
* @LastEditTime: 2024-12-02 13:44:47
* @LastEditors: zwq
* @Description:
-->
<template>
<div class="app-container">
<!-- :isFold="true" 控制展开 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick"
@select-changed="selectType" />
<base-table v-if="tableData.length" class="right-aside" v-loading="dataListLoading" :table-props="tableProps"
:page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@@ -17,34 +11,47 @@
<div v-else class="no-data-bg"></div>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@pagination="getDataList" />
<!-- <el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-button type="primary" @click="exportXlsx">xlsx</el-button>
<el-button type="success" @click="exportPdf">pdf</el-button>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog> -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
</div>
</template>
<script>
import Vue from 'vue';
import AddOrUpdate from './add-or-updata';
import { parseTime } from '../../mixins/code-filter';
import { getCostOriginRadioHisData, getPdList } from '@/api/core/monitoring/index'
import * as XLSX from 'xlsx'
import FileSaver from 'file-saver'
import jsPDF from 'jspdf'
import html2canvas from 'html2canvas'
import { getCostOriginRadioHisData, getPdList } from '@/api/core/monitoring/index';
import { exportCostOriginRadioHisData } from '../../../../api/core/monitoring';
const tableProps = [
// Vue2 中注册全局方法(如果需要)
Vue.prototype.$download = Vue.prototype.$download || {
excel: (response, fileName) => {
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' });
const url = window.URL.createObjectURL(blob);
const aLink = document.createElement('a');
aLink.style.display = 'none';
aLink.href = url;
aLink.setAttribute('download', fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink);
window.URL.revokeObjectURL(url);
}
};
Vue.prototype.$modal = Vue.prototype.$modal || {
confirm: (message) => {
return new Promise((resolve, reject) => {
if (window.confirm(message)) {
resolve();
} else {
reject();
}
});
}
};
const tableProps = [
{
prop: 'reportType',
label: '报表类型'
@@ -52,12 +59,11 @@ const tableProps = [
{
prop: 'time',
label: '日期',
// filter: parseTime,
width: 160
},
{
{
prop: 'bindObjectName',
label: '产线'
label: '产线'
},
{
prop: 'thick',
@@ -67,11 +73,11 @@ const tableProps = [
prop: 'speed',
label: '在线速度'
},
{
{
prop: 'width',
label: '掰边宽度'
},
{
},
{
prop: 'inArea',
label: '拉引量/㎡'
},
@@ -79,21 +85,83 @@ const tableProps = [
prop: 'outArea',
label: '下片面积/㎡'
},
{
{
prop: 'ratio',
label: '良品率'
},
label: '良品率/%'
},
];
/**
* 工具函数获取选择时间所在周的起始和结束时间Vue2 兼容)
* @param {String|Date} selectTime - 选择的时间支持格式yyyy-MM-dd、yyyy-MM-dd HH:mm:ss 或 Date 对象)
* @returns {Array} [startDate, endDate] - 所在周周一 00:00:00 至 周日 23:59:59Date 对象)
*/
function getSelectedWeekRange(selectTime) {
// 兼容 String 类型时间和 Date 对象,统一转为 Date 实例
const targetDate = new Date(selectTime);
// 处理无效日期(若传入非法时间,返回当前时间的本周范围)
// if (isNaN(targetDate.getTime())) {
// console.warn('传入的时间格式无效,将使用当前时间计算本周范围');
// return getCurrentWeekRange(); // 可根据需求改为抛出错误或返回空
// }
const day = targetDate.getDay() || 7; // 周日为 7避免周日 -0 天仍为周日)
const start = new Date(targetDate);
start.setDate(targetDate.getDate() - day + 1); // 计算所在周的周一
start.setHours(0, 0, 0, 0); // 重置时分秒为 00:00:00.000
const end = new Date(start);
end.setDate(start.getDate() + 6); // 周一 +6 天 = 周日
end.setHours(23, 59, 59, 999); // 重置时分秒为 23:59:59.999
return [start, end];
}
/**
* 工具函数获取选择时间所在年的起始和结束时间Vue2 兼容)
* @param {String|Date} selectTime - 选择的时间支持格式yyyy-MM-dd、yyyy-MM-dd HH:mm:ss 或 Date 对象)
* @returns {Array} [startDate, endDate] - 所在年 1月1日 00:00:00 至 12月31日 23:59:59Date 对象)
*/
function getSelectedYearRange(selectTime) {
// 兼容 String 类型时间和 Date 对象,统一转为 Date 实例
const targetDate = new Date(selectTime);
// 处理无效日期(若传入非法时间,返回当前时间的本年范围)
// if (isNaN(targetDate.getTime())) {
// console.warn('传入的时间格式无效,将使用当前时间计算本年范围');
// return getCurrentYearRange(); // 可根据需求改为抛出错误或返回空
// }
const year = targetDate.getFullYear(); // 获取选择时间的年份
const start = new Date(year, 0, 1); // 所在年 1月1日月份从 0 开始)
start.setHours(0, 0, 0, 0); // 重置时分秒为 00:00:00.000
const end = new Date(year, 11, 31); // 所在年 12月31日11 代表 12 月)
end.setHours(23, 59, 59, 999); // 重置时分秒为 23:59:59.999
return [start, end];
}
// 格式化时间为 yyyy-MM-dd HH:mm:ssVue2 兼容)
function formatDateTime(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
export default {
components: {
AddOrUpdate
},
data() {
return {
urlOptions: {
getDataListURL: getCostOriginRadioHisData
},
data() {
return {
urlOptions: {
getDataListURL: getCostOriginRadioHisData
},
tableData: [],
listQuery: {
pageSize: 10,
@@ -101,181 +169,366 @@ export default {
total: 1,
bindObjectId: undefined,
statisticType: undefined,
startTime: undefined,
endTime: undefined
},
pdLineList:[],
pdLineList: [],
exportLoading: false,
dataListLoading: false,
selectedList: [],
dialogVisible: false,
selectedList: [],
dialogVisible: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
tableProps,
tableProps,
tableBtn: [
{
type: 'edit',
btnName: '编辑',
},
].filter((v) => v),
tableData: [],
fileName: '',
].filter(v => v),
fileName: '',
formConfig: [
{
type: 'select',
label: '维度',
label: '报表类型',
onchange: true,
selectOptions: [
{
id: '0',
name:'班组'
},
{
id: '1',
name: '日'
},
{
id: '2',
name: '周'
},
{
id: '3',
name: '月'
},
{
id: '4',
name: '年'
}
{ id: '0', name: '班组' },
{ id: '1', name: '日' },
{ id: '2', name: '周' },
{ id: '3', name: '月' },
{ id: '4', name: '年' }
],
param: 'statisticType'
param: 'statisticType',
index: 1,
extraOptions: [
{
parent: 'statisticType',
type: 'datePicker',
label: '统计时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultTime: ['00:00:00', '23:59:59'],
defaultSelect: [],
width: 250,
key: 'datePicker-0', // 唯一 key触发重新渲染
appendToBody: true // 优化定位:挂载到 body 下
},
// 日 - 日期范围选择
{
parent: 'statisticType',
type: 'datePicker',
label: '统计时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeValDay',
defaultTime: ['00:00:00', '23:59:59'],
defaultSelect: [],
width: 250,
key: 'datePicker-1', // 唯一 key触发重新渲染
appendToBody: true // 优化定位:挂载到 body 下
},
// 周 - 单个日期选择(自动获取本周范围)
{
parent: 'statisticType',
type: 'datePicker',
label: '统计时间',
dateType: 'week',
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeValWeek',
width: 250,
key: 'datePicker-2', // 唯一 key触发重新渲染
appendToBody: true // 优化定位:挂载到 body 下
},
// 月 - 日期范围选择
{
parent: 'statisticType',
type: 'datePicker',
label: '统计时间',
dateType: 'monthrange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeValMonth',
defaultTime: ['00:00:00', '23:59:59'],
width: 250,
key: 'datePicker-3', // 唯一 key触发重新渲染
appendToBody: true // 优化定位:挂载到 body 下
},
// 年 - 单个日期选择(自动获取本年范围)
{
parent: 'statisticType',
type: 'datePicker',
label: '统计时间',
dateType: 'year',
placeholder: '选择年份',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeValYear',
width: 250,
key: 'datePicker-4', // 唯一 key触发重新渲染
appendToBody: true // 优化定位:挂载到 body 下
}
]
},
{
type: 'select',
label: '产线',
selectOptions: [],
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'bindObjectId'
},
{
type: 'datePicker',
label: '统计开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd HH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultTime: ['00:00:00', '23:59:59'],
defaultSelect: []
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}
],
};
},
{
type: 'separate',
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}
],
};
},
watch: {
// 监听报表类型变化,强制刷新日期选择器
'listQuery.statisticType'(newVal, oldVal) {
if (newVal !== oldVal && this.$refs.searchBarForm) {
// 触发 search-bar 组件重新渲染(如果 search-bar 支持)
if (this.$refs.searchBarForm.$forceUpdate) {
this.$refs.searchBarForm.$forceUpdate();
}
// 延迟重置定位,确保 DOM 已更新
setTimeout(() => {
const datePickerEl = this.$refs.searchBarForm.$el.querySelector('.el-date-picker');
if (datePickerEl) {
// 触发 Element UI 日期选择器重新计算定位(内部方法)
const datePickerInstance = datePickerEl.__vue__;
if (datePickerInstance && datePickerInstance.updatePopper) {
datePickerInstance.updatePopper();
}
}
}, 100);
}
}
},
mounted() {
this.$refs.searchBarForm.formInline.statisticType = '1';
// Vue2 中 $refs 需在 $nextTick 中访问(确保 DOM 渲染完成)
this.$nextTick(() => {
if (this.$refs.searchBarForm) {
this.$refs.searchBarForm.formInline.statisticType = '1';
}
});
this.listQuery.statisticType = '1';
this.getDataList()
this.getPdLineList()
},
this.getDataList();
this.getPdLineList();
},
methods: {
selectType(val) {
// 报表类型切换时的回调(如需扩展可在此添加逻辑)
console.log('报表类型切换:', val);
},
handleClick(val) {
console.log(val);
console.log('操作按钮点击:', val);
if (val.type === 'edit') {
this.addOrUpdateVisible= true
this.addOrUpdateVisible = true;
// Vue2 中 $nextTick 确保子组件已渲染
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data);
});
}
},
getPdLineList() {
getPdList().then((res) => {
this.formConfig[1].selectOptions = res.data || []
this.pdLineList = res.data || []; // 保存产线数据
})
},
selectChange(val) {
console.log(val)
this.selectedList = val
},
buttonClick(val) {
console.log('val', val);
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.bindObjectId = val.bindObjectId ? val.bindObjectId : undefined;
this.listQuery.statisticType = val.statisticType ? val.statisticType : undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0]: undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1]: undefined;
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
const arr = ['班组','日', '周', '月', '年'];
this.tableData = response.data?.list?.map((item) => {
item.reportType = arr[this.listQuery.statisticType];
item.statisticType = this.listQuery.statisticType
// 匹配 bindObjectName
const targetLine = this.pdLineList.find(line => line.id === item.bindObjectId);
item.bindObjectName = targetLine ? targetLine.name : ''; // 赋值名称,无匹配则为空
return item;
});
this.listQuery.total = response.data.total;
this.dataListLoading = false;
getPdLineList() {
getPdList().then(res => {
// Vue2 中数组赋值需确保响应式
this.$set(this.formConfig[1], 'selectOptions', res.data || []);
this.pdLineList = res.data || [];
}).catch(err => {
console.error('获取产线列表失败:', err);
});
},
// 每页数
selectChange(val) {
console.log('选择变更:', val);
this.selectedList = val;
},
buttonClick(val) {
console.log('头部按钮点击:', val);
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.bindObjectId = val.bindObjectId ? val.bindObjectId : undefined;
this.listQuery.statisticType = val.statisticType ? val.statisticType : undefined;
// 处理不同时间维度的时间范围
this.handleTimeRange(val);
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log('未知按钮:', val);
}
},
// 处理不同时间维度的时间范围
handleTimeRange(val) {
const statisticType = val.statisticType;
const timeVal = val.timeVal;
const timeValDay = val.timeValDay;
const timeValWeek = val.timeValWeek;
const timeValMonth = val.timeValMonth;
const timeValYear = val.timeValYear;
// 重置时间参数
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
switch (statisticType) {
case '0': // 班组 - 沿用原时间范围
if (timeVal && timeVal.length === 2) {
this.listQuery.startTime = timeVal[0];
this.listQuery.endTime = timeVal[1];
}
break;
case '1': // 日 - 沿用原时间范围
if (timeValDay && timeValDay.length === 2) {
this.listQuery.startTime = timeValDay[0];
this.listQuery.endTime = timeValDay[1];
}
break;
case '3': // 月 - 沿用原时间范围
if (timeValMonth && timeValMonth.length === 2) {
this.listQuery.startTime = timeValMonth[0];
this.listQuery.endTime = timeValMonth[1];
}
break;
case '2': // 周 - 自动计算本周范围
if (timeValWeek) {
const [start, end] = getSelectedWeekRange(timeValWeek);
this.listQuery.startTime = formatDateTime(start);
this.listQuery.endTime = formatDateTime(end);
}
break;
case '4': // 年 - 自动计算本年范围
if (timeValYear) {
const [start, end] = getSelectedYearRange(timeValYear);
this.listQuery.startTime = formatDateTime(start);
this.listQuery.endTime = formatDateTime(end);
}
break;
}
},
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery)
.then(response => {
const arr = ['班组', '日', '周', '月', '年'];
// Vue2 中数组赋值确保响应式
this.tableData = (response.data?.list || []).map(item => {
item.reportType = arr[this.listQuery.statisticType] || '';
item.statisticType = this.listQuery.statisticType;
// 匹配产线名称
const targetLine = this.pdLineList.find(line => line.id === item.bindObjectId);
item.bindObjectName = targetLine ? targetLine.name : '';
return item;
});
this.listQuery.total = response.data?.total || 0;
})
.catch(err => {
console.error('获取数据失败:', err);
this.tableData = [];
this.listQuery.total = 0;
})
.finally(() => {
this.dataListLoading = false;
});
},
// 每页数变更
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
// 当前页变更
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 导出处理
handleExport() {
// 处理查询参数
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出原片报表?').then(() => {
this.exportLoading = true;
return exportCostOriginRadioHisData(params);
}).then(response => {
this.$download.excel(response, '原片报表.xls');
this.exportLoading = false;
}).catch(() => { });
const params = { ...this.listQuery };
// 移除分页参数
delete params.pageNo;
delete params.pageSize;
delete params.total;
this.$modal.confirm('是否确认导出原片报表?')
.then(() => {
this.exportLoading = true;
return exportCostOriginRadioHisData(params);
})
.then(response => {
this.$download.excel(response, '原片报表.xls');
})
.catch(err => {
console.error('导出失败:', err);
})
.finally(() => {
this.exportLoading = false;
});
}
},
},
// Vue2 中监听数据变化(如需)
watch: {
'listQuery.statisticType'(newVal) {
console.log('报表类型变更:', newVal);
// 可添加类型变更后的额外逻辑
}
}
};
</script>
<style scoped>
.app-container {
padding: 16px;
}
.no-data-bg {
height: 400px;
background-color: #f5f7fa;
display: flex;
align-items: center;
justify-content: center;
color: #999;
}
.right-aside {
margin-bottom: 16px;
}
</style>

View File

@@ -0,0 +1,274 @@
<template>
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
<el-form :inline="true" ref="searchBarForm" :model="formInline" class="searchBar">
<span class="blue-block" v-if="removeBlue ? false : true"></span>
<template v-for="item in formConfig">
<el-form-item v-if="item.type !== ''" :key="item.param" :label="item.label ? item.label : ''"
:required="item.required ? item.required : false">
<el-input v-if="item.type === 'input'" v-model="formInline[item.param]"
:size="item.size ? item.size : 'small'" clearable :disabled="item.disabled ? item.disabled : false"
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'"
:placeholder="item.placeholder ? item.placeholder : ''" />
<el-select v-if="item.type === 'select'" v-model="formInline[item.param]"
:size="item.size ? item.size : 'small'" :filterable="item.filterable ? item.filterable : false"
:multiple="item.multiple ? item.multiple : false" :clearable="item.clearable === false ? false : true"
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" :placeholder="item.label" @change="
item.onchange
? $emit('select-changed', {
param: item.param,
value: formInline[item.param]
})
: null
">
<el-option v-for="(sub, i) in item.selectOptions" :key="i"
:label="item.labelField ? sub[item.labelField] : sub['name']"
:value="item.valueField ? sub[item.valueField] : sub['id']" />
</el-select>
<el-date-picker v-if="item.type === 'datePicker'" :key="item.param" :size="item.size ? item.size : 'small'"
v-model="formInline[item.param]" :type="item.dateType" :format="item.format ? item.format : 'yyyy-MM-dd'"
:value-format="item.valueFormat ? item.valueFormat : null" :default-time="item.defaultTime || null"
:range-separator="item.rangeSeparator || null" :start-placeholder="item.startPlaceholder || null"
:end-placeholder="item.endPlaceholder || null" :placeholder="item.placeholder"
:picker-options="item.pickerOptions ? item.pickerOptions : null"
:clearable="item.clearable === false ? false : true"
:style="item.width ? 'width:' + item.width + 'px' : (item.dateType === 'datetimerange' ? 'width:340px' : (item.dateType === 'daterange' ? 'width:220px' : 'width:140px'))" />
<el-autocomplete v-if="item.type === 'autocomplete'" v-model="formInline[item.param]"
:value-key="item.valueKey ? item.valueKey : 'value'" :size="item.size ? item.size : 'small'"
:fetch-suggestions="item.querySearch" :placeholder="item.placeholder"
:clearable="item.clearable === false ? false : true"
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" filterable />
<el-cascader v-if="item.type === 'cascader'" v-model="formInline[item.param]" :options="item.selectOptions"
:props="item.cascaderProps" :size="item.size ? item.size : 'small'"
:clearable="item.clearable === false ? false : true"
:show-all-levels="item.showAllLevels === false ? false : true"
:collapse-tags="item.collapseTags === true ? true : false"
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" @change="
item.onChange
? $emit('cascader-change', {
param: item.param,
value: formInline[item.param]
})
: null
"></el-cascader>
<el-button v-if="item.type === 'button'" :type="item.color" :size="item.size ? item.size : 'small'"
:plain="item.plain ? item.plain : false" :round="item.round ? item.round : false"
@click="headBtnClick(item.name)">{{ item.btnName }}</el-button>
<span v-if="item.type === 'separate'" class="separateStyle"></span>
<!-- 可用于显示其他按钮 -->
</el-form-item>
</template>
<el-form-item>
<slot></slot>
</el-form-item>
</el-form>
<span v-if="isFold" class="foldClass" @click='switchMode'>
{{ isExpand ? '收起' : '展开' }}
<i class="iconfont" :class="isExpand ? 'icon-upward' : 'icon-downward'"></i>
</span>
</div>
</template>
<script>
export default {
name: 'SearchBar',
props: {
formConfigs: {
type: Array,
default: () => {
return []
}
},
removeBlue: {
type: Boolean,
default: false
},
isFold: {// 多行模式(默认否)
type: Boolean,
default: false
}
},
data() {
const formInline = {}
const formConfig = this.formConfigs
let hasExtraOptions = false
for (const obj of formConfig) {
if (obj.type !== 'button') {
if (obj.defaultSelect === false || obj.defaultSelect === 0) {
formInline[obj.param] = obj.defaultSelect
} else {
formInline[obj.param] = obj.defaultSelect || '' // defaultSelect下拉框默认选中项
}
}
if (obj.extraOptions) {
hasExtraOptions = true
}
}
return {
formInline,
formConfig,
hasExtraOptions,
isExpand: false // 是否展开(默认否)
}
},
watch: {
formConfig: {
handler() {
for (const obj of this.formConfig) {
if (obj.defaultSelect) {
this.formInline[obj.param] = obj.defaultSelect
} else if (obj.defaultSelect === null) {
// 需要手动从外部清除选项缓存的情况确保在外部配置项中可直接设置null
this.formInline[obj.param] = ''
}
}
},
deep: true,
immediate: true
},
formInline: {
handler: function () {
this.$forceUpdate()
},
deep: true,
immediate: true
}
},
mounted() {
this.$nextTick(() => {
this.init()
})
},
methods: {
init() {
if (this.hasExtraOptions) {
// 如果有额外参数就处理,如果没有就算了
for (const obj of this.formConfig) {
if (obj.extraOptions) {
// 注: 对obj.extraOptions的选择是互斥的!
this.$watch(
`formInline.${obj.param}`,
function (newVal) {
let deleteCount = 0
if (obj.index + 1 < this.formConfig.length) {
// 如果obj不是最后一个配置
const nextConfig = this.formConfig[obj.index + 1]
if (nextConfig.parent && nextConfig.parent === obj.param)
deleteCount = 1
}
const currentConfig = Object.assign(
{},
obj.extraOptions[newVal]
)
this.formConfig.splice(
obj.index + 1,
deleteCount,
currentConfig
)
// 修改 formInline
this.$set(this.formInline, currentConfig.param, '')
},
{ immediate: true }
)
}
}
}
},
headBtnClick(btnName) {
this.formInline.btnName = btnName
this.$emit('headBtnClick', this.formInline)
},
resetForm() {
this.$refs.searchBarForm.resetFields()
const formInline = {}
const formConfig = this.formConfigs
for (const obj of formConfig) {
if (obj.type !== 'button') {
if (obj.defaultSelect === false || obj.defaultSelect === 0) {
formInline[obj.param] = obj.defaultSelect
} else {
formInline[obj.param] = obj.defaultSelect || '' // defaultSelect下拉框默认选中项
}
}
}
this.formInline = formInline
},
switchMode() {// 展开和收起切换
this.isExpand = !this.isExpand
const element = this.$refs.searchBarRef
if (this.isExpand) {
element.classList.remove('divHeight')
} else {
element.classList.add('divHeight')
}
}
}
}
</script>
<style>
.searchBarBox {
width: 100%;
position: relative;
margin-bottom: 8px;
}
.searchBarBox::after {
content: "";
display: block;
clear: both;
}
.divHeight {
height: 45px;
overflow: hidden;
}
.searchBar .blue-block {
display: inline-block;
float: left;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 12px;
}
.searchBar .el-form-item {
margin-bottom: 4px;
}
.searchBar .el-date-editor .el-range__icon {
font-size: 16px;
color: #0B58FF;
}
.searchBar .el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
}
.searchBar .el-input__prefix .el-icon-time {
font-size: 16px;
color: #0B58FF;
}
.searchBar .separateStyle {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
vertical-align: middle;
}
.searchBarBox .foldClass {
position: absolute;
top: 14px;
right: 0;
cursor: pointer;
font-size: 12px;
color: #0B58FF;
}
.searchBarBox .foldClass .iconfont {
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// 取值范围: xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@@ -0,0 +1,134 @@
<template>
<el-dialog :visible.sync="visible" width="40%">
<small-title slot="title" :no-padding="true">
{{ this.dataForm.lineId + '·' + this.dataForm.equipmentName }}
</small-title>
<div class="content">
<div class="visual-part">
<base-table :table-props="tableProps"
:page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
</div>
</div>
<!-- <div slot="footer" class="dialog-footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">
确定
</el-button>
</div> -->
</el-dialog>
</template>
<script>
const tableProps = [
{
prop: 'paramName',
label: '参数名称'
},
{
prop: 'paramValue',
label: '当前值',
// filter: parseTime,
// width: 160
},
];
import { getParamMonitor } from '@/api/base/equipment';
// import { parseTime } from '../../mixins/code-filter';
import SmallTitle from './SmallTitle';
export default {
components: { SmallTitle },
data() {
return {
visible: false,
tableProps,
tableData:[],
listQuery: {
pageNo: 1,
pageSize:100,
},
addOrUpdateVisible: false,
dataForm: {
equipmentId:undefined,
equipmentName: undefined,
lineId: undefined,
},
};
},
methods: {
init(data) {
console.log(data.paramMonitors,'data');
this.dataForm.equipmentId = data.equipmentId || '';
this.dataForm.equipmentName = data.equipmentName || '';
this.dataForm.lineId = data.lineId || '';
this.visible = true;
this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// getParamMonitor({
// equipmentId:this.dataForm.equipmentId
// }).then((res) => {
this.tableData = data.paramMonitors
// })
});
}
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style>

View File

@@ -0,0 +1,561 @@
<template>
<el-dialog :visible.sync="visible" width="80%" @close="handleClose" title-class="dialog-title">
<small-title slot="title" :no-padding="true">
{{ dataForm.lineId + '·' + dataForm.equipmentName }}
</small-title>
<search-bar removeBlue :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-tabs class="custom-tabs" v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'\u3000报警时长\u3000'" name="duration"></el-tab-pane>
<el-tab-pane :label="'\u3000报警次数\u3000'" name="times"></el-tab-pane>
</el-tabs>
<div class="content">
<div class="visual-part">
<div v-if="hasData" style="display: flex; justify-content: space-around; gap: 20px; padding: 10px 0;">
<!-- 移除 v-if始终渲染两个图表容器 -->
<div id="barChart" style="width: 48%; height: 400px;"></div>
<div id="pieChart" style="width: 48%; height: 400px;"></div>
</div>
<div v-if="!hasData" class="no-data">
<el-empty description="暂无相关报警数据"></el-empty>
</div>
</div>
</div>
</el-dialog>
</template>
<script>
import { getAlarmDet } from '@/api/base/equipment';
import * as echarts from 'echarts';
import SmallTitle from './SmallTitle';
const CHART_CONFIG = {
barColor: '#288AFF',
pieColors: [
'#288AFF', '#4096FF', '#69B1FF', '#91CFFF', '#B8E0FF',
'#E0F2FF', '#1890FF', '#096DD9', '#0050B3', '#003A8C'
],
fontColor: '#333',
lightFontColor: '#666',
borderRadius: 4
};
export default {
components: { SmallTitle },
data() {
return {
visible: false,
hasData: false,
listQuery: {
pageNo: 1,
pageSize: 100,
equipmentId: undefined,
startTime: undefined,
endTime: undefined
},
formConfig: [
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultTime: ['00:00:00', '23:59:59'],
defaultSelect: []
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
activeLabel: 'duration', // 默认选中「报警时长」
dataForm: {
equipmentId: undefined,
equipmentName: undefined,
lineId: undefined
},
chartInstances: {
bar: null,
pie: null
},
isDomReady: false,
originData: null // 存储原始数据
};
},
mounted() {
this.$nextTick(() => {
this.isDomReady = true;
if (this.listQuery.equipmentId) {
this.getDataList();
}
});
},
watch: {
// Tab 切换时自动刷新图表(无需额外操作,依赖 handleTabClick 触发查询)
activeLabel() {
if (this.isDomReady && this.originData) {
this.$nextTick(() => {
this.renderBothCharts(); // 切换 Tab 后重新渲染两个图表
});
}
}
},
methods: {
initDefaultDate() {
const today = new Date();
const start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0).getTime();
const end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 23, 59, 59, 0).getTime();
this.formConfig[0].defaultSelect = [start, end];
this.listQuery.startTime = start;
this.listQuery.endTime = end;
if (this.$refs.searchBarForm) {
this.$refs.searchBarForm.form.timeVal = [start, end];
}
},
handleTabClick() {
// 切换 Tab 时重新查询数据(或直接复用已有数据渲染)
this.getDataList();
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.startTime = val.timeVal?.[0];
this.listQuery.endTime = val.timeVal?.[1];
this.getDataList();
break;
default:
}
},
async getDataList() {
try {
if (!this.listQuery.equipmentId) {
console.warn('设备ID不能为空');
this.hasData = false;
return;
}
const queryParams = {
equipmentId: this.listQuery.equipmentId,
startTime: this.listQuery.startTime,
endTime: this.listQuery.endTime,
};
const res = await getAlarmDet(queryParams);
const originData = res.data || [];
this.originData = originData;
this.hasData = originData.length > 0;
if (this.hasData && this.isDomReady) {
this.$nextTick(() => {
this.renderBothCharts(); // 数据查询成功后,同时渲染两个图表
});
} else {
this.destroyAllCharts();
}
} catch (error) {
console.error('获取报警数据失败:', error);
this.hasData = false;
this.destroyAllCharts();
}
},
// 核心方法:同时渲染柱状图和饼图(根据当前 Tab 类型)
renderBothCharts() {
if (this.activeLabel === 'duration') {
// 报警时长:柱状图(时长排序)+ 饼图(时长占比)
this.renderBarChart('duration');
this.renderPieChart('duration');
} else {
// 报警次数:柱状图(次数排序)+ 饼图(次数占比)
this.renderBarChart('times');
this.renderPieChart('times');
}
},
// 渲染柱状图(支持两种数据类型)
renderBarChart(type) {
this.destroyChart('bar');
const chartDom = document.getElementById('barChart');
if (!chartDom || !this.originData.length) return;
// 根据类型排序和提取数据
let sortedData, xData, seriesData, yAxisName;
if (type === 'duration') {
// 报警时长:按时长降序
sortedData = [...this.originData].sort((a, b) => b.alarmDuration - a.alarmDuration);
seriesData = sortedData.map(item => item.alarmDuration);
yAxisName = '报警时长';
} else {
// 报警次数:按次数降序
sortedData = [...this.originData].sort((a, b) => b.alarmCount - a.alarmCount);
seriesData = sortedData.map(item => item.alarmCount);
yAxisName = '报警次数';
}
xData = sortedData.map(item => this.truncateText(item.alarmContent, 8));
try {
this.chartInstances.bar = echarts.init(chartDom);
const option = {
title: {
text: `${yAxisName}统计(柱状图)`,
left: 'center',
textStyle: { fontSize: 14, color: CHART_CONFIG.fontColor }
},
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
padding: 10,
textStyle: { fontSize: 11 },
formatter: (params) => {
const index = params[0].dataIndex;
const item = sortedData[index];
return `
<div style="text-align: left;">
<div>${item.alarmContent}</div>
<div>${yAxisName}${type === 'duration' ? item.alarmDuration : item.alarmCount}</div>
<div>占比:${type === 'duration' ? item.alarmDurationRatio.toFixed(2) : item.alarmCountRatio.toFixed(2)}%</div>
</div>
`;
}
},
grid: {
left: '5%',
right: '5%',
bottom: '18%',
top: '15%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xData,
axisTick: { alignWithLabel: true },
axisLabel: {
interval: 0,
fontSize: 12,
color: CHART_CONFIG.lightFontColor
},
axisLine: { lineStyle: { color: '#e8e8e8' } }
}
],
yAxis: [
{
type: 'value',
name: yAxisName,
nameTextStyle: { fontSize: 11, color: CHART_CONFIG.lightFontColor },
axisLabel: {
fontSize: 11,
color: CHART_CONFIG.lightFontColor,
},
axisLine: { lineStyle: { color: '#e8e8e8' } },
splitLine: { lineStyle: { color: '#f5f5f5' } },
max: (value) => value.max * 1.2
}
],
series: [
{
name: yAxisName,
type: 'bar',
itemStyle: {
color: CHART_CONFIG.barColor,
borderRadius: [CHART_CONFIG.borderRadius, CHART_CONFIG.borderRadius, 0, 0],
shadowBlur: 3,
shadowColor: 'rgba(40, 138, 255, 0.2)',
shadowOffsetY: 2
},
barWidth: '16',
data: seriesData,
label: {
show: true,
position: 'top',
distance: 6,
fontSize: 11,
color: CHART_CONFIG.fontColor,
formatter: (params) => `${params.value}`
}
}
]
};
this.chartInstances.bar.setOption(option);
this.addResizeListener('bar');
} catch (error) {
console.error(`${yAxisName}柱状图初始化失败:`, error);
setTimeout(() => this.renderBarChart(type), 200);
}
},
// 渲染饼图(支持两种数据类型)
renderPieChart(type) {
this.destroyChart('pie');
const chartDom = document.getElementById('pieChart');
if (!chartDom || !this.originData.length) return;
// 根据类型处理饼图数据
let pieData, seriesName;
if (type === 'duration') {
// 报警时长:按时长占比处理
seriesName = '报警时长';
pieData = this.handlePieData(this.originData, 'alarmDuration', 'alarmDurationRatio');
} else {
// 报警次数:按次数占比处理
seriesName = '报警次数';
pieData = this.handlePieData(this.originData, 'alarmCount', 'alarmCountRatio');
}
try {
this.chartInstances.pie = echarts.init(chartDom);
const option = {
title: {
text: `${seriesName}统计(饼图)`,
left: 'center',
textStyle: { fontSize: 14, color: CHART_CONFIG.fontColor }
},
tooltip: {
trigger: 'item',
padding: 10,
textStyle: { fontSize: 11 },
formatter: (params) => {
return `
<div style="text-align: left;">
<div>${params.name}</div>
<div>${seriesName}${params.value}${type === 'duration' ? '' : '次'}</div>
<div>占比:${params.percent.toFixed(2)}%</div>
</div>
`;
}
},
series: [
{
name: seriesName,
type: 'pie',
radius: ['50%', '70%'],
center: ['50%', '55%'],
color: CHART_CONFIG.pieColors,
label: {
show: true,
position: 'outside',
distance: 15,
fontSize: 11,
color: CHART_CONFIG.lightFontColor,
formatter: (params) => {
const truncatedName = this.truncateText(params.name, 8);
return `${truncatedName}(${params.value}${type === 'duration' ? '' : '次'}, ${params.percent.toFixed(1)}%)`;
},
align: 'center',
baseline: 'middle'
},
labelLine: {
show: true,
length: 15,
length2: 20,
lineStyle: {
color: '#ccc',
width: 1,
type: 'solid'
},
smooth: 0.2
},
data: pieData,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.1)'
},
label: {
color: CHART_CONFIG.fontColor,
fontSize: 12,
fontWeight: 500
},
labelLine: {
lineStyle: {
color: CHART_CONFIG.barColor,
width: 1.5
}
}
}
}
]
};
this.chartInstances.pie.setOption(option);
this.addResizeListener('pie');
} catch (error) {
console.error(`${seriesName}饼图初始化失败:`, error);
setTimeout(() => this.renderPieChart(type), 200);
}
},
// 通用饼图数据处理(支持动态字段)
handlePieData(data, valueKey, ratioKey) {
const threshold = 5; // 占比低于5%合并为「其他」
let otherCount = 0;
const mainData = data.filter(item => {
if (item[ratioKey] >= threshold) {
return true;
} else {
otherCount += item[valueKey];
return false;
}
}).map(item => ({
name: item.alarmContent,
value: item[valueKey],
ratio: item[ratioKey]
}));
if (otherCount > 0) {
mainData.push({
name: '其他',
value: otherCount,
ratio: 100 - mainData.reduce((sum, item) => sum + item.ratio, 0)
});
}
return mainData;
},
truncateText(text, maxLength) {
if (!text) return '';
return text.length > maxLength ? text.slice(0, maxLength) + '...' : text;
},
addResizeListener(type) {
const chart = this.chartInstances[type];
if (chart) {
const resizeHandler = () => chart.resize();
window.addEventListener('resize', resizeHandler);
chart.resizeHandler = resizeHandler;
}
},
destroyChart(type) {
const chart = this.chartInstances[type];
if (chart) {
window.removeEventListener('resize', chart.resizeHandler);
chart.dispose();
this.chartInstances[type] = null;
}
},
destroyAllCharts() {
Object.keys(this.chartInstances).forEach(type => {
this.destroyChart(type);
});
},
handleClose() {
this.destroyAllCharts();
this.formConfig[0].defaultSelect = [];
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
this.originData = null;
this.hasData = true;
if (this.$refs.searchBarForm) {
this.$refs.searchBarForm.form.timeVal = [];
}
},
init(data) {
this.dataForm = {
equipmentId: data.equipmentId || '',
equipmentName: data.equipmentName || '',
lineId: data.lineId || ''
};
this.activeLabel = 'duration'
this.listQuery.equipmentId = data.equipmentId || undefined;
this.visible = true;
this.originData = null;
this.hasData = false;
this.initDefaultDate();
this.$nextTick(() => {
this.$nextTick(() => {
this.isDomReady = true;
this.getDataList();
});
});
}
},
beforeDestroy() {
this.destroyAllCharts();
}
};
</script>
<style scoped>
/* 保持原有样式,优化图表容器布局 */
.drawer>>>.el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer>>>.el-form-item__label {
padding: 0;
}
.drawer>>>.el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer>>>.el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer>>>.content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
}
.drawer>>>.visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
padding: 10px 0;
}
/* 优化图表容器响应式布局 */
@media (max-width: 1200px) {
.visual-part>div {
flex-direction: column;
}
#barChart,
#pieChart {
width: 100% !important;
height: 350px !important;
margin-bottom: 20px;
}
}
.drawer>>>.el-form,
.drawer>>>.attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -2,14 +2,14 @@
* @Author: zwq
* @Date: 2025-10-23 13:43:55
* @LastEditors: zwq
* @LastEditTime: 2025-10-23 16:50:43
* @LastEditTime: 2025-11-14 21:13:10
* @Description:
-->
<template>
<div class="app-container">
<div class="app-container" style="padding-top: 0">
<div v-for="item in groupClassArr" :key="item.planId">
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
{{item.planName}}
{{ item.deptName + ' - ' + item.planName }}
</small-title>
<base-table
:table-props="tableProps"
@@ -59,13 +59,14 @@ export default {
},
created() {},
methods: {
init(det) {
init(det, detSort) {
this.tableData = det;
//返回计划名和id
const arr = det.map((item) => {
const obj = {
planName: item.schedulingPlanName,
planId: item.schedulingPlanId,
deptName: item.belongDeptName,
};
return obj;
});
@@ -76,7 +77,19 @@ export default {
map.set(item.planId, item);
}
});
this.groupClassArr = Array.from(map.values());
const newArr = Array.from(map.values());
// 创建B数组中id的顺序映射
const orderMap = new Map();
detSort.forEach((item, index) => {
orderMap.set(item, index);
});
// 根据B的顺序对A进行排序
this.groupClassArr = [...newArr].sort((a, b) => {
const orderA = orderMap.get(a.planId);
const orderB = orderMap.get(b.planId);
return orderA - orderB;
});
},
},
};

View File

@@ -2,212 +2,221 @@
* @Author: zwq
* @Date: 2025-10-23 13:43:55
* @LastEditors: zwq
* @LastEditTime: 2025-10-24 11:14:55
* @LastEditTime: 2025-11-25 09:39:43
* @Description:
-->
<template>
<el-row :gutter="10" style="background-color: #f2f4f9">
<!--部门数据-->
<el-col :span="4">
<div class="head-container">
<el-tabs v-model="activeName" stretch @tab-click="tabsClick">
<el-tab-pane label="部门" name="first"></el-tab-pane>
<el-tab-pane label="班组" name="second"></el-tab-pane>
</el-tabs>
<div v-if="activeName == 'first'">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
highlight-current
@node-click="handleNodeClick" />
</div>
<div v-else>
<el-input
v-model="groupName"
placeholder="请输入班组名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="groupOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree1"
default-expand-all
highlight-current
@node-click="handleNodeClick1" />
</div>
<div
class="app-container"
style="
background-color: #f2f4f9;
padding: 0;
display: grid;
grid-template-columns: 1fr 5fr;
gap: 10px;
">
<div class="head-container">
<el-tabs v-model="activeName" stretch @tab-click="tabsClick">
<el-tab-pane label="部门" name="first"></el-tab-pane>
<el-tab-pane label="班组" name="second"></el-tab-pane>
</el-tabs>
<div v-if="activeName == 'first'">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick" />
</div>
</el-col>
<el-col :span="20">
<div class="groupTeamScheduling">
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="月份选择">
<el-date-picker
v-model="startDay"
type="month"
placeholder="选择月"
size="small"
@change="selectMonth"
:clearable="false"
style="width: 120px"></el-date-picker>
<span
style="color: #909399; font-size: 12px"
v-if="activeName == 'first'">
提示排班日历仅展示当前选中部门的节假日设置若休假日中仍有排班则表示下级组织已通过自定义假期进行排班
<div v-else>
<el-input
v-model="groupName"
placeholder="请输入班组名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="groupOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree1"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick1" />
</div>
</div>
<div class="groupTeamScheduling">
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="月份选择">
<el-date-picker
v-model="startDay"
type="month"
placeholder="选择月"
size="small"
@change="selectMonth"
:clearable="false"
style="width: 120px"></el-date-picker>
<span
style="color: #909399; font-size: 12px"
v-if="activeName == 'first'">
提示排班日历仅展示当前选中部门的节假日设置若休假日中仍有排班则表示下级组织已通过自定义假期进行排班
</span>
<span v-else style="margin-left: 10px">
组长:
<span style="font-weight: 600; margin: 0 10px">
{{ showTeamName?.leaderName || '-' }}
</span>
<span v-else>
组长:{{ showTeamName?.leaderName || '-' }} 组长电话:{{
showTeamName?.leaderPhone || '-'
}}
组长电话:
<span style="font-weight: 600; margin: 0 10px">
{{ showTeamName?.leaderPhone || '-' }}
</span>
</el-form-item>
<el-form-item style="float: right">
<el-button
size="small"
type="primary"
@click="(startDay = new Date()), getHolidayPage()">
跳转到今天
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 日历区域 -->
<div class="calenderArea">
<el-calendar v-model="startDay">
<template slot="dateCell" slot-scope="{ data }">
<div v-if="data.type === 'current-month'">
<!-- 日期 -->
<div class="dateStyle">
<el-row :gutter="20">
<!-- 公历和农历 -->
<el-col :span="18">
{{ Number(data.day.split('-')[2]) }}
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
</el-col>
<!-- 显示假或班 -->
<el-col :span="6">
<div
class="work-tip"
:style="{
backgroundColor: HolidayList[
Number(data.day.split('-')[2]) - 1
]?.isHoliday
? '#67C23A'
: '#409EFF',
}">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isHoliday
? '假'
: '班'
}}
<!-- //变更节假日未更新排班计划的角标 -->
<div
class="subIcon"
v-if="
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isUpdate
">
<el-tooltip
effect="dark"
content="本日节假日变更已影响当前排班计划,但尚未同步,请及时处理。"
placement="top">
<i
class="el-icon-warning"
style="color: #f56c6c"></i>
</el-tooltip>
</div>
</div>
</el-col>
<!-- 显示排班 -->
</span>
</el-form-item>
<el-form-item style="float: right">
<el-button
size="small"
type="primary"
@click="(startDay = new Date()), getHolidayPage()">
跳转到今天
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 日历区域 -->
<div class="calenderArea">
<el-calendar v-model="startDay">
<template slot="dateCell" slot-scope="{ data }">
<div v-if="data.type === 'current-month'">
<!-- 日期 -->
<div class="dateStyle">
<el-row :gutter="20">
<!-- 公历和农历 -->
<el-col :span="18">
{{ Number(data.day.split('-')[2]) }}
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
</el-col>
<!-- 显示假或班 -->
<el-col :span="6">
<div
v-if="
HolidayList[Number(data.day.split('-')[2]) - 1]?.det
.length > 0
">
<el-col
:span="24"
v-for="(item, index) in HolidayList[
class="work-tip"
:style="{
backgroundColor: HolidayList[
Number(data.day.split('-')[2]) - 1
]?.det.filter(
(item) =>
item.schedulingPlanId ==
HolidayList[Number(data.day.split('-')[2]) - 1]
?.schedulingPlanId
)"
:key="index">
]?.isHoliday
? '#67C23A'
: '#409EFF',
}">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isHoliday
? '假'
: '班'
}}
<!-- //变更节假日未更新排班计划的角标 -->
<div
class="subIcon"
v-if="
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isUpdate
">
<el-tooltip
effect="dark"
content="点击展示全部排班计划"
placement="top-start">
<div
class="holiday-div"
:style="{
backgroundColor:
holidayDivColor[item?.classesCode],
}"
@click="
holidayLog(
HolidayList[Number(data.day.split('-')[2]) - 1]
?.det,
HolidayList[Number(data.day.split('-')[2]) - 1]
?.date
)
"
:title="
item.classesName +
' | ' +
item.teamName +
' | ' +
item.workTime
">
{{
item.classesName +
' | ' +
item.teamName +
' | ' +
item.workTime
}}
</div>
content="本日节假日变更已影响当前排班计划,但尚未同步,请及时处理。"
placement="top">
<i class="el-icon-warning" style="color: #f56c6c"></i>
</el-tooltip>
</el-col>
</div>
</div>
</el-row>
</div>
</div>
<div
v-else
style="font-size: 20px; font-weight: 500; text-align: left">
<el-row :gutter="20">
<el-col :span="24">
{{ Number(data.day.split('-')[2]) }}
<span style="font-size: 12px">
{{ getLunarDate(data.day) }}
</span>
</el-col>
<!-- 显示排班 -->
<div
v-if="
HolidayList[Number(data.day.split('-')[2]) - 1]?.det
.length > 0
">
<el-col
:span="24"
v-for="(item, index) in HolidayList[
Number(data.day.split('-')[2]) - 1
]?.det.filter(
(item) =>
item.schedulingPlanId ==
HolidayList[Number(data.day.split('-')[2]) - 1]
?.schedulingPlanId
)"
:key="index">
<el-tooltip
effect="dark"
content="点击展示全部排班计划"
placement="top-start">
<div
class="holiday-div"
:style="{
backgroundColor: holidayDivColor[item?.classesCode],
}"
@click="
holidayLog(
HolidayList[Number(data.day.split('-')[2]) - 1]
?.det,
HolidayList[Number(data.day.split('-')[2]) - 1]
?.date,
HolidayList[Number(data.day.split('-')[2]) - 1]
?.detSort
)
"
:title="
item.classesName +
' | ' +
item.teamName +
' | ' +
item.workTime
">
{{
item.classesName +
' | ' +
item.teamName +
' | ' +
item.workTime
}}
</div>
</el-tooltip>
</el-col>
</div>
</el-row>
</div>
</template>
</el-calendar>
</div>
</div>
<div
v-else
style="font-size: 20px; font-weight: 500; text-align: left">
<el-row :gutter="20">
<el-col :span="24">
{{ Number(data.day.split('-')[2]) }}
<span style="font-size: 12px">
{{ getLunarDate(data.day) }}
</span>
</el-col>
</el-row>
</div>
</template>
</el-calendar>
</div>
</el-col>
</div>
<base-dialog
:dialogTitle="dialogTitle"
:dialogVisible="logVisible"
@@ -228,7 +237,7 @@
</slot>
</template>
</base-dialog>
</el-row>
</div>
</template>
<script>
@@ -339,13 +348,43 @@ export default {
getEnableData().then((response) => {
// 处理 deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, 'id'));
this.deptOptions.push(...this.handleTree1(response.data, 'id'));
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.deptId);
});
});
listByDeptId(this.topDept.id).then((response) => {
this.groupOptions = [];
this.groupOptions.push(...response.data);
});
},
//大整数精度丢失
handleTree1(data, fid) {
const id = fid || 'id';
const parentId = 'parentId';
const children = 'children';
const rootId =
data
.map((item) => item[parentId].toString())
.reduce((min, current) => {
if (current.length < min.length) return current;
if (current.length > min.length) return min;
return current < min ? current : min;
}) || 0;
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data));
//循环所有项
const treeData = cloneData.filter((father) => {
let branchArr = cloneData.filter((child) => {
//返回每一项的子级数组
return father[id] == child[parentId];
});
branchArr.length > 0 ? (father.children = branchArr) : '';
//返回第一层
return father[parentId] == rootId;
});
return treeData !== '' ? treeData : data;
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
@@ -358,8 +397,14 @@ export default {
leaderName: this.groupOptions[0].leaderName || '-',
leaderPhone: this.groupOptions[0].leaderPhone || '-',
};
this.$nextTick(() => {
this.$refs.tree1.setCurrentKey(this.teamId);
});
} else if (this.activeName == 'first') {
this.deptId = this.topDept.id;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.deptId);
});
}
this.getHolidayPage();
},
@@ -441,11 +486,11 @@ export default {
return '';
}
},
holidayLog(det, date) {
holidayLog(det, date, detSort) {
this.dialogTitle = this.showDeptName + '-' + date + '-排班详情';
this.logVisible = true;
this.$nextTick(() => {
this.$refs.holidayLogRef.init(det);
this.$refs.holidayLogRef.init(det, detSort);
});
},
cancelLog() {
@@ -459,8 +504,8 @@ export default {
.head-container {
padding: 20px 10px 0;
background-color: #fff;
min-height: calc(100vh - 120px - 8px);
border-radius: 8px;
height: 100%;
}
.groupTeamScheduling {
.operationArea {

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-11 14:27:37
* @LastEditors: zwq
* @LastEditTime: 2025-10-29 17:12:04
* @LastEditTime: 2025-11-14 22:00:10
* @Description:
-->
<template>
@@ -25,7 +25,7 @@
</template>
<script>
import { listByDeptId } from '@/api/group/Schedule';
import { getGroupPage } from '@/api/group/groupSetting';
const tableProps = [
{
@@ -39,7 +39,7 @@ const tableProps = [
width: 100,
},
{
prop: 'deptId',
prop: 'deptName',
label: '所属部门',
},
{
@@ -57,7 +57,7 @@ export default {
data() {
return {
urlOptions: {
getDataListURL: listByDeptId,
getDataListURL: getGroupPage,
},
tableProps,
tableData: [],
@@ -86,16 +86,16 @@ export default {
pageSize: 100,
code: '',
name: '',
deptId: undefined,
},
selectedList: [],
selectedArr: [], //已选的班组,从父组件传过来的
deptId: undefined,
};
},
created() {},
methods: {
init(id, tableData) {
this.deptId = id;
this.formInline.deptId = id;
this.selectedArr = tableData || [];
this.$nextTick(() => {
this.getDataList();
@@ -103,8 +103,9 @@ export default {
},
// 获取数据列表
getDataList() {
this.urlOptions.getDataListURL(this.deptId).then((response) => {
this.tableData = response.data;
this.urlOptions.getDataListURL(this.formInline).then((response) => {
this.tableData = response.data.list.filter(item=>item.enabled===1);
this.tableData.forEach(item=>item.teamId= item.id)
this.$nextTick(() => {
if (this.selectedArr.length > 0) {
this.setSelectedRows();
@@ -119,12 +120,12 @@ export default {
table.clearSelection();
this.selectedArr.forEach((item) => {
const rowInTable = this.tableData.find((i) => i.id === item.id);
const rowInTable = this.tableData.find((i) => i.teamId === item.teamId);
if (rowInTable) {
//这里一定要用table.tableData这样才是指向同一个数组
this.$set(table.store.states, 'selection', [
...table.store.states.selection,
table.tableData.find((i) => i.id === item.id),
table.tableData.find((i) => i.teamId === item.teamId),
]);
}
});
@@ -149,22 +150,19 @@ export default {
selectChange(val) {
this.selectedList = val;
},
// 判断两个数组是否有重复的 id
// 判断两个数组是否有重复的 id,去重
hasDuplicateIds(arr1, arr2) {
const idSet = new Set(arr1.map((item) => item.id));
return arr2.some((item) => idSet.has(item.id));
return arr2.filter(
(item2) => !arr1.some((item1) => item1.teamId === item2.teamId)
);
},
dataFormSubmit() {
if (this.selectedList && this.selectedList.length > 0) {
const haveData = this.hasDuplicateIds(
this.selectedList = this.hasDuplicateIds(
this.selectedArr,
this.selectedList
);
if (haveData) {
this.$message('请不要重复添加数组');
return;
}
this.$emit('refreshTableData', this.selectedList);
} else if (this.selectedArr.length > 0) {
this.$message('请不要重复添加数组');

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-13 15:07:24
* @LastEditors: zwq
* @LastEditTime: 2025-10-29 15:28:52
* @LastEditTime: 2025-12-01 14:40:46
* @Description:
-->
<template>
@@ -54,10 +54,11 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="部门">
<el-form-item label="部门" prop="deptId">
<dept-select
style="width: 100%"
ref="deptSelect"
v-model="dataForm.deptId"
@DeptId="setDeptId"></dept-select>
</el-form-item>
</el-col>
@@ -111,7 +112,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" v-if="dataForm.shiftType>1">
<el-col :span="6" v-if="dataForm.shiftType > 1">
<el-form-item label="同班次连排" prop="shiftSustainedNum">
<el-input
v-model="dataForm.shiftSustainedNum"
@@ -134,6 +135,18 @@
<div v-if="stepNum == 2">
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
班次
<el-tag type="warning" style="color: black" v-if="!isClassTimePass">
<i class="el-icon-warning" style="color: #ffbd02"></i>
两班倒和三班倒的班次设置时间
<span style="color: red">不能重叠</span>
在24小时
</el-tag>
<el-tag type="warning" style="color: black" v-if="!covers24Hours">
<i class="el-icon-warning" style="color: #ffbd02"></i>
两班倒和三班倒的班次设置时间,班次时间
<span style="color: red">必须连续</span>
在24小时
</el-tag>
</small-title>
<base-table
:table-props="tableProps1"
@@ -150,6 +163,12 @@
</base-table>
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
班组
<el-tag type="warning" style="color: black">
<i class="el-icon-warning" style="color: #ffbd02"></i>
排班从计划开始时间对应的第一个班次开始
<span style="color: red">班组列表顺序</span>
依次循环执行
</el-tag>
</small-title>
<base-table
:table-props="tableProps2"
@@ -157,6 +176,7 @@
:limit="10"
:table-data="tableData2"
:add-button-show="'新增'"
@emitFun="handleSort"
@emitButtonClick="addNewGroup">
<method-btn
v-if="tableBtn2.length"
@@ -174,8 +194,7 @@
:no-padding="true">
排班计划预览
<span style="font-size: 14px; color: #ff1c15">
系统将根据以下设置按班组轮班顺序依次循环每日班次生成正式排班计划请确认
系统将根据
<el-popover
placement="right"
title="比如三班两倒同班次连排2天不休周末排班如下"
@@ -192,9 +211,10 @@
</el-table>
<i
slot="reference"
class="el-icon-warning-outline"
style="color: #ff1c15"></i>
class="el-icon-chat-dot-square"
style="color: #409eff; font-size: 18px"></i>
</el-popover>
设置按班组轮班顺序依次循环每日班次生成正式排班计划请确认
</span>
</small-title>
<el-tag>
@@ -227,7 +247,7 @@
<div style="color: rgba(0, 0, 0, 0.6)">同班次连排</div>
<div style="color: #000000">
{{
dataForm.shiftSustainedNum +
(dataForm.shiftSustainedNum ? dataForm.shiftSustainedNum : '') +
['日', '周', '月', '季'][dataForm.shiftSustainedType - 1]
}}
</div>
@@ -335,6 +355,7 @@ import { parseTime } from '@/filter/code-filter';
import editClass from './edit-class.vue';
import addGroup from './add-group.vue';
import bindLine from './bind-line.vue';
import sortSet from './sortSet.vue';
import {
getCode,
createStepOne,
@@ -374,10 +395,17 @@ const tableProps1 = [
];
const tableProps2 = [
{
prop: 'shunxu',
label: '顺序',
width: 70,
subcomponent: sortSet,
},
{
prop: 'code',
label: '班组编号',
width: 140,
showOverflowtooltip: true,
},
{
prop: 'name',
@@ -422,6 +450,7 @@ export default {
},
],
stepNum: 1, // 当前第几步
isEdit: false, //是否是编辑状态,编辑的时候,让前端上一步和取消都不用接口
shiftTypeEdit: undefined, //该值为编辑时获取的shiftType到第二步判断dataForm.shiftType是否改变同时改变班次信息
//第一步参数
dataForm: {
@@ -476,6 +505,7 @@ export default {
name: [
{ required: true, message: '计划名称不能为空', trigger: 'blur' },
],
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
startDay: [
{ required: true, message: '开始时间不能为空', trigger: 'change' },
],
@@ -508,6 +538,8 @@ export default {
btnName: '编辑',
},
].filter((v) => v),
isClassTimePass: true, //修改班次时间后需要判断时间是否有重叠且是否在24小时内 true是没问题的
covers24Hours: true, //修改班次时间后需要判断时间是否覆盖24小时连续的时间 true是没问题的
tableData1: [],
tableProps2,
tableBtn2: [
@@ -597,8 +629,9 @@ export default {
};
},
methods: {
init(id) {
init(id, isEdit) {
this.dataForm.id = id || undefined;
this.isEdit = isEdit || false;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
@@ -609,14 +642,18 @@ export default {
this.tableData1 = res.data?.stepTwo.groupPlanClassesBaseVOList;
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
this.tableData2.forEach((item, index) => {
let lineName = '';
lineName = this.setLineName(item.bindLineTree, lineName);
this.$set(
this.tableData2[index],
'lineName',
lineName.slice(0, -1)
);
let lineName = [];
if (item.isProduction) {
lineName = this.setLineName(item.bindLineTree);
this.$set(
this.tableData2[index],
'lineName',
lineName.join(';')
);
}
});
this.stepNum = 3;
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
});
} else {
getCode().then((res) => {
@@ -628,18 +665,33 @@ export default {
//上一步
upSubmit() {
if (this.stepNum == 2) {
returnStepOne(this.dataForm.id).then((res) => {
if (!this.isEdit) {
//编辑的时候,让前端上一步和取消都不用接口,
returnStepOne(this.dataForm.id).then((res) => {
this.stepNum -= 1;
this.$emit('setSN', this.stepNum);
this.$nextTick(() => {
this.setDataForm();
});
});
} else {
this.stepNum -= 1;
this.$emit('setSN', this.stepNum);
this.$nextTick(() => {
this.setDataForm();
});
});
}
} else if (this.stepNum == 3) {
returnStepTwo(this.dataForm.id).then((res) => {
if (!this.dataForm.id) {
//编辑的时候,让前端上一步和取消都不用接口,
returnStepTwo(this.dataForm.id).then((res) => {
this.stepNum -= 1;
this.$emit('setSN', this.stepNum);
});
} else {
this.stepNum -= 1;
this.$emit('setSN', this.stepNum);
});
}
}
},
//下一步
@@ -654,9 +706,12 @@ export default {
this.$message('部门不能为空');
return;
}
const compareDate = this.compareDates(this.dataForm.startDay,this.dataForm.endDay)
const compareDate = this.compareDates(
this.dataForm.startDay,
this.dataForm.endDay
);
if (compareDate > 0 ) {
if (compareDate > 0) {
this.$message('开始时间不能大于结束时间');
return;
}
@@ -677,6 +732,7 @@ export default {
return;
}
if (this.stepNum == 2) {
//班组验证
if (!this.tableData2 || this.tableData2.length == 0) {
this.$message('班组不能为空');
return;
@@ -684,7 +740,10 @@ export default {
let isbindLine = false;
this.tableData2.forEach((item) => {
if (!item.bindLineTree || item.bindLineTree.length == 0) {
if (
item.isProduction &&
(!item.bindLineTree || item.bindLineTree.length == 0)
) {
isbindLine = true;
}
});
@@ -711,6 +770,11 @@ export default {
return;
}
//班次验证
if (!this.isClassTimePass || !this.covers24Hours) {
this.$message('班次内时间有误,请重新填写!');
return;
}
let data = {};
data.planId = this.dataForm.id;
data.groupPlanClassesBaseVOList = []; //排班-班次信息list
@@ -722,24 +786,30 @@ export default {
startTime: item.startTime,
endTime: item.endTime,
daySpan: item.daySpan,
code: item.code,
};
data.groupPlanClassesBaseVOList.push(obj);
});
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
this.tableData2.forEach((item) => {
this.tableData2.forEach((item, index) => {
const obj = {
teamId: item.id,
sort: index + 1,
teamId: item.teamId || item.id,
name: item.name,
leaderName: item.leaderName,
leaderPhone:item.leaderPhone,
leaderName: item.leaderName,
leaderPhone: item.leaderPhone,
bindData: JSON.stringify(item.bindLineTree),
};
data.groupPlanTeamBaseVOList.push(obj);
});
createStepTwo(data).then((res) => {
this.stepNum += 1;
this.$emit('setSN', this.stepNum);
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
if (res.code === 200 || res.code === 0) {
this.stepNum += 1;
this.$emit('setSN', this.stepNum);
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
} else {
this.$message(res.msg);
}
});
return;
}
@@ -748,7 +818,7 @@ export default {
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
this.tableData2.forEach((item) => {
const obj = {
teamId: item.id,
teamId: item.teamId || item.id,
name: item.name,
bindData: JSON.stringify(item.bindLineTree),
};
@@ -774,7 +844,7 @@ export default {
setDataForm() {
this.$refs.deptSelect.setID(this.dataForm.deptId);
},
//比较时间,开始时间在结束时间前
//比较时间,开始时间在结束时间前
compareDates(date1, date2) {
const d1 = date1;
const d2 = date2;
@@ -793,54 +863,156 @@ export default {
this.tableData1 = [];
if (this.dataForm.shiftType == 1) {
const obj = {
sort: 1,
name: '长白班',
startTime: '08:00:00',
endTime: '17:00:00',
daySpan: 0, //是否跨天
code: 1, //排版日历页面,根据这个字段显示颜色
code: 1, //排版日历页面,根据这个字段显示颜色
};
this.tableData1.push(obj);
} else if (this.dataForm.shiftType == 2) {
const obj1 = {
sort: 1,
name: '白班',
startTime: '08:00:00',
endTime: '20:00:00',
daySpan: 0,
code: 1,
code: 1,
};
const obj2 = {
sort: 2,
name: '夜班',
startTime: '20:00:00',
endTime: '08:00:00',
daySpan: 1,
code: 3,
code: 3,
};
this.tableData1.push(obj1, obj2);
} else if (this.dataForm.shiftType == 3) {
const obj1 = {
sort: 1,
name: '早班',
startTime: '08:00:00',
endTime: '16:00:00',
daySpan: 0,
code: 1,
code: 1,
};
const obj2 = {
sort: 2,
name: '中班',
startTime: '16:00:00',
endTime: '00:00:00',
daySpan: 1,
code: 2,
code: 2,
};
const obj3 = {
sort: 3,
name: '夜班',
startTime: '00:00:00',
endTime: '08:00:00',
daySpan: 0,
code: 3,
code: 3,
};
this.tableData1.push(obj1, obj2, obj3);
}
},
/**
* 将时间字符串转换为分钟数
* @param {string} timeStr - 时间字符串,如 "08:00:00"
* @returns {number} 分钟数
*/
timeToMinutes(timeStr) {
const [hours, minutes, s] = timeStr.split(':').map(Number);
return hours * 60 + minutes;
},
/**
* 修改班次时间后需要判断时间是否有覆盖且是否覆盖24小时
* @param {string} start1 - 开始时间1
* @param {string} end1 - 结束时间1
* @param {string} start2 - 开始时间2
* @param {string} end2 - 结束时间2
* @returns {boolean} 是否重叠 true则重叠false则可以使用
*/
isTimeOverlap(start1, end1, start2, end2) {
const start1Min = this.timeToMinutes(start1);
const end1Min = this.timeToMinutes(end1);
const start2Min = this.timeToMinutes(start2);
const end2Min = this.timeToMinutes(end2);
// 处理跨天情况
const totalMinutes = 24 * 60;
// 如果结束时间小于开始时间,说明跨天
const isEnd1NextDay = end1Min < start1Min;
const isEnd2NextDay = end2Min < start2Min;
if (isEnd1NextDay && isEnd2NextDay) {
// 两个时间段都跨天,直接比较
return true;
} else if (isEnd1NextDay) {
// 第一个时间段跨天
return start2Min < end1Min || end2Min > start1Min;
} else if (isEnd2NextDay) {
// 第二个时间段跨天
return start1Min < end2Min || end1Min > start2Min;
} else {
// 都不跨天,正常比较
return start1Min < end2Min && end1Min > start2Min;
}
},
/**
* 检查多个班次是否连续覆盖24小时
* @param {Array} shifts - 班次数组每个班次包含startTime和endTime
* @returns {boolean} 是否连续覆盖24小时
*/
isCover24Hours(shifts) {
if (!shifts || shifts.length === 0) return false;
const totalMinutes = 24 * 60;
// 将班次转换为时间段对象
const intervals = shifts.map((shift) => ({
start: this.timeToMinutes(shift.startTime),
end: this.timeToMinutes(shift.endTime),
}));
// 处理跨天情况如果结束时间小于开始时间加上24小时
const normalizedIntervals = intervals.map((interval) => {
let { start, end } = interval;
if (end < start) {
end += totalMinutes;
}
return { start, end, originalEnd: interval.end };
});
// 按开始时间排序
normalizedIntervals.sort((a, b) => a.start - b.start);
// 检查是否连续覆盖
let coveredUntil = normalizedIntervals[0].end;
let hasGap = false;
for (let i = 1; i < normalizedIntervals.length; i++) {
const current = normalizedIntervals[i];
// 如果当前班次的开始时间大于已覆盖的结束时间,说明有间隔
if (current.start > coveredUntil) {
hasGap = true;
break;
}
// 更新已覆盖的结束时间
coveredUntil = Math.max(coveredUntil, current.end);
}
// 检查是否覆盖完整的24小时
const firstStart = normalizedIntervals[0].start;
// 判断条件没有间隔且覆盖时间达到24小时
return !hasGap && coveredUntil - firstStart >= totalMinutes;
},
//编辑班次
handleClick1(val) {
this.addOrUpdateVisible1 = true;
@@ -859,11 +1031,37 @@ export default {
this.tableData2.splice(val.data._pageIndex - 1, 1);
}
},
//班组改变顺序
handleSort(val) {
if (val.type == 'up') {
const temp = this.tableData2[val.index];
this.tableData2.splice(val.index, 1);
let i = 0;
//如果是数组第一个,再向上则放到最后
if (val.index == 0) {
i = this.tableData2.length;
} else {
i = val.index - 1;
}
this.tableData2.splice(i, 0, temp);
} else {
const temp = this.tableData2[val.index];
this.tableData2.splice(val.index, 1);
let i = 0;
//如果是数组最后一个,再向下则放到第一个(因为先splice(val.index, 1)所以这里length不用-1)
if (val.index == this.tableData2.length) {
i = 0;
} else {
i = val.index + 1;
}
this.tableData2.splice(i, 0, temp);
}
},
// 新增班组
addNewGroup() {
this.addOrUpdateVisible2 = true;
this.$nextTick(() => {
this.$refs.addGroupRef.init(this.dataForm.deptId,this.tableData2);
this.$refs.addGroupRef.init(this.dataForm.deptId, this.tableData2);
});
},
cancel1() {
@@ -886,6 +1084,58 @@ export default {
},
refreshTableData1(index, val) {
this.tableData1.splice(index, 1, val);
this.tableData1.sort((a, b) => {
if (a.sort === b.sort) {
return -1; // sort相等时a排在b前面
}
return a.sort - b.sort;
});
this.tableData1.forEach((item, index) => {
item.sort = index + 1;
});
//修改班次时间后需要判断时间是否有重叠且是否在24小时内,isTimeOverlap方法返回false才是校验通过
if (this.dataForm.shiftType == 2) {
const twoClass = this.tableData1.map(({ startTime, endTime }) => ({
startTime,
endTime,
}));
this.isClassTimePass = !this.isTimeOverlap(
twoClass[0].startTime,
twoClass[0].endTime,
twoClass[1].startTime,
twoClass[1].endTime
);
} else if (this.dataForm.shiftType == 3) {
const threeClass = this.tableData1.map(({ startTime, endTime }) => ({
startTime,
endTime,
}));
const result1 = this.isTimeOverlap(
threeClass[0].startTime,
threeClass[0].endTime,
threeClass[1].startTime,
threeClass[1].endTime
);
const result2 = this.isTimeOverlap(
threeClass[1].startTime,
threeClass[1].endTime,
threeClass[2].startTime,
threeClass[2].endTime
);
const result3 = this.isTimeOverlap(
threeClass[0].startTime,
threeClass[0].endTime,
threeClass[2].startTime,
threeClass[2].endTime
);
this.isClassTimePass = !(result1 || result2 || result3);
}
//修改班次时间后两班倒和三班倒需要判断时间是否连续覆盖24小时内
if (this.dataForm.shiftType > 1) {
this.covers24Hours = this.isCover24Hours(this.tableData1);
console.log(1111, this.covers24Hours);
}
this.cancel1();
},
refreshTableData2(val) {
@@ -894,23 +1144,45 @@ export default {
},
refreshTableData3(index, val) {
this.tableData2[index].bindLineTree = val;
let lineName = '';
lineName = this.setLineName(val, lineName);
let lineName = this.setLineName(val);
if (lineName) {
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
this.$set(this.tableData2[index], 'lineName', lineName.join(';'));
}
this.cancel3();
},
//提取绑定的产线工段名展示出来
setLineName(val, lineName) {
val.forEach((item) => {
lineName += item.name + '';
if (item.children && item.children.length > 0) {
const childName = this.setLineName(item.children, lineName);
lineName = childName;
setLineName(data) {
const paths = [];
const processNode = (node, currentPath = []) => {
const newPath = [...currentPath, node.name];
if (node.children && node.children.length > 0) {
// 检查子节点是否都是叶子节点
const allChildrenAreLeaves = node.children.every(
(child) => !child.children || child.children.length === 0
);
if (allChildrenAreLeaves && node.children.length > 1) {
// 如果所有子节点都是叶子节点且多于1个用括号合并显示
const leafNames = node.children
.map((child) => child.name)
.join(' 、 ');
paths.push(`${newPath.join('/')}/(${leafNames})`);
} else if (allChildrenAreLeaves && node.children.length === 1) {
// 只有一个叶子子节点,用括号显示
paths.push(`${newPath.join('/')}/${node.children[0].name}`);
} else {
// 继续处理子节点
node.children.forEach((child) => processNode(child, newPath));
}
} else {
// 没有子节点的节点如原片产线1用括号显示
paths.push(`${currentPath.join('/')}/${node.name}`);
}
});
return lineName;
};
data.forEach((node) => processNode(node));
return paths;
},
//第三步
// 进来加载预览排班
@@ -919,6 +1191,7 @@ export default {
id: this.dataForm.id,
count: day,
};
this.period = day;
this.tableProps3 = [];
this.tableData3 = [];
getPerView(data).then((res) => {
@@ -946,6 +1219,7 @@ export default {
label: item.day,
work: item.work,
subcomponent: propSpan,
showOverflowtooltip: true,
};
this.tableProps3.push(obj);
item.det.forEach((sItem, sIndex) => {
@@ -970,7 +1244,8 @@ export default {
});
},
cancelStep() {
if (this.stepNum > 1) {
if (this.stepNum > 1 && !this.isEdit) {
//编辑的时候,让前端上一步和取消都不用接口,
cancelStepThree(this.dataForm.id).then((res) => {
this.$message('已取消计划');
this.$emit('refreshDataList');

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-10-30 10:47:09
* @LastEditTime: 2025-11-25 15:49:17
* @Description:
-->
<template>
@@ -13,8 +13,12 @@
:to_data="toData"
@add-btn="add"
@remove-btn="remove"
pid="pid"
:defaultProps="{ label: 'name' }"
pid="fid"
:node_key="'uniqueId'"
:defaultProps="{
label: 'name',
children: 'children',
}"
height="450px"
style="padding-bottom: 20px"
:mode="mode"
@@ -43,16 +47,34 @@ export default {
this.fromData = [];
this.toData = [];
getGroupPlanTree().then((res) => {
this.fromData = res.data;
this.fromData.forEach((item) => {
res.data.forEach((item) => {
item.productionLineId = 0;
});
this.fromData = this.generateUniqueData(res.data);
this.$nextTick(() => {
this.toData = val.bindLineTree || [];
this.getFilterLeftData(this.fromData, this.toData); //编辑时组件有bug左边相同数据不消失
});
});
},
generateUniqueData(data) {
return data.map((node) => this.processNode(node));
},
processNode(node) {
// 创建唯一ID类型-原始ID
const uniqueId = node.type+'L'+node.id;
if (node.type > 0) {
node.fid = (node.type - 1)+'L'+node.pid;
}
return {
...node,
uniqueId,
children: node.children
? node.children.map((child) => this.processNode(child))
: [],
};
},
// 监听穿梭框组件添加
add(fromData, toData, obj) {
console.log('fromData:', fromData);

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-21 14:27:23
* @LastEditors: zwq
* @LastEditTime: 2025-10-21 15:02:27
* @LastEditTime: 2025-11-25 15:14:53
* @Description:
-->
<template>
@@ -46,7 +46,7 @@
</div>
<div>
<span class="title">创建人:</span>
{{ infoData.creator }}
{{ infoData.creatorName }}
</div>
<div>
<span class="title">创建时间:</span>
@@ -73,7 +73,7 @@
:limit="10"
:table-data="tableData1"></base-table>
<base-table
v-else
v-else
:table-props="tableProps2"
:page="1"
:limit="10"
@@ -150,26 +150,45 @@ export default {
this.infoData = {};
getPlan(id).then((res) => {
this.infoData = res.data || {};
console.log(res);
this.tableData1 = res.data?.groupPlanClassesBaseVOList;
this.tableData1 = res.data?.groupPlanClassesBaseVOList.sort(
(a, b) => a.sort - b.sort
);
this.tableData2 = res.data?.groupPlanTeamBaseVOList;
this.tableData2.forEach((item, index) => {
let lineName = '';
lineName = this.setLineName(item.bindLineTree, lineName);
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
if (item.isProduction) {
lineName = this.setLineName(item.bindLineTree);
}
this.$set(this.tableData2[index], 'lineName', lineName);
});
});
},
//提取绑定的产线工段名展示出来
setLineName(val, lineName) {
val.forEach((item) => {
lineName += item.name + '';
if (item.children && item.children.length > 0) {
const childName = this.setLineName(item.children, lineName);
lineName = childName;
setLineName(val) {
if (!val || val.length === 0) return '';
const currentLevelNames = val.map((item) => item.name);
// 处理当前层级显示
let currentDisplay = '';
if (currentLevelNames.length > 1) {
currentDisplay = `(${currentLevelNames.join(' 、 ')})`;
} else {
currentDisplay = currentLevelNames[0];
}
// 查找所有子节点(取第一个有子节点的元素)
const childNode = val.find(
(item) => item.children && item.children.length > 0
);
if (childNode) {
const childPath = this.setLineName(childNode.children);
if (childPath) {
return `${currentDisplay} / ${childPath}`;
}
});
return lineName;
}
return currentDisplay;
},
},
};

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-10-20 10:23:52
* @LastEditTime: 2025-11-04 14:08:47
* @Description:
-->
<template>
@@ -15,9 +15,10 @@
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="序" prop="index">
<el-form-item label="序" prop="sort">
<el-input-number
v-model="dataForm.index"
style="width: 100%"
v-model="dataForm.sort"
:step="1"
:min="1"
step-strictly />
@@ -38,7 +39,8 @@
format="H:mm"
value-format="HH:mm:ss"
v-model="dataForm.startTime"
placeholder="选择日期时间"></el-time-picker>
@change="timeFun('start')"
placeholder="选择时间"></el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -48,7 +50,19 @@
format="H:mm"
value-format="HH:mm:ss"
v-model="dataForm.endTime"
placeholder="选择日期时间"></el-time-picker>
@change="timeFun('end')"
placeholder="选择时间"></el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否跨天" prop="daySpan">
<el-switch
v-model="dataForm.daySpan"
disabled
:active-value="1"
:inactive-value="0"
active-text="隔天"
inactive-text="当天"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -70,15 +84,17 @@ export default {
return {
dataForm: {
id: undefined,
index: undefined,
sort: undefined,
name: undefined,
startTime: undefined,
endTime: undefined,
daySpan: 0,
code: 1,
remark: undefined,
},
_pageIndex: 1,
dataRule: {
index: [{ required: true, message: '序不能为空', trigger: 'blur' }],
sort: [{ required: true, message: '序不能为空', trigger: 'blur' }],
name: [
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
],
@@ -93,13 +109,31 @@ export default {
},
methods: {
init(val) {
this._pageIndex = val._pageIndex-1;
this.dataForm.index = val._pageIndex || 1;
this._pageIndex = val._pageIndex - 1;
this.dataForm.sort = val._pageIndex || 1;
this.dataForm.name = val.name || undefined;
this.dataForm.startTime = val.startTime || undefined;
this.dataForm.endTime = val.endTime || undefined;
this.dataForm.remark = val.remark || undefined;
this.dataForm.daySpan = val.daySpan || 0;
this.dataForm.code = val.code || 1;
},
timeFun(val) {
if (this.dataForm.startTime && this.dataForm.endTime) {
if (this.dataForm.startTime > this.dataForm.endTime) {
this.dataForm.daySpan = 1
} else if (this.dataForm.startTime < this.dataForm.endTime) {
this.dataForm.daySpan = 0
} else {
if (val === 'start') {
this.dataForm.startTime = ''
} else {
this.dataForm.endTime = ''
}
this.$modal.msgWarning('班次开始时间和结束时间不能相同')
}
}
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {

View File

@@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2025-10-11 14:27:37
* @Date: 2025-10-13 15:07:24
* @LastEditors: zwq
* @LastEditTime: 2025-10-29 14:50:16
* @LastEditTime: 2025-11-28 09:56:09
* @Description:
-->
<template>
@@ -31,13 +31,17 @@
<el-form-item label="开始时间" prop="startDay">
<el-date-picker
v-model="formInline.startDay"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"></el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endDay">
<el-date-picker
v-model="formInline.endDay"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"></el-date-picker>
</el-form-item>
<el-form-item label="部门" prop="deptId">
@@ -46,8 +50,12 @@
ref="deptSelect"
@DeptId="setDeptId"></dept-select>
</el-form-item>
<el-form-item label="状态" prop="leaderName">
<el-select v-model="formInline.status" placeholder="请选择状态">
<el-form-item label="状态" prop="status">
<el-select
v-model="formInline.status"
size="small"
clearable
placeholder="请选择状态">
<el-option
v-for="item in options"
:key="item.value"
@@ -65,7 +73,8 @@
</el-button>
</el-form-item>
<el-form-item>
<span class="separateStyle"
<span
class="separateStyle"
v-hasPermi="['base:group-scheduling-plan:query']"></span>
</el-form-item>
<el-form-item>
@@ -74,7 +83,8 @@
</el-button>
</el-form-item>
<el-form-item>
<span class="separateStyle"
<span
class="separateStyle"
v-hasPermi="['base:group-scheduling-plan:create']"></span>
</el-form-item>
<el-form-item>
@@ -87,6 +97,17 @@
新增
</el-button>
</el-form-item>
<el-form-item>
<el-button
type="warning"
plain
size="small"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['base:group-scheduling-plan:export']">
导出
</el-button>
</el-form-item>
</el-form>
</div>
<base-table
@@ -201,6 +222,7 @@ import {
copyPlan,
disablePlan,
updateScheduleLater,
exportExcel,
} from '@/api/group/Schedule';
const tableProps = [
@@ -268,91 +290,97 @@ export default {
},
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-scheduling-plan:update')?
{
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 1,
this.$auth.hasPermi('base:group-scheduling-plan:update')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 1,
},
],
},
],
},
}:undefined,
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
{
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 1,
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-plan:delete')
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 1,
},
],
},
],
},
}:undefined,
this.$auth.hasPermi('base:group-scheduling-plan:query')?
{
type: 'detail',
btnName: '查看',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: 1,
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-plan:query')
? {
type: 'detail',
btnName: '查看',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: 1,
},
],
},
],
},
}:undefined,
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
{
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2,
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-plan:delete')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2,
},
],
},
],
},
}:undefined,
this.$auth.hasPermi('base:group-holiday:update')?
{
type: 'sync',
btnName: '同步节假日',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2,
}
: undefined,
this.$auth.hasPermi('base:group-holiday:update')
? {
type: 'sync',
btnName: '同步节假日',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2,
},
{
type: 'equal',
name: 'updateFlag',
value: true,
},
],
},
{
type: 'equal',
name: 'updateFlag',
value: true,
},
],
},
}:undefined,
this.$auth.hasPermi('base:group-scheduling-plan:create')?
{
type: 'copy',
btnName: '复制',
}:undefined,
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-plan:create')
? {
type: 'copy',
btnName: '复制',
}
: undefined,
].filter((v) => v),
tableData: [],
options: [
@@ -370,50 +398,52 @@ export default {
},
],
formInline: {
code: '',
name: '',
startDay: '',
endDay: '',
deptId: '',
status: '',
code: null,
name: null,
startDay: null,
endDay: null,
deptId: null,
status: null,
},
stepNum: 1, // 新增编辑时当前第几步
detailVisible: false,
// 导出遮罩层
exportLoading: false,
};
},
components: {
AddOrUpdate,
deptSelect,
detail
detail,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
const date1 = new Date(this.formInline.startDay).getTime();
const date2 = new Date(this.formInline.endDay).getTime();
if (date1 > date2) {
if (this.formInline.startDay > this.formInline.endDay) {
this.$message('开始时间不得晚于结束时间');
return;
}
this.listQuery = {
pageNo: 1,
pageSize: 10,
pageSize: 20,
total: 1,
...this.formInline,
};
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetFields();
this.formInline.name = null;
this.formInline.code = null;
this.formInline.deptId = null;
this.$refs.deptSelect.clear();
this.formInline.leaderName = null;
this.formInline.status = null;
this.formInline.startDay = null;
this.formInline.endDay = null;
this.listQuery = {
pageSize: 10,
pageSize: 20,
pageNo: 1,
total: 1,
};
@@ -462,7 +492,8 @@ export default {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
this.stepNum = 3;
this.$refs.addOrUpdate.init(val.data.id, true);
});
} else if (val.type === 'delete') {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex);
@@ -474,23 +505,62 @@ export default {
} else if (val.type === 'cancel') {
disablePlan(val.data.id).then((res) => {
this.$modal.msgSuccess('作废成功');
this.getDataList()
this.getDataList();
});
} else if (val.type === 'sync') {
updateScheduleLater({ planId: val.data.id }).then((res) => {
this.$modal.msgSuccess('同步节假日成功');
this.getDataList()
});
this.$confirm(
'当前节假日包含尚未同步节假日变更,是否立即将上述节假日同步更新到排班计划?',
'同步节假日',
{
confirmButtonText: '确认同步',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
updateScheduleLater({
planId: val.data.id,
logId: val.data.updateLogId,
}).then((res) => {
this.$modal.msgSuccess('同步节假日成功');
this.getDataList();
});
})
.catch((res) => {
this.getDataList();
this.$message({
type: 'info',
message: '已取消',
});
});
} else if (val.type === 'copy') {
copyPlan(val.data.id).then((res) => {
this.$modal.msgSuccess('复制成功');
this.getDataList()
this.getDataList();
});
}
},
detailCancel() {
this.detailVisible = false;
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.formInline };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有数据项?')
.then(() => {
this.exportLoading = true;
return exportExcel(params);
})
.then((response) => {
this.$download.excel(response, '排班计划.xls');
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

View File

@@ -0,0 +1,44 @@
<!--
* @Author: zwq
* @Date: 2025-10-13 16:40:08
* @LastEditors: zwq
* @LastEditTime: 2025-11-04 16:08:57
* @Description:
-->
<template>
<div>
<el-button type="text" size="mini" @click="moveUp()" style="display:inline-block"></el-button>
<el-button type="text" size="mini" @click="moveDown()" style="display:inline-block;float:right"></el-button>
</div>
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {};
},
created() {},
methods: {
moveUp() {
const val = {
type: 'up',
index: this.injectData._pageIndex - 1,
};
this.$emit('emitData', val);
},
moveDown() {
const val = {
type: 'down',
index: this.injectData._pageIndex - 1,
};
this.$emit('emitData', val);
},
},
};
</script>

View File

@@ -2,13 +2,13 @@
* @Author: zwq
* @Date: 2025-10-13 16:18:41
* @LastEditors: zwq
* @LastEditTime: 2025-10-20 10:13:26
* @LastEditTime: 2025-11-04 10:54:19
* @Description:
-->
<template>
<span>
{{
injectData.shiftSustainedNum +
(injectData.shiftSustainedNum?injectData.shiftSustainedNum:'') +
(injectData.shiftSustainedType
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
: '')

View File

@@ -48,7 +48,6 @@ export default {
this.deptId = id;
},
clear() {
console.log(this.$refs.treeselect);
this.$refs.treeselect.clear();
},
// 格式化部门的下拉框

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-10-29 14:47:33
* @LastEditTime: 2025-11-27 14:49:34
* @Description:
-->
<template>
@@ -25,16 +25,18 @@
<el-col :span="8">
<el-form-item label="班组名称" prop="name">
<el-input
:disabled="nameDisable"
v-model="dataForm.name"
clearable
placeholder="请输入班组名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门">
<el-form-item label="部门" prop="deptId">
<dept-select
style="width: 100%"
ref="deptSelect"
v-model="dataForm.deptId"
@DeptId="setDeptId"></dept-select>
</el-form-item>
</el-col>
@@ -44,7 +46,7 @@
style="width: 100%"
v-model="dataForm.leaderId"
@change="setLeaderName"
filterable
filterable
placeholder="请选择组长">
<el-option
v-for="item in leaderArr"
@@ -59,7 +61,7 @@
<el-input
v-model="dataForm.leaderPhone"
clearable
maxlength="11"
maxlength="11"
placeholder="请输入组长电话" />
</el-form-item>
</el-col>
@@ -77,6 +79,7 @@
<el-form-item label="生产班组" prop="isProduction">
<el-select
style="width: 100%"
@change="setIsProduction"
v-model="dataForm.isProduction"
placeholder="请选择是否为生产班组">
<el-option
@@ -108,6 +111,7 @@ import {
updateGroup,
getGroup,
getCode,
updateIsProduction,
} from '@/api/group/groupSetting';
export default {
@@ -137,7 +141,8 @@ export default {
num: undefined,
remark: undefined,
},
setData: true,
setData: true,
nameDisable: false, //班组被使用时,班组名称不能修改
leaderArr: [],
options: [
{
@@ -156,19 +161,21 @@ export default {
name: [
{ required: true, message: '班组名称不能为空', trigger: 'blur' },
],
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
leaderId: [
{ required: true, message: '组长不能为空', trigger: 'change' },
],
isProduction: [
{ required: true, message: '生产班组不能为空', trigger: 'change' },
],
leaderPhone: [
{
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
leaderPhone: [
{
pattern:
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur',
},
],
},
};
},
@@ -184,9 +191,43 @@ export default {
})
.catch(() => {});
},
setDataForm(){
this.$refs.deptSelect.setID(this.dataForm.deptId)
},
setDataForm() {
this.$refs.deptSelect.setID(this.dataForm.deptId);
this.nameDisable = false;
updateIsProduction(this.dataForm.id).then(({ data }) => {
if (data) {
this.$notify({
title: '警告',
message: '当前班组仍参与排班计划或正在执行工单。班组名称不能修改',
type: 'warning',
});
this.nameDisable = true;
}
});
},
setIsProduction() {
// 修改的提交
if (this.dataForm.id && this.nameDisable) {
this.$confirm(
'当前班组仍参与排班计划或正在执行工单。<br/>修改<strong> 是否是生产班组 </strong>不会自动更新排班内容,可能导致排班信息与班组属性不一致,请注意核查!<br/>是否确认修改是否是生产班组?',
'修改是否是生产班组',
{
dangerouslyUseHTMLString: true,
confirmButtonText: '确认修改',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {})
.catch((res) => {
this.$message({
type: 'info',
message: '已取消',
});
this.dataForm.isProduction = !this.dataForm.isProduction;
});
}
},
setLeaderName(val) {
this.leaderArr.map((item) => {
if (val === item.id) {
@@ -194,33 +235,33 @@ export default {
}
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
if(!this.dataForm.deptId){
this.$message('部门不能为空');
return
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
if (!this.dataForm.deptId) {
this.$message('部门不能为空');
return;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
},
};
</script>

View File

@@ -1,14 +1,21 @@
<!--
* @Author: zwq
* @Date: 2025-10-11 14:41:12
* @LastEditors: zwq
* @LastEditTime: 2025-11-27 14:19:39
* @Description:
-->
<template>
<el-switch
@change="changeStatus"
size="small"
v-model="list.enabled"
v-model="injectData.enabled"
:active-value="1"
:inactive-value="0"></el-switch>
</template>
<script>
import { updateGroup } from '@/api/group/groupSetting';
import { updateGroup, updateIsProduction } from '@/api/group/groupSetting';
export default {
props: {
injectData: {
@@ -17,17 +24,51 @@ export default {
},
},
data() {
return {
list: this.injectData,
};
return {};
},
created() {},
methods: {
changeStatus(val) {
const data = { ...this.injectData, enabled: val };
updateGroup(data).then((res) => {
this.$modal.msgSuccess('修改成功');
this.$emit('emitData');
const pdata = { ...this.injectData, enabled: val };
updateIsProduction(this.injectData.id).then(({ data }) => {
if (data) {
this.$confirm(
'当前班组仍参与排班计划或正在执行工单。<br/>修改<strong> 班组状态 </strong>不会自动更新排班内容,可能导致排班信息与班组属性不一致,请注意核查!<br/>是否确认修改班组状态?',
'更新班组状态',
{
dangerouslyUseHTMLString: true,
confirmButtonText: '确认修改',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
updateGroup(pdata).then((res) => {
if (res.code === 0 || res.code === 200) {
this.$modal.msgSuccess('修改成功');
this.$emit('emitData');
} else {
this.$modal.msg(res.msg);
}
});
})
.catch((res) => {
this.$emit('emitData');
this.$message({
type: 'info',
message: '已取消',
});
});
} else {
updateGroup(pdata).then((res) => {
if (res.code === 0 || res.code === 200) {
this.$modal.msgSuccess('修改成功');
this.$emit('emitData');
} else {
this.$modal.msg(res.msg);
}
});
}
});
},
},

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2025-10-11 14:27:37
* @LastEditors: zwq
* @LastEditTime: 2025-10-29 14:44:41
* @LastEditTime: 2025-11-14 21:50:40
* @Description:
-->
<template>
@@ -212,7 +212,7 @@ export default {
case 'search':
this.listQuery = {
pageNo: 1,
pageSize: 10,
pageSize: 20,
total: 1,
...this.formInline,
};
@@ -225,7 +225,7 @@ export default {
this.$refs.deptSelect.clear();
this.formInline.leaderName = null;
this.listQuery = {
pageSize: 10,
pageSize: 20,
pageNo: 1,
total: 1,
};

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-10-23 13:29:58
* @LastEditTime: 2025-11-27 14:06:11
* @Description:
-->
<template>
@@ -18,6 +18,7 @@
<el-col :span="12">
<el-form-item label="节假日名称" prop="name">
<el-input
ref="inputWidth"
v-model="dataForm.name"
clearable
:disabled="detail"
@@ -54,7 +55,7 @@
</el-col>
<el-col :span="12">
<el-form-item
v-if="dataForm.dateType == 1"
v-if="dataForm.dateType == 1 && dataForm.calendarType == 1"
label="日期"
prop="dateDay">
<el-date-picker
@@ -66,9 +67,13 @@
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="--MM-dd"
@blur="$forceUpdate()"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item v-else label="日期" prop="dateDayArr">
<el-form-item
v-else-if="dataForm.dateType == 2 && dataForm.calendarType == 1"
label="日期"
prop="dateDayArr">
<el-date-picker
:disabled="detail"
style="width: 100%"
@@ -80,8 +85,53 @@
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@blur="$forceUpdate()"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item
v-else-if="dataForm.dateType == 1 && dataForm.calendarType == 2"
label="日期"
prop="dateDayChinese">
<j-date-picker
ref="JDatePicker1"
style="line-height: 18px"
v-model="dataForm.dateDayChinese"
id="value1"
:width="width1"
:placeholder="placeholder"
:picker-options="pickerOptions"
:rangeSeparator="rangeSeparator"
@change="onDateChange"
:disabled="detail"
:showLunarClass="showLunarClass"
:showLunarControl="showLunarControl"
type="DATE"
:showBackYears="showBackYears"
:showLunarIcon="showLunarIcon"
:format="format"></j-date-picker>
</el-form-item>
<el-form-item
v-else-if="dataForm.dateType == 2 && dataForm.calendarType == 2"
label="日期"
prop="dateDayArrChinese">
<j-date-picker
style="line-height: 18px"
ref="JDatePicker2"
v-model="dataForm.dateDayArrChinese"
id="value2"
:width="width1"
:placeholder="placeholder"
:picker-options="pickerOptions"
:rangeSeparator="rangeSeparator"
@change="onDateChange"
:disabled="detail"
:showLunarClass="showLunarClass"
:showLunarControl="showLunarControl"
type="DATERANGE"
:showBackYears="showBackYears"
:showLunarIcon="showLunarIcon"
:format="format"></j-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否每年重复" prop="repeat">
@@ -131,6 +181,7 @@
</template>
<script>
import JDatePicker from './components/JDatePicker.vue';
import {
createHoliday,
updateHoliday,
@@ -141,7 +192,9 @@ import {
} from '@/api/group/holidaySetting';
export default {
components: {},
components: {
JDatePicker,
},
data() {
return {
dataForm: {
@@ -151,11 +204,16 @@ export default {
dateType: 1,
dateDay: undefined,
dateDayArr: [],
dateDayChinese: undefined,
dateDayArrChinese: [],
noRepeatYear: undefined,
noRepeatYearChinese: undefined,
repeat: true,
inherited: true, // 是否为继承
deptId: undefined,
},
detail: false,
inherited: true,
options1: [
{
value: 1,
@@ -202,6 +260,12 @@ export default {
dateDayArr: [
{ required: true, message: '日期不能为空', trigger: 'change' },
],
dateDayChinese: [
{ required: true, message: '日期不能为空', trigger: 'change' },
],
dateDayArrChinese: [
{ required: true, message: '日期不能为空', trigger: 'change' },
],
repeat: [
{
required: true,
@@ -216,13 +280,63 @@ export default {
},
},
dialogVisible: false,
//农历组件数据
showLunarClass: 'LUNAR', //农历日期的展示类型 MIX(混合)FULLLUNAR(全农历)LUNAR(农历)NUMBER(数字)
showBackYears: 2, //向后展示年数;见于年份列表;
showLunarIcon: true, //是否显示农历控制组件
showLunarControl: false, //是否显示农历控制组件
width1: '300', //这个设置成100%原组件写死了px需要修改
format: 'yyyy-MM-dd',
placeholder: '',
rangeSeparator: '-',
editable: true,
clearable: true,
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
},
},
};
},
watch: {
'dataForm.calendarType': function (newValue, oldValue) {
this.$nextTick(() => {
if (this.$refs.JDatePicker1) {
this.$refs.JDatePicker1.isLunar = true; //默认转为农历
this.$refs.JDatePicker1.onLunarChange();
}
if (this.$refs.JDatePicker2) {
this.$refs.JDatePicker2.isLunar = true;
this.$refs.JDatePicker2.onLunarChange();
}
});
},
'dataForm.dateType': function (newValue, oldValue) {
this.$nextTick(() => {
if (this.$refs.JDatePicker1) {
this.$refs.JDatePicker1.isLunar = true; //默认转为农历
this.$refs.JDatePicker1.onLunarChange();
}
if (this.$refs.JDatePicker2) {
this.$refs.JDatePicker2.isLunar = true;
this.$refs.JDatePicker2.onLunarChange();
}
});
},
},
mounted() {
this.$nextTick(() => {
this.width1 = this.$refs.inputWidth.$el.offsetWidth + '';
});
},
methods: {
init(deptId, id, detail) {
init(deptId, val, detail, inherited) {
this.dataForm.deptId = deptId || undefined;
this.dataForm.id = id || undefined;
this.dataForm.id = val.holidayId || undefined;
this.dataForm.inherited = val.isInherit || false;
this.detail = detail || false;
this.inherited = inherited; //编辑的时候该部门如果是自定义的但这个val数据是继承的修改之后则变成自定义的inherited
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
@@ -245,14 +359,21 @@ export default {
this.dataForm.dateType == 1 &&
this.dataForm.calendarType == 2
) {
this.dataForm.dateDay = this.dataForm.oneDayChinese;
this.dataForm.dateDayChinese =
'L' +
new Date().getFullYear() +
this.dataForm.oneDayChinese.slice(-6);
} else if (
this.dataForm.dateType == 2 &&
this.dataForm.calendarType == 2
) {
this.dataForm.dateDayArr = [
this.dataForm.startDayChinese,
this.dataForm.endDayChinese,
this.dataForm.dateDayArrChinese = [
'L' +
new Date().getFullYear() +
this.dataForm.startDayChinese.slice(-6),
'L' +
new Date().getFullYear() +
this.dataForm.endDayChinese.slice(-6),
];
}
});
@@ -307,10 +428,13 @@ export default {
this.$modal.msgSuccess('删除成功');
updateSchedule({ logId: res.data.logId }).then((res1) => {
this.$modal.msgSuccess('更新成功');
this.$emit('refreshPage');
});
this.$emit('refreshPage');
});
},
onDateChange(val) {
console.log(val);
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
@@ -329,25 +453,60 @@ export default {
this.dataForm.dateType == 1 &&
this.dataForm.calendarType == 2
) {
this.dataForm.oneDayChinese = this.dataForm.dateDay;
this.dataForm.oneDayChinese =
'--' + this.dataForm.dateDayChinese.slice(-5);
} else if (
this.dataForm.dateType == 2 &&
this.dataForm.calendarType == 2
) {
this.dataForm.startDayChinese = this.dataForm.dateDayArr[0];
this.dataForm.endDayChinese = this.dataForm.dateDayArr[1];
this.dataForm.startDayChinese =
'--' + this.dataForm.dateDayArrChinese[0].slice(-5);
this.dataForm.endDayChinese =
'--' + this.dataForm.dateDayArrChinese[1].slice(-5);
}
if (this.dataForm.calendarType == 1 && !this.dataForm.repeat) {
this.dataForm.noRepeatYear = new Date().getFullYear();
} else if (this.dataForm.calendarType == 2 && !this.dataForm.repeat) {
this.dataForm.noRepeatYearChinese = new Date().getFullYear();
}
// 修改的提交
if (this.dataForm.id) {
updateHoliday(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.$emit('refreshPage');
if (!this.inherited) {
this.dataForm.inherited = false;
}
updateHoliday(this.dataForm).then((res) => {
if (!res.data.updateFlag) {
this.$modal.msgSuccess('修改成功');
this.$emit('refreshPage');
} else {
this.$confirm(
'新增节假日影响已有排班计划,是否立即更新?',
'更新排班',
{
confirmButtonText: '立即更新',
cancelButtonText: '暂不更新',
type: 'warning',
}
)
.then(() => {
updateSchedule({ logId: res.data.logId }).then((res1) => {
this.$modal.msgSuccess('更新成功');
});
this.$emit('refreshPage');
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
this.$emit('refreshPage');
});
}
});
return;
}
// 添加的提交
createHoliday(this.dataForm).then((res) => {
updateSchedule;
if (!res.data.updateFlag) {
this.$modal.msgSuccess('新增成功');
this.$emit('refreshPage');
@@ -363,15 +522,16 @@ export default {
)
.then(() => {
updateSchedule({ logId: res.data.logId }).then((res1) => {
this.$modal.msgSuccess('新成功');
this.$emit('refreshPage');
this.$modal.msgSuccess('新成功');
});
this.$emit('refreshPage');
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
this.$emit('refreshPage');
});
}
});

View File

@@ -0,0 +1,735 @@
<template>
<div class="full-jcalendar" :style="{width:handleWidth+'px'}">
<p class="input-icon__tip" v-show="isLunar && showLunarIcon">
<i v-if="isLeap"></i>
<i v-else></i>
</p>
<p class="input-icon" @mouseover="onInputOver" @mouseout="onInputOut">
<i class="iconfont el-icon-date" ></i>
<i class="iconfont icon-richeng" v-show="!clearVisible"></i>
<i class="iconfont icon-guanbi is-clear" v-show="clearable && clearVisible" @click="onClearInput"></i>
</p>
<input type="text" :value="inputText" :class="['input__inner',{'is-disabled':disabled}]" :placeholder="placeholder" @click="onInputFocus" :readonly="!editable || type.toUpperCase() ==='DATERANGE' || (isLunar && showLunarClass.toUpperCase()!='NUMBER')" :disabled="disabled" @input="inputText = $event.target.value" @change="handleInputChange" />
<!--日期控件弹窗主体-->
<div class="full-jcalendar__main" :class="{'is-daterange':type.toUpperCase() === 'DATERANGE'}" v-show="calendarVisible">
<!--单日期模式-->
<div v-show="type.toUpperCase() === 'DATE'">
<div class="full-jcalendar-header">
<span class="title-year" @click="showYearList">{{year}}</span>
<span style="width:10px;"></span>
<span class="title-month" @click="monthVisible = true">{{month}}</span>
<span style="width:10px;" v-if="showLunarControl"></span>
<label v-if="showLunarControl"><input type="checkbox" v-model="isLunar" @change="onLunarChange" />农历</label>
<!-- header 切换月份 -->
<p class="prev-month" @click.stop="goPrev"><i class="icon iconfont el-icon-arrow-left"></i></p>
<p class="next-month" @click.stop="goNext"><i class="icon iconfont el-icon-arrow-right"></i></p>
</div>
<!-- body 日期和事件 -->
<div class="full-jcalendar__body">
<div class="weeks">
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
</div>
<!--日期 -->
<div class="week-row" v-for="(week,index) in calendarDatas" :key="index">
<!--日期 单元格-->
<div class="day-cell" v-for="(day,index) in week" :key="index"
:class="[{'today': day.isToday,'not-optional':isNotOptional(day),'select':day.isSelect,'not-cur-month': !day.isCurMonth }]"
@click="onDateSelect(day)">
<!-- 日期 节气 农历 -->
<div class="day-number">
<p class="solar">
<!--<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.lMonth>10 &&day.lDate.IDayCn==='初一'"></span>-->
<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.IDayCn==='初一'"></span>
<span :class="['number',{'is-today':day.isToday,'is-empty':day.isToday && !day.lDate.isFestival && !day.lDate.isTerm}]">{{day.isToday?'今天':day.day}}</span>
</p>
<p class="lunar" v-show="!day.isToday || day.lDate.isFestival || day.lDate.isTerm">
<span class="festival" v-if="day.lDate.isFestival">{{day.lDate.festival[0]}}</span>
<span class="term" v-else-if="day.lDate.isTerm">{{day.lDate.Term}}</span>
<!--<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.isLeap && day.lDate.lMonth>10?day.lDate.IMonthCn.replace('闰',''):day.lDate.IMonthCn}}</span>-->
<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.IMonthCn.replace('','')}}</span>
<span v-else>{{day.lDate.IDayCn}}</span>
</p>
</div>
</div>
</div>
</div>
<!-- 月份切换 -->
<div class="full-jcalendar__month" v-show="monthVisible">
<div class="full-jcalendar-header">
<span>{{month}}</span>
</div>
<div class="full-jcalendar__body">
<ul class="data-list">
<li @click="onMonthSelect(m-1)" v-for="m in 12" :key="m">{{m}}</li>
</ul>
<p class="clearfix"></p>
<p class="close" @click="monthVisible=false"> </p>
</div>
</div>
<!-- 年份切换 -->
<div class="full-jcalendar__year" v-show="yearVisible">
<div class="full-jcalendar-header">
<span>{{year}}</span>
<!-- header 年份翻页 -->
<p class="prev-month" @click.stop="goYearPrevList"><i class="icon iconfont el-icon-arrow-left"></i></p>
<p class="next-month" @click.stop="goYearNextList"><i class="icon iconfont el-icon-arrow-right"></i></p>
</div>
<div class="full-jcalendar__body">
<ul class="data-list">
<li :class="{'select-year':(m + startYear -1)==year,'curr-year':(m + startYear -1)==todayYear}" @click="onYearSelect(m + startYear -1)" v-for="m in 12" :key="m">{{m + startYear -1}}</li>
</ul>
<p class="clearfix"></p>
<p class="close" @click="yearVisible=false"> </p>
</div>
</div>
</div>
<!--日期段模式-->
<div class="date-range__month leftMonth" v-if="type.toUpperCase() === 'DATERANGE'">
<div class="full-jcalendar-header">
<span class="title-year">{{year}}</span>
<span style="width:10px;"></span>
<span class="title-month">{{month}}</span>
<span style="width:10px;" v-if="showLunarControl"></span>
<label v-if="showLunarControl"><input type="checkbox" v-model="isLunar" @change="onLunarChange" />农历</label>
<!-- header 切换月份 -->
<p class="prev-year" @click.stop="goYearPrev"><i class="icon iconfont el-icon-d-arrow-left"></i></p>
<p class="prev-month" @click.stop="goPrev"><i class="icon iconfont el-icon-arrow-left"></i></p>
</div>
<!-- body 日期和事件 -->
<div class="full-jcalendar__body">
<div class="weeks">
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
</div>
<!--日期 -->
<div class="week-row" v-for="(week,index) in calendarDatas" :key="index" @mouseout="onMouseOut">
<!--日期 单元格-->
<div class="day-cell" v-for="(day,index) in week" :key="index"
:class="[{'today': day.isToday,'not-optional':isNotOptional(day),'choose':isChoose(day),'select':isSelect(day),'not-cur-month': !day.isCurMonth }]"
@click="onDateSelect(day)" @mouseover="onMouseOver(day)">
<!-- 日期 节气 农历 -->
<div class="day-number">
<p class="solar">
<!--<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.lMonth>10 &&day.lDate.IDayCn==='初一'"></span>-->
<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.IDayCn==='初一'"></span>
<span :class="['number',{'is-today':day.isToday,'is-empty':day.isToday && !day.lDate.isFestival && !day.lDate.isTerm}]">{{day.isToday?'今天':day.day}}</span>
</p>
<p class="lunar" v-show="!day.isToday || day.lDate.isFestival || day.lDate.isTerm">
<span class="festival" v-if="day.lDate.isFestival">{{day.lDate.festival[0]}}</span>
<span class="term" v-else-if="day.lDate.isTerm">{{day.lDate.Term}}</span>
<!--<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.isLeap && day.lDate.lMonth>10?day.lDate.IMonthCn.replace('闰',''):day.lDate.IMonthCn}}</span>-->
<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.IMonthCn.replace('','')}}</span>
<span v-else>{{day.lDate.IDayCn}}</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="date-range__month" v-if="type.toUpperCase() === 'DATERANGE'">
<div class="full-jcalendar-header">
<span class="title-year">{{year2}}</span>
<span style="width:10px;"></span>
<span class="title-month">{{month2}}</span>
<!-- header 切换月份 -->
<p class="next-year" @click.stop="goYearNext"><i class="icon iconfont el-icon-d-arrow-right"></i></p>
<p class="next-month" @click.stop="goNext"><i class="icon iconfont el-icon-arrow-right"></i></p>
</div>
<!-- body 日期和事件 -->
<div class="full-jcalendar__body">
<div class="weeks">
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
<strong class="week"></strong>
</div>
<!--日期 -->
<div class="week-row" v-for="(week,index) in calendarDatas2" :key="index" @mouseout="onMouseOut">
<!--日期 单元格-->
<div class="day-cell" v-for="(day,index) in week" :key="index"
:class="[{'today': day.isToday,'not-optional':isNotOptional(day),'choose':isChoose(day),'select':isSelect(day),'not-cur-month': !day.isCurMonth }]"
@click="onDateSelect(day)" @mouseover="onMouseOver(day);">
<!-- 日期 节气 农历 -->
<div class="day-number">
<p class="solar">
<!--<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.lMonth>10 &&day.lDate.IDayCn==='初一'"></span>-->
<span class="is-leap" v-if="day.lDate.isLeap && day.lDate.IDayCn==='初一'"></span>
<span :class="['number',{'is-today':day.isToday,'is-empty':day.isToday && !day.lDate.isFestival && !day.lDate.isTerm}]">{{day.isToday?'今天':day.day}}</span>
</p>
<p class="lunar" v-show="!day.isToday || day.lDate.isFestival || day.lDate.isTerm">
<span class="festival" v-if="day.lDate.isFestival">{{day.lDate.festival[0]}}</span>
<span class="term" v-else-if="day.lDate.isTerm">{{day.lDate.Term}}</span>
<!--<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.isLeap && day.lDate.lMonth>10?day.lDate.IMonthCn.replace('闰',''):day.lDate.IMonthCn}}</span>-->
<span v-else-if="day.lDate.IDayCn==='初一'">{{day.lDate.IMonthCn.replace('','')}}</span>
<span v-else>{{day.lDate.IDayCn}}</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</template>
<script>
import moment from 'moment';
import JDatePickerScript from './jDatePicker.js'
export default {
props: {
width: {
type: String,
default: '200',
},
value: {
type:[String,Date,Array],
default: ''
},
placeholder:{
type: String,
default: ''
},
format: {
type: String,
default: 'YYYY-MM-DD'
},
showLunarClass: {
type: String,
default: 'NUMBER',//共四种FULLLUNAR全农历格式丁酉[鸡]年己酉月乙巳日LUNAR中文格式丁酉[鸡]年七月廿三NUMBER数字格式2017-09-13MIX格式丁酉(2017)[鸡]年七月廿三;
},
showLunarIcon:{
type: Boolean,
default: false,
},
showBackYears:{
type: Number,
default: 2,
},
showLunarControl:{
type: Boolean,
default: true,
},
disabled:{
type: Boolean,
default: false,
},
editable:{
type: Boolean,
default: true,
},
clearable:{
type: Boolean,
default: true,
},
type:{
type: String,
default: "DATE",//DATE - 日期类型DATERANGE 时间段;
},
rangeSeparator:{
type: String,
default: "-",//时间段分隔符
},
pickerOptions:{
type:Object,
default:null
},
},
computed: {
handleWidth: function () {
let w = this.width.toString();
if (w == null || w == '') {
return 200;
}
if (w.indexOf('px') > -1) w = w.replace(/px/, '');
let w0 = parseInt(w) || 0;
if (w0 == 0) {
return 200;
}
return w0;
},
},
watch: {
'value': function (newValue, oldValue) {
this.inputText = '';
this.isLeap = false;
this.isLunar = false;
this.handleInputText(newValue);
},
'showLunarIcon': function (newValue, oldValue) {
},
},
data () {
return {
inputText:'',
startYear:0,//年份列表的起始年份
monthDay: '',//月份日期类型,用来比较日期
selectDay:[],//type=daterange,存放点击选中的时间值;
chooseDay:[],//type=daterange,存放鼠标移动所选时间段;
year: 0,
month: 0,
year2: 0,
month2: 0,
isCurrMonth: true,
calendarDatas: [],
calendarDatas2: [],
calendarVisible: false,//日历显示开关
yearVisible: false,//年份选择开关
monthVisible: false,//月份选择开关
clearVisible:false,//清除按钮开关
isLunar: false,//是否启用农历
isLeap: false,//是否闰月
}
},
created () {
let month = moment()
this.monthDay = month.toISOString();
this.todayYear = month.year();
this.loadCalendar();
document.addEventListener('click', (e) => {
let icon = this.$el.querySelector('.input-icon');
let input = this.$el.querySelector('.input__inner');
let main = this.$el.querySelector('.full-jcalendar__main');
if (!icon.contains(e.target) && !input.contains(e.target) && !main.contains(e.target)) {
this.calendarVisible = false;
if (this.selectDay.length > 0) {
this.monthDay = this.selectDay[0];
}
}
});
this.handleInputText(this.value,true);
},
methods: {
handleInputText(newValue,isNeedEmit){
if (newValue == undefined || newValue == null || !newValue.toString().length) return;
let valueDay = '', valueDay2 = '', result = '';
if (this.type.toUpperCase() == 'DATE') {
//单日期模式
newValue = newValue.toString();
let isLunar = newValue.indexOf('L') > -1;
this.isLunar = isLunar;
if (isLunar) {
//农历模式
let showLunarClass = this.showLunarClass.toUpperCase();
let lunarDate = JDatePickerScript.calendar.getSolar(newValue);
valueDay = new Date(lunarDate.cYear + '-' + lunarDate.cMonth + '-' + lunarDate.cDay).toISOString();
if (showLunarClass == 'NUMBER') {
result = moment(new Date(lunarDate.lYear + '-' + lunarDate.lMonth + '-' + lunarDate.lDay)).format(this.format.toUpperCase());
}
else if (showLunarClass == 'MIX') {
result = lunarDate.gzYear + '(' + lunarDate.lYear + ')[' + lunarDate.Animal + ']年 ' + lunarDate.IMonthCn + lunarDate.IDayCn;
}
else if (showLunarClass == 'FULLLUNAR') {
result = lunarDate.gzYear + '[' + lunarDate.Animal + ']年 ' + lunarDate.gzMonth + '月 ' + lunarDate.gzDay + '日';
}
else if (showLunarClass == 'LUNAR') {
result = lunarDate.gzYear + '[' + lunarDate.Animal + ']年 ' + lunarDate.IMonthCn + lunarDate.IDayCn;
}
} else {
//公历模式
let date = new Date(newValue);
valueDay = date.toISOString();
result = moment(date).format(this.format.toUpperCase());
this.$emit('input',moment(date).format('YYYY-MM-DD'))
}
this.monthDay = valueDay;
this.selectDay = [valueDay];
this.inputText = result;
this.loadCalendar();
return;
}
if (this.type.toUpperCase() == 'DATERANGE') {
//时间段模式
//判断newValue是否为数组ES2005以上支持isArray
if (Array.isArray(newValue) && newValue.length == 2) {
let beginDt = newValue[0];
let endDt = newValue[1];
//判断value是否为日期类型
if(beginDt == undefined || beginDt == null || !beginDt.toString().length) return;
if(endDt == undefined || endDt == null || !endDt.toString().length) return;
beginDt = beginDt.toString();
endDt = endDt.toString();
let isLunar = beginDt.indexOf('L') > -1;
this.isLunar = isLunar;
if (isLunar) {
//农历模式
let beginDateResult = '', endDateResult = '';
let showLunarClass = this.showLunarClass.toUpperCase();
let beginLunarDate = JDatePickerScript.calendar.getSolar(beginDt);
let endLunarDate = JDatePickerScript.calendar.getSolar(endDt);
valueDay = new Date(beginLunarDate.cYear + '-' + beginLunarDate.cMonth + '-' + beginLunarDate.cDay).toISOString();
valueDay2 = new Date(endLunarDate.cYear + '-' + endLunarDate.cMonth + '-' + endLunarDate.cDay).toISOString();
if (showLunarClass == 'NUMBER') {
beginDateResult = moment(new Date(beginLunarDate.lYear + '-' + beginLunarDate.lMonth + '-' + beginLunarDate.lDay)).format(this.format.toUpperCase());
endDateResult = moment(new Date(endLunarDate.lYear + '-' + endLunarDate.lMonth + '-' + endLunarDate.lDay)).format(this.format.toUpperCase());
}
else if (showLunarClass == 'MIX') {
beginDateResult = beginLunarDate.gzYear + '(' + beginLunarDate.lYear + ')[' + beginLunarDate.Animal + ']年 ' + beginLunarDate.IMonthCn + beginLunarDate.IDayCn;
endDateResult = endLunarDate.gzYear + '(' + endLunarDate.lYear + ')[' + endLunarDate.Animal + ']年 ' + endLunarDate.IMonthCn + endLunarDate.IDayCn;
}
else if (showLunarClass == 'FULLLUNAR') {
beginDateResult = beginLunarDate.gzYear + '[' + beginLunarDate.Animal + ']年 ' + beginLunarDate.gzMonth + '月 ' + beginLunarDate.gzDay + '日';
endDateResult = endLunarDate.gzYear + '[' + endLunarDate.Animal + ']年 ' + endLunarDate.gzMonth + '月 ' + endLunarDate.gzDay + '日';
}
else if (showLunarClass == 'LUNAR') {
beginDateResult = beginLunarDate.gzYear + '[' + beginLunarDate.Animal + ']年 ' + beginLunarDate.IMonthCn + beginLunarDate.IDayCn;
endDateResult = endLunarDate.gzYear + '[' + endLunarDate.Animal + ']年 ' + endLunarDate.IMonthCn + endLunarDate.IDayCn;
}
result = beginDateResult + ' ' + this.rangeSeparator + ' ' + endDateResult;
} else {
//公历模式
if(isNeedEmit){
this.$emit('input',[moment(new Date(beginDt)).format('YYYY-MM-DD'),moment(new Date(endDt)).format('YYYY-MM-DD')]);
return;
}
let beginDate = new Date(beginDt);
let endDate = new Date(endDt);
valueDay = beginDate.toISOString();
valueDay2 = endDate.toISOString();
result = moment(beginDate).format(this.format.toUpperCase()) + ' ' + this.rangeSeparator + ' ' + moment(endDate).format(this.format.toUpperCase());
}
this.monthDay = valueDay;
this.selectDay = [valueDay, valueDay2];
this.chooseDay = [valueDay, valueDay2];
this.inputText = result;
this.loadCalendar();
}
}
},
handleInputChange(e){
let result = e.target.value;
if(this.type.toUpperCase() == 'DATE'){
//单日期
if(this.isLunar){
//农历 NUMBER 模式
if(this.showLunarClass.toUpperCase() == 'NUMBER') {
let regex = /\d{4}[-\.\/]\d{1,2}[-\.\/]\d{1,2}/;
if (!regex.test(result)) return;
result = result.replace(/\./g, '-').replace(/\//g, '-');
result = 'L' + moment(new Date(result)).format('YYYY-MM-DD');
}
}else{
let regex = /\d{4}[-\.\/]\d{1,2}[-\.\/]\d{1,2}/;
if (!regex.test(result)) return;
result = result.replace(/\./g, '-').replace(/\//g, '-');
result = moment(new Date(result)).format('YYYY-MM-DD');
}
}
this.$emit('change',result);
this.$emit('input',result);
},
onClearInput(){
if(this.type.toUpperCase() == 'DATERANGE'){
this.$emit('change',[]);
this.$emit('input', []);
}else {
this.$emit('change', '');
this.$emit('input', '');
}
this.selectDay = [];
this.chooseDay = [];
this.monthDay = moment().toISOString();
this.clearVisible = false;
},
onInputOver(){
if(this.disabled) return;
if(this.value ==null || this.value == '')return;
this.clearVisible = true;
},
onInputOut(){
this.clearVisible = false;
},
isNotOptional(day){
if (this.pickerOptions != null && this.pickerOptions != undefined && 'disabledDate' in this.pickerOptions) {
return this.pickerOptions.disabledDate(new Date(day.date));
}
return false;
},
isChoose(day){
//是否在选中时间段区域内
if(this.type.toUpperCase() == 'DATERANGE') {
if(this.chooseDay.length == 2){
let currDay = moment(day.date);
return currDay.isSameOrAfter(this.chooseDay[0]) & currDay.isSameOrBefore(this.chooseDay[1]) & day.isCurMonth;
}
}
return false;
},
isSelect(day){
return this.chooseDay.length>0 & moment(day.date).isSame(new Date(this.chooseDay[0]),'day') & day.isCurMonth;
},
onInputFocus(){
if(this.disabled) return;
this.loadCalendar();
this.calendarVisible = true;
},
onLunarChange(){
if (this.value != null && this.value != '' && this.value.length > 0) {
if (this.type.toUpperCase() == 'DATERANGE') {
//时间段模式
if (this.isLunar) {
//由公历到农历
//判断日期结果集中日期格式是否为农历,若是不作处理直接返回。
if(this.value[0].indexOf('L')>-1) return;
let beginDay = JDatePickerScript.calendar.getLunar(this.value[0].replace(/L/,'').replace(/R/,''));
let endDay = JDatePickerScript.calendar.getLunar(this.value[1].replace(/L/,'').replace(/R/,''));
let beginDayResult = 'L' + (beginDay.isLeap ? 'R' : '') + moment(new Date(beginDay.lYear + '-' + beginDay.lMonth + '-' + beginDay.lDay)).format('YYYY-MM-DD');
let endDayResult = 'L' + (endDay.isLeap ? 'R' : '') + moment(new Date(endDay.lYear + '-' + endDay.lMonth + '-' + endDay.lDay)).format('YYYY-MM-DD');
this.$emit('change',[beginDayResult,endDayResult]);
this.$emit('input' ,[beginDayResult,endDayResult]);
} else {
//由农历到公历
//判断日期结果集中日期格式是否为农历,若不是不作处理直接返回。
if(this.value[0].indexOf('L') == -1) return;
let beginDay = JDatePickerScript.calendar.getSolar(this.value[0]);
let endDay = JDatePickerScript.calendar.getSolar(this.value[1]);
let beginDayResult = moment(new Date(beginDay.cYear + '-' + beginDay.cMonth + '-' + beginDay.cDay)).format('YYYY-MM-DD');
let endDayResult = moment(new Date(endDay.cYear + '-' + endDay.cMonth + '-' + endDay.cDay)).format('YYYY-MM-DD');
this.$emit('change',[beginDayResult,endDayResult]);
this.$emit('input' ,[beginDayResult,endDayResult]);
}
} else {
//单日期模式
let day,result = '';
if (this.isLunar) {
//由公历到农历
//判断日期结果中日期格式是否为农历,若是不作处理直接返回。
if(this.value.indexOf('L')>-1) return;
day = JDatePickerScript.calendar.getLunar(this.value.replace(/L/,'').replace(/R/,''));
result = 'L' + (day.isLeap ? 'R' : '') + moment(new Date(day.lYear + '-' + day.lMonth + '-' + day.lDay)).format('YYYY-MM-DD');
this.$emit('change', result);
this.$emit('input' , result);
} else {
//由农历到公历
//判断日期结果中日期格式是否为农历,若不是不作处理直接返回。
if(this.value.indexOf('L') == -1) return;
day = JDatePickerScript.calendar.getSolar(this.value);
result = moment(new Date(day.cYear + '-' + day.cMonth + '-' + day.cDay)).format('YYYY-MM-DD');
this.$emit('change', new Date(result));
this.$emit('input' , new Date(result));
}
}
}
},
showYearList(){
//公式A 默认当前年所在页面的起始年S 选择日期所在年份Z(pagesize) = 12; Math.ceil : 向上入有小数就向上1
// result = A - Math.ceil( (A-S) / Z ) * Z;
let A = this.todayYear + parseInt(this.showBackYears) - 11;
this.startYear = A - Math.ceil((A - this.year )/12) * 12;
this.yearVisible = true;
},
goYearPrevList(){
if(this.startYear<1912) return;
this.startYear -= 12;
},
goYearNextList(){
if(this.startYear>=this.todayYear + parseInt(this.showBackYears) - 11) return;
this.startYear += 12;
},
goYearPrev(){
this.monthDay = moment(this.monthDay).subtract(1,'years').toISOString();
this.loadCalendar();
},
goYearNext(){
this.monthDay = moment(this.monthDay).add(1,'years').toISOString();
this.loadCalendar();
},
goPrev () {
let newMonth = moment(this.monthDay).subtract(1, 'months');
this.monthDay = newMonth.toISOString();
this.loadCalendar()
},
goNext () {
let newMonth = moment(this.monthDay).add(1, 'months');
this.monthDay = newMonth.toISOString();
this.loadCalendar()
},
onMouseOver(day){
if (this.selectDay.length == 1) {
let currDay = moment(day.date);
let beginDt = this.selectDay[0];
if (currDay.isAfter(beginDt)) {
this.chooseDay = [beginDt, currDay.toISOString()];
}
}
},
onMouseOut(){
if (this.selectDay.length < 2) {
this.chooseDay = [];
}
},
onDateSelect(day){
if(this.isNotOptional(day)) return;
let dayDate = new Date(day.date).toISOString();
if(this.type.toUpperCase() == 'DATERANGE') {
if (this.selectDay.length >= 2) {
this.selectDay = [];
this.chooseDay = [];
}
//判断日期1、第一次选中直接加入结果集为时间段起始日期
// 2、小于起始日期则重置结果集所选日期为结果集起始日期
// 3、大于等于起始日期加入结果集为时间段结束日期可返回结果。
if (this.selectDay.length > 0) {
if (moment(dayDate).isSameOrAfter(this.selectDay[0])) {
this.selectDay.push(dayDate);
}else{
this.selectDay = [dayDate];
}
}else {
this.selectDay.push(dayDate);
}
//校正日历控件展示月份到起始月份或当前月份
//this.monthDay = new Date(this.selectDay[0]).toISOString();
//判断结果集是否符合条件数组selectDay.length2返回结果隐藏控件
if (this.selectDay.length == 2) {
if(this.isLunar) {
let beginLunarDateResult = '', endLunarDateResult = '';
let beginLunar = JDatePickerScript.calendar.getLunar(this.selectDay[0]);
beginLunarDateResult = 'L' + (beginLunar.isLeap ? 'R' : '') + moment(new Date(beginLunar.lYear + '-' + beginLunar.lMonth + '-' + beginLunar.lDay)).format("YYYY-MM-DD");
endLunarDateResult = 'L' + (day.lDate.isLeap ? 'R' : '') + moment(new Date(day.lDate.lYear + '-' + day.lDate.lMonth + '-' + day.lDate.lDay)).format("YYYY-MM-DD");
this.$emit('change', [beginLunarDateResult, endLunarDateResult])
this.$emit('input' , [beginLunarDateResult, endLunarDateResult])
}else{
this.$emit('change', [moment(this.selectDay[0]).format('YYYY-MM-DD'), moment(this.selectDay[1]).format('YYYY-MM-DD')])
this.$emit('input' , [moment(this.selectDay[0]).format('YYYY-MM-DD'), moment(this.selectDay[1]).format('YYYY-MM-DD')])
}
this.calendarVisible = false;
}
}else {
let result = day.date;
if (this.isLunar) {
let tip = 'L' + (day.lDate.isLeap ? 'R' : '');
let date = new Date(day.lDate.lYear + '-' + day.lDate.lMonth + '-' + day.lDate.lDay).toISOString();
result = tip + moment(date).format("YYYY-MM-DD")
}
this.monthDay = dayDate;
this.calendarVisible = false;
this.$emit('change', result);
this.$emit('input' , result);
}
},
onMonthSelect(command){
let newMonth = moment(this.monthDay).month(command)
this.monthDay = newMonth.toISOString();
this.loadCalendar();
this.monthVisible = false;
},
onYearSelect(command){
let newMonth = moment(this.monthDay).year(command)
this.monthDay = newMonth.toISOString();
this.yearVisible = false;
this.monthVisible = true;
},
loadCalendar () {
if(this.monthDay==null || this.monthDay == ''){
this.monthDay = moment().toISOString();
}
let startDate = moment(this.monthDay).startOf('month').format('YYYY-MM-DD');
let currentMonth = moment(startDate);
this.year = currentMonth.year();
this.month = currentMonth.month() + 1;
this.calendarDatas = this.handleCalendar(currentMonth);
if(this.type.toUpperCase() == 'DATERANGE'){
//时间段模式
let currentMonth2 = currentMonth.clone().add(1,'months');
this.year2 = currentMonth2.year();
this.month2 = currentMonth2.month() + 1;
this.calendarDatas2 = this.handleCalendar(currentMonth2);
}
},
handleCalendar(currentMonth){
let start = currentMonth.clone()
start.subtract(start.day(), 'd')
let calendars = [];
for (let iWeek = 0; iWeek < 6; iWeek++) {
let week = []
if (iWeek > 0 && !start.isSame(currentMonth, 'month')) {
break;
}
for (let iDay = 0; iDay < 7; iDay++) {
week.push({
day: start.date(),
isToday: start.isSame(new Date(), 'day'),
isSelect: this.selectDay.length>0 && start.isSame(new Date(this.selectDay[0]),'day'),
isCurMonth: start.isSame(currentMonth, 'month'),
weekIndex:iWeek,
week: iDay,
date: start.clone().format('YYYY-MM-DD'),
lDate: JDatePickerScript.calendar.getLunar(start.clone().format('YYYY-MM-DD')),
});
start.add(1, 'd')
}
calendars.push(week)
}
return calendars;
}
},
}
</script>
<style src="../theme/public.css" scoped>
</style>

View File

@@ -0,0 +1,13 @@
import jDatePicker from './JDatePicker.vue' // 导入组件
const jLunarDatePicker = {
install(Vue, options) {
Vue.component(jDatePicker.name, jDatePicker) // vuePayKeyboard.name 组件的name属性
// 类似通过 this.$xxx 方式调用插件的 其实只是挂载到原型上而已
// Vue.prototype.$xxx // 最终可以在任何地方通过 this.$xxx 调用
// 虽然没有明确规定用$开头 但是大家都默认遵守这个规定
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(jLunarDatePicker);
}
export default jLunarDatePicker // 导出..

View File

@@ -0,0 +1,626 @@
/**
* @1900-2100区间内的公历、农历互转
* @charset UTF-8
* @公历转农历calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
*/
const calendar = {
/**
* 农历1900-2100的润大小信息表
* @Array Of Property
* @return Hex
*/
lunarInfo:[0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,//1900-1909
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,//1910-1919
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,//1920-1929
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,//1930-1939
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,//1940-1949
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,//1950-1959
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,//1960-1969
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,//1970-1979
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,//1980-1989
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,//1990-1999
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,//2000-2009
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,//2010-2019
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,//2020-2029
0x05aa0,0x076a3,0x096d0,0x04afb,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,//2030-2039
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,//2040-2049
/**Add By JJonline@JJonline.Cn**/
0x14b63,0x09370,0x049f8,0x04970,0x064b0,0x168a6,0x0ea50, 0x06b20,0x1a6c4,0x0aae0,//2050-2059
0x0a2e0,0x0d2e3,0x0c960,0x0d557,0x0d4a0,0x0da50,0x05d55,0x056a0,0x0a6d0,0x055d4,//2060-2069
0x052d0,0x0a9b8,0x0a950,0x0b4a0,0x0b6a6,0x0ad50,0x055a0,0x0aba4,0x0a5b0,0x052b0,//2070-2079
0x0b273,0x06930,0x07337,0x06aa0,0x0ad50,0x14b55,0x04b60,0x0a570,0x054e4,0x0d160,//2080-2089
0x0e968,0x0d520,0x0daa0,0x16aa6,0x056d0,0x04ae0,0x0a9d4,0x0a2d0,0x0d150,0x0f252,//2090-2099
0x0d520],//2100
/**
* 公历每个月份的天数普通表
* @Array Of Property
* @return Number
*/
solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],
/**
* 天干地支之天干速查表
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
* @return Cn string
*/
Gan:["\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1","\u5e9a","\u8f9b","\u58ec","\u7678"],
/**
* 天干地支之地支速查表
* @Array Of Property
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
* @return Cn string
*/
Zhi:["\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a","\u7533","\u9149","\u620c","\u4ea5"],
/**
* 天干地支之地支速查表<=>生肖
* @Array Of Property
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
* @return Cn string
*/
Animals:["\u9f20","\u725b","\u864e","\u5154","\u9f99","\u86c7","\u9a6c","\u7f8a","\u7334","\u9e21","\u72d7","\u732a"],
/**
* 24节气速查表
* @Array Of Property
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
* @return Cn string
*/
solarTerm:["\u5c0f\u5bd2","\u5927\u5bd2","\u7acb\u6625","\u96e8\u6c34","\u60ca\u86f0","\u6625\u5206","\u6e05\u660e","\u8c37\u96e8","\u7acb\u590f","\u5c0f\u6ee1","\u8292\u79cd","\u590f\u81f3","\u5c0f\u6691","\u5927\u6691","\u7acb\u79cb","\u5904\u6691","\u767d\u9732","\u79cb\u5206","\u5bd2\u9732","\u971c\u964d","\u7acb\u51ac","\u5c0f\u96ea","\u5927\u96ea","\u51ac\u81f3"],
/**
* 1900-2100各年的24节气日期速查表
* @Array Of Property
* @return 0x string For splice
*/
sTermInfo:['9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f',
'97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f',
'b027097bd097c36b0b6fc9274c91aa','9778397bd19801ec9210c965cc920e','97b6b97bd19801ec95f8c965cc920f',
'97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2','9778397bd197c36c9210c9274c91aa',
'97b6b97bd19801ec95f8c965cc920e','97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec95f8c965cc920e','97bcf97c3598082c95f8e1cfcc920f',
'97bd097bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f',
'97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd097bd07f595b0b6fc920fb0722',
'9778397bd097c36b0b6fc9210c8dc2','9778397bd19801ec9210c9274c920e','97b6b97bd19801ec95f8c965cc920f',
'97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
'97b6b97bd19801ec95f8c965cc920f','97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e','97bd07f1487f595b0b0bc920fb0722',
'7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e','97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf7f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa','97b6b97bd197c36c9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
'97b6b7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36b0b70c9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa','97b6b7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','977837f0e37f149b0723b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c35b0b6fc9210c8dc2',
'977837f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
'977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
'977837f0e37f14998082b0723b06bd','7f07e7f0e37f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f595b0b0bb0b6fb0722','7f0e37f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f531b0b0bb0b6fb0722',
'7f0e37f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e37f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35',
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f149b0723b0787b0721',
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0723b06bd',
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722','7f0e37f0e366aa89801eb072297c35',
'7ec967f0e37f14998082b0723b06bd','7f07e7f0e37f14998083b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14898082b0723b02d5','7f07e7f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66aa89801e9808297c35','665f67f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66a449801e9808297c35',
'665f67f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
'7f0e36665b66a449801e9808297c35','665f67f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721','7f0e26665b66a449801e9808297c35','665f67f0e37f1489801eb072297c35',
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722'],
/**
* 数字转中文速查表
* @Array Of Property
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
* @return Cn string
*/
nStr1:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341"],
/**
* 日期转农历称呼速查表
* @Array Of Property
* @trans ['初','十','廿','卅']
* @return Cn string
*/
nStr2:["\u521d","\u5341","\u5eff","\u5345"],
/**
* 月份转农历称呼速查表
* @Array Of Property
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
* @return Cn string
*/
nStr3:["\u6b63","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u51ac","\u814a"],
/**
* 农历节日
*/
lunarFestival:{"1-1":"春节","1-15":"上元节","2-2":"龙抬头","5-5":"端午","7-7":"七夕","7-15":"中元节","8-15":"中秋","9-9":"重阳","10-15":"下元节","12-8":"腊八","12-23":"小年"},
/**
* 公历节日
*/
solarFestival:{"1-1":"元旦","2-14":"情人节","3-8":"妇女节","3-12":"植树节","4-1":"愚人节","5-1":"劳动节","5-4":"青年节","6-1":"儿童节","7-1":"建党节","8-1":"建军节","9-10":"教师节","10-1":"国庆节","11-1":"万圣节","12-24":"平安夜","12-25":"圣诞节"},
/**
* 返回农历y年一整年的总天数
* @param lunar Year
* @return Number
* @eg:var count = calendar.lYearDays(1987) ;//count=387
*/
lYearDays:function(y) {
var i, sum = 348;
for(i=0x8000; i>0x8; i>>=1) { sum += (calendar.lunarInfo[y-1900] & i)? 1: 0; }
return(sum+calendar.leapDays(y));
},
/**
* 返回农历y年闰月是哪个月若y年没有闰月 则返回0
* @param lunar Year
* @return Number (0-12)
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
*/
leapMonth:function(y) { //闰字编码 \u95f0
return(calendar.lunarInfo[y-1900] & 0xf);
},
/**
* 返回农历y年闰月的天数 若该年没有闰月则返回0
* @param lunar Year
* @return Number (0、29、30)
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
*/
leapDays:function(y) {
if(calendar.leapMonth(y)) {
return((calendar.lunarInfo[y-1900] & 0x10000)? 30: 29);
}
return(0);
},
/**
* 返回农历y年m月非闰月的总天数计算m为闰月时的天数请使用leapDays方法
* @param lunar Year
* @return Number (-1、29、30)
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
*/
monthDays:function(y,m) {
if(m>12 || m<1) {return -1}//月份参数从1至12参数错误返回-1
return( (calendar.lunarInfo[y-1900] & (0x10000>>m))? 30: 29 );
},
/**
* 返回公历(!)y年m月的天数
* @param solar Year
* @return Number (-1、28、29、30、31)
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
*/
solarDays:function(y,m) {
if(m>12 || m<1) {return -1} //若参数错误 返回-1
var ms = m-1;
if(ms==1) { //2月份的闰平规律测算后确认返回28或29
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
}else {
return(calendar.solarMonth[ms]);
}
},
/**
* 农历年份转换为干支纪年
* @param lYear 农历年的年份数
* @return Cn string
*/
toGanZhiYear:function(lYear) {
var ganKey = (lYear - 3) % 10;
var zhiKey = (lYear - 3) % 12;
if(ganKey == 0) ganKey = 10;//如果余数为0则为最后一个天干
if(zhiKey == 0) zhiKey = 12;//如果余数为0则为最后一个地支
return calendar.Gan[ganKey-1] + calendar.Zhi[zhiKey-1];
},
/**
* 公历月、日判断所属星座
* @param cMonth [description]
* @param cDay [description]
* @return Cn string
*/
toAstro:function(cMonth,cDay) {
var s = "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf";
var arr = [20,19,21,21,21,22,23,23,23,23,22,22];
return s.substr(cMonth*2 - (cDay < arr[cMonth-1] ? 2 : 0),2) + "\u5ea7";//座
},
/**
* 传入offset偏移量返回干支
* @param offset 相对甲子的偏移量
* @return Cn string
*/
toGanZhi:function(offset) {
return calendar.Gan[offset%10] + calendar.Zhi[offset%12];
},
/**
* 传入公历(!)y年获得该年第n个节气的公历日期
* @param y公历年(1900-2100)n二十四节气中的第几个节气(1~24)从n=1(小寒)算起
* @return day Number
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
*/
getTerm:function(y,n) {
if(y<1900 || y>2100) {return -1;}
if(n<1 || n>24) {return -1;}
var _table = calendar.sTermInfo[y-1900];
var _info = [
parseInt('0x'+_table.substr(0,5)).toString() ,
parseInt('0x'+_table.substr(5,5)).toString(),
parseInt('0x'+_table.substr(10,5)).toString(),
parseInt('0x'+_table.substr(15,5)).toString(),
parseInt('0x'+_table.substr(20,5)).toString(),
parseInt('0x'+_table.substr(25,5)).toString()
];
var _calday = [
_info[0].substr(0,1),
_info[0].substr(1,2),
_info[0].substr(3,1),
_info[0].substr(4,2),
_info[1].substr(0,1),
_info[1].substr(1,2),
_info[1].substr(3,1),
_info[1].substr(4,2),
_info[2].substr(0,1),
_info[2].substr(1,2),
_info[2].substr(3,1),
_info[2].substr(4,2),
_info[3].substr(0,1),
_info[3].substr(1,2),
_info[3].substr(3,1),
_info[3].substr(4,2),
_info[4].substr(0,1),
_info[4].substr(1,2),
_info[4].substr(3,1),
_info[4].substr(4,2),
_info[5].substr(0,1),
_info[5].substr(1,2),
_info[5].substr(3,1),
_info[5].substr(4,2),
];
return parseInt(_calday[n-1]);
},
/**
* 传入农历数字月份返回汉语通俗表示法
* @param lunar month
* @return Cn string
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
*/
toChinaMonth:function(m) { // 月 => \u6708
if(m>12 || m<1) {return -1} //若参数错误 返回-1
var s = calendar.nStr3[m-1];
s+= "\u6708";//加上月字
return s;
},
/**
* 传入年份月份返回第n个星期日的日期数字
* @param y 年份
* @param m 月份
* @param n 第几个星期日 ( 5>n>0的数字 一个月一般就4个星期日最多5个)
* @return 日期数字3 getSunday(2017,9,1); 九月的第一个星期日是3号超出返回-1
*/
getSunday(y,m,n){
var d = new Date(y+'-' + m + '-1');
var d2= new Date(y+'-'+(m+1)+'-1');
d2.setDate(0);
var maxDay = d2.getDate();//传入月份的最后一天
var week = d.getDay();
var first = 1;
if(week>0) first = d.getDate() + (7 - week);
var result = (n-1)*7 + first;
if(result>maxDay) return -1;
return result;
},
/**
* 传入农历日期数字返回汉字表示法
* @param lunar day
* @return Cn string
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
*/
toChinaDay:function(d){ //日 => \u65e5
var s;
switch (d) {
case 10:
s = '\u521d\u5341'; break;
case 20:
s = '\u4e8c\u5341'; break;
break;
case 30:
s = '\u4e09\u5341'; break;
break;
default :
s = calendar.nStr2[Math.floor(d/10)];
s += calendar.nStr1[d%10];
}
return(s);
},
/**
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
* @param y year
* @return Cn string
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
*/
getAnimal: function(y) {
return calendar.Animals[(y - 4) % 12]
},
/**
* 判断 当天为 此年的第几天
* @param date
* @returns {number}
*/
getCyclical:function(date){
var nowDate = new Date(date);
var initTime = new Date(date);
initTime.setMonth(0); // 本年初始月份
initTime.setDate(1); // 本年初始时间
var differenceVal = nowDate - initTime ; // 今天的时间减去本年开始时间,获得相差的时间
return Math.ceil(differenceVal/(24*60*60*1000));
},
/**
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
* @param y solar year
* @param m solar month
* @param d solar day
* @return JSON object
* @eg:console.log(calendar.solar2lunar(1987,11,01));
*/
solar2lunar:function (y,m,d) { //参数区间1900.1.31~2100.12.31
//年份限定、上限
if(y<1900 || y>2100) {
return -1;// undefined转换为数字变为NaN
}
//公历传参最下限
if(y==1900&&m==1&&d<31) {
return -1;
}
//未传参 获得当天
if(!y) {
var objDate = new Date();
}else {
var objDate = new Date(y,parseInt(m)-1,d)
}
var i, leap=0, temp=0;
//修正ymd参数
var y = objDate.getFullYear(),
m = objDate.getMonth()+1,
d = objDate.getDate();
var offset = (Date.UTC(objDate.getFullYear(),objDate.getMonth(),objDate.getDate()) - Date.UTC(1900,0,31))/86400000;
for(i=1900; i<2101 && offset>0; i++) {
temp = calendar.lYearDays(i);
offset -= temp;
}
if(offset<0) {
offset+=temp; i--;
}
//是否今天
var isTodayObj = new Date(),
isToday = false;
if(isTodayObj.getFullYear()==y && isTodayObj.getMonth()+1==m && isTodayObj.getDate()==d) {
isToday = true;
}
//星期几
var nWeek = objDate.getDay(),
cWeek = calendar.nStr1[nWeek];
//数字表示周几顺应天朝周一开始的惯例
if(nWeek==0) {
nWeek = 7;
}
//农历年
var year = i;
var leap = calendar.leapMonth(i); //闰哪个月
var isLeap = false;
//效验闰月
for(i=1; i<13 && offset>0; i++) {
//闰月
if(leap>0 && i==(leap+1) && isLeap==false){
--i;
isLeap = true; temp = calendar.leapDays(year); //计算农历闰月天数
}
else{
temp = calendar.monthDays(year, i);//计算农历普通月天数
}
//解除闰月
if(isLeap==true && i==(leap+1)) { isLeap = false; }
offset -= temp;
}
// 闰月导致数组下标重叠取反
if(offset==0 && leap>0 && i==leap+1)
{
if(isLeap){
isLeap = false;
}else{
isLeap = true; --i;
}
}
if(offset<0)
{
offset += temp;
--i;
}
//农历月
var month = i;
//农历日
var day = offset +1;
//天干地支处理
var sm = m-1;
var gzY = calendar.toGanZhiYear(year);
// 当月的两个节气
// bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
var firstNode = calendar.getTerm(y,(m*2-1));//返回当月「节」为几日开始
var secondNode = calendar.getTerm(y,(m*2));//返回当月「节」为几日开始
// 依据12节气修正干支月
var gzM = calendar.toGanZhi((y-1900)*12+m+11);
if(d>=firstNode) {
gzM = calendar.toGanZhi((y-1900)*12+m+12);
}
//传入的日期的节气与否
var isTerm = false;
var Term = null;
if(firstNode==d) {
isTerm = true;
Term = calendar.solarTerm[m*2-2];
}
if(secondNode==d) {
isTerm = true;
Term = calendar.solarTerm[m*2-1];
}
//日柱 当月一日与 1900/1/1 相差天数
var dayCyclical = Date.UTC(y,sm,1,0,0,0,0)/86400000+25567+10;
var gzD = calendar.toGanZhi(dayCyclical+d-1);
//(年-1900) * 5 + (年-1900+3) / 4 + 9 + 当年年初起累积日数
// var dayCyclical = (y-1900)*5 + (y-1900+3)/4 + 9 +(this.getCyclical(y+'-'+m+'-'+d))
// var gzD = calendar.toGanZhi(dayCyclical-1);
//该日期所属的星座
var astro = calendar.toAstro(m,d);
//该日期所有的节日
var festival = [];
//农历传统节日
var lf = calendar.lunarFestival[month+'-'+day];
if(lf != undefined && lf != null && lf != '') festival.push(lf);
if(month==12 && (isLeap?day == calendar.leapDays(year):calendar.monthDays(month-1)==29?day == 30:day == 29)) festival.push('除夕');
//公历节日
var sf = calendar.solarFestival[m+'-'+d];
if(sf != undefined && sf != null && sf != '') festival.push(sf);
if(m==5 && d==calendar.getSunday(y,m,2)) festival.push('母亲节');
if(m==6 && d==calendar.getSunday(y,m,3)) festival.push('父亲节');
return {'lYear':year,'lMonth':month,'lDay':day,'isFestival':festival.length>0,'festival':festival,'Animal':calendar.getAnimal(year),'IMonthCn':(isLeap?"\u95f0":'')+calendar.toChinaMonth(month),'IDayCn':calendar.toChinaDay(day),'cYear':y,'cMonth':m,'cDay':d,'gzYear':gzY,'gzMonth':gzM,'gzDay':gzD,'isToday':isToday,'isLeap':isLeap,'nWeek':nWeek,'ncWeek':"\u661f\u671f"+cWeek,'isTerm':isTerm,'Term':Term,'astro':astro};
},
getLunar:function (date) {
var D;
if(date==undefined){
D = new Date();
}else{
D = new Date(date);
}
D.setHours(D.getHours()+8)//根据国际UTC标准中国时区应为UTC+8
var cY = D.getUTCFullYear();
var cM = D.getUTCMonth()+1;
var cD = D.getUTCDate();
//console.log('getLunar:月'+cM+'--'+cD+'日')
return calendar.solar2lunar(cY,cM,cD);
},
/**
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
* @param y lunar year
* @param m lunar month
* @param d lunar day
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
* @return JSON object
* @eg:console.log(calendar.lunar2solar(1987,9,10));
*/
lunar2solar:function(y,m,d,isLeapMonth) { //参数区间1900.1.31~2100.12.1
var isLeapMonth = !!isLeapMonth;
var leapOffset = 0;
var leapMonth = calendar.leapMonth(y);
var leapDay = calendar.leapDays(y);
if(isLeapMonth&&(leapMonth!=m)) {return -1;}//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
if(y==2100&&m==12&&d>1 || y==1900&&m==1&&d<31) {return -1;}//超出了最大极限值
var day = calendar.monthDays(y,m);
var _day = day;
//bugFix 2016-9-25
//if month is leap, _day use leapDays method
if(isLeapMonth) {
_day = calendar.leapDays(y,m);
}
if(y < 1900 || y > 2100 || d > _day) {return -1;}//参数合法性效验
//计算农历的时间差
var offset = 0;
for(var i=1900;i<y;i++) {
offset+=calendar.lYearDays(i);
}
var leap = 0,isAdd= false;
for(var i=1;i<m;i++) {
leap = calendar.leapMonth(y);
if(!isAdd) {//处理闰月
if(leap<=i && leap>0) {
offset+=calendar.leapDays(y);isAdd = true;
}
}
offset+=calendar.monthDays(y,i);
}
//转换闰月农历 需补充该年闰月的前一个月的时差
if(isLeapMonth) {offset+=day;}
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
var stmap = Date.UTC(1900,1,30,0,0,0);
var calObj = new Date((offset+d-31)*86400000+stmap);
var cY = calObj.getUTCFullYear();
var cM = calObj.getUTCMonth()+1;
var cD = calObj.getUTCDate();
return calendar.solar2lunar(cY,cM,cD);
},
/**
* 传入农历日期
* @param date 类型String格式L2017-01-02闰月LR2017-06-03
* @returns {*|JSON}
*/
getSolar(date) {
if(date == undefined || date == null || date == '' || date.indexOf('L') == -1) return null;
var isLeapMonth = date.indexOf('R')>-1;
var D = date.replace(/L/,'').replace(/R/,'').split('-');
var cY = parseInt(D[0]);
var cM = parseInt(D[1]);
var cD = parseInt(D[2]);
return calendar.lunar2solar(cY,cM,cD,isLeapMonth);
},
};
export default { calendar }

View File

@@ -33,6 +33,10 @@ const tableProps = [
prop: 'opPeopleName',
label: '操作人'
},
{
prop: 'deptName',
label: '部门'
},
{
prop: 'opType',
label: '操作类型',

View File

@@ -2,176 +2,284 @@
* @Author: zwq
* @Date: 2024-07-01 14:54:06
* @LastEditors: zwq
* @LastEditTime: 2025-10-27 10:18:54
* @LastEditTime: 2025-11-24 16:11:20
* @Description:
-->
<template>
<el-row :gutter="10" style="background-color: #f2f4f9">
<!--部门数据-->
<el-col :span="4">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
highlight-current
@node-click="handleNodeClick" />
</div>
</el-col>
<el-col :span="20">
<div class="groupTeamScheduling">
<div class="operationArea">
<el-row>
<el-col :span="16">
<div style="height: 40px; font-size: 16px">
<span style="color: #409eff; font-weight: 600">
{{ showDeptName }}
</span>
节假日设置
</div>
</el-col>
<el-col :span="8">
<div style="float: right">
<el-button
size="small"
type="primary"
style="margin-right: 10px"
v-hasPermi="['base:group-holiday:create']"
@click="addHoliday">
新增节假日
</el-button>
<el-button
size="small"
v-hasPermi="['base:group-holiday-log:query']"
@click="holidayLog">
节假日变更记录
</el-button>
</div>
</el-col>
</el-row>
</div>
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="月份选择">
<el-date-picker
v-model="startDay"
type="month"
placeholder="选择月"
size="small"
@change="selectMonth"
:clearable="false"
style="width: 120px"></el-date-picker>
</el-form-item>
<el-form-item style="float: right">
<div
class="app-container"
style="
background-color: #f2f4f9;
padding: 0;
display: grid;
grid-template-columns: 1fr 5fr;
gap: 10px;
">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick" />
</div>
<div class="groupTeamScheduling">
<div class="operationArea">
<el-row>
<el-col :span="6">
<div style="height: 40px; font-size: 16px">
<span style="color: #409eff; font-weight: 600">
{{ showDeptName }}
</span>
节假日设置
<span
:style="{
color: inherited ? '#67c23a' : '#b5b839',
fontSize: '12px',
fontWeight: 600,
}"
v-show="ishasParent">
{{ inherited ? '继承模式' : '自定义模式' }}
</span>
</div>
</el-col>
<el-col :span="18" v-if="!ishasParent">
<div style="float: right">
<el-button
size="small"
type="primary"
@click="(startDay = new Date()), getHolidayPage()">
跳转到今天
style="margin-right: 10px"
v-hasPermi="['base:group-holiday:create']"
@click="addHoliday">
新增节假日
</el-button>
</el-form-item>
</el-form>
<el-button
size="small"
v-hasPermi="['base:group-holiday-log:query']"
@click="holidayLog">
节假日变更记录
</el-button>
</div>
</el-col>
<el-col :span="18" v-else style="text-align: right">
<el-button
size="small"
type="primary"
:disabled="inherited"
v-hasPermi="['base:group-holiday:create']"
@click="addHoliday">
新增节假日
</el-button>
<el-button
size="small"
type="success"
:disabled="inherited"
v-hasPermi="['base:group-holiday:update']"
@click="reExtends">
恢复继承
</el-button>
<el-button
size="small"
type="warning"
:disabled="!inherited"
v-hasPermi="['base:group-holiday:update']"
@click="disExtends">
解除继承
</el-button>
<el-button
size="small"
:disabled="inherited"
v-hasPermi="['base:group-holiday-log:query']"
@click="holidayLog">
节假日变更记录
</el-button>
</el-col>
</el-row>
</div>
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="月份选择">
<el-date-picker
v-model="startDay"
type="month"
placeholder="选择月"
size="small"
@change="selectMonth"
:clearable="false"
style="width: 120px"></el-date-picker>
</el-form-item>
<el-form-item label="继承上一级的节假日" v-show="ishasParent">
<div
style="
width: 36px;
height: 36px;
background-color: #67c23a;
border-radius: 3px;
"></div>
</el-form-item>
<el-form-item label="本级自定义的节假日" v-show="ishasParent">
<div
style="
width: 36px;
height: 36px;
background-color: #b5b839;
border-radius: 3px;
"></div>
</el-form-item>
<el-form-item style="float: right">
<el-button
size="small"
type="primary"
@click="(startDay = new Date()), getHolidayPage()">
跳转到今天
</el-button>
</el-form-item>
</el-form>
<div v-if="!ishasParent">
<el-tag
v-if="topDeptId == deptId"
type="warning"
closable
v-if="showTag1"
@close="handleClose(1)"
style="margin-bottom: 10px; color: black">
<i class="el-icon-warning" style="color: #ffbd02"></i>
当前节假日设置为组织架构中最高层级配置默认自动继承至下属部门子部门可选择
<span style="color: red">解除继承</span>
设置后进行独立修改复制后不再继承上级设置
设置后进行独立修改解除后不再继承上级设置
</el-tag>
</div>
<!-- 日历区域 -->
<div class="calenderArea">
<el-calendar v-model="startDay">
<template slot="dateCell" slot-scope="{ data }">
<div v-if="data.type === 'current-month'">
<!-- 日期 -->
<div class="dateStyle">
<el-row :gutter="20">
<!-- 公历和农历 -->
<el-col :span="18">
{{ Number(data.day.split('-')[2]) }}
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
</el-col>
<!-- 显示假或班 -->
<el-col :span="6">
<div
class="work-tip"
:style="{
backgroundColor: HolidayList[
Number(data.day.split('-')[2]) - 1
]?.isHoliday
? '#67C23A'
: '#409EFF',
}">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isHoliday
? '假'
: '班'
}}
</div>
</el-col>
<!-- 显示假期名和操作 -->
<el-col
:span="24"
v-if="
<div v-else>
<div v-if="inherited">
<el-tag
type="warning"
closable
v-if="showTag2"
@close="handleClose(2)"
style="margin-bottom: 10px; color: black">
<i class="el-icon-warning" style="color: #ffbd02"></i>
当前部门继承上级节假日设置默认不可修改可通过
<span style="color: red">解除继承</span>
进行自定义解除后将不再继承
</el-tag>
</div>
<div v-else>
<el-tag
type="warning"
closable
v-if="showTag3"
@close="handleClose(3)"
style="margin-bottom: 10px; color: black">
<i class="el-icon-warning" style="color: #ffbd02"></i>
当前部门已解除继承节假日可自由配置点击
<span style="color: red">恢复继承</span>
将清空当前设置并同步上级节假日
</el-tag>
</div>
</div>
</div>
<!-- 日历区域 -->
<div class="calenderArea">
<el-calendar v-model="startDay">
<template slot="dateCell" slot-scope="{ data }">
<div v-if="data.type === 'current-month'">
<!-- 日期 -->
<div
class="dateStyle"
@click="
new Date(data.day).getTime() >=
new Date().setHours(0, 0, 0, 0) &&
(!ishasParent || !inherited) &&
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isHoliday &&
showDetail(HolidayList[Number(data.day.split('-')[2]) - 1])
">
<el-row :gutter="20">
<!-- 公历和农历 -->
<el-col :span="18">
{{ Number(data.day.split('-')[2]) }}
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
</el-col>
<!-- 显示假或班 -->
<el-col :span="6">
<div
class="work-tip"
:style="{
backgroundColor: HolidayList[
Number(data.day.split('-')[2]) - 1
]?.isHoliday
? '#67C23A'
: '#409EFF',
}">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.isHoliday
">
<div
class="holiday-div"
@click="
new Date(data.day).getTime() > Date.now() &&
showDetail(
HolidayList[Number(data.day.split('-')[2]) - 1]
.holidayId
)
? '假'
: '班'
}}
</div>
</el-col>
<!-- 显示假期名和操作 -->
<el-col
:span="24"
v-if="
HolidayList[Number(data.day.split('-')[2]) - 1]?.isHoliday
">
<div
class="holiday-div"
:style="{
backgroundColor: ishasParent
? HolidayList[Number(data.day.split('-')[2]) - 1]
.isInherit
? '#67c23a'
: '#b5b839'
: '',
}">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.holidayName
}}
<span
class="holiday-div-btn"
v-if="
(!ishasParent || !inherited) &&
new Date(data.day).getTime() >=
new Date().setHours(0, 0, 0, 0)
">
{{
HolidayList[Number(data.day.split('-')[2]) - 1]
?.holidayName
}}
<span
class="holiday-div-btn"
v-if="new Date(data.day).getTime() > Date.now()">
<i class="el-icon-more" style="color: #fff"></i>
</span>
</div>
</el-col>
</el-row>
</div>
</div>
<div
v-else
style="font-size: 20px; font-weight: 500; text-align: left">
<el-row :gutter="20">
<el-col :span="24">
{{ Number(data.day.split('-')[2]) }}
<span style="font-size: 12px">
{{ getLunarDate(data.day) }}
</span>
<i class="el-icon-more" style="color: #fff"></i>
</span>
</div>
</el-col>
</el-row>
</div>
</template>
</el-calendar>
</div>
</div>
<div
v-else
style="font-size: 20px; font-weight: 500; text-align: left">
<el-row :gutter="20">
<el-col :span="24">
{{ Number(data.day.split('-')[2]) }}
<span style="font-size: 12px">
{{ getLunarDate(data.day) }}
</span>
</el-col>
</el-row>
</div>
</template>
</el-calendar>
</div>
</el-col>
</div>
<base-dialog
:dialogTitle="dialogTitle"
:dialogVisible="addOrUpdateVisible"
@@ -179,6 +287,7 @@
@confirm="handleConfirm"
:before-close="cancel"
:destroy-on-close="true"
class="addDialog"
width="40%">
<add-or-updata
ref="addOrUpdataRef"
@@ -244,7 +353,7 @@
</slot>
</template>
</base-dialog>
</el-row>
</div>
</template>
<script>
@@ -252,7 +361,14 @@ import moment from 'moment';
import { solarToLunar } from 'chinese-lunar';
import { getUserProfile } from '@/api/system/user';
import { deptHolidayList, getEnableData } from '@/api/group/holidaySetting';
import {
deptHolidayList,
getEnableData,
disExtends,
reExtends,
updateSchedule,
getSet,
} from '@/api/group/holidaySetting';
import addOrUpdata from './add-or-updata.vue';
import holidayLog from './holidayLog';
@@ -274,7 +390,9 @@ export default {
// 选择的部门名称
showDeptName: undefined,
topDeptId: undefined, // 保存当前用户的部门id为最高级部门id
parentId: undefined, // 保存部门点击时对象的父id用于解除和恢复继承
deptId: undefined,
ishasParent: false, // 判断是否有上级,false,则表示为最高级
defaultProps: {
children: 'children',
label: 'name',
@@ -283,6 +401,10 @@ export default {
addOrUpdateVisible: false,
detail: false,
logVisible: false,
inherited: true, //该部门是否为继承状态
showTag1: true, //tag标签是否显示的
showTag2: true,
showTag3: true,
};
},
watch: {
@@ -298,9 +420,9 @@ export default {
this.showDeptName = response.data.dept.name || '';
this.topDeptId = response.data.dept.id || ''; // 保存当前用户的部门id为最高级部门id
this.deptId = response.data.dept.id || '';
this.getHolidayPage();
this.getTreeselect();
this.getSet();
});
this.getTreeselect();
},
methods: {
getHolidayPage() {
@@ -329,11 +451,53 @@ export default {
/** 查询部门下拉树结构 */
getTreeselect() {
getEnableData().then((response) => {
// 遍历部门,判断当前帐号的部门是否有为最上级
const nowDept = response.data.filter((i) => i.id == this.topDeptId);
this.ishasParent = nowDept[0].hasParent;
this.parentId = nowDept[0].parentId;
// 处理 deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, 'id'));
this.deptOptions.push(...this.handleTree1(response.data, 'id'));
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.deptId);
});
});
},
//大整数精度丢失
handleTree1(data, fid) {
const id = fid || 'id';
const parentId = 'parentId';
const children = 'children';
const rootId =
data
.map((item) => item[parentId].toString())
.reduce((min, current) => {
if (current.length < min.length) return current;
if (current.length > min.length) return min;
return current < min ? current : min;
}) || 0;
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data));
//循环所有项
const treeData = cloneData.filter((father) => {
let branchArr = cloneData.filter((child) => {
//返回每一项的子级数组
return father[id] == child[parentId];
});
branchArr.length > 0 ? (father.children = branchArr) : '';
//返回第一层
return father[parentId] == rootId;
});
return treeData !== '' ? treeData : data;
},
// 根据部门id查询该部门是否是继承
getSet() {
getSet({ id: this.deptId }).then((res) => {
this.inherited = res.data;
});
this.getHolidayPage();
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
@@ -343,6 +507,11 @@ export default {
handleNodeClick(data) {
this.deptId = data.id;
this.showDeptName = data.name;
this.ishasParent = data.hasParent;
this.parentId = data.parentId;
this.getSet();
this.showTag1 = true;
this.showTag2 = true;
this.getHolidayPage();
},
//获取农历
@@ -414,9 +583,109 @@ export default {
this.detail = false;
this.dialogTitle = '新增节假日';
this.$nextTick(() => {
this.$refs.addOrUpdataRef.init(this.deptId);
this.$refs.addOrUpdataRef.init(this.deptId, {
inherited: this.inherited,
});
});
},
disExtends() {
this.$confirm(
'当前节假日设置继承自上级部门,解除继承后将不再自动同步上级设置。<br/>系统将保留当前节假日配置作为初始数据,您可以自定义修改。<br/>是否确认解除继承?',
'解除继承',
{
dangerouslyUseHTMLString: true,
confirmButtonText: '确认解除',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
disExtends({ id: this.deptId, pid: this.parentId }).then((res) => {
if (!res.data.updateFlag) {
this.$modal.msgSuccess('操作成功');
this.getSet();
} else {
this.$confirm(
'新增节假日影响已有排班计划,是否立即更新?',
'更新排班',
{
confirmButtonText: '立即更新',
cancelButtonText: '暂不更新',
type: 'warning',
}
)
.then(() => {
updateSchedule({ logId: res.data.logId }).then((res1) => {
this.$modal.msgSuccess('更新成功');
this.getSet();
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
});
}
});
})
.catch((res) => {
console.log(res);
this.$message({
type: 'info',
message: '已取消',
});
});
},
reExtends() {
this.$confirm(
'恢复继承后,当前部门将重新同步未来时间的上级部门的节假日设置,现有自定义配置将被清空并替换为上级设置,不可恢复。<br/>是否确认继续?',
'恢复继承',
{
dangerouslyUseHTMLString: true,
confirmButtonText: '确认恢复继承',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
reExtends({ id: this.deptId, pid: this.parentId }).then((res) => {
if (!res.data.updateFlag) {
this.$modal.msgSuccess('操作成功');
this.getSet();
} else {
this.$confirm(
'新增节假日影响已有排班计划,是否立即更新?',
'更新排班',
{
confirmButtonText: '立即更新',
cancelButtonText: '暂不更新',
type: 'warning',
}
)
.then(() => {
updateSchedule({ logId: res.data.logId }).then((res1) => {
this.$modal.msgSuccess('更新成功');
this.getSet();
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
this.getSet();
});
}
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
});
},
holidayLog() {
this.logVisible = true;
this.$nextTick(() => {
@@ -434,12 +703,12 @@ export default {
handleConfirm() {
this.$refs.addOrUpdataRef.dataFormSubmit();
},
showDetail(id) {
showDetail(val) {
this.addOrUpdateVisible = true;
this.detail = true;
this.dialogTitle = '节假日详情';
this.$nextTick(() => {
this.$refs.addOrUpdataRef.init(this.deptId, id, true);
this.$refs.addOrUpdataRef.init(this.deptId, val, true, this.inherited); //编辑的时候该部门如果是自定义的但这个val数据是继承的修改之后则变成自定义的inherited
});
},
editHoliday() {
@@ -456,6 +725,15 @@ export default {
cancelLog() {
this.logVisible = false;
},
handleClose(val) {
if (val == 1) {
this.showTag1 = false;
} else if (val == 2) {
this.showTag2 = false;
} else {
this.showTag3 = false;
}
},
},
};
</script>
@@ -463,7 +741,7 @@ export default {
.head-container {
padding: 20px 10px 0;
background-color: #fff;
min-height: calc(100vh - 120px - 8px);
height: 100%;
border-radius: 8px;
}
.groupTeamScheduling {
@@ -561,4 +839,9 @@ export default {
}
}
}
.addDialog {
.el-dialog__body {
overflow: visible;
}
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,319 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Sat Apr 15 15:55:39 2017
By admin
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
panose-1="2 0 6 3 0 0 0 0 0 0"
ascent="896"
descent="-128"
x-height="792"
bbox="0 -224 1273 896.22"
underline-thickness="0"
underline-position="0"
unicode-range="U+0078-E810"
/>
<missing-glyph
/>
<glyph glyph-name=".notdef"
/>
<glyph glyph-name=".notdef"
/>
<glyph glyph-name=".null" horiz-adv-x="0"
/>
<glyph glyph-name="nonmarkingreturn" horiz-adv-x="341"
/>
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="sousuo" unicode="&#xe602;" horiz-adv-x="1000"
d="M808 54l-73 75q48 76 48 167q0 130 -90.5 222t-218 92t-218 -92t-90.5 -222t90.5 -222t217.5 -92q67 0 128 28l22 -23v0l60 -60q25 -26 62 -26t62.5 26t25.5 63.5t-26 63.5zM262 296.5q0 89.5 62 153t150 63.5t150.5 -63.5t62.5 -153t-62.5 -153t-150.5 -63.5t-150 63.5
t-62 153z" />
<glyph glyph-name="tingzhi" unicode="&#xe61d;"
d="M511 809q106 0 199 -41q93 -40 161.5 -108.5t109 -161t40.5 -198t-40.5 -198.5t-109 -161.5t-161.5 -109t-198.5 -40.5t-197.5 41q-93 40 -161.5 108.5t-109 161.5t-40.5 198.5t40.5 198t109 161t161 109t197.5 40.5v0zM764 231q34 0 61.5 18t27.5 53q0 34 -27.5 50.5
t-61.5 16.5h-501q-34 0 -62.5 -16.5t-28.5 -50.5q0 -35 28.5 -53t62.5 -18h501v0zM764 231z" />
<glyph glyph-name="bianji" unicode="&#xe69e;"
d="M502 330zM380 -16v0l-191 -35l38 188v0zM681 591l-69 -69l153 -153l69 69zM262 171l153 -153l316 317l-153 153z" />
<glyph glyph-name="icon01" unicode="&#xe600;"
d="M858 43l-179 177q18 38 18 80q0 77 -54.5 131.5t-132.5 54.5q-25 0 -49 -6l79 -80q25 -25 23.5 -61.5t-28.5 -63t-63.5 -28t-61.5 22.5l-79 80q-7 -24 -7 -50q0 -77 54.5 -132t131.5 -55q43 0 80 19l179 -178q17 -17 42 -16t43 20q19 18 20 43t-16 42v0zM810 -29
q-13 0 -22.5 9t-9.5 22t9.5 22t22.5 9t22 -9t9 -22t-9 -22t-22 -9v0zM901 383h-18h-42h-1q-12 1 -23 9h-1q-26 17 -25 47q0 8 3 17q3 10 9 17l9 10l21 21l13 12q13 18 13 40.5t-14 40.5l-36 37q-18 14 -41 14.5t-40 -13.5l-14 -13l-29 -30v0v0q-26 -21 -57 -7q-10 4 -18 12
q-13 14 -15 32v14v29v19q-3 22 -19 37.5t-39 18.5h-52q-22 -2 -38 -18t-20 -38v-18v-30v-13v0v0v-2v-2v-1q-1 -1 -1 -4l-1 -1l-0.5 -2l-0.5 -2v0q-1 -1 -3 -5v0q-4 -10 -13 -17q-15 -13 -36 -13q-20 0 -35 12l-9 10l-21 20l-13 13q-17 14 -40 13.5t-40 -14.5l-37 -36
q-14 -18 -14.5 -40.5t12.5 -40.5l13 -13l30 -30v0q1 0 1.5 -1l0.5 -1l0.5 -1t1 -1.5t0.5 -1t1 -1.5l0.5 -0.5t0.5 -1.5l0.5 -1t1.5 -2v-1t0.5 -2t1.5 -2v-1t0.5 -2.5t0.5 -2.5v0q1 -3 1 -5v0q4 -27 -16 -46v0q-14 -14 -33 -16h-13h-30h-18q-22 -3 -38 -19t-18 -38v-53
q2 -22 17.5 -38t38.5 -19h18l42 -1q5 0 5 -1h2q2 -1 3 -1q18 -5 29 -20t11 -33v0q0 -20 -12 -35l-10 -9v0l-21 -21l-13 -13q-13 -18 -13 -40.5t14 -39.5l37 -37q18 -15 40.5 -15t40.5 14l12 12l31 30v0v1q1 0 2 1t2 1q1 1 2 1l2 2l1.5 0.5l1.5 0.5l2 1q1 0 2 1q2 0 2 1v0v0
l5 1v0q1 0 2.5 0.5t2.5 0.5v0h4q26 1 43 -16q13 -13 16 -33v-13v-30v-18q2 -22 18.5 -38t38.5 -18h52q23 2 39 17.5t19 37.5v18v31v12v0q2 15 11 28l2 2l0.5 1t1.5 1q5 5 11 9v0q1 1 3 2q1 1 2 1v0h1l1.5 0.5l1.5 0.5l-50 50q-32 -9 -68 -9q-102 0 -173.5 71.5t-70.5 172.5
q0 102 71.5 173.5t173 71.5t173 -72t71.5 -173q0 -35 -10 -67l50 -49q4 7 12 16q7 7 18 11q8 4 14 4h14h30h17q23 3 38.5 19t18.5 39v52q-2 23 -18 39t-38 19v0zM901 383z" />
<glyph glyph-name="shijian" unicode="&#xe620;"
d="M511.5 684q-104.5 0 -192.5 -51t-139.5 -139.5t-51.5 -193t51.5 -193t139.5 -139.5t192.5 -51t193 51t139.5 139.5t51 193t-51 193t-139.5 139.5t-193 51zM511.5 -48q-94.5 0 -175 46.5t-127 127t-46.5 175t46.5 175t127 127t175 46.5t175 -46.5t127.5 -127t47 -175
t-47 -175t-127.5 -127t-175 -46.5zM704 301h-175v226q0 8 -5 13t-12.5 5t-12.5 -5t-5 -13v-244q0 -7 5 -12t13 -5h192q7 0 12 5t5 12t-5 12.5t-12 5.5z" />
<glyph glyph-name="weixin" unicode="&#xe60f;"
d="M669 495q14 0 30 -2q-20 95 -110.5 157.5t-206.5 62.5q-130 0 -222 -77.5t-92 -189.5q0 -124 126 -212l-31 -94l109 55q80 -16 110 -16q14 0 30 1q-10 33 -10 66q0 103 77.5 176t189.5 73zM500 580q18 0 28.5 -11t10.5 -28.5t-10.5 -28.5t-28.5 -11t-32.5 11.5
t-14.5 28.5t14.5 28t32.5 11zM280 501q-18 0 -32.5 11.5t-14.5 28.5t14.5 28t32.5 11t29 -11t11 -28.5t-11 -28.5t-29 -11zM956 250q0 93 -80 160.5t-187 67.5q-112 0 -189.5 -67t-77.5 -161.5t77.5 -161t189.5 -66.5q31 0 94 16l86 -47l-23 78q110 83 110 181zM602 289
q-11 0 -21 10t-10 21.5t10 21.5t21 10q17 0 28.5 -9.5t11.5 -22t-11.5 -22t-28.5 -9.5zM775 289q-12 0 -21.5 10t-9.5 21.5t9.5 21.5t21.5 10q17 0 28 -9.5t11 -22t-11 -22t-28 -9.5z" />
<glyph glyph-name="fenxiang1" unicode="&#xe655;"
d="M770 222q-38 0 -71.5 -16.5t-55.5 -46.5l-249 125q7 21 7 43q0 25 -8 48l248 124q22 -31 56 -48.5t73 -17.5q65 0 111.5 46.5t46.5 112t-46.5 111.5t-112 46t-112 -46t-46.5 -112q0 -9 1 -18l-261 -131q-46 44 -109 44q-65 0 -111.5 -46.5t-46.5 -112t46.5 -112
t112 -46.5t111.5 47l259 -130q-2 -11 -2 -22q0 -65 46.5 -111.5t112 -46.5t112 46.5t46.5 112t-46.5 111.5t-111.5 46v0z" />
<glyph glyph-name="qq" unicode="&#xe649;"
d="M856 184q-6 81 -83 167q3 7 4.5 21.5t-5 37.5t-22.5 40v2q0 107 -67 177t-164 71q-97 -1 -163.5 -71t-66.5 -177v-2q-17 -17 -23 -40t-5 -37.5t4 -21.5q-77 -86 -83 -167q-2 -41 12 -59q7 -7 17 -4.5t23.5 17.5t24.5 38q13 -46 54 -100q-26 -6 -42 -24t-17 -36.5t7 -35.5
q23 -38 93 -38q106 0 150 42q5 5 15 5t16 -5q43 -42 149 -42q70 0 94 38q7 17 6.5 35.5t-16.5 36.5t-42 24q40 54 53 100q11 -23 24.5 -38t24 -17.5t16.5 4.5q14 18 12 59z" />
<glyph glyph-name="xinzeng" unicode="&#xe642;"
d="M739 330h-188v207q0 22 -34 24q-16 1 -24.5 -6t-8.5 -18v-207h-199q-1 0 -4.5 0.5t-9 -1t-11 -4t-9.5 -8.5t-4 -14q0 -15 2.5 -24t7.5 -12.5t9 -4t11 -0.5h207l-1 -217v-6t0.5 -6t0.5 -5.5t1 -6t2.5 -5t4 -5t5.5 -3t7.5 -2t10.5 -0.5q35 0 35 42l1 214h189q42 0 42 36
q0 16 -10.5 24.5t-21.5 7.5h-11zM518.5 770q-97.5 0 -186.5 -38t-153 -102.5t-102 -153t-38 -186.5t38 -186.5t102 -153t153 -102.5t186.5 -38t186.5 38t153.5 102t102.5 153t38 187t-38 186.5t-102.5 153t-153.5 102.5t-186.5 38zM519 -126q-113 0 -209 55.5t-151.5 151.5
t-55.5 209t55.5 209t151.5 151.5t209 55.5t208.5 -55.5t151.5 -151.5t56 -209t-56 -209t-151.5 -151.5t-208.5 -55.5z" />
<glyph glyph-name="tishi" unicode="&#xe64d;"
d="M512.5 193q-10.5 0 -18 7.5t-7.5 17.5v328q0 10 7.5 17.5t18 7.5t18 -7.5t7.5 -17.5v-328q0 -10 -7.5 -17.5t-18 -7.5zM512.5 27q-10.5 0 -18 7.5t-7.5 17.5v2q0 11 7.5 18.5t18 7.5t18 -7.5t7.5 -18.5v-2q0 -10 -7.5 -17.5t-18 -7.5zM512.5 -135q-88.5 0 -168.5 34
q-78 33 -138.5 93.5t-93.5 138.5q-34 81 -34 169t34 169q33 78 93.5 138.5t138.5 93.5q80 34 168.5 34t169.5 -34q78 -33 138.5 -93.5t93.5 -138.5q34 -81 34 -169t-34 -169q-33 -78 -93.5 -138.5t-138.5 -93.5q-81 -34 -169.5 -34zM513 684q-77 0 -147 -29t-124.5 -83.5
t-83.5 -124.5t-29 -147t29 -147t83.5 -124.5t124.5 -83.5t147 -29t147 29t124.5 83.5t83.5 124.5t29 147t-29 147t-83.5 124.5t-124.5 83.5t-147 29z" />
<glyph glyph-name="shijian1" unicode="&#xe6fb;"
d="M513 -202q-102 0 -195 39.5t-160 106.5t-107 160t-40 195.5t40 195.5t107 160t160 107t195 40t195 -40t160 -107t107 -160t40 -195.5t-40 -195.5t-107 -160t-160 -106.5t-195 -39.5zM513 745q-91 0 -173 -35.5t-142 -95t-95 -142t-35 -173t35 -173t95 -142t142 -95
t173 -35.5t173 35.5t142 95t95 142t35 173t-35 173t-95 142t-142 95t-173 35.5zM770 174q-5 -11 -16.5 -15.5t-22.5 0.5l-236 79q-18 9 -17 29l-0.5 1t-0.5 2v326q0 12 9 21t21 9t20.5 -9t8.5 -21v-310l220 -73q11 -5 15 -16.5t-1 -22.5z" />
<glyph glyph-name="iconfontweibowukuang" unicode="&#xe661;"
d="M727 341q-16 3 -20.5 9.5t-0.5 11.5l3 4q1 3 3 7t6 15.5t4.5 22.5t-4.5 25.5t-16 25.5q-14 14 -37 18.5t-46 1t-44 -9t-33 -11.5l-13 -5q-10 -3 -17 -4.5t-10.5 0t-5.5 3.5t-2 7.5t1 9t3 12.5t3 14q0 15 -2.5 27.5t-11 27t-23 22t-41 7t-62.5 -12.5q-35 -12 -71.5 -36
t-64 -49.5t-50 -49.5t-34.5 -40l-12 -15q-33 -44 -48.5 -87.5t-16.5 -65t0 -21.5q6 -48 30 -86.5t57 -62t78.5 -40t86.5 -24.5t88 -11q76 -6 157 11.5t151 61t99 103.5q17 36 17.5 67t-10.5 51t-29.5 35t-34 22t-27.5 9v0zM415 28q-110 -5 -188 42.5t-78 119.5t77.5 124
t188.5 57q112 5 188.5 -37t76.5 -113q0 -73 -78 -130.5t-187 -62.5v0zM385 307q-30 -3 -53.5 -13.5t-37 -23.5t-22.5 -30t-12.5 -30.5t-4.5 -28t-0.5 -19.5t0.5 -8v0v-5t2 -11.5t5.5 -16.5t12 -17t19.5 -15q67 -32 126 -19.5t94 58.5q14 17 18.5 42t-2 50.5t-22.5 47
t-48.5 33t-74.5 6.5v0zM348 116q-20 -2 -35 8t-15 27q0 18 14 32.5t34 16.5q23 2 37.5 -9t14.5 -29q0 -16 -14.5 -30t-35.5 -16v0zM435 189q-7 -5 -14.5 -4.5t-11.5 6.5t-2 14.5t9 13.5q8 6 15.5 5t11.5 -7q3 -7 1 -15t-9 -13v0zM798 400q9 0 16 6t8 14v3q4 32 -1 57
t-16.5 39t-26.5 23t-30.5 11.5t-28.5 3t-21 -0.5l-8 -1q-10 0 -17 -7t-7 -17t7 -17t17 -7q32 6 50.5 0.5t26 -19.5t9 -28t0.5 -25l-2 -11q0 -10 7 -17t17 -7v0zM781 679q-51 12 -121 -1l-1.5 -1l-1.5 -1h-1q-11 -3 -18.5 -12.5t-7.5 -21.5q0 -14 10.5 -24.5t25.5 -10.5
q18 3 31 8q6 0 18.5 1.5t33.5 -3.5t42 -13t43 -26.5t37 -43.5q28 -60 11 -115q-7 -17 -7 -34q0 -14 10 -22.5t25 -8.5t23 5.5t11 23.5v0q19 57 14.5 102.5t-20 79t-43.5 58t-56 39t-58 21.5v0zM781 679z" />
<glyph glyph-name="delete" unicode="&#xe616;"
d="M768 -128h-96v672h-96v-672h-128v672h-96v-672h-96v672h512v-672zM416 704h192v-64h-192v64zM880 640h-176v96q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45v-96h-176q-20 0 -34 -14t-14 -34t14 -34t34 -14h16v-704q0 -26 19 -45t45 -19h576q26 0 45 19t19 45v704h16
q20 0 34 14t14 34t-14 34t-34 14z" />
<glyph glyph-name="dizhi" unicode="&#xe685;"
d="M512 -212q-16 17 -41.5 47.5t-92 115.5t-117 161.5t-92 166.5t-41.5 149q0 159 112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5q0 -59 -41.5 -149t-92 -166.5t-116.5 -161.5t-92.5 -115.5t-41.5 -47.5v0zM512 684q-106 0 -181 -75t-75 -181t75 -181t181 -75t181 75
t75 181t-75 181t-181 75z" />
<glyph glyph-name="guanbi" unicode="&#xe637;"
d="M481.5 748q-97.5 0 -186 -37.5t-152.5 -101.5t-102 -153t-38 -186t38 -185.5t102 -152.5t152.5 -102t186 -38t186 38t152.5 102t102 152.5t38 185.5t-38 186t-102 153t-152.5 101.5t-186 37.5zM683 69v0q-10 -10 -24 -10t-24 10l-153 153l-154 -154v0q-10 -10 -24 -10
t-24 10t-10 24t10 24l153 154l-153 154q-10 10 -10 24t10 24v0q10 10 24 10t24 -10l153 -154l154 154v0q10 10 24 10t24 -10t10 -24t-10 -24l-153 -154l153 -153q10 -10 10 -24t-10 -24z" />
<glyph glyph-name="shoucang1" unicode="&#xe604;"
d="M512 727q-16 0 -26 -22l-95 -191q-11 -23 -36 -41t-50 -22l-211 -30q-25 -4 -29.5 -18.5t12.5 -32.5l154 -149q17 -17 26.5 -46.5t5.5 -53.5l-36 -211q-3 -18 3 -27.5t18 -9.5q10 0 22 6l189 99q22 12 53 12t53 -12l189 -99q12 -6 22 -6q12 0 18 9.5t3 27.5l-36 211
q-4 24 5.5 53.5t26.5 46.5l154 149q17 18 12.5 32.5t-29.5 18.5l-211 30q-25 4 -50 22t-36 41l-95 191q-10 22 -26 22v0z" />
<glyph glyph-name="phone" unicode="&#xe622;"
d="M295 688q34 0 60 -28q15 -16 39 -44q24 -26 22 -58.5t-28 -56.5l-13 -11q-30 -27 -45 -39q-42 -34 -33 -89t46 -112q67 -102 160 -157q20 -12 61 -26q14 -5 29 -5q33 0 60 25q17 17 53 48l5 4q27 23 57 23q35 0 62 -29q23 -25 39 -43q23 -27 21.5 -58t-27.5 -55l-6 -6
q-41 -47 -103 -76q-19 -7 -41 -7q-27 0 -63 10q-123 35 -247 146q-160 143 -234 314q-41 97 -34 171q5 51 41 81q13 11 38 34q17 15 25 22q26 22 56 22zM295 735q-48 0 -87 -34q-7 -6 -28.5 -25t-33.5 -29q-52 -43 -58 -113q-9 -87 38 -194q77 -181 245 -331
q133 -119 266 -156q43 -12 76 -12q32 0 59 10q19 9 37 20t30.5 20t23.5 18.5t17 16t10.5 11.5t4.5 6q40 37 42.5 87t-32.5 91q-17 19 -40 44q-42 45 -97 45q-48 0 -88 -35q-43 -37 -60 -54q-13 -12 -27 -12q-7 0 -14 3q-36 12 -52 22q-83 49 -144 142q-32 49 -39 94
q-5 28 15 43q14 11 60 53q41 37 44 89t-33 93q-25 28 -41 45q-40 42 -94 42v0z" />
<glyph glyph-name="bianji1" unicode="&#xe64a;"
d="M784 525l-126 126l63 63q15 15 37.5 15t37.5 -15l51 -51q15 -15 15 -37.5t-15 -37.5zM418 159l-126 126l342 340l126 -126zM191 56l77 205l124 -125zM756 13q14 0 23 -9.5t9 -22.5t-9 -22.5t-23 -9.5h-564q-13 0 -22 9.5t-9 22.5t9 22.5t22 9.5h564z" />
<glyph glyph-name="guanbi1" unicode="&#xe609;"
d="M512 739q-117 0 -216.5 -58t-157.5 -157.5t-58 -216.5t58 -216.5t157.5 -157.5t216.5 -58t216.5 58t157.5 157.5t58 216.5t-58 216.5t-157.5 157.5t-216.5 58zM721 150l-53 -52l-156 157l-156 -157l-53 52l157 157l-157 156l52 53l157 -157l156 157l53 -53l-157 -156z
" />
<glyph glyph-name="cuowu" unicode="&#xe617;"
d="M564 276l289 288q10 10 10 24.5t-10 25t-24.5 10.5t-24.5 -11l-290 -287l-286 287q-11 11 -25 11t-24.5 -10.5t-10.5 -25t10 -24.5l287 -287l-289 -288q-10 -10 -10 -24.5t10 -25t24.5 -10.5t24.5 11l289 287l289 -290q11 -10 25.5 -10t24.5 10t10 24.5t-10 24.5
l-289 290v0zM564 276z" />
<glyph glyph-name="tupian" unicode="&#xe6a0;"
d="M975 714h-926q-21 0 -35 -14t-14 -34v-732q0 -20 14 -34t35 -14h926q21 0 35 14t14 34v732q0 20 -14 34t-35 14zM926 147l-180 180q-16 17 -39.5 17t-39.5 -17l-211 -211l-91 91q-14 15 -35.5 15t-37.5 -15l-192 -192q-3 8 -3 17v536q0 21 14.5 35t34.5 14h731
q21 0 35 -14t14 -35v-421zM316.5 519q-40.5 0 -68.5 -28.5t-28 -68.5t28 -68.5t68.5 -28.5t69 28.5t28.5 68.5t-28.5 68.5t-69 28.5z" />
<glyph glyph-name="yonghuming" unicode="&#xe618;"
d="M705 -212q-5 0 -10 3q-22 14 -52.5 20.5t-51.5 7.5h-24h-38v0h-477q-8 0 -14 5.5t-6 14.5v24q-2 41 23 84q22 38 62 65q49 32 123 45h1q28 2 76 15q66 18 72 33q1 3 2 5q2 11 -1 43q-3 34 -17 66t-25.5 47.5t-33.5 39.5q-19 22 -26 32q-30 45 -34 97v1q0 21 19 38l1 1v0
q0 2 -1 8v3q-6 31 -6.5 74t4.5 74q2 24 15.5 49.5t22 34.5t14.5 14v0q13 11 18 19l1 2q0 1 -0.5 2l-0.5 1q-7 15 -4 27q3 19 25 25q8 2 23 2l1 1q47 2 75 0q53 -4 98 -14.5t71.5 -21.5t48 -24t27.5 -18.5t9 -9.5h1q22 -27 33 -67q3 -12 4 -21q7 -43 4 -104q-1 -22 -5 -48
q-1 -5 0 -7l3 -3q10 -10 13 -20q2 -7 2 -17v-1q-3 -52 -34 -97q-7 -10 -26 -32q-21 -24 -33 -39.5t-26 -47.5t-17 -66q-2 -32 0 -43q1 -2 1 -5q1 -1 4 -4.5t21 -12t48 -16.5q48 -13 76 -15v0h1q74 -14 123 -46q41 -27 63 -65q24 -42 21 -83v-24q0 -9 -5.5 -14.5t-14.5 -5.5
h-189q-8 0 -14 5.5t-6 14t6 14.5t14 6h169v4v2q3 30 -17 63q-18 29 -50 50q-42 27 -107 39q-42 6 -81 16q-87 23 -99 59q-8 14 -4 64q4 41 20 78t29.5 54.5t36.5 44.5q18 20 24 28q23 34 26 76v4l-4 4l-5 5q-12 16 -9 38q4 25 5 45q3 57 -4 95v1q-1 7 -3 17q-8 30 -25 51
q-15 15 -49 32q-71 34 -178 42q-25 2 -70 -1h-1h-8q6 -15 2 -27q-2 -6 -6 -13q-8 -13 -26 -28q-4 -4 -10.5 -11t-16.5 -25.5t-11 -34.5v-3q-5 -27 -4.5 -67t5.5 -68v-3q6 -29 -11 -45h-1q-5 -5 -5 -6v0q-1 -1 -1 -2q4 -42 27 -76q6 -8 23 -28q23 -27 36.5 -44.5t29.5 -54.5
t20 -78q4 -49 -3 -64q-12 -36 -100 -59q-41 -11 -80 -16q-65 -11 -106 -38q-33 -21 -51 -50q-20 -34 -18 -64v-2v-4h457h38v0h24v0q10 0 24.5 -1.5t47 -10t53.5 -22.5q7 -5 9 -13t-3 -15q-6 -9 -17 -9v0zM629 116q0 -1 1 -1q-1 0 -1 1v0zM396 116l-1 -1l1 1v0z" />
<glyph glyph-name="mima" unicode="&#xe61e;"
d="M511 285q-22 0 -38 -15.5t-16 -37.5q0 -24 18 -40v-49q0 -15 10.5 -25.5t25.5 -10.5t25 10.5t10 25.5v49q18 16 18 40q0 22 -15.5 37.5t-37.5 15.5v0zM760 445h-35v89q0 89 -63 151.5t-151.5 62.5t-151 -62.5t-62.5 -151.5v-89h-35q-37 0 -63 -26t-26 -63v-338
q0 -37 26 -63t63 -26h498q37 0 63 26t26 63v338q0 37 -26 63t-63 26v0zM511 712q74 0 126 -52t52 -126v-89h-356v89v0q0 74 52 126t126 52v0zM814 18q0 -22 -16 -37.5t-38 -15.5h-498q-22 0 -38 15.5t-16 37.5v338q0 23 16 38.5t38 15.5h498q22 0 38 -15.5t16 -38.5v-338v0z
M814 18z" />
<glyph glyph-name="shoucang" unicode="&#xe60b;"
d="M752 -127q-16 0 -30 7l-208 103l-209 -103q-15 -8 -34 -6.5t-34 11.5q-15 11 -22 28.5t-4 35.5l43 225l-164 153q-30 29 -17 68q6 18 20 30t32 15l229 42l102 208q18 37 58 37q19 0 35 -10t24 -27l102 -208l229 -41q18 -3 32 -15t20 -30q6 -17 1.5 -35.5t-17.5 -31.5
l-166 -155l42 -224q3 -19 -4 -36.5t-22 -28.5q-17 -12 -38 -12v0zM514 35l228 -114q12 -6 21.5 1.5t7.5 19.5l-46 248l183 173q8 8 5 19q-4 12 -16 14l-252 44l-113 230q-5 10 -17.5 10t-17.5 -10l-113 -229l-251 -47q-13 -2 -17 -13q-4 -12 5 -20l183 -171l-48 -249
q-2 -11 8 -18q10 -8 20 -2l230 114v0zM514 35z" />
<glyph glyph-name="zhengque" unicode="&#xe60e;"
d="M512 -125q-116 0 -213.5 57t-154.5 154.5t-57 213.5t57 213.5t154.5 154.5t213.5 57t213.5 -57t154.5 -154.5t57 -213.5t-57 -213.5t-154.5 -154.5t-213.5 -57zM512 672q-101 0 -186.5 -50t-135.5 -135.5t-50 -186.5t50 -186.5t135.5 -135.5t186.5 -50t186.5 50
t135.5 135.5t50 186.5t-50 186.5t-135.5 135.5t-186.5 50zM682 448q5 9 2.5 20t-12 16.5t-20.5 2.5t-16 -13l-170 -294l-95 88q-8 8 -19 8.5t-19 -7t-8 -18.5t7 -20l122 -112q7 -8 18 -8t19 7q2 2 49.5 84t94.5 164z" />
<glyph glyph-name="tuichu" unicode="&#xe7c8;" horiz-adv-x="1274"
d="M851 -212h-716q-57 0 -94 38q-41 40 -41 90v768q0 50 41 91q37 37 94 37h716q50 0 88 -37q34 -35 34 -91v-77q0 -10 -7.5 -17.5t-18 -7.5t-18 7.5t-7.5 17.5v77q0 35 -20 54q-22 23 -51 23h-716q-35 0 -58 -23q-26 -25 -26 -54v-768q0 -29 26 -54q23 -23 58 -23h716
q29 0 51 23q20 19 20 54v77q0 10 7.5 17.5t18 7.5t18 -7.5t7.5 -17.5v-77q0 -56 -34 -91q-38 -37 -88 -37v0zM1203 274h-640q-10 0 -17.5 7.5t-7.5 18.5t7.5 18.5t17.5 7.5h640q11 0 18.5 -7.5t7.5 -18.5t-7.5 -18.5t-18.5 -7.5v0zM1031 57q-11 0 -18.5 7.5t-7.5 18t8 18.5
l199 199l-199 199q-8 8 -8 18.5t7.5 18t18 7.5t18.5 -8l217 -217q7 -7 7 -18t-7 -18l-217 -217q-8 -8 -18 -8v0zM1031 57z" />
<glyph glyph-name="wodedingdan30" unicode="&#xe638;"
d="M179 148l204 -213l500 522l-203 212l-501 -521v0zM16 -196l321 78l-207 215l-114 -293v0zM939 725q-26 26 -44 41t-40 25t-43.5 3.5t-42.5 -28.5l-39 -45l207 -216l43 42q21 22 26.5 44t-4 45.5t-24 43t-39.5 45.5v0z" />
<glyph glyph-name="chenggong" unicode="&#xe62a;"
d="M511 -147q-91 0 -174 35.5t-143 95t-95.5 142.5t-35.5 174t35.5 174t95.5 143t143 95.5t174 35.5t174 -35.5t142.5 -95.5t95 -143t35.5 -174t-35.5 -174t-95 -142.5t-142.5 -95t-174 -35.5zM784 458l-14 14q-6 6 -14.5 6t-14.5 -6l-298 -292l-110 115q-6 6 -21 -8
l-14 -15q-15 -14 -8 -21l146 -153q7 -6 21 8l14 15q4 3 6 7l307 301q6 6 6 14.5t-6 14.5z" />
<glyph glyph-name="time" unicode="&#xe62f;"
d="M512 736q-185 0 -316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5zM512 -96q-104 0 -192.5 51.5t-140 140t-51.5 192.5t51.5 192.5t140 140t192.5 51.5t192.5 -51.5t140 -140t51.5 -192.5t-51.5 -192.5
t-140 -140t-192.5 -51.5zM672 288h-160v224q0 13 -9.5 22.5t-22.5 9.5t-22.5 -9.5t-9.5 -22.5v-256q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5t-9.5 22.5t-22.5 9.5z" />
<glyph glyph-name="jingshu" unicode="&#xe611;"
d="M270 606v40q0 9 -6 14.5t-14 5.5t-14 -5.5t-6 -14.5v-399q0 -2 1 -5v-97h-14q-22 0 -38 -15t-18 -37v-4v-1v-1q1 -22 17 -37.5t39 -15.5h14v-39h-17h-3q-37 2 -63 29.5t-26 65.5v1.5v1.5q-1 64 0 551v2q0 40 28 67.5t67 27.5h31h477h5q8 0 14 -5.5t6 -13.5v-76h-385
q-56 0 -95 -40zM883.5 -29q-8.5 0 -14 -6t-5.5 -14v-54h-494q-22 0 -38 15.5t-17 37.5v0.5v0.5v4q1 22 17 37.5t38 15.5h509h4h1q8 0 13.5 6t5.5 14v556q0 8 -5.5 14t-13.5 6h-5h-477h-32q-39 0 -67 -28t-28 -67v-2v-551v-2v-2q0 -37 26 -64.5t63 -29.5q2 -1 3 -1h517
q8 0 13.5 6t5.5 14v74q0 8 -5.5 14t-14 6zM766 154q-10 -1 -21 -2.5t-31.5 -2t-22.5 -0.5h-26q-23 0 -41 -1.5t-35 -5.5q-2 -1 -7 -1q-7 0 -14 5t-7 11t8 11q2 2 9 10q11 12 19 10q4 -4 10.5 -5.5t11.5 -1.5q3 0 10 0.5t10 0.5h7q3 3 4.5 9.5t1.5 12.5q0 4 -1 13v13v8l-5 7
q-9 0 -20.5 -1.5t-28.5 -5.5q-1 3 -1.5 5.5t-0.5 5.5q0 15 12 23.5t28 8.5q10 0 16 -3l101 -4q3 -6 3 -13q0 -16 -13 -16h-44q-2 -7 -2 -11q-2 -13 -2 -26q0 -4 0.5 -9t0.5 -7l3 -4q88 -10 90 -10q0 -19 -22 -24zM591 437q7 8 14 10l5 5q8 5 15 5q6 0 13 -4h2q4 0 8 1
q10 0 19 -1.5t20 -5.5q10 9 24 9q12 0 14 -12q6 -10 6 -18q0 -15 -19 -29q-8 -7 -17 -13v-2q1 -5 6 -8q23 -11 40 -16q50 -18 93 -24q-6 -15 -12 -23q-19 -24 -42 -24q-6 0 -8 1q-13 4 -29 16q-43 32 -45 33q-1 1 -16 14q-9 8 -17 6q-6 -6 -14.5 -13.5t-17 -16t-14.5 -13.5
q-29 -23 -55 -23q-10 5 -14 9q-8 6 -8 14q44 18 69 35q34 23 57 58q1 8 -3 10.5t-11 2.5h-8q-10 0 -16 -1q-21 -4 -36 -12q-10 4 -10 14q0 8 7 16zM422 350q5 4 16 14q14 15 23 26q26 33 43 63q3 4 6.5 5t6.5 1q9 0 16 -9.5t7 -20.5q0 -15 -12 -22q-13 -10 -21 -17
q-25 -21 -47 -43q2 -5 6.5 -7.5t9.5 -2.5q10 1 14 1t6 -1q5 5 9 8q22 21 37 45q8 3 15 -3.5t12 -12.5q0 -14 -12 -26q-10 -8 -20 -17q-25 -26 -29 -31q-16 -18 -23 -36q9 0 37 12q13 6 22 6q4 -1 6 -1l8 -17q-16 -14 -42.5 -23t-49.5 -16q-13 -2 -19 11q-3 7 -3 16
q0 21 13 29l4 4q8 12 13 23l-49 -4l-11 23q-2 13 8 23zM389 178q6 12 21 15q15 2 28 5l123 33q2 1 5 1q8 0 8 -11q0 -8 -4.5 -15.5t-11.5 -7.5q-8 -4 -20 -9q-30 -12 -53 -20q-38 -13 -69 -21q-5 -6 -11 -6q-7 0 -12 8.5t-5 19.5q0 6 1 8z" />
<glyph glyph-name="huiyuan1" unicode="&#xe610;"
d="M614 -212h-204q-63 0 -94 0.5t-80 3t-73 9t-51 17t-38 28.5t-11 42v20q0 93 46.5 171.5t126.5 124.5t174 46h204q94 0 174 -46t126.5 -124.5t46.5 -171.5v-20q0 -18 -6.5 -32.5t-22.5 -25t-31 -18t-44.5 -12t-50 -7t-60.5 -4t-63 -1.5h-69v0v0zM408 193
q-120 0 -205.5 -84t-85.5 -202v-21q0 -14 25 -23t77 -12.5t88.5 -4t100.5 -0.5h208q56 0 91.5 0.5t89.5 4t82 12.5t28 23v21q0 118 -85.5 202t-205.5 84h-208v0zM502 270q-114 0 -194.5 79.5t-80.5 191.5t80.5 191.5t194.5 79.5t194.5 -79.5t80.5 -191.5t-80.5 -191.5
t-194.5 -79.5v0v0v0zM283 542q0 -89 64 -152t154.5 -63t154.5 63t64 151.5t-64 151.5t-154.5 63t-154.5 -63t-64 -151v0v0v0z" />
<glyph glyph-name="xiazai" unicode="&#xe6d2;"
d="M356 296v-1v-1v-2v0v-0.5v-0.5q0 -1 1 -2v-1l0.5 -0.5l0.5 -0.5l140 -157l0.5 -0.5l0.5 -0.5h0.5h0.5v-0.5v-0.5q1 0 2 -1h0.5h0.5q4 -1 7 1l1 2v0v0l147 157l1 1v1q0 1 1 2v0.5v0.5v0v1q0 8 -8 8h-93v102q0 7 -5 12t-12 5h-68q-7 0 -12 -5t-5 -12v-102v0l-93 -1
q-6 0 -8 -4zM849 446q-9 24 -34 24q-15 0 -25.5 -10.5t-10.5 -26.5q0 -8 3 -15v0q0 -1 5.5 -15t6.5 -17.5t5.5 -15.5t6 -18.5t4 -16.5t3.5 -18t1 -16q0 -127 -89.5 -216.5t-216 -89.5t-216 89.5t-89.5 216t89.5 216t215.5 89.5q43 0 120 -30v0q8 -5 18 -5q15 0 25.5 10.5
t10.5 25.5q0 21 -17 32v0v0q-3 1 -6 3q-68 32 -151 32q-101 0 -187 -50t-136 -136t-50 -187.5t50 -187.5t136 -136t187.5 -50t187.5 50t136 136t50 188q0 74 -33 145zM474 437h68q7 0 12 5t5 12v17q0 7 -5 12t-12 5h-68q-7 0 -12 -5t-5 -12v-17q0 -7 5 -12t12 -5z" />
<glyph glyph-name="zhengque1" unicode="&#xe6e0;"
d="M449 100q-15 0 -25 11l-257 257q-11 10 -11 25t10.5 25.5t25.5 10.5t25 -11l232 -231l392 392q10 10 25 10t25.5 -10.5t10.5 -25t-10 -25.5l-418 -417q-10 -11 -25 -11z" />
<glyph glyph-name="richeng" unicode="&#xe641;"
d="M874 -110h-750q-28 0 -48 19.5t-20 48.5v750q0 28 20 48t48 20h68v-34q0 -42 30 -72t72.5 -30t72.5 30t30 72v34h205v-34q0 -42 29.5 -72t72 -30t72.5 30t30 72v34h68q29 0 49 -20t20 -48v-750q0 -28 -20 -48t-49 -20v0zM879 592h-759v-638h759v638v0zM295 398h-103v102
h103v-102v0zM295 227h-103v103h103v-103v0zM295 57h-103v102h103v-102v0zM465 398h-102v102h102v-102v0zM465 227h-102v103h102v-103v0zM465 57h-102v102h102v-102v0zM636 398h-103v102h103v-102v0zM636 227h-103v103h103v-103v0zM636 57h-103v102h103v-102v0zM806 398h-102
v102h102v-102v0zM806 227h-102v103h102v-103v0zM806 57h-102v102h102v-102v0zM703 674q-28 0 -47.5 19.5t-19.5 47.5v70q0 28 19.5 47.5t47.5 19.5t47.5 -19.5t19.5 -47.5v-70q0 -28 -19.5 -47.5t-47.5 -19.5v0zM294 674q-28 0 -48 19.5t-20 47.5v70q0 28 20 47.5t47.5 19.5
t47.5 -19.5t20 -47.5v-70q0 -28 -20 -47.5t-47 -19.5v0zM294 674z" />
<glyph glyph-name="fo" unicode="&#xe606;"
d="M844 385q0 13 -8 24t-20 16q13 13 13 31t-12.5 30.5t-30.5 12.5h-4q3 8 3 18q0 17 -12.5 30t-30.5 13q-2 0 -4 -1q2 7 2 14q0 18 -12.5 30.5t-30.5 12.5h-4q2 7 2 15q0 18 -12.5 30.5t-30.5 12.5h-3q2 7 2 15q0 17 -12.5 30t-30.5 13q-2 0 -5 -1q1 5 1 10q0 16 -10 28
t-25 15v3q0 18 -12.5 30.5t-30.5 12.5t-30.5 -12.5t-12.5 -30.5v-4q-15 -3 -24 -14.5t-9 -27.5q0 -5 1 -10q-3 1 -5 1q-18 0 -30.5 -13t-12.5 -30q0 -8 2 -15h-3q-18 0 -30.5 -12.5t-12.5 -30.5q0 -8 2 -15h-4q-18 0 -30.5 -12.5t-12.5 -30.5q0 -7 2 -14q-2 1 -4 1
q-18 0 -31 -13t-13 -30q0 -10 4 -18h-4q-18 0 -30.5 -12.5t-12.5 -30.5t13 -31q-12 -5 -20 -16t-8 -24q0 -16 11 -28q-1 -20 13 -47q22 -41 34 -105.5t5 -118.5q-2 -11 -5.5 -29t-6 -30.5t-2.5 -15.5q0 -17 12 -28.5t29 -11.5q15 0 26.5 9.5t13.5 24.5h1q4 -5 9 -10t22 -16
t36 -19t51 -15t68 -7t68 7t51.5 15t36 19t21.5 16t9 10h1q2 -15 13.5 -24.5t26.5 -9.5q17 0 29 11.5t12 28.5q0 3 -2.5 15.5t-6 30.5t-5.5 29q-7 54 5 118.5t34 105.5q15 27 14 47q10 12 10 28zM767 380v-21q-9 -68 -17 -98q-6 -23 -18 -129q-10 -81 -70.5 -129t-138.5 -52
q-77 4 -136.5 52t-69.5 129q-13 106 -18 129q-4 14 -8 38l-7 42l-2 18v8q-1 0 -2 12.5t1 30t9 34t26 26.5t47 7q113 -14 172 -14t148 14q24 3 41 -3t25.5 -17t13 -26.5t5 -27t-0.5 -23.5zM689 323h-99q29 -22 65.5 -18.5t79.5 38.5q-25 -15 -46 -20zM576 150q12 18 -6 39
q-10 11 -18 33.5t-9 50.5t6.5 54t33.5 46t69 25q27 3 52.5 -7t36.5 -22l12 -11q-1 2 -2.5 6t-9.5 14.5t-18 18.5t-28.5 14.5t-40.5 6.5q-64 0 -100 -54.5t-14 -142.5q2 -5 5.5 -17t5 -18t2 -15t-2 -13.5t-9 -8.5t-18.5 -4v0q41 -13 53 5zM509 408.5q0 6.5 4.5 10.5t11 4
t10.5 -4t4 -10.5t-4 -11t-10.5 -4.5t-11 4.5t-4.5 11zM524 408zM472 150q-12 18 7 39q9 11 16.5 33.5t8.5 51t-6.5 54.5t-33.5 46t-67 24q-27 3 -52.5 -7t-37.5 -22l-12 -11l3 6t9.5 14.5t17.5 18.5t28.5 14.5t41.5 6.5q63 0 99 -54.5t14 -142.5q-2 -5 -5.5 -17t-5 -18
t-2 -15t2 -13.5t9.5 -8.5t18 -4v0q-5 -2 -12 -3.5t-21.5 -0.5t-19.5 9zM359 323h99q-29 -22 -65.5 -18.5t-79.5 38.5q25 -15 46 -20zM450 68q74 -76 147 0q-36 -5 -73 -5t-55 2zM592 76l6 1q-9 9 -19 16q-13 10 -26 10q-8 1 -15.5 -2.5t-10.5 -7.5l-4 -3q-1 1 -4 3.5
t-10.5 6.5t-14.5 3q-14 0 -26 -10q-9 -7 -19 -16v0v0v0l2 -1q70 -10 141 0zM737 8q0 8 6 14t14 6t13.5 -6t5.5 -14t-5.5 -13.5t-13.5 -5.5t-14 5.5t-6 13.5zM281 8q0 8 5.5 14t13.5 6t14 -6t6 -14t-6 -13.5t-14 -5.5t-13.5 5.5t-5.5 13.5z" />
<glyph glyph-name="fo3" unicode="&#xe60c;"
d="M483 826q-5 -13 -12 -36.5t-11 -32.5q-7 -21 -12 -29q-2 -4 -5.5 -7t-9 -6.5t-7.5 -5.5q-18 -14 -20 -30q-1 -11 4 -23q-9 -4 -10.5 -6.5t-0.5 -11.5q1 -6 12.5 -38.5t6.5 -51.5q7 0 10 5t4 13.5t3 11.5q9 -6 12 -23q4 -14 -10 -22q-10 -5 -30.5 -11t-24.5 -7
q-13 -5 -22.5 -14t-14.5 -16.5t-8 -23t-4 -21.5t-2 -24q-5 -49 -8 -63q0 -2 -1 -7.5t-1.5 -7t-1.5 -6t-0.5 -6.5t0.5 -6t1 -7t2 -6.5t3 -7.5q1 -1 2 -3q6 -12 7.5 -17t-3.5 -18q-27 -3 -54 -14q-29 -13 -41 -29q-3 -4 -4.5 -9t-1.5 -8.5t1.5 -9.5t2.5 -8.5t4.5 -9.5t3.5 -8
q2 -4 0 -7.5t-6.5 -7.5t-5.5 -7q-5 -10 -3 -25q0 -7 5 -29q-16 -10 -28 -19q-21 -18 -30 -40q-5 -12 -7 -27q-1 -7 -1 -15q7 -4 15 -7q45 -19 115 -29q122 -17 284 -3q55 4 133 17q4 0 10 1q28 5 43.5 8t38 11.5t37.5 20.5q18 15 -9 50q-18 23 -50 39q-7 3 -13 5
q-3 1 -4 2.5t-1 3t0.5 4.5t0.5 4q1 18 2 38q0 1 -13 14q5 8 7 15q6 16 2 29q-5 18 -30 33q-10 5 -25 11q-5 2 -12 7t-10 6t-6 1.5t-4 1.5t-1 5q0 8 2 16q0 2 10 27q8 20 5 46q-9 84 -43 134q-6 7 -23 13.5t-34.5 10.5t-33.5 10.5t-19.5 15.5t7.5 26q5 6 7 -2q1 -3 1 -4
q4 -11 13 -14q8 -3 9 0.5t-2 8.5q-1 3 -1 5q-3 11 -1 24q2 6 6 20t5 22q2 17 -5 22q-3 2 -5 4t-2.5 4t-0.5 5v7q-1 17 -16 31q-7 6 -19 13q-4 3 -5.5 10t-2.5 9q-2 3 -6.5 7.5t-5.5 6.5q-4 6 -4 23q-9 23 -12 31q-1 1 -3 5.5t-2 6.5q-3 6 -8 6h-4v0z" />
<glyph glyph-name="muyu2" unicode="&#xe612;"
d="M752 409q17 -7 47 -17t47 -16.5t39.5 -24t34.5 -41t20.5 -66t8.5 -100.5q0 -34 -2 -61.5t-5.5 -48t-9 -36t-13 -26t-17 -17t-21 -10t-24.5 -5t-28 -2t-31 -0.5q-15 1 -22 1h-347q-43 0 -71 27t-37 67t-2 85q9 63 65.5 79t114.5 -24q13 -9 29 -21t22.5 -16t17.5 -9.5
t21 -6t25 0.5q47 3 71.5 36t24.5 83q0 27 -4.5 51.5t-15 49.5t-31.5 40t-50 15q-24 0 -45.5 -11t-36.5 -24t-41.5 -24t-58.5 -11q-31 0 -53 27t-27.5 65.5t-1 77t27 65.5t56.5 27q36 0 69 -16.5t59.5 -40t79.5 -59t115 -63.5zM460.5 821q-31.5 16 -69 -1t-58.5 -57
q-19 -37 -14 -73.5t30 -56.5q-257 -493 -275 -536q-12 -28 7 -45q22 -20 48 8q13 14 24 39q28 67 225 519q30 -5 60 13t48 52q21 41 13.5 81.5t-39 56.5z" />
<glyph glyph-name="xiaoxizhongxin" unicode="&#xe605;"
d="M48 669v-395q0 -57 40.5 -98t98.5 -41h208l7 -175l205 175h234q58 0 98.5 41t40.5 98v395q0 58 -40.5 98.5t-98.5 40.5h-654q-58 0 -98.5 -40.5t-40.5 -98.5v0zM647 449.5q0 27.5 19.5 47t46.5 19.5t46.5 -19.5t19.5 -47t-19.5 -46.5t-46.5 -19t-46.5 19t-19.5 46.5z
M446 449.5q0 27.5 19.5 47t46.5 19.5t46.5 -19.5t19.5 -47t-19.5 -46.5t-46.5 -19t-46.5 19t-19.5 46.5zM249 449.5q0 27.5 19 47t46.5 19.5t46.5 -19.5t19 -47t-19 -46.5t-46.5 -19t-46.5 19t-19 46.5z" />
<glyph glyph-name="shouqi" unicode="&#xe677;"
d="M833 -32v832q0 6 -5 11t-11 5h-33q-6 0 -11 -5t-5 -11v-832q0 -7 5 -11.5t11 -4.5h33q6 0 11 4.5t5 11.5zM545 -32v832q0 6 -5 11t-11 5h-33q-6 0 -11 -5t-5 -11v-832q0 -7 5 -11.5t11 -4.5h33q6 0 11 4.5t5 11.5zM256 -32v832q0 6 -5 11t-11 5h-33q-6 0 -11 -5t-5 -11
v-832q0 -7 5 -11.5t11 -4.5h33q6 0 11 4.5t5 11.5z" />
<glyph glyph-name="mima1" unicode="&#xe654;"
d="M847 -128h-675q-44 0 -75 29t-31 71v424q0 41 30.5 70.5t75.5 29.5h26v98q0 128 90.5 215t220.5 87t221 -87t91 -215v-99h26q44 0 75 -29t31 -71v-424q0 -41 -31 -70t-75 -29zM465 187v-111q0 -18 13 -30t31.5 -12t31.5 12t13 30v111q20 11 32.5 30.5t12.5 42.5
q0 35 -26.5 59.5t-63 24.5t-63 -24.5t-26.5 -59.5q0 -23 12.5 -42.5t32.5 -30.5zM732 598q0 87 -65 148.5t-157.5 61.5t-157.5 -61.5t-65 -148.5v-102h445v102z" />
<glyph glyph-name="xiangshangjiantou" unicode="&#xe65d;"
d="M966 227l-435 432q-7 7 -17.5 7t-17.5 -7l-442 -432q-7 -7 -7 -17.5t7.5 -17.5t17.5 -7t18 7l425 416l416 -416q7 -7 17.5 -7t18 7t7.5 17.5t-8 17.5z" />
<glyph glyph-name="xiangxiajiantou" unicode="&#xe65e;"
d="M966 573q-7 7 -17.5 7t-17.5 -7l-416 -416l-425 416q-8 7 -18 7t-17.5 -7t-7.5 -17.5t7 -17.5l442 -432q7 -8 17.5 -8t17.5 8l435 432q15 20 0 35z" />
<glyph glyph-name="xiangyoujiantou" unicode="&#xe65f;"
d="M762 406l-432 436q-8 7 -18 7t-17.5 -7.5t-7.5 -17.5t7 -18l416 -416l-416 -425q-7 -7 -7 -17.5t7.5 -18t17.5 -7.5t18 8l432 441q7 7 7 17.5t-7 17.5z" />
<glyph glyph-name="xiangzuojiantou" unicode="&#xe660;"
d="M730 -35l-416 425l416 416q7 8 7 18t-7.5 17.5t-17.5 7.5t-18 -7l-432 -436q-7 -7 -7 -17.5t7 -17.5l432 -441q8 -8 18 -8t17.5 7.5t7.5 18t-7 17.5z" />
<glyph glyph-name="zhankai1" unicode="&#xe69c;"
d="M928 704h-832q-7 0 -11.5 -4.5t-4.5 -11.5v-32q0 -7 4.5 -11.5t11.5 -4.5h832q7 0 11.5 4.5t4.5 11.5v32q0 7 -4.5 11.5t-11.5 4.5zM928 416h-832q-7 0 -11.5 -4.5t-4.5 -11.5v-32q0 -7 4.5 -11.5t11.5 -4.5h832q7 0 11.5 4.5t4.5 11.5v32q0 7 -4.5 11.5t-11.5 4.5z
M928 127h-832q-7 0 -11.5 -4.5t-4.5 -11.5v-32q0 -7 4.5 -11.5t11.5 -4.5h832q7 0 11.5 4.5t4.5 11.5v32q0 7 -4.5 11.5t-11.5 4.5z" />
<glyph glyph-name="location" unicode="&#xe6c2;"
d="M513 -94h-1q-26 0 -44 19q-89 92 -172 205q-166 223 -166 350q0 104 51 192t139 139t192 51t192 -51t139 -139t51 -192q0 -77 -58 -186q-57 -105 -168 -241l-1 -1l-109 -126q-18 -20 -45 -20v0zM512 805q-88 0 -163 -43.5t-118.5 -118.5t-43.5 -163q0 -108 155 -316
q81 -110 168 -200q1 -1 2 -1h1q1 0 2 1l109 125q107 132 161 232q52 97 52 159q0 88 -43.5 163t-118.5 118.5t-163 43.5zM512 302q-74 0 -126.5 52t-52.5 126t52.5 126.5t126.5 52.5t126.5 -52.5t52.5 -126.5t-52.5 -126t-126.5 -52zM512 602q-50 0 -85.5 -35.5t-35.5 -86
t35.5 -86t85.5 -35.5t85.5 35.5t35.5 86t-35.5 86t-85.5 35.5z" />
<glyph glyph-name="suoxiaotuichuquanpingshouhui" unicode="&#xe794;"
d="M410 382h-312q-14 0 -23 -9t-9 -22.5t9 -23t23 -9.5h242l-267 -267q-9 -9 -9 -21.5t9 -21.5t21.5 -9t21.5 8l270 270v-247q0 -13 9 -22.5t22.5 -9.5t23 9.5t9.5 22.5v320q0 32 -40 32zM553 446h313q13 0 22.5 9.5t9.5 23t-9.5 22.5t-22.5 9h-243l267 268q9 9 9 21.5
t-9 21.5t-21.5 9t-21.5 -9l-269 -269v246q0 14 -9.5 23t-23 9t-22.5 -9t-9 -23v-320q0 -15 10.5 -23.5t28.5 -8.5z" />
<glyph glyph-name="xitong1" unicode="&#xe61b;"
d="M512.5 208q-72.5 0 -124 51.5t-51.5 124t51.5 123.5t124 51t124 -51t51.5 -123.5t-51.5 -124t-124 -51.5zM923 461v0l-82 19l-2 6q-8 26 -22 52l-3 6l44 74q12 18 13 36t-11 33l-42 42q-12 13 -33 13t-37 -12h-1l-72 -46l-6 3q-25 14 -52 22l-6 2l-19 84v0
q-3 19 -17.5 34t-33.5 15h-59q-17 0 -30 -15t-17 -35l-21 -82l-6 -2q-29 -9 -56 -24l-6 -3l-74 47v0q-16 12 -37 12t-33 -13l-42 -42q-12 -14 -11 -32.5t12 -36.5l47 -77l-3 -6q-13 -26 -20 -49l-2 -6l-83 -19v0q-19 -3 -34 -17.5t-15 -33.5v-59q0 -17 15 -30t35 -18l83 -20
l2 -6q8 -23 19 -46l3 -6l-47 -77q-11 -18 -12 -36t11 -33l42 -42q12 -13 33 -13t37 12v0l75 47l5 -3q28 -15 56 -24l6 -2l21 -82q5 -20 17.5 -35t30.5 -15h59q18 0 32.5 15t18.5 34v0l18 84l7 2q26 9 51 22l6 3l72 -46h1q16 -12 37 -12t33 13l42 42q12 15 11 33t-13 36
l-44 74l3 6q12 24 20 49l2 6l83 20q21 5 35.5 18t14.5 30v59q0 19 -15 33.5t-34 17.5v0z" />
<glyph glyph-name="ai-edit" unicode="&#xe613;" horiz-adv-x="1025"
d="M202 771q-41 0 -70.5 -29t-29.5 -70v-598q0 -41 29.5 -70t70.5 -29h598q41 0 70 29t29 70v393l103 99v-529q0 -68 -50 -116.5t-119 -48.5h-668q-68 0 -116.5 48.5t-48.5 116.5v661q0 70 49 123t116 53h529l-99 -103h-393zM568 285l-222 -63l63 221zM590 307l-159 158
l349 346l159 -157zM1010 725l-47 -47l-159 157l48 47q13 13 31 14t30 -12l99 -98q13 -12 12 -30t-14 -31v0zM1010 725z" />
<glyph glyph-name="sanjiao" unicode="&#xe6a2;"
d="M290 818l651 -440l-651 -441v881z" />
<glyph glyph-name="error-circle" unicode="&#xe615;"
d="M511 -61q-89 0 -170.5 34t-144.5 97t-97 144t-34 170.5t34 171t97 144.5t144.5 96.5t170.5 33.5t170.5 -33.5t144.5 -96.5t96.5 -144.5t33.5 -171t-33.5 -170.5t-96.5 -144t-144.5 -97t-170.5 -34zM511 779q-79 0 -151 -30t-128 -85.5t-85.5 -127.5t-29.5 -151t29.5 -151
t85.5 -128t128 -86t151 -30t151 30t128 86t85.5 128t29.5 151t-29.5 151t-85.5 127.5t-128 85.5t-151 30zM362.5 212q-10.5 0 -18 7.5t-7.5 18t8 18.5l296 297q8 7 18.5 7t18 -7.5t7.5 -18t-8 -18.5l-296 -296q-8 -8 -18.5 -8zM659.5 212q-10.5 0 -18.5 8l-296 296
q-8 8 -8 18.5t7.5 18t18 7.5t18.5 -7l296 -297q8 -8 8 -18.5t-7.5 -18t-18 -7.5z" />
<glyph glyph-name="shouqi1" unicode="&#xe65b;"
d="M510 768l419 -419q14 -14 32.5 -14t32.5 14t14 32.5t-14 32.5l-482 482l-482 -482q-14 -14 -14 -32.5t14 -32.5t32.5 -14t32.5 14l415 419v0zM512 305l419 -419q14 -14 32.5 -14t32.5 14t14 32.5t-14 32.5l-484 482l-482 -482q-14 -14 -14 -32.5t14 -32.5t32.5 -14
t32.5 14l417 419v0zM512 305z" />
<glyph glyph-name="jian" unicode="&#xe648;"
d="M797 516h-91v139q0 47 -33 80t-79 33h-352q-47 0 -80 -33t-33 -80v-351q0 -47 33 -80t80 -33h143v-87q0 -42 29.5 -71.5t70.5 -29.5h312q42 0 71.5 29.5t29.5 71.5v312q0 41 -29.5 70.5t-71.5 29.5zM242 255q-20 0 -34.5 14.5t-14.5 34.5v351q0 21 14.5 35t34.5 14h352
q20 0 34.5 -14t14.5 -35v-139h-158q-41 0 -70.5 -29.5t-29.5 -70.5v-161h-143zM643 452v-148q0 -20 -14.5 -34.5t-34.5 -14.5h-145v161q0 15 10.5 25.5t25.5 10.5h158zM834 104q0 -15 -10.5 -26t-26.5 -11h-312q-15 0 -25.5 11t-10.5 26v87h145q46 0 79 33t33 80v148h91
q16 0 26.5 -10.5t10.5 -25.5v-312z" />
<glyph glyph-name="daiban1" unicode="&#xe679;"
d="M511 831q-91 0 -173.5 -35.5t-142 -95t-94.5 -142t-35 -173t35 -173t94.5 -142t142 -95t173 -35.5t173 35.5t142.5 95t95 142t35 173t-35 173t-95 142t-142.5 95t-172.5 35.5v0zM495 728q5 1 5 2h20q22 -10 24 -12q27 -22 18 -55q-10 -34 -45 -38q-21 -2 -37.5 10
t-20.5 32t6.5 37.5t29.5 23.5v0zM273 633q51 -35 153 -114q60 -47 116 -91q27 -21 21 -52q-7 -34 -40 -42q-34 -7 -55 20q-138 178 -179 234q-21 29 -31 46q-2 5 -3 8q7 -1 18 -9v0zM856 372q-1 0 -1 -4q0 -2 1 -3v-8q-1 -5 -2 -15.5t-2 -16.5q-13 -74 -56 -137
q-45 -64 -112 -103q-60 -34 -125 -43q-3 0 -11 -0.5t-12 -0.5h-5h-3h-4h-27h-3h-3h-8q-5 0 -15.5 1t-16.5 2q-93 17 -165 78q-64 54 -96 133q-17 40 -22 83q-1 3 -1 9.5t-1 9.5v8q0 1 1 3l-1 4v27q1 0 1 2.5v2.5l-1 3v6q0 1 4 22q6 44 24 86q4 11 15 16t22 1
q16 -5 22.5 -18.5t0.5 -28.5q-10 -28 -15 -49q-15 -74 8 -144q21 -61 66 -106q39 -41 92 -63q56 -23 116 -21q83 4 150 51q64 45 95 117q30 69 20 143q-15 116 -109 189q-6 4 -12.5 8t-14.5 9t-12 7q-9 7 -14 15q-14 22 6 42q14 15 37 4q106 -56 157 -163q25 -53 30 -113
q1 -4 2 -4v-6q-1 0 -1 -2.5v-2.5v-4l1 -4v-22v0zM856 372z" />
<glyph glyph-name="laba" unicode="&#xe647;"
d="M867 611q-9 10 -22 10t-22.5 -9.5t-9.5 -22.5t9 -23q74 -73 74 -182q0 -104 -74 -182q-9 -10 -9 -23t9.5 -22.5t22.5 -9.5t22 10q93 93 93 227t-93 227zM774 518q-9 10 -22 10t-22.5 -9.5t-9.5 -22.5t10 -22q38 -39 38 -90q0 -56 -38 -90q-10 -9 -10 -22t9.5 -22.5
t22.5 -9.5t22 10q58 57 58 134q0 38 -15.5 74t-42.5 60zM557 752l-237 -144v-448l237 -144q33 -21 58 -7.5t25 52.5v643q0 40 -25 54t-58 -6zM64 512v-256q0 -41 27.5 -68.5t68.5 -27.5h96v448h-96q-41 0 -68.5 -27.5t-27.5 -68.5z" />
<glyph glyph-name="shenfenxinxi" unicode="&#xe810;"
d="M511 707h324q24 0 37 -2q87 -11 87 -98q1 -228 0 -438q0 -48 -29 -77.5t-77 -29.5q-361 -1 -684 0q-48 0 -76 28t-28 75q-1 220 0 436q1 105 106 106h340v0v0zM413 210v82q-2 25 -19 44t-41 21q-63 5 -128 0q-22 -1 -37.5 -15t-19.5 -36q-2 -14 -3 -29.5t-1.5 -36
t-0.5 -30.5h250v0v0zM365 486q0 31 -22 52.5t-54 22.5q-32 0 -54 -22t-22 -54t22 -54t54 -22t54 22.5t22 54.5v0v0zM661 308h118q33 0 34 26q2 30 -32 30q-123 1 -239 0q-33 0 -32 -31q1 -25 34 -25h117v0v0zM661 205v0h118q34 1 34 26q0 13 -8.5 21t-23.5 8q-107 1 -240 0
q-16 0 -22 -9q-12 -17 -6 -27q11 -17 28 -18t120 -1v0v0zM704 409h75q16 0 25 7.5t9 19.5q-1 25 -32 26q-79 1 -157 0q-15 -1 -23.5 -9t-7.5 -19q4 -25 34 -25h77v0v0zM704 409z" />
<glyph glyph-name="zhankai" unicode="&#xe63c;"
d="M204 391l326 -289l288 288l41 -42l-327 -327l-367 326zM204 747l326 -290l288 289l41 -42l-327 -327l-367 326z" />
<glyph glyph-name="icon-yxj-record" unicode="&#xe639;"
d="M774 476h-520q-9 0 -16 7t-7 16.5t7 16t16 6.5h520q9 0 16 -6.5t7 -16t-7 -16.5t-16 -7zM623 297h-369q-9 0 -16 8t-7 17.5t7 17.5t16 8h369q9 0 16 -8t7 -17.5t-7 -17.5t-16 -8zM689 118h-435q-9 0 -16 8t-7 17.5t7 17.5t16 8h435q9 0 16 -8t7 -17.5t-7 -17.5t-16 -8z
M660 660h-296q-38 0 -64 25.5t-26 62.5q0 30 19 53.5t50 29.5q7 29 31 47t56 18h164q32 0 56 -18t31 -47q31 -6 50 -29.5t19 -54.5q0 -36 -26 -61.5t-64 -25.5zM430 850q-19 0 -31 -11.5t-12 -28.5q0 -9 -7 -16t-16 -7q-19 0 -31 -10.5t-12 -27.5t12 -27t31 -10h296
q19 0 31 10.5t12 27t-12 27.5t-31 11q-9 0 -16 6.5t-7 16.5q0 17 -12 28t-31 11h-164zM842 -127h-660q-49 0 -83.5 34.5t-34.5 83.5v660q0 49 34.5 83.5t83.5 34.5h115q10 0 17 -7t7 -16.5t-7 -16.5t-17 -7h-115q-29 0 -50 -21t-21 -50v-660q0 -29 21 -50t50 -21h660
q29 0 50 21t21 50v660q0 29 -21 50t-50 21h-115q-10 0 -17 7t-7 16.5t7 16.5t17 7h115q49 0 83.5 -34.5t34.5 -83.5v-660q0 -49 -34.5 -83.5t-83.5 -34.5z" />
<glyph glyph-name="huiyuan" unicode="&#xe62c;"
d="M573 462q-40 -17 -73.5 -44.5t-58 -63.5t-38 -78t-13.5 -89q0 -41 10.5 -79t29.5 -71h-21q-23 0 -53.5 1.5t-63.5 4.5l-64 6q-32 4 -58.5 8t-44.5 8t-23 8q-8 6 -12.5 39t3.5 84q3 20 13 32.5t24 22t31.5 15t36 10.5t35.5 11t31 15q16 10 25.5 20t13.5 19.5t4 19.5t-1 23
q-2 18 -13 29t-24 22q-7 5 -12 15t-9 20q-4 12 -8 25q-6 1 -11 5t-10.5 11.5t-9.5 21t-3 24.5t5 19q3 9 10 17q0 30 3 60q3 26 11 55t25 52q16 22 34 36t38 22t39 10.5t38 2.5q23 0 45.5 -5t42 -13.5t35 -19.5t24.5 -22q21 -26 30.5 -56.5t13.5 -58.5q4 -31 4 -64
q5 -4 8 -10t5 -14.5t1 -21.5q-2 -17 -7 -27t-11 -15q-8 -7 -15 -9l-4 -10l-4 -11q-1 -6 -4 -12v0v0zM687 436q51 0 96.5 -19.5t79.5 -53.5t53.5 -79.5t19.5 -97t-19.5 -97.5t-53.5 -80t-79.5 -53t-96.5 -19q-53 0 -98.5 19t-79 53t-53.5 80t-20 97t20 97t53.5 80t79 53.5
t98.5 19.5v0v0zM832 235q5 16 -4 29t-24 18.5t-30 1t-22 -24.5q-4 -14 -8 -25q-4 -12 -7 -24q-4 -13 -9 -27.5t-13 -33.5q-8 -21 -22.5 -19.5t-22.5 16.5q-9 16 -16 34q-7 17 -15 36q-7 17 -12 32q-6 14 -10 23q-6 12 -21 14t-28.5 -4t-23 -19t-2.5 -28q5 -16 12 -35.5
t15 -40.5q8 -20 15.5 -40t12.5 -34q12 -30 36 -45t50.5 -16t51 11.5t35.5 38.5q9 21 18 43t17.5 44t15.5 41q7 20 11 34v0v0zM832 235z" />
<glyph glyph-name="renshiguanli" unicode="&#xe60d;" horiz-adv-x="1029"
d="M839 82v4.5v4.5l-16 -9h16zM701 103l15 85q0 5 -3 9l-61 60q-23 22 -14 48q1 5 3 8q-14 7 -34 15q-6 1 -18 4.5t-18 4.5q-12 9 -36 59q-8 1 -23 3q1 14 11 26.5t12 19.5t3 26.5t6 28.5q3 6 13 11t13 9q8 11 12 34q8 42 -2 63q-2 4 -4.5 8.5t-4 7.5t-1.5 9q-1 10 2 44
t3 35q1 51 -7 84q-9 26 -22 34l-27 4l-17 15q-24 15 -49.5 20t-51.5 0t-40.5 -9.5t-35.5 -13.5q-44 -14 -63.5 -71t-2.5 -140q3 -11 -3.5 -23t-6.5 -16q0 -2 1 -17t2.5 -23t4 -21t7 -21t10.5 -12q1 0 5.5 -1.5t8.5 -2.5t4 0l6 -69q3 -5 12 -15.5t11 -22.5l-17 -4
q-24 -50 -36 -59q-6 -2 -18 -5t-18 -5q-24 -9 -69.5 -29t-61.5 -26q-8 -3 -29.5 -11t-31.5 -12.5t-22.5 -15.5t-17.5 -25v-126h419h283q-2 11 -1 21zM762 349q5 1 8 6l1 1q-18 8 -33 14q-23 6 -35 9q-12 8 -34 56l-22 4q0 13 9.5 24.5t12 18.5t3.5 25.5t5 27.5q3 5 12.5 10
t12.5 9q8 10 12 32q7 41 -3 61q-1 3 -3.5 7.5t-4 7.5t-1.5 9q-1 9 2 41.5t3 33.5q1 49 -7 80q-9 25 -21 32l-26 5l-16 14q-49 31 -118 12q1 0 1 -1l3 -1l12 -11l23 -4l5 -3q25 -14 38 -53v-1l1 -1q9 -38 8 -93q0 -4 -2 -24q-4 -44 -3 -51v-1q0 -1 1 -2q4 -7 5 -10
q16 -32 6 -85q-6 -31 -18 -48q-8 -11 -25 -20q0 -3 -1 -13q-1 -21 -4 -33q-3 -7 -7 -13l5 -10q0 -1 1 -2.5t1 -2.5q13 -28 20 -37q5 -1 14 -3.5t13 -3.5l2 -1l3 -1q18 -7 56 -24l1 1zM701 103l15 85q0 5 -3 9l-61 60q-23 22 -14 48q1 5 3 8q-14 7 -34 15q-6 1 -18 4.5
t-18 4.5q-12 9 -36 59q-8 1 -23 3q1 14 11 26.5t12 19.5t3 26.5t6 28.5q3 6 13 11t13 9q8 11 12 34q8 42 -2 63q-2 4 -4.5 8.5t-4 7.5t-1.5 9q-1 10 2 44t3 35q1 51 -7 84q-9 26 -22 34l-27 4l-17 15q-24 15 -49.5 20t-51.5 0t-40.5 -9.5t-35.5 -13.5q-44 -14 -63.5 -71
t-2.5 -140q3 -11 -3.5 -23t-6.5 -16q0 -2 1 -17t2.5 -23t4 -21t7 -21t10.5 -12q1 0 5.5 -1.5t8.5 -2.5t4 0l6 -69q3 -5 12 -15.5t11 -22.5l-17 -4q-24 -50 -36 -59q-6 -2 -18 -5t-18 -5q-24 -9 -69.5 -29t-61.5 -26q-8 -3 -29.5 -11t-31.5 -12.5t-22.5 -15.5t-17.5 -25v-126
h419h283q-2 11 -1 21zM839 82v4.5v4.5l-16 -9h16zM1023 282q7 7 5.5 12.5t-11.5 7.5l-85 12q-9 2 -19 9t-15 16l-38 77q-4 9 -10 9t-11 -9l-38 -77q-4 -9 -14 -16t-20 -9l-85 -12q-9 -2 -11 -7.5t5 -12.5l61 -60q7 -7 11 -18.5t2 -21.5l-14 -85q-3 -15 8 -15q4 0 9 3l76 40
q8 4 20.5 4t21.5 -4l75 -40q5 -3 9 -3q11 0 8 15l-14 85q-2 9 2 21t11 19zM1023 282q7 7 5.5 12.5t-11.5 7.5l-85 12q-9 2 -19 9t-15 16l-38 77q-4 9 -10 9t-11 -9l-38 -77q-4 -9 -14 -16t-20 -9l-85 -12q-9 -2 -11 -7.5t5 -12.5l61 -60q7 -7 11 -18.5t2 -21.5l-14 -85
q-3 -15 8 -15q4 0 9 3l76 40q8 4 20.5 4t21.5 -4l75 -40q5 -3 9 -3q11 0 8 15l-14 85q-2 9 2 21t11 19z" />
<glyph glyph-name="xinzenghuiyuan" unicode="&#xe61f;"
d="M729 4q-84 0 -143.5 59.5t-59.5 143.5q0 60 31.5 109t82.5 74q4 5 7 10q5 12 9 23q6 17 9 27q8 3 16 10q7 6 12 17q6 11 7 29q2 14 0 24q-2 9 -6 15q-3 7 -9 12q0 35 -4 70q-4 29 -14 64q-11 34 -33 62q-9 12 -25.5 24t-37.5 22q-21 9 -45 15q-24 5 -48 5q-20 0 -40 -3
q-21 -3 -41.5 -11.5t-40.5 -23.5t-36 -40q-18 -25 -27 -57q-8 -32 -12 -60q-4 -33 -3 -67q-8 -8 -11 -18q-4 -9 -5 -21t4 -27q4 -14 10 -22t11 -12q6 -5 12 -7q5 -16 8 -28q4 -10 10 -22q4 -10 11 -17q15 -12 26.5 -23.5t13.5 -31.5q1 -13 1 -25t-4 -22q-5 -11 -14 -21
q-9 -11 -27 -22q-22 -14 -52 -22t-57 -18q-28 -10 -48 -27q-21 -17 -25 -49q-8 -57 -3.5 -92.5t12.5 -42.5q5 -5 25 -9t47 -9q28 -4 62 -8t69 -7q32 -3 67 -5q33 -2 57 -2q23 0 58 2t69 5q38 3 72 7q37 5 65 10q30 6 49 12q20 6 24 12q6 10 9 28q0 2 1 5q-45 -24 -96 -24z
M726 383q-74 0 -126 -52t-52 -126t52 -126t126 -52t126.5 52t52.5 126t-52.5 126t-126.5 52v0zM826 207v-5v0q-1 -9 -7.5 -15.5t-15.5 -6.5h-52v-74h-28v0q-9 0 -15.5 6.5t-6.5 15.5v52h-74v28v0q0 9 6.5 15.5t15.5 6.5h52v52v23h29v0q9 -1 15 -7.5t6 -15.5v-52h75v-23v0z
M826 207z" />
<glyph glyph-name="fozhu" unicode="&#xe601;"
d="M96 410v-22t1 -24q-33 -15 -48 -47.5t-5 -67.5q9 -31 34.5 -50t57.5 -19q7 0 15 2q11 -21 25 -39q-20 -30 -15 -66t32 -59q27 -24 63 -24t64 24q20 -10 42 -19q0 -36 23 -63.5t59 -32.5q7 -1 14 -1q32 0 57.5 19.5t34.5 50.5q24 2 46 7q28 -45 81 -45q21 0 40 9
q33 15 47.5 48t4.5 67q18 14 35 30q19 -9 40 -9q53 0 81 44q20 31 14.5 66.5t-32.5 58.5q7 22 13 45q35 5 59 32t24 63v1v1q0 36 -24 63t-60 32q-5 23 -13 44q27 24 32.5 59t-14.5 66t-54.5 40.5t-66.5 -5.5q-17 16 -36 30q11 34 -4 67t-48 48t-67.5 4.5t-53.5 -40.5
q-22 4 -46 6q-10 34 -40 54t-65.5 14.5t-59 -33t-23.5 -63.5q-22 -8 -42 -19q-27 23 -63 23.5t-63 -23.5t-32 -60t15 -65q-14 -19 -25 -39q-36 5 -66.5 -14t-40.5 -54t5.5 -67.5t47.5 -47.5zM144 403q29 3 52 21t31.5 47t-1 57t-32.5 46q8 13 17 26q21 -11 44 -11
q36 0 63 23q23 20 30 49t-3 56q14 7 28 13q13 -22 35 -35.5t48 -13.5q7 0 14 1q30 5 51.5 25t28.5 49q14 -2 30 -5q-2 -29 13.5 -54t42.5 -38q19 -8 40 -8q38 0 66 27l24 -20q-17 -24 -18 -53t15 -55v0q29 -44 81 -44q8 0 19 2q5 -15 9 -29q-28 -11 -44.5 -35.5t-16.5 -54.5
v0v-1q0 -30 17 -54.5t44 -34.5q-4 -15 -9 -30q-28 6 -55.5 -5t-43.5 -37q-17 -26 -15.5 -55t18.5 -53q-12 -10 -23 -20q-21 20 -50 25.5t-57 -7.5q-27 -12 -42 -37.5t-14 -54.5q-16 -3 -30 -5q-7 29 -28.5 49t-51.5 24.5t-56 -9t-41 -38.5q-14 5 -27 12q9 27 2 56t-30 48.5
t-52.5 23t-55.5 -10.5l-16 26q23 18 32 46t0.5 56.5t-31.5 47t-52 21.5v16v15z" />
<glyph glyph-name="iconfontquanping" unicode="&#xe60a;"
d="M144 -16h304q13 0 22 9.5t9 22t-9 22t-22 9.5h-236l260 260q9 9 9 21t-9 21t-21 9t-21 -9l-262 -262v240q0 13 -9 22t-22 9t-22 -9t-9 -22v-311q0 -32 38 -32v0zM880 794h-304q-13 0 -22 -9t-9 -22t9 -22t22 -9h236l-260 -261q-9 -8 -9 -20.5t9 -21.5t21 -9t21 9l262 262
v-240q0 -12 9 -21.5t22 -9.5t22 9.5t9 21.5v312q0 15 -10.5 23t-27.5 8v0z" />
<glyph glyph-name="iconfontshuangjiantou" unicode="&#xe608;"
d="M535 52l335 341q10 11 10 26.5t-10.5 26t-25.5 10.5t-26 -11l-311 -317l-312 317q-11 11 -26 11t-25.5 -10.5t-10.5 -26t11 -26.5l335 -341q11 -12 28 -10q16 -2 28 10v0v0v0v0zM507 309q16 -1 28 10l335 341q10 11 10 26.5t-10.5 26t-25.5 10.5t-26 -10l-311 -318
l-312 318q-11 10 -26 10t-25.5 -10.5t-10.5 -26t11 -26.5l335 -341q11 -11 28 -10v0v0v0z" />
<glyph glyph-name="temple" unicode="&#xe607;"
d="M626 749h-240q15 16 42.5 41t47 45t29.5 39q0 16 3 22q-7 -21 12 -44.5t55 -53.5t51 -49zM715 727v-23q67 -38 74 -38q16 0 28 16q-1 -2 -3 -7t-4.5 -9.5t-4.5 -8.5q-5 -8 -17 -15.5t-19 -7.5h-529q-14 0 -31 19t-14 29q12 -16 29 -16q6 0 36.5 19.5t36.5 25.5v16h418z
M291 593h431v13h-431v-13zM310 513h392v57h-392v-57zM769 459q77 -51 96 -51q8 0 18 6.5t17 15.5q-1 -9 -11.5 -25t-10.5 -26q0 -3 -10 -13h-727l6 7q-3 5 -17 19.5t-18 27.5v10q5 -9 15 -15.5t20 -6.5q9 0 30 11.5t41.5 25t21.5 14.5q3 6 3 28h526v-28zM220 328h610v13
h-610v-13zM763 302v-54h-514q0 7 1.5 21.5t1.5 16.5q0 6 -4.5 10t-4.5 6h520zM843 219v-38q1 0 26 -15t53.5 -30.5t38.5 -15.5q28 0 45 29q7 -14 -21 -47t-50 -33h-861q-24 8 -35 20q-12 8 -22 23.5t-10 20.5v16q12 -29 44 -29q13 0 36.5 13t48.5 29.5t30 18.5q3 0 3 10v28
h674zM157 25h699v16h-699v-16zM189 -52h635v58h-635v-58zM96 -119h820v35h-820v-35z" />
<glyph glyph-name="huiyuan2" unicode="&#xe631;"
d="M516 821q-88 0 -169 -34t-140.5 -91.5t-95 -137.5t-36.5 -168q-2 -120 56 -221.5t158.5 -161t220.5 -61.5q87 -1 167.5 33t139.5 92t95 138t37 167q1 89 -33 171t-92 141.5t-138.5 95.5t-169.5 37zM809 134q-75 94 -187 130q140 177 10 289q-55 47 -128 44t-123 -55
q-23 -24 -36 -56t-15 -68.5t17 -77.5t59 -76q-117 -38 -190 -131q-60 66 -82.5 158t3 190.5t97.5 172.5q71 74 169.5 102t198 6t172.5 -90q80 -74 110 -174.5t9 -196.5t-84 -167zM249 99q6 -8 8 -9q63 -62 157 -84.5t188.5 -1.5t160.5 80q9 11 8.5 16.5t-8.5 14.5
q-140 156 -340 105q-106 -28 -174 -121zM513 281q54 0 94 39t41 94t-39.5 96t-95.5 41q-55 1 -95.5 -39.5t-40.5 -95.5q-1 -56 39 -95.5t97 -39.5z" />
<glyph glyph-name="shangchuan1" unicode="&#xe672;"
d="M512 896q-138 0 -256 -69t-187 -187t-69 -256t69 -256t187 -187t256 -69t256 69t187 187t69 256t-69 256t-187 187t-256 69zM559 128h-56q-12 0 -23 10.5t-11 23.5t11 23.5t23 10.5h56q13 0 23.5 -10.5t10.5 -23.5t-10.5 -23.5t-23.5 -10.5zM687 401h-94v-107
q0 -12 -8.5 -20.5t-21.5 -8.5h-60q-12 0 -20.5 8.5t-8.5 20.5v107h-103q-12 0 -21 8t-9 18q0 30 13 38l145 162q13 13 30 13t30 -13l145 -162q13 -13 13 -38q-4 -10 -12.5 -18t-17.5 -8z" />
<glyph glyph-name="sousuo-sousuo" unicode="&#xe603;"
d="M691.5 646.5q-91.5 91.5 -221 91.5t-221 -91.5t-91.5 -221t91.5 -221.5t221 -92t221 92t91.5 221.5t-91.5 221zM181.5 136q-56.5 57 -88 131.5t-31.5 157.5q0 111 54.5 205.5t149 149t205.5 54.5t205 -54.5t149 -149t55 -205.5q0 -83 -31.5 -157.5t-88.5 -131.5
t-131.5 -88.5t-157.5 -31.5t-158 31.5t-131.5 88.5zM946 -50q-17 -16 -40 -16t-39 16l-79 79q-17 17 -17 40t16.5 39.5t39.5 16.5t40 -17l79 -79q16 -16 16 -39t-16 -40v0z" />
<glyph glyph-name="shangchuan" unicode="&#xe63a;"
d="M542 144h-60q-12 0 -21 -9t-9 -21.5t9 -21t21 -8.5h60q12 0 21 8.5t9 21t-9 21.5t-21 9zM512 865q-98 0 -187 -38.5t-153.5 -102.5t-102.5 -153t-38 -187t38 -187t102.5 -153t153.5 -102.5t187 -38.5t187 38.5t153 102.5t102.5 153t38.5 187t-38.5 187t-102.5 153
t-153 102.5t-187 38.5zM512 -55q-89 0 -170.5 35t-140 93.5t-93.5 140t-35 170.5t35 170.5t93.5 140t140 93.5t170.5 35t170.5 -35t140 -93.5t93.5 -140t35 -170.5t-35 -170.5t-93.5 -140t-140 -93.5t-170.5 -35zM541 610q-12 13 -28.5 13t-27.5 -13l-140 -162
q-14 -16 -12 -38q2 -11 10 -18.5t20 -7.5h89v-150q0 -13 9 -21.5t21 -8.5h60q12 0 21 8.5t9 21.5v150h91q11 0 19.5 7.5t9.5 18.5q3 22 -11 38z" />
<glyph glyph-name="shoukuan" unicode="&#xe6fd;"
d="M986 269q-20 11 -72.5 -9.5t-105.5 -52t-103.5 -58.5t-64.5 -27q-3 -1 -9.5 -2.5t-27 -2t-42.5 2.5t-54.5 15t-64.5 31q-52 29 -101.5 61t-73.5 50l-24 17q-3 2 -8.5 5t-24 7.5t-37 5t-45 -6.5t-51.5 -23q-17 -12 -36.5 -23t-30 -16.5l-10.5 -5.5v-327q3 4 8.5 9.5
t22.5 20t35.5 25.5t46 20t53.5 9q43 0 121 -26t137 -51.5t56 -25.5q3 -1 9 -3.5t24 -7t35 -6t39 2t40 14.5l378 282q13 6 18 24t-4.5 39t-32.5 33zM582 211q92 0 170 46t124 124t46 169.5t-46 169.5t-124 124t-170 46q-91 0 -169 -44.5t-124 -121t-46 -167.5
q0 -92 46 -171.5t124 -127t169 -47.5zM474 749l115 -154l115 154h64l-141 -192h103q2 0 4 -1.5t2 -3.5v-2v-19q0 -3 -1.5 -4.5t-3.5 -1.5h-1h-122v-45h115q3 0 4.5 -1.5t1.5 -3.5l1 -1v-26q0 -3 -2 -4.5t-3 -1.5h-2h-115v-71q0 -6 -13 -6h-25q-3 0 -6.5 1.5t-4.5 3.5l-2 1
v71h-109q-5 0 -5.5 0.5t-0.5 5.5v19q0 3 1.5 4.5t2.5 1.5l2 1h115v51h-115q-3 0 -4.5 1.5t-1.5 3.5v1v19q0 3 1.5 4.5l2.5 2.5h2h102l-140 192h64z" />
<glyph glyph-name="men" unicode="&#xe6cf;"
d="M501 422q-19 0 -32.5 -11t-13.5 -27t13.5 -27t32.5 -11t32.5 11t13.5 27t-13.5 27t-32.5 11zM760 784h-497q-32 0 -53.5 -16.5t-24.5 -44.5v0v-672q0 -30 22 -48.5t56 -18.5h497q33 0 56 18t23 44v676q0 26 -23 44t-56 18zM578 57q31 5 51.5 25t20.5 45v514
q0 25 -20.5 45t-51.5 25l-243 33h425q20 0 33 -13q8 -8 8 -20v-654q0 -12 -8 -20q-13 -13 -33 -13h-425zM613 125q0 -5 -11.5 -17t-20.5 -14l-353 -51v680l353 -49q9 -2 20.5 -14t11.5 -17v-518z" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,411 @@
@charset "UTF-8";
@font-face {
font-family: 'iconfont';
src: url('font/iconfont/iconfont.eot?t=1492242939353'); /* IE9*/
src: url('font/iconfont/iconfont.eot?t=1492242939353#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('font/iconfont/element-icons.woff?t=1492242939353') format('woff'), /* chrome, firefox */
url('font/iconfont/element-icons.ttf?t=1492242939353') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('font/iconfont/iconfont.svg?t=1492242939353#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-time:before { content: "\e62f"; }
.icon-richeng:before { content: "\e641"; }
.icon-guanbi:before { content: "\e617"; }
.icon-xiangzuojiantou:before { content: "\e660"; }
.icon-xiangyoujiantou:before { content: "\e65f"; }
body {
margin: 0px;
padding: 0px;
/*background: url(assets/bg1.jpg) center !important;
background-size: cover;*/
background: #ffffff;
font-size: 12px;
-webkit-font-smoothing: antialiased;
}
body, button, input, select, textarea {
font: 400 1em/1.5 PingFang SC,/*Lantinghei SC,Helvetica Neue,*/Microsoft Yahei,Hiragino Sans GB,Microsoft Sans Serif,WenQuanYi Micro Hei,sans;
}
ul,li,dl,dt,dd{ margin:0; padding:0; list-style:none;}
em,i{ font-style:normal; margin:0; padding:0;}
h1,h2,h3,h4,h5,p{ margin:0; padding:0;}
a{ cursor: pointer;}
.full-jcalendar{
position: relative;
font-size: 14px;
display: inline-block;
}
.full-jcalendar .input-icon{
position: absolute;
width: 28px;
height: 100%;
right: 0;
top: 5px;
text-align: center;
color: #e8a400;
transition: all .3s;
}
.full-jcalendar .input-icon .iconfont{
font-size: 18px;
}
.full-jcalendar .input-icon .iconfont.is-clear{
color:#999;
font-weight: bolder;
}
.full-jcalendar .input-icon__tip{
position: absolute;
right:28px;
top:10px;
width:16px;
cursor: default;
text-align: center;
}
.full-jcalendar .input-icon__tip i{
display: block;
margin:0;
padding:0;
width:16px;
height:16px;
background-color: #ff5a00;
border-radius: 8px;
font-size: 12px;
color:#fff;
line-height: 16px;
text-align: center;
overflow: hidden;
}
.full-jcalendar .input__inner{
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: #fff;
background-image: none;
border-radius: 5px;
border: 1px solid #bfcbd9;
box-sizing: border-box;
color: #1f2d3d;
display: inline-block;
font-size: inherit;
height: 36px;
line-height: 1;
outline: none;
padding: 3px 10px;
transition: border-color .2s cubic-bezier(.645,.045,.355,1);
min-width:193px;
width: 100%;
}
.full-jcalendar .input__inner:focus{
outline: none;
border-color:#20a0ff;
}
.full-jcalendar .input__inner:hover{
border-color:#8391a5;
}
.input-icon+.input__inner{
padding-right:28px;
}
.input-icon__tip+.input__inner{
padding-right:35px;
}
.full-jcalendar input.input__inner::placeholder, .full-jcalendar input.input__inner:-moz-placeholder{
color:#97A8BE;
}
.full-jcalendar input.is-disabled{
background-color: #eef1f6;
border-color: #d1dbe5;
color: #bbb;
cursor: not-allowed;
}
.full-jcalendar .is-disabled i{
color: #bbb;
}
.full-jcalendar .is-disabled *{
cursor: not-allowed;
}
.full-jcalendar__main{
cursor: pointer;
position: absolute;
z-index: 1670;
left:2px;
top:38px;
width:296px;
background-color: #ffffff;
border-radius: 5px;
-moz-box-shadow:2px 2px 5px #C9C9C9;
-webkit-box-shadow:2px 2px 5px #C9C9C9;
box-shadow:2px 2px 5px #C9C9C9;
overflow: hidden;
}
.full-jcalendar__main.is-daterange{
width:593px;
}
.full-jcalendar__main .date-range__month{
float: left;
width:296px;
overflow: hidden;
}
.full-jcalendar__main .date-range__month.leftMonth{
border-right:1px solid #F8F8F8;
}
.full-jcalendar-header{
position: relative;
width:100%;
padding:5px 0;
height:24px;
font-size: 14px;
text-align: center;
line-height: 24px;
color:#333;
}
.full-jcalendar-header span{ display: inline-block;}
.full-jcalendar-header .title-year:hover,.full-jcalendar-header .title-month:hover{
color:#50bfff;
}
.date-range__month .full-jcalendar-header .title-year:hover,.date-range__month .full-jcalendar-header .title-month:hover{
color:#333;
}
.full-jcalendar-header .prev-month,.full-jcalendar-header .next-month {
cursor: pointer;
line-height: 20px;
text-align: center;
color: #E1CEB7;
font-size: 20px;
}
.full-jcalendar-header p.prev-month{
position: absolute;
z-index: 1676;
left:5px;
top:5px;
}
.full-jcalendar-header p.next-month {
position: absolute;
z-index: 1676;
right: 5px;
top: 5px;
}
.date-range__month .full-jcalendar-header .prev-year{
position: absolute;
z-index: 1676;
left: 5px;
top: 5px;
}
.date-range__month .full-jcalendar-header .prev-month{
left:35px;
}
.date-range__month .full-jcalendar-header .next-year{
position: absolute;
z-index: 1676;
right: 5px;
top: 5px;
}
.date-range__month .full-jcalendar-header .next-month{
right:35px;
}
.full-jcalendar__body {
margin: 0;
padding: 0;
width: 100%;
height: 280px;
position: relative;
}
.full-jcalendar__body ul,.full-jcalendar__body p {
margin: 0;
padding: 0;
}
.full-jcalendar__body .weeks {
width: 100%;
height: 30px;
display: flex;
border-top: 1px solid #F8F8F8;
}
.full-jcalendar__body .weeks .week {
flex: 1;
text-align: center;
font-size: 14px;
color: #8391A5;
line-height: 30px;
border: none;
}
.full-jcalendar__body .weeks .week strong {
font-weight: normal;
}
.full-jcalendar__body .week-row {
display: flex;
width:100%;
}
.full-jcalendar__body .week-row .day-cell {
position: relative;
flex: 1;
padding: 2px;
border: 1px solid #F8F8F8;
margin-right: -1px;
margin-bottom: -1px;
text-align: center;
}
.full-jcalendar__body .day-cell .day-number .lunar {
font-size: 12px;
color: #ACACAC;
}
.full-jcalendar__body .day-cell .day-number .solar {
font-size: 12px;
color: #483a32;
/*text-shadow: 1px 1px 1px #ddd;*/
}
/*.full-jcalendar__body .day-cell.not-cur-month .solar {*/
/*text-shadow: none;*/
/*}*/
.full-jcalendar__body .day-cell .day-number .solar .is-leap {
display: inline-block;
width:14px;
height:14px;
border-radius: 7px;
background-color: #f00;
font-size: 12px;
color: #fff;
text-align: center;
line-height: 14px;
}
.full-jcalendar__body .day-cell .day-number .term {
fontsize:12px;
color: #FFC200;
}
.full-jcalendar__body .day-cell .day-number .festival {
fontsize:12px;
color: #ff8610;
}
.full-jcalendar__body .day-cell .day-number .is-today {
font-size: 12px;
color: #20a0ff;
}
.full-jcalendar__body .day-cell .day-number .is-empty {
line-height: 34px;
}
.full-jcalendar__body .day-cell.today {
background-color: #FBF9F6;
}
.full-jcalendar__body .day-cell.today:before {
content: " ";
position: absolute;
top: 0;
right: 0;
width: 0;
height: 0;
border-top: .5em solid #20a0ff;
border-left: .5em solid transparent;
}
.full-jcalendar__body .day-cell.choose {
background-color: #d2ecff;
}
.full-jcalendar__body .day-cell.select {
background-color: #009bfe;
}
.full-jcalendar__body .day-cell.select .lunar,
.full-jcalendar__body .day-cell.select .solar,
.full-jcalendar__body .day-cell.select .term ,
.full-jcalendar__body .day-cell.select .festival ,
.full-jcalendar__body .day-cell.select .is-today{
color: #fff;
}
.full-jcalendar__body .day-cell.select .solar .is-leap {
background: none;
}
.full-jcalendar__body .day-cell.not-cur-month .lunar
,.full-jcalendar__body .day-cell.not-cur-month .solar
,.full-jcalendar__body .day-cell.not-cur-month .term
,.full-jcalendar__body .day-cell.not-cur-month .festival{
color: #ddd;
}
.full-jcalendar__body .day-cell:hover {
background-color: #ECF1F4;
}
.full-jcalendar__body .day-cell.choose:hover {
background-color: #009bfe;
}
.full-jcalendar__body .day-cell.choose:hover .lunar,
.full-jcalendar__body .day-cell.choose:hover .solar,
.full-jcalendar__body .day-cell.choose:hover .term ,
.full-jcalendar__body .day-cell.choose:hover .festival ,
.full-jcalendar__body .day-cell.choose:hover .is-today{
color: #fff;
}
.full-jcalendar__body .select:hover{
background-color: #009bfe;
}
.full-jcalendar__body .day-cell.not-optional{
background-color: #ECF1F4;
}
.full-jcalendar__month,.full-jcalendar__year{
position: absolute;
z-index: 1677;
top:0;
left:0;
width:100%;
height:100%;
background-color: #fff;
}
.full-jcalendar__body .close{
position: absolute;
bottom:10px;
right:10px;
padding:3px 5px;
font-size:12px;
background-color: #FBF8FF;
border:1px solid #F8F8F8;
border-radius: 3px;
}
.full-jcalendar__body .data-list{
list-style: none;
margin:auto;
padding:20px 0 0 0;
width:85%;
}
.full-jcalendar__body .data-list li{
position: relative;
list-style: none;
line-height: normal;
float: left;
width:25%;
text-align: center;
padding:5px 0;
margin:10px 0;
font-size:14px;
color:#333;
}
.full-jcalendar__body .data-list li:hover ,.full-jcalendar__body .data-list li.select-year {
background-color: #50bfff;
color: #fff;
}
.full-jcalendar__body .data-list li.curr-year:before {
content: " ";
position: absolute;
top: 0;
right: 0;
width: 0;
height: 0;
border-top: .5em solid #20a0ff;
border-left: .5em solid transparent;
}
.full-jcalendar__body .clearfix{
float: none;
width:100%;
clear: both;
height:0px;
line-height: 0px;
}

View File

@@ -51,6 +51,7 @@
src="/static/videos/login.webm"
muted
autoplay
id="video"
loop
style="
user-select: none;
@@ -338,7 +339,8 @@ export default {
SysUserSocialTypeEnum: SystemUserSocialTypeEnum,
};
},
created() {
created() {
// 租户开关
this.tenantEnable = getTenantEnable();
if (this.tenantEnable) {
@@ -356,8 +358,15 @@ export default {
this.redirect = this.$route.query.redirect
? decodeURIComponent(this.$route.query.redirect)
: undefined;
this.getCookie();
},
this.getCookie();
},
mounted () {
const video = document.getElementById('video');
// 设置为0.5倍速数值越小速度越慢0.5为半速0.75为0.75倍速等)
video.playbackRate = 0.2;
},
methods: {
getCode() {
// 情况一,未开启:则直接登录

View File

@@ -0,0 +1,309 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
@emitFun="handleEmitFun">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
</div>
</template>
<script>
import moment from 'moment';
import {
getPdList,
} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { getDefectAnalysis } from '@/api/monitoring/defectSummary';
import * as XLSX from 'xlsx'
import FileSaver from 'file-saver'
export default {
name: 'QualityInspectionType',
mixins: [basicPageMixin],
data() {
return {
// tableBtn: [
// this.$auth.hasPermi('base:quality-inspection-type:update')
// ? {
// type: 'edit',
// btnName: '修改',
// }
// : undefined,
// this.$auth.hasPermi('base:quality-inspection-type:delete')
// ? {
// type: 'delete',
// btnName: '删除',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '添加时间',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'remark', label: '玻璃编号' },
{
prop: 'checkTime',
label: '检测时间',
fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'checkNum', label: '缺陷数' },
{
prop: 'glassGrade',
label: '等级',
filter: (val) => val === 0 ? '合格' : val === 1 ? '提示' : val === 2 ? '返修' : val === 3 ? '报废' : ''
},
{ prop: 'reason', label: '判等原因' },
{ prop: 'specifications', label: '规格' },
// {
// label: '操作',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// ]);
// },
// },
// },
],
//
searchBarFormConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
},
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
},
{
type: 'input',
label: '缺陷数>',
// selectOptions: [],
param: 'checkNum',
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
{
type: 'separate',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:create')
// ? 'button'
// : '',
// btnName: '新增',
// name: 'add',
// plain: true,
// color: 'success',
// },
{
type: this.$auth.hasPermi('base:quality-inspection-type:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
// 表单配置
// formRows: [
// [
// {
// input: true,
// label: '检测类型名称',
// prop: 'name',
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// // bind: {
// // disabled: true, // some condition, like detail mode...
// // }
// },
// ],
// [{ input: true, label: '检测类型编码', prop: 'code' }],
// [{ input: true, label: '备注', prop: 'remark' }],
// ],
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: undefined,
factoryId: undefined,
checkNum: undefined,
startTime: undefined,
endTime: undefined,
},
// 表单参数
form: {},
};
},
// watch: {
// form: {
// handler: (val) => {
// console.log('form changed', val);
// },
// deep: true
// },
// },
created() {
this.getList();
this.getDict()
},
methods: {
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];
});
getFactoryPage({ pageSize: 100, pageNo: 1 }).then(res => {
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
});
},
/** base table related */
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
}
},
/** search bar related */
handleSearchBarBtnClick(btn) {
// const keys = ['name'];
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineId ? btn.lineId : undefined
this.queryParams.factoryId = btn.factoryId ? btn.factoryId : undefined
this.queryParams.startTime = btn.timeVal ? btn.timeVal[0] : undefined
this.queryParams.endTime = btn.timeVal ? btn.timeVal[1] : undefined
this.queryParams.checkNum = btn.checkNum ? btn.checkNum : undefined
// keys.forEach((key) => {
// this.queryParams[key] = btn[key] || null;
// });
this.getList();
break;
case 'add':
this.handleAdd();
break;
case 'export':
this.handleExport();
break;
// case 'reset':
// this.$refs['search-bar'].resetForm();
// this.resetQuery();
// break;
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
getDefectAnalysis(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
handleExport() {
// 处理查询参数
let tables = document.querySelector('.el-table').cloneNode(true)
const fix = tables.querySelector('.el-table__fixed')
const fixRight = tables.querySelector('.el-table__fixed-right')
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'))
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'))
}
let exportTable = XLSX.utils.table_to_book(tables)
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookSST: true, type: 'array'
})
// sheetjs.xlsx为导出表格的标题名称
try {
FileSaver.saveAs(new Blob([exportTableOut], {
type: 'application/octet-stream'
}),'缺陷分析.xlsx')
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut)
}
return exportTableOut
},
},
};
</script>

View File

@@ -0,0 +1,560 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
@emitFun="handleEmitFun">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<div v-if="chartData" class="charts-container">
<div v-for="(lineData, lineName) in chartData" :key="lineName" class="chart-wrapper">
<div class="blue-block"></div>
<h3 class="chart-title">{{ lineName }}</h3>
<div :id="`chart-${lineName}`" class="chart" style="width: 100%; height: 300px;"></div>
</div>
</div>
<defect-summary-det ref="defectSummaryDetRef" v-if="defectVis" />
</div>
</template>
<script>
import moment from 'moment';
import {
getPdList,
} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import { getDefectSummaryTable, getDefectSummaryChart } from '@/api/monitoring/defectSummary';
import * as echarts from 'echarts';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import defectSummaryDet from './defectSummaryDet.vue'
export default {
name: 'QualityInspectionType',
mixins: [basicPageMixin],
components: {
defectSummaryDet
},
data() {
return {
tableBtn: [
this.$auth.hasPermi('base:quality-inspection-type:update')
? {
type: 'detail',
btnName: '缺陷详情',
}
: undefined,
// this.$auth.hasPermi('base:quality-inspection-type:delete')
// ? {
// type: 'delete',
// btnName: '删除',
// }
// : undefined,
].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '添加时间',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'glassNum', label: '玻璃总数' },
{
prop: 'okNum',
label: '合格品数',
},
{ prop: 'okRate', label: '合格百分比' },
{ prop: 'repairNum', label: '返修品数' },
{ prop: 'repairRate', label: '返修百分比' },
{ prop: 'ngNum', label: '废片数' },
{ prop: 'ngRate', label: '废片百分比' },
{ prop: 'oneNgNum', label: '1类缺陷玻璃数量' },
{ prop: 'twoNgNum', label: '2类缺陷玻璃数量' },
{ prop: 'threeNgNum', label: '3类缺陷玻璃数量' },
// {
// label: '操作',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// ]);
// },
// },
// },
],
//
searchBarFormConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
},
{
type: 'select',
label: '产线',
selectOptions: [],
multiple: true,
param: 'lineId',
},
// {
// type: 'input',
// label: '缺陷数>',
// // selectOptions: [],
// param: 'number',
// },
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
defaultTime: ['00:00:00', '23:59:59'],
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
{
type: 'separate',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:create')
// ? 'button'
// : '',
// btnName: '新增',
// name: 'add',
// plain: true,
// color: 'success',
// },
{
type: this.$auth.hasPermi('base:quality-inspection-type:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
// 表单配置
// formRows: [
// [
// {
// input: true,
// label: '检测类型名称',
// prop: 'name',
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// // bind: {
// // disabled: true, // some condition, like detail mode...
// // }
// },
// ],
// [{ input: true, label: '检测类型编码', prop: 'code' }],
// [{ input: true, label: '备注', prop: 'remark' }],
// ],
// 是否显示弹出层
open: false,
chartData: {},
charts: {},
defectVis:false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: undefined,
factoryId: undefined,
checkNum: undefined,
startTime: undefined,
},
// 表单参数
form: {},
};
},
// watch: {
// form: {
// handler: (val) => {
// console.log('form changed', val);
// },
// deep: true
// },
// },
created() {
this.getList();
this.getDict()
},
methods: {
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];
});
getFactoryPage({ pageSize: 100, pageNo: 1 }).then(res => {
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
});
},
/** base table related */
handleTableBtnClick({ data, type }) {
switch (type) {
case 'detail':
this.defectVis = true
this.$nextTick(() => {
this.$refs.defectSummaryDetRef.init({
factoryId:data.factoryId,
lineId: [data.lineId],
factoryName: data.factoryName,
lineName: data.lineName,
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
})
})
break;
case 'delete':
this.handleDelete(data);
break;
}
},
beforeDestroy() {
// 销毁所有 ECharts 实例
Object.values(this.charts).forEach(chart => {
if (chart && chart.dispose) {
chart.dispose();
}
});
this.charts = {};
},
/**
* 初始化单个图表
* @param {string} lineName - 产线名称
* @param {Array} lineData - 该产线的原始数据
*/
initSingleChart(lineName, lineData) {
// 如果已有实例,先销毁
if (this.charts[lineName]) {
this.charts[lineName].dispose();
}
const chartDom = document.getElementById(`chart-${lineName}`);
if (!chartDom || !lineData || lineData.length === 0) {
console.warn(`图表容器 chart-${lineName} 未找到或数据为空`);
return;
}
const myChart = echarts.init(chartDom);
// --- 动态处理数据逻辑 ---
const startTime = this.queryParams.startTime;
const endTime = this.queryParams.endTime;
if (!startTime || !endTime) {
console.error("起始时间或结束时间为空,无法计算时间差。");
return;
}
const durationDays = (endTime - startTime) / (1000 * 60 * 60 * 24);
const isHourly = durationDays < 7;
// 使用Map来保证顺序并能存储聚合后的数据和原始显示标签
const aggregatedMap = new Map();
lineData.forEach(item => {
let groupKey; // 用于分组的键
let displayLabel; // 用于显示的标签
if (isHourly) {
// --- 方法一:使用字符串分割 ---
const timePart = item.timePoint.split('T')[1];
groupKey = timePart ? timePart : item.timePoint; // 安全处理
displayLabel = item.timePoint.replace('T', ' ');
} else {
// 按天聚合:分组键和显示标签都到天
groupKey = item.timePoint.split('T')[0];
displayLabel = groupKey;
}
if (!aggregatedMap.has(groupKey)) {
aggregatedMap.set(groupKey, {
displayLabel: displayLabel,
okNum: 0,
repairNum: 0,
ngNum: 0
});
}
const aggregatedItem = aggregatedMap.get(groupKey);
aggregatedItem.okNum += item.okNum || 0;
aggregatedItem.repairNum += item.repairNum || 0;
aggregatedItem.ngNum += item.ngNum || 0;
});
// 准备 ECharts 所需的数据格式
const xAxisData = [];
const okNumData = [];
const repairNumData = [];
const ngNumData = [];
aggregatedMap.forEach(item => {
xAxisData.push(item.displayLabel);
okNumData.push(item.okNum);
repairNumData.push(item.repairNum);
ngNumData.push(item.ngNum);
});
// --- ECharts 配置项 ---
const option = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'cross' },
},
legend: {
data: ['合格品数', '返修品数', '废片数'],
itemHeight: 2,
itemWidth: 20,
},
grid: {
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLabel: {
rotate: 45,
interval: 0, // 强制显示所有标签
formatter: function (value) {
if (isHourly) {
// 从 "2025-10-30 00:00" 中提取 "00:00" 进行显示
return value.split(' ')[1];
} else {
// 天级别,显示 "MM-DD"
const dateParts = value.split('-');
return `${dateParts[1]}-${dateParts[2]}`;
}
}
}
},
yAxis: {
type: 'value',
min: 0
},
series: [
{
name: '合格品数',
type: 'line',
showSymbol: false,
data: okNumData,
itemStyle: { color: 'rgba(40, 138, 255, 1)' },
},
{
name: '返修品数',
type: 'line',
showSymbol: false,
data: repairNumData,
itemStyle: { color: 'rgba(115, 222, 147, 1)' },
},
{
name: '废片数',
type: 'line',
showSymbol: false,
data: ngNumData,
itemStyle: { color: 'rgba(255, 206, 106, 1)' },
}
]
};
myChart.setOption(option);
this.charts[lineName] = myChart;
// 监听容器大小变化
const resizeObserver = new ResizeObserver(() => {
myChart.resize();
});
resizeObserver.observe(chartDom);
myChart._resizeObserver = resizeObserver;
},
/**
* 根据获取到的 chartData 更新所有图表
*/
updateAllCharts() {
if (!this.chartData) {
return;
}
// 使用 nextTick 确保 v-for 生成的 DOM 已存在
this.$nextTick(() => {
const lineNames = Object.keys(this.chartData);
lineNames.forEach(lineName => {
this.initSingleChart(lineName, this.chartData[lineName]);
});
});
},
/** search bar related */
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineId ? btn.lineId : undefined
this.queryParams.factoryId = btn.factoryId ? btn.factoryId : undefined
this.queryParams.startTime = btn.timeVal ? btn.timeVal[0] : undefined
this.queryParams.endTime = btn.timeVal ? btn.timeVal[1] : undefined
this.getList();
break;
case 'add':
this.handleAdd();
break;
case 'export':
this.handleExport();
break;
// case 'reset':
// this.$refs['search-bar'].resetForm();
// this.resetQuery();
// break;
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
getDefectSummaryTable(this.queryParams).then((response) => {
this.list = response.data;
// this.total = response.data.total;
this.loading = false;
})
getDefectSummaryChart(this.queryParams).then((res) => {
console.log('res.data', res.data);
this.chartData = res.data || {};
// 手动调用更新图表的方法
this.updateAllCharts();
// // this.total = response.data.total;
// this.loading = false;
})
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
name: undefined,
code: undefined,
remark: undefined,
};
this.resetForm('form');
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let tables = document.querySelector('.el-table').cloneNode(true)
const fix = tables.querySelector('.el-table__fixed')
const fixRight = tables.querySelector('.el-table__fixed-right')
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'))
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'))
}
let exportTable = XLSX.utils.table_to_book(tables)
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookSST: true, type: 'array'
})
// sheetjs.xlsx为导出表格的标题名称
try {
FileSaver.saveAs(new Blob([exportTableOut], {
type: 'application/octet-stream'
}), '缺陷汇总.xlsx')
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut)
}
return exportTableOut
},
},
};
</script>
<style scoped>
.charts-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 20px;
}
.chart-wrapper {
flex: 1;
min-width: 300px;
margin-top: 10px;
/* 最小宽度,防止缩得太小 */
/* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
border-radius: 4px; */
/* padding: 10px; */
}
.blue-block {
display: inline-block;
float: left;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 16px;
}
.chart-title {
text-align: left;
color: #333;
font-size: 16px;
margin-bottom: 10px;
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<div>
<el-drawer title="详情" :visible.sync="visible" size="70%" @close='closeD'>
<div class="box">
<!-- 顶部信息展示区域 -->
<div class="info-header">
<div class="info-item">
<span class="label">工厂</span>
<span class="value">{{ factoryName }}</span>
</div>
<div class="info-item">
<span class="label">产线</span>
<span class="value">{{ lineName }}</span>
</div>
<div class="info-item">
<span class="label">时间范围</span>
<span class="value">{{ timeRange }}</span>
</div>
<div class="info-item">
<el-button type="primary" @click="handleExport">导出</el-button>
</div>
</div>
<!-- 表格 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps"
:table-data="tableData" :span-method="spanMethod" :max-height="tableH">
</base-table>
</div>
</el-drawer>
</div>
</template>
<script>
import moment from 'moment';
import * as XLSX from 'xlsx';
import { getDefectSummaryDet } from '@/api/monitoring/defectSummary';
// import { publicFormatter } from '@/utils/dict'
const tableProps = [
{ prop: 'defectLevel', label: '缺陷等级' },
{ prop: 'defectName', label: '缺陷类型' },
{ prop: 'defectNum', label: '玻璃数量' }
]
export default {
name: 'EnergyStatisticsDet',
props: {},
data() {
return {
visible: false,
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(115),
total: 0,
queryParams: { pageNo: 1, pageSize: 30 },
factoryName: '',
lineName: '',
timeRange: '',
name: '',
energyType: '',
energyTypeId: '',
addOrEditTitle: "",
centervisible: false,
collectionList: [
{ value: 0, label: '否' },
{ value: 1, label: '是' }
],
showBtn: true,
selectedList: []
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115)
})
},
methods: {
spanMethod({ row, column, rowIndex, columnIndex }) {
const fields = ['defectLevel']
const cellValue = row[column.property]
if (cellValue && fields.includes(column.property)) {
const prevRow = this.tableData[rowIndex - 1]
let nextRow = this.tableData[rowIndex + 1]
if (prevRow && prevRow[column.property] === cellValue) {
return { rowspan: 0, colspan: 0 }
} else {
let countRowspan = 1
while (nextRow && nextRow[column.property] === cellValue) {
nextRow = this.tableData[++countRowspan + rowIndex]
}
if (countRowspan > 1) {
return { rowspan: countRowspan, colspan: 1 }
}
}
}
},
init(data) {
this.visible = true;
this.factoryName = data.factoryName || '未知工厂';
this.lineName = data.lineName || '未知产线';
if (data.startTime && data.endTime) {
const start = moment(data.startTime).format('yyyy-MM-DD HH:mm:ss');
const end = moment(data.endTime).format('yyyy-MM-DD HH:mm:ss');
this.timeRange = `${start} - ${end}`;
} else {
this.timeRange = '';
}
this.queryParams.factoryId = data.factoryId;
this.queryParams.lineId = data.lineId;
this.queryParams.startTime = data.startTime;
this.queryParams.endTime = data.endTime;
this.getList();
},
getList() {
getDefectSummaryDet({ ...this.queryParams }).then((res) => {
this.tableData = res.data || [];
})
},
closeD() {
this.$emit('closeDrawer');
},
closeDet() {
this.getList();
},
// --- 重写的导出方法 ---
// --- 修改后的导出方法 ---
handleExport() {
console.log("开始执行导出...");
this.$modal.confirm('确定要导出表格数据吗?').then(() => {
console.log("用户确认导出");
// 1. 准备数据
console.log("tableProps:", this.tableProps);
console.log("tableData:", this.tableData);
// 1.1 准备表头 (新增了 '工厂', '产线', '时间范围')
const headers = ['工厂', '产线', '时间范围', ...this.tableProps.map(prop => prop.label)];
console.log("生成的表头:", headers);
// 1.2 准备表格数据
const exportData = [];
this.tableData.forEach((row) => {
const newRow = [];
// 先添加顶部信息列
newRow.push(this.factoryName);
newRow.push(this.lineName);
newRow.push(this.timeRange);
// 再添加表格数据列
this.tableProps.forEach((prop) => {
// 直接填入所有数据,不再对 defectLevel 进行合并判断
newRow.push(row[prop.prop] !== undefined ? row[prop.prop] : '');
});
exportData.push(newRow);
});
console.log("处理后的数据:", exportData);
// 2. 创建工作簿和工作表
try {
const worksheet = XLSX.utils.aoa_to_sheet([headers, ...exportData]);
console.log("工作表创建成功");
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, '缺陷详情数据');
console.log("工作簿创建成功");
// 3. 触发下载
const fileName = `${this.factoryName}-${this.lineName}-缺陷汇总详情-${moment().format('YYYYMMDDHHmmss')}.xlsx`;
console.log("准备下载文件:", fileName);
XLSX.writeFile(workbook, fileName);
console.log("下载触发成功");
} catch (error) {
console.error("生成Excel文件时出错:", error);
this.$modal.msgError('导出失败,生成文件时出错!');
}
}).catch((error) => {
console.log("用户取消导出或发生错误:", error);
});
},
}
}
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
}
.info-header {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
padding: 16px 0;
border-bottom: 1px solid #ebeef5;
margin-bottom: 16px;
.info-item {
display: flex;
align-items: center;
margin-right: 32px;
font-size: 16px;
margin-bottom: 8px;
.label {
color: #606266;
margin-right: 8px;
font-weight: 500;
}
.value {
color: #303133;
}
}
}
</style>

View File

@@ -0,0 +1,416 @@
<template>
<div style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row class="" style="
margin-bottom: 12px;
background: #fff;
padding: 16px 16px 0;
border-radius: 8px;
">
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<base-table :max-height="tableH" :table-props="tableProps" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :table-data="list" @emitFun="handleEmitFun" />
</el-row>
<!-- 搜索工作栏 -->
<!-- 用一个 div 包裹表格和图表并使用 flex 布局 -->
<el-row class="" style="
height: 1px;
flex: 1;
margin-bottom: 12px;
background: #fff;
padding: 16px 16px 32px;
border-radius: 8px;
display: flex;
flex-direction: column;
">
<el-row :gutter="20">
<el-col :span="24">
<div id="chart" style="width: 100%; height: 300px;"></div>
</el-col>
</el-row>
</el-row>
</div>
</template>
<script>
import {
getPdList,
} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { getSectionDefect } from '@/api/monitoring/defectSummary';
import * as echarts from 'echarts';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
name: 'QualityInspectionType',
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
tableBtn: [
this.$auth.hasPermi('base:quality-inspection-type:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('base:quality-inspection-type:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '添加时间',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'checkCount', label: '检测片数' },
{
prop: 'ngCount',
label: '不良合计',
},
{
prop: 'ngRate',
label: '不良率',
},
{ prop: 'originalNgCount', label: '原片不良' },
{ prop: 'edgeNgCount', label: '磨边不良' },
{ prop: 'silkNgCount', label: '丝印不良' },
{ prop: 'drillNgCount', label: '打孔不良' },
{ prop: 'coatingNgCount', label: '镀膜不良' },
{ prop: 'packNgCount', label: '钢包不良' },
// {
// label: '操作',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// ]);
// },
// },
// },
],
//
searchBarFormConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
},
{
type: 'select',
label: '产线',
selectOptions: [],
multiple: true,
param: 'lineId',
},
// {
// type: 'input',
// label: '缺陷数>',
// // selectOptions: [],
// param: 'number',
// },
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
{
type: 'separate',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:create')
// ? 'button'
// : '',
// btnName: '新增',
// name: 'add',
// plain: true,
// color: 'success',
// },
{
type: this.$auth.hasPermi('base:quality-inspection-type:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
// 表单配置
// formRows: [
// [
// {
// input: true,
// label: '检测类型名称',
// prop: 'name',
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// // bind: {
// // disabled: true, // some condition, like detail mode...
// // }
// },
// ],
// [{ input: true, label: '检测类型编码', prop: 'code' }],
// [{ input: true, label: '备注', prop: 'remark' }],
// ],
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: undefined,
factoryId: undefined,
startTime: undefined,
endTime: undefined,
},
// 表单参数
form: {},
};
},
// watch: {
// form: {
// handler: (val) => {
// console.log('form changed', val);
// },
// deep: true
// },
// },
created() {
this.getList();
this.getDict()
},
methods: {
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];
});
getFactoryPage({ pageSize: 100, pageNo: 1 }).then(res => {
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
});
},
/** base table related */
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
}
},
/** search bar related */
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineId ? btn.lineId : undefined
this.queryParams.factoryId = btn.factoryId ? btn.factoryId : undefined
this.queryParams.startTime = btn.timeVal ? btn.timeVal[0] : undefined
this.queryParams.endTime = btn.timeVal ? btn.timeVal[1] : undefined
this.getList();
break;
case 'add':
this.handleAdd();
break;
case 'export':
this.handleExport();
break;
case 'reset':
this.$refs['search-bar'].resetForm();
this.resetQuery();
break;
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
getSectionDefect(this.queryParams).then((response) => {
this.list = response.data;
// 定义颜色数组,与你提供的顺序一致
const colors = [
'rgba(99, 189, 255, 1)',
'rgba(113, 100, 255, 1)',
'rgba(255, 104, 96, 1)',
'rgba(255, 151, 71, 1)',
'rgba(176, 235, 66, 1)',
'rgba(214, 128, 255, 1)',
'rgba(0, 67, 210, 1)'
];
const series = response.data.map((item, index) => {
// 为每个系列分配颜色index 从 0 开始,依次对应 colors 数组
const color = colors[index % colors.length]; // 使用取模确保不越界
return {
name: item.lineName,
type: 'bar',
stack: 'Ad',
barWidth: '20',
emphasis: {
focus: 'series'
},
itemStyle: {
color: color // 指定当前系列的颜色
},
data: [
item.originalNgCount,
item.edgeNgCount,
item.silkNgCount,
item.drillNgCount,
item.coatingNgCount,
item.packNgCount
]
};
});
this.loading = false;
this.getChart(series);
});
},
getChart(series) {
var chartDom = document.getElementById('chart');
var myChart = echarts.init(chartDom);
var option;
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: 30,
top: 20,
right: 30,
bottom:20
},
legend: {},
xAxis: [
{
type: 'category',
data: ['原片不良', '磨边不良', '丝印不良', '打孔不良', '镀膜不良', ' 钢包不良']
}
],
yAxis: [
{
type: 'value'
}
],
series: series
};
option && myChart.setOption(option);
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let tables = document.querySelector('.el-table').cloneNode(true)
const fix = tables.querySelector('.el-table__fixed')
const fixRight = tables.querySelector('.el-table__fixed-right')
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'))
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'))
}
let exportTable = XLSX.utils.table_to_book(tables)
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookSST: true, type: 'array'
})
// sheetjs.xlsx为导出表格的标题名称
try {
FileSaver.saveAs(new Blob([exportTableOut], {
type: 'application/octet-stream'
}), '工段不良.xlsx')
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut)
}
return exportTableOut
},
},
};
</script>
<style scoped>
/* 添加 scoped 以避免样式污染 */
.app-container {
padding: 20px;
}
.content-wrapper {
display: flex;
flex-direction: column;
/* 垂直排列 */
gap: 20px;
}
.table-container,
.chart-container {
flex: 1;
/* 让两个容器平分父容器的空间 */
min-height: 300px;
/* 设置最小高度,防止内容过少时变形 */
border: 1px solid #ebeef5;
/* 添加一个边框,方便看清分隔 */
border-radius: 4px;
padding: 10px;
background-color: #fff;
}
/* 确保图表容器的父元素也有高度ECharts 才能正确渲染 */
.chart-container {
display: flex;
flex-direction: column;
}
</style>

View File

@@ -0,0 +1,674 @@
<template>
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row class="" style="
height: 1px;
flex: 1;
margin-bottom: 12px;
background: #fff;
padding: 16px 16px 32px;
border-radius: 8px;
display: flex;
flex-direction: column;
">
<el-row :gutter="20">
<el-col :span="24">
<div class="blue-title">
图表时间维度
<div style="position: relative; display: flex; align-items: center; gap: 10px; margin-top: 10px;">
<el-button type="primary" @click="handleExport"
style="position: absolute;top: 0px;right: 10px;z-index: 9999;">
导出
</el-button>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="flex: 1;">
<!-- 班组标签页 -->
<el-tab-pane label="班组" name="group">
<!-- 修改使用四宫格布局容器 -->
<div class="chart-grid">
<div id="mapGroupMain" class="chart-container" style="height: 400px;"></div>
<div id="mapGroupMainScrap" class="chart-container" style="height: 400px;"></div>
<div id="listGroupMain" class="chart-container" style="height: 400px;"></div>
<div id="listGroupMainScrap" class="chart-container" style="height: 400px;"></div>
</div>
</el-tab-pane>
<!-- 日标签页 -->
<el-tab-pane label="日" name="day">
<!-- 修改使用四宫格布局容器 -->
<div class="chart-grid">
<div id="mapDayMain" class="chart-container" style="height: 400px;"></div>
<div id="mapDayMainScrap" class="chart-container" style="height: 400px;"></div>
<div id="listDayMain" class="chart-container" style="height: 400px;"></div>
<div id="listDayMainScrap" class="chart-container" style="height: 400px;"></div>
</div>
</el-tab-pane>
<!-- 周标签页 -->
<el-tab-pane label="周" name="week">
<!-- 修改使用四宫格布局容器 -->
<div class="chart-grid">
<div id="mapWeekMain" class="chart-container" style="height: 400px;"></div>
<div id="mapWeekMainScrap" class="chart-container" style="height: 400px;"></div>
<div id="listWeekMain" class="chart-container" style="height: 400px;"></div>
<div id="listWeekMainScrap" class="chart-container" style="height: 400px;"></div>
</div>
</el-tab-pane>
<!-- 月标签页 -->
<el-tab-pane label="月" name="month">
<!-- 修改使用四宫格布局容器 -->
<div class="chart-grid">
<div id="mapMonthMain" class="chart-container" style="height: 400px;"></div>
<div id="mapMonthMainScrap" class="chart-container" style="height: 400px;"></div>
<div id="listMonthMain" class="chart-container" style="height: 400px;"></div>
<div id="listMonthMainScrap" class="chart-container" style="height: 400px;"></div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</el-col>
</el-row>
</el-row>
</div>
</template>
<script>
import {
getQualityIsraPage,
} from '@/api/monitoring/qualityIsra';
import moment from 'moment';
import * as echarts from 'echarts';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { parseTime } from '@/utils/ruoyi';
import { getPdList } from '@/api/core/monitoring/auto';
import html2canvas from 'html2canvas';
export default {
name: 'QualityIsra',
mixins: [tableHeightMixin],
data() {
return {
isFold: false,
list: [],
dynamicProps: [],
activeName: 'group', // 默认激活“日”标签页
// 新增班组图表接口URL与后端确认一致
groupMapUrl: '/extend/check-isra-statistics/groupMap',
groupListUrl: '/extend/check-isra-statistics/groupList',
// 原有接口URL保持不变
dayMapUrl: '/extend/check-isra-statistics/dayMap',
weekMapUrl: '/extend/check-isra-statistics/weekMap',
monthMapUrl: '/extend/check-isra-statistics/monthMap',
dayListUrl: '/extend/check-isra-statistics/dayList',
weekListUrl: '/extend/check-isra-statistics/weekList',
monthListUrl: '/extend/check-isra-statistics/monthList',
searchBarFormConfig: [
{
type: 'select',
label: '是否报废',
placeholder: '请选择是否报废',
param: 'checkDiscard',
selectOptions: [
{ name: '否', id: 0 },
{ name: '是', id: 1 }
],
},
{
type: 'select',
label: '缺陷类型',
placeholder: '请选择缺陷类型',
param: 'checkType',
selectOptions: [],
labelField: 'name',
valueField: 'name',
defaultSelect: [],
filterable: true
},
{
type: 'select',
label: '产线',
selectOptions: [],
labelField: 'name',
valueField: 'name',
param: 'lineName',
filterable: true,
defaultSelect: []
},
{
type: 'datePicker',
label: '时间段',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'checkTime',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
// 查询参数
queryParams: {
checkDiscard: undefined,
// checkType: undefined,
// lineName: undefined,
startTime: undefined,
endTime: undefined,
},
};
},
created() {
// 初始化折叠状态(如需使用可取消注释)
// this.isFold = this.searchBarWidth('QualityIsraBox', 1198);
},
computed: {
tableProps() {
return [
{
prop: 'checkType',
label: '缺陷类型',
},
{
prop: 'sumNum',
label: '缺陷总数',
},
...this.dynamicProps,
];
},
},
mounted() {
// 从路由参数获取产线信息并回显
if (this.$route.query.lineName) {
this.queryParams.lineName = this.$route.query.lineName;
this.searchBarFormConfig[2].defaultSelect = this.$route.query.lineName;
}
// 从路由参数获取时间信息并回显
if (this.$route.query.originalGlassOutputTime) {
const time = new Date(Number(this.$route.query.originalGlassOutputTime));
this.queryParams.startTime = parseTime(time);
this.queryParams.endTime = parseTime(time);
this.searchBarFormConfig[3].defaultSelect = [
this.queryParams.startTime,
this.queryParams.endTime,
];
}
// 初始化数据
this.getData();
this.getDict();
},
methods: {
/** 标签页切换事件 */
handleClick() {
this.getData();
},
/** 核心:获取并渲染图表数据(支持班组/日/周/月) */
getData() {
// 1. 根据当前激活的标签页选择对应的接口URL和图表容器ID
let mapUrl, listUrl, mapDomId, listDomId, mapDomIdScrap, listDomIdScrap;
switch (this.activeName) {
case 'group':
mapUrl = this.groupMapUrl;
listUrl = this.groupListUrl;
mapDomId = 'mapGroupMain';
listDomId = 'listGroupMain';
mapDomIdScrap = 'mapGroupMainScrap';
listDomIdScrap = 'listGroupMainScrap';
break;
case 'day':
mapUrl = this.dayMapUrl;
listUrl = this.dayListUrl;
mapDomId = 'mapDayMain';
listDomId = 'listDayMain';
mapDomIdScrap = 'mapGroupDayScrap';
listDomIdScrap = 'listGroupDayScrap';
break;
case 'week':
mapUrl = this.weekMapUrl;
listUrl = this.weekListUrl;
mapDomId = 'mapWeekMain';
listDomId = 'listWeekMain';
mapDomIdScrap = 'mapGroupWeekScrap';
listDomIdScrap = 'listGroupWeekScrap';
break;
case 'month':
mapUrl = this.monthMapUrl;
listUrl = this.monthListUrl;
mapDomId = 'mapMonthMain';
listDomId = 'listMonthMain';
mapDomIdScrap = 'mapGroupMonthScrap';
listDomIdScrap = 'listGroupMonthScrap';
break;
}
// 2. 请求“各类型缺陷对比图”数据
this.$axios({
url: mapUrl,
method: 'get',
params: this.queryParams
}).then((res) => {
const mapArr = [];
const mapLegendData = [];
// 处理接口返回数据(确保与后端数据格式匹配)
for (const type in res.data) {
const dataArr = [];
const xAxisData = [];
res.data[type].forEach(ele => {
dataArr.push(ele.num); // 缺陷数量
// 班组标签页使用“班组名称”作为X轴其他标签页使用“时间”
xAxisData.push(ele.checkTime);
});
mapArr.push({
name: type, // 缺陷类型名称
type: 'line', // 折线图
data: dataArr,
xAxisData: xAxisData // 存储当前系列的X轴数据
});
mapLegendData.push(type);
}
// 渲染“各类型缺陷对比图”
const mapChartDom = document.getElementById(mapDomId);
if (mapChartDom) {
const myChart = echarts.init(mapChartDom);
myChart.clear(); // 清除原有图表
myChart.setOption({
title: { text: '所有缺陷对比图' },
tooltip: { trigger: 'axis' },
legend: { data: mapLegendData, top: '10%', y: 'top', x: 'left' },
grid: { left: '3%', right: '4%', bottom: '3%', top: '20%', containLabel: true },
xAxis: {
type: 'category',
data: mapArr.length > 0 ? mapArr[0].xAxisData : [] // 使用第一个系列的X轴数据
},
yAxis: { type: 'value', name: '缺陷数量' },
series: mapArr
});
// 监听窗口 resize自动调整图表大小
window.addEventListener('resize', () => myChart.resize());
}
});
this.$axios({
url: mapUrl,
method: 'get',
params: {
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
checkDiscard:true
}
}).then((res) => {
const mapArr = [];
const mapLegendData = [];
// 处理接口返回数据(确保与后端数据格式匹配)
for (const type in res.data) {
const dataArr = [];
const xAxisData = [];
res.data[type].forEach(ele => {
dataArr.push(ele.num); // 缺陷数量
// 班组标签页使用“班组名称”作为X轴其他标签页使用“时间”
xAxisData.push(ele.checkTime);
});
mapArr.push({
name: type, // 缺陷类型名称
type: 'line', // 折线图
data: dataArr,
xAxisData: xAxisData // 存储当前系列的X轴数据
});
mapLegendData.push(type);
}
// 渲染“各类型缺陷对比图”
const mapChartDom = document.getElementById(mapDomIdScrap);
if (mapChartDom) {
const myChart = echarts.init(mapChartDom);
myChart.clear(); // 清除原有图表
myChart.setOption({
title: { text: '所有缺陷对比图' },
tooltip: { trigger: 'axis' },
legend: { data: mapLegendData, top: '10%', y: 'top', x: 'left' },
grid: { left: '3%', right: '4%', bottom: '3%', top: '20%', containLabel: true },
xAxis: {
type: 'category',
data: mapArr.length > 0 ? mapArr[0].xAxisData : [] // 使用第一个系列的X轴数据
},
yAxis: { type: 'value', name: '缺陷数量' },
series: mapArr
});
// 监听窗口 resize自动调整图表大小
window.addEventListener('resize', () => myChart.resize());
}
});
// 3. 请求“缺陷率趋势图”数据
this.$axios({
url: listUrl,
method: 'get',
params: this.queryParams
}).then((res) => {
const listNumArr = []; // 缺陷数量
const listRatioArr = []; // 缺陷率
const listXAxisData = []; // X轴数据
// 处理接口返回数据(确保与后端数据格式匹配)
res.data.forEach(ele => {
listNumArr.push(ele.num);
listRatioArr.push(ele.ratio); // 缺陷率(百分比)
// 班组标签页使用“班组名称”作为X轴其他标签页使用“时间”
listXAxisData.push(this.activeName === 'group' ? ele.groupName : ele.checkTime);
});
// 渲染“缺陷率趋势图”
const listChartDom = document.getElementById(listDomId);
if (listChartDom) {
const myChart = echarts.init(listChartDom);
myChart.clear(); // 清除原有图表
myChart.setOption({
title: { text: '所有缺陷率趋势图' },
tooltip: { trigger: 'axis' },
legend: { data: ['缺陷数量', '缺陷率'], top: '10%' },
grid: { left: '3%', right: '4%', bottom: '3%', top: '20%', containLabel: true },
xAxis: {
type: 'category',
data: listXAxisData
},
yAxis: [
{
type: 'value',
name: '缺陷数量',
axisLabel: { formatter: '{value}' }
},
{
type: 'value',
name: '缺陷率',
axisLabel: { formatter: '{value} %' },
position: 'right' // 缺陷率Y轴放在右侧
}
],
series: [
{
name: '缺陷数量',
type: 'bar',
barWidth: '3%',
data: listNumArr,
itemStyle: { color: 'rgba(40, 138, 255, 1)' } // 柱状图颜色
},
{
name: '缺陷率',
type: 'line',
yAxisIndex: 1, // 关联右侧Y轴
data: listRatioArr,
itemStyle: { color: 'rgba(115, 222, 147, 1)' }, // 折线图颜色
symbol: 'circle', // 标记点样式
symbolSize: 6
}
]
});
// 监听窗口 resize自动调整图表大小
window.addEventListener('resize', () => myChart.resize());
}
});
this.$axios({
url: listUrl,
method: 'get',
params: {
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
checkDiscard: true
}
}).then((res) => {
const listNumArr = []; // 缺陷数量
const listRatioArr = []; // 缺陷率
const listXAxisData = []; // X轴数据
// 处理接口返回数据(确保与后端数据格式匹配)
res.data.forEach(ele => {
listNumArr.push(ele.num);
listRatioArr.push(ele.ratio); // 缺陷率(百分比)
// 班组标签页使用“班组名称”作为X轴其他标签页使用“时间”
listXAxisData.push(this.activeName === 'group' ? ele.groupName : ele.checkTime);
});
// 渲染“缺陷率趋势图”
const listChartDom = document.getElementById(listDomIdScrap);
if (listChartDom) {
const myChart = echarts.init(listChartDom);
myChart.clear(); // 清除原有图表
myChart.setOption({
title: { text: '所有缺陷率趋势图' },
tooltip: { trigger: 'axis' },
legend: { data: ['缺陷数量', '缺陷率'], top: '10%' },
grid: { left: '3%', right: '4%', bottom: '3%', top: '20%', containLabel: true },
xAxis: {
type: 'category',
data: listXAxisData
},
yAxis: [
{
type: 'value',
name: '缺陷数量',
axisLabel: { formatter: '{value}' }
},
{
type: 'value',
name: '缺陷率',
axisLabel: { formatter: '{value} %' },
position: 'right' // 缺陷率Y轴放在右侧
}
],
series: [
{
name: '缺陷数量',
type: 'bar',
barWidth: '3%',
data: listNumArr,
itemStyle: { color: 'rgba(40, 138, 255, 1)' } // 柱状图颜色
},
{
name: '缺陷率',
type: 'line',
yAxisIndex: 1, // 关联右侧Y轴
data: listRatioArr,
itemStyle: { color: 'rgba(115, 222, 147, 1)' }, // 折线图颜色
symbol: 'circle', // 标记点样式
symbolSize: 6
}
]
});
// 监听窗口 resize自动调整图表大小
window.addEventListener('resize', () => myChart.resize());
}
});
},
/** 新增:导出数据功能 */
handleExport() {
// 1. 找到当前激活标签页内的 .chart-wrapper 容器
const container = document.querySelector(`.el-tab-pane[aria-selected="true"] .chart-wrapper`);
if (!container) {
this.$message.warning('未找到图表容器');
console.error('导出失败:未找到 .chart-wrapper 容器');
return;
}
this.$message.info('正在生成图片,请稍候...');
// 2. 获取当前标签页的两个图表实例,并强制刷新它们
// 这是解决问题的关键步骤
const chartIds = this.getChartIdsByActiveName();
chartIds.forEach(id => {
const chartDom = document.getElementById(id);
if (chartDom) {
const chartInstance = echarts.getInstanceByDom(chartDom);
if (chartInstance) {
chartInstance.resize(); // 强制图表重新渲染
}
}
});
// 3. 使用 setTimeout 等待图表渲染完成后再进行截图
// 延迟时间可以根据你的图表复杂度调整,一般 100-300ms 足够
setTimeout(() => {
html2canvas(container, {
scale: 2,
useCORS: true,
logging: false,
backgroundColor: null,
// 增加一个配置,确保能捕获到所有元素
windowWidth: container.scrollWidth,
windowHeight: container.scrollHeight
}).then(canvas => {
const imgBase64 = canvas.toDataURL('image/png');
const link = document.createElement('a');
link.href = imgBase64;
const titleMap = { group: '班组', day: '日', week: '周', month: '月' };
const title = titleMap[this.activeName] || '数据';
link.download = `${title}度缺陷分析报告.png`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.$message.success('图表导出成功!');
}).catch(error => {
this.$message.error('图表导出失败!');
console.error('html2canvas 截图失败:', error);
});
}, 200); // 等待 200 毫秒
},
// 新增一个辅助方法,根据当前激活的标签页获取对应的图表 ID
getChartIdsByActiveName() {
switch (this.activeName) {
case 'group':
return ['mapGroupMain', 'listGroupMain'];
case 'day':
return ['mapDayMain', 'listDayMain'];
case 'week':
return ['mapWeekMain', 'listWeekMain'];
case 'month':
return ['mapMonthMain', 'listMonthMain'];
default:
return [];
}
},
/** 获取搜索栏的字典数据(缺陷类型、产线列表) */
async getDict() {
// 获取缺陷类型列表
const defectRes = await this.$axios({
url: '/extend/check-isra-standards/page',
method: 'get',
params: { pageSize: 100, pageNo: 1 }
});
this.searchBarFormConfig[1].selectOptions = defectRes.data.list || [];
// 获取产线列表
const lineRes = await getPdList();
this.searchBarFormConfig[2].selectOptions = lineRes.data || [];
},
/** 查询列表数据(如需使用表格可取消注释) */
// getList() {
// this.getDataList();
// },
/** 表格数据查询(如需使用表格可取消注释) */
// async getDataList() {
// this.loading = true;
// try {
// const { data } = await getQualityIsraPage(this.queryParams);
// this.dynamicProps = this.filterNameData(data.nameData);
// this.list = this.filterData(data.data);
// } catch (error) {
// console.error('获取表格数据失败:', error);
// } finally {
// this.loading = false;
// }
// },
/** 过滤动态表格列名(如需使用表格可取消注释) */
// filterNameData(nameData) {
// const nameSet = new Set(nameData.map(nd => nd.name));
// return Array.from(nameSet).sort().map(name => ({ prop: name, label: name }));
// },
/** 过滤表格数据(如需使用表格可取消注释) */
// filterData(data) {
// return data.map(item => {
// const keyValuePairs = {};
// item.data.forEach(d => {
// keyValuePairs[d.dynamicName] = d.dynamicValue;
// });
// return { ...keyValuePairs, sumNum: item.sumNum, checkType: item.checkType };
// });
// },
/** 搜索按钮点击事件(如需使用搜索栏可取消注释) */
// handleSearchBarBtnClick(val) {
// if (val.btnName === 'search') {
// this.queryParams.checkDiscard = (val?.checkDiscard === 0 || val?.checkDiscard === 1) ? val?.checkDiscard : undefined;
// this.queryParams.lineName = val.lineName ? val.lineName : undefined;
// this.queryParams.checkType = val.checkType ? val.checkType : undefined;
// this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined;
// this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined;
// this.getList();
// this.getData();
// }
// }
},
};
</script>
<style lang="scss">
.blue-title {
position: relative;
padding: 4px 0;
padding-left: 12px;
font-size: 14px;
color: #606266;
font-weight: 700;
margin-bottom: 12px;
&::before {
content: '';
position: absolute;
left: 0;
top: 6px;
height: 16px;
width: 4px;
border-radius: 1px;
background: #0b58ff;
}
}
/* 新增:四宫格布局样式 */
.chart-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
/* 创建两列,宽度相等 */
grid-template-rows: repeat(2, auto);
/* 创建两行,高度自适应内容 */
gap: 20px;
/* 图表之间的间距 */
width: 100%;
}
.chart-container {
width: 100%;
border: 1px solid #f0f0f0;
border-radius: 4px;
box-sizing: border-box;
}
</style>

View File

@@ -0,0 +1,270 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-09-11 15:55:13
description: DialogForm for qualityInspectionRecord only
-->
<template>
<el-form
ref="form"
:model="innerDataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="检测内容"
prop="inspectionDetId"
:rules="[{ required: true, message: '检测内容不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.inspectionDetId"
placeholder="请选择检测内容"
filterable
clearable
@change="handleInspectionDetChange">
<el-option
v-for="opt in inspectionDetList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="来源"
prop="source"
:rules="[{ required: true, message: '来源不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.source"
placeholder="请选择来源"
filterable
clearable
@change="$emit('update', innerDataForm)">
<el-option
v-for="opt in [
{ label: '手动', value: 1 },
{ label: '自动', value: 2 },
]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.productionLineId"
placeholder="请选择产线"
filterable
clearable
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="工段"
prop="sectionId"
:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.sectionId"
placeholder="请选择工段"
clearable
filterable
@change="$emit('update', innerDataForm)">
<el-option
v-for="opt in sectionList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="检测人员" prop="checkPerson">
<el-input
v-model="innerDataForm.checkPerson"
clearable
@change="$emit('update', innerDataForm)"
placeholder="请输入检测人员" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检测时间"
prop="checkTime"
:rules="[{ required: true, message: '检测时间不能为空', trigger: 'blur' }]">
<el-date-picker
v-model="innerDataForm.checkTime"
type="datetime"
placeholder="请选择检测时间"
value-format="timestamp"
@change="$emit('update', innerDataForm)"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="描述" prop="explainText">
<el-input
v-model="innerDataForm.explainText"
placeholder="请输入描述信息"
@change="$emit('update', innerDataForm)"
type="textarea"></el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
v-model="innerDataForm.remark"
@change="$emit('update', innerDataForm)"
placeholder="请输入备注"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: {},
props: {
dataForm: {
type: Object,
default: () => ({}),
},
},
data() {
return {
formLoading: true,
inspectionDetList: [],
productionLineList: [],
sectionList: [],
innerDataForm: {},
cacheInspectionDetList: null,
};
},
mounted() {
Promise.all([this.getProductLineList(), this.getInspectionDetList()]).then(
() => {
this.formLoading = false;
}
);
},
watch: {
// 'innerDataForm.productionLineId': {
// handler: async function (plId) {
// if (plId) await this.getWorksectionList(plId);
// },
// immediate: true,
// },
dataForm: {
handler: function (dataForm) {
this.innerDataForm = Object.assign({}, dataForm);
if (dataForm.productionLineId)
this.getWorksectionList(dataForm.productionLineId);
},
immediate: true,
},
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
handleInspectionDetChange(value) {
const { id, content } = this.cacheInspectionDetList.find(
(item) => item.id == value
);
this.innerDataForm.inspectionDetId = id;
this.innerDataForm.inspectionDetContent = content;
this.$emit('update', this.innerDataForm);
},
async handleProductlineChange(id) {
// await this.getWorksectionList(id);
this.innerDataForm.sectionId = null;
this.$emit('update', this.innerDataForm);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
// 获取产线列表
async getProductLineList() {
const response = await this.$axios('/base/core-production-line/listAll');
this.productionLineList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
// 获取检测内容列表
async getInspectionDetList() {
const response = await this.$axios(
'/base/quality-inspection-det/listAll'
);
this.cacheInspectionDetList = response.data;
this.inspectionDetList = response.data.map((item) => ({
label: item.content,
value: item.id,
}));
},
// 获取工段列表
async getWorksectionList(plId) {
const response = await this.$axios(
'/base/workshop-section/listByParentId',
{
params: {
id: plId,
},
}
);
this.sectionList = response.data.map((item) => ({
label: item.name,
value: item.id,
}));
},
},
};
</script>
<style scoped lang="scss">
.el-date-editor,
.el-select {
width: 100%;
}
</style>

View File

@@ -0,0 +1,468 @@
<template>
<div class="app-container">
<!-- <div class="blue-title">生产节拍时序图</div> -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table :max-height="tableH" :table-props="tableProps" :page="1" :limit="20" :table-data="list">
</base-table>
<!-- </el-row> -->
</div>
</template>
<script>
import {
getQualityIsraPage,
// getQualityIsraDayMap,
// getQualityIsraWeekMap,
// getQualityIsraMonthMap,
// getQualityIsraDayList,
// getQualityIsraWeekList,
// getQualityIsraMonthList,
} from '@/api/monitoring/qualityIsra';
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import * as echarts from 'echarts';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import { getPdList } from '@/api/base/coreProductionLine';
import { parseTime } from '@/utils/ruoyi';
import { getPdList, } from '@/api/core/monitoring/auto';
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
export default {
name: 'QualityIsra',
// components: {
// DialogForm,
// },
mixins: [tableHeightMixin],
data() {
return {
isFold: false,
list: [],
dynamicProps: [],
activeName: 'day',
dayMapUrl: '/extend/check-isra-statistics/dayMap',
weekMapUrl: '/extend/check-isra-statistics/weekMap',
monthMapUrl: '/extend/check-isra-statistics/monthMap',
dayListUrl: '/extend/check-isra-statistics/dayList',
weekListUrl: '/extend/check-isra-statistics/weekList',
monthListUrl: '/extend/check-isra-statistics/monthList',
searchBarFormConfig: [
{
type: 'select',
label: '是否报废',
placeholder: '请选择是否报废',
param: 'checkDiscard',
selectOptions: [
{ name: '否', id: 0 },
{ name: '是', id: 1 }
],
},
{
type: 'select',
label: '缺陷类型',
placeholder: '请选择缺陷类型',
param: 'checkType',
selectOptions: [],
labelField: 'name',
valueField: 'name',
defaultSelect: [],
filterable: true
},
{
type: 'select',
label: '产线',
selectOptions: [],
labelField: 'name',
valueField: 'name',
param: 'lineName',
filterable: true,
defaultSelect: []
},
{
type: 'datePicker',
label: '时间段',
dateType: 'datetimerange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'checkTime',
// width: 350,
},
{
type:'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
// 查询参数
queryParams: {
checkDiscard: undefined,
checkType:undefined,
lineName: undefined,
startTime: undefined,
endTime: undefined,
// productionLineId: null,
},
};
},
created() {
// this.getProductLineList();
// this.isFold = this.searchBarWidth('QualityIsraBox', 1198);
},
computed: {
tableProps() {
return [
{
// width: 128,
prop: 'checkType',
label: '缺陷类型',
},
{
// width: 128,
prop: 'sumNum',
label: '缺陷总数',
},
...this.dynamicProps,
];
},
},
mounted() {
if (this.$route.query.lineName) {
// console.log('打印看看产线', this.$route.query.lineName)
this.queryParams.lineName = this.$route.query.lineName
this.searchBarFormConfig[2].defaultSelect = this.$route.query.lineName
}
if (this.$route.query.originalGlassOutputTime) {
console.log('你好', this.$route.query.originalGlassOutputTime)
this.queryParams.startTime = parseTime(new Date(Number(this.$route.query.originalGlassOutputTime)))
this.queryParams.endTime = parseTime(new Date(Number(this.$route.query.originalGlassOutputTime)))
this.searchBarFormConfig[3].defaultSelect = [
this.queryParams.startTime,
this.queryParams.endTime,
];
}
this.getList()
this.getData()
this.getDict()
},
methods: {
handleClick() {
this.getData()
},
getData() {
this.$axios({
url: this.activeName === 'day' ? this.dayMapUrl : this.activeName === 'week' ? this.weekMapUrl : this.monthMapUrl,
method: 'get',
params: this.queryParams
}).then((res) => {
let mapArr= []
let mapLegendData = []
let obj = {
name: '',
type: 'line',
// stack: 'Total',
data: [],
mapXAxisData: [],
}
// let mapXAxisData = []
for (let i in res.data) {
// console.log(i)
let dataArr = []
res.data[i].forEach(ele => {
dataArr.push(ele.num)
obj.mapXAxisData.push(ele.checkTime)
})
obj.name = i
obj.data = dataArr
mapLegendData.push(i)
mapArr.push(obj)
}
console.log(mapArr);
// console.log(res.data[res]);
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
var myChart = echarts.init(chartDom);
var option;
option = {
title: {
text: '各类型缺陷对比图',
// top:'5px'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: mapLegendData,
top: "10%",
y: 'top',
x:'left'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top:'20%',
containLabel: true
},
// toolbox: {
// feature: {
// saveAsImage: {}
// }
// },
xAxis: {
type: 'category',
// boundaryGap: false,
data: mapArr[0].mapXAxisData
},
yAxis: {
type: 'value'
},
series: mapArr
}
myChart.clear()
option && myChart.setOption(option);
})
this.$axios({
url: this.activeName === 'day' ? this.dayListUrl : this.activeName === 'week' ? this.weekListUrl : this.monthListUrl,
method: 'get',
params: this.queryParams
}).then((res) => {
// console.log(res);
let listNumArr = []
let listRatioArr = []
// let listLegendData = []
let listXAxisData = []
// for (let i in res.data) {
// console.log(i)
// let dataArr = []
res.data.forEach(ele => {;
listNumArr.push(ele.num)
listRatioArr.push(ele.ratio)
listXAxisData.push(ele.checkTime)
})
console.log(listNumArr);
// obj.name = i
// obj.data = dataArr
// listLegendData.push(i)
// listArr.push(obj)
// }
// console.log(res.data[res]);
var chartDom = this.activeName === 'day' ? document.getElementById('listDayMain') : this.activeName === 'week' ? document.getElementById('listWeekMain') : document.getElementById('listMonthMain')
var myChart = echarts.init(chartDom);
var option;
option = {
title: {
text: '缺陷率趋势图'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['缺陷数量', '缺陷率'],
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
// toolbox: {
// feature: {
// saveAsImage: {}
// }
// },
xAxis: {
type: 'category',
// boundaryGap: false,
data: listXAxisData
},
yAxis: [
{
type: 'value',
name: '缺陷数量',
// min: 0,
// max: 250,
// interval: 50,
// axisLabel: {
// formatter: '{value} ml'
// }
},
{
type: 'value',
name: '缺陷率',
// min: 0,
// max: 25,
// interval: 5,
axisLabel: {
formatter: '{value} %'
}
}
],
series: [
{
name: '缺陷数量',
type: 'bar',
barWidth: '3%',
data: listNumArr,
// label: {
// show: true, //开启显示
// position: 'top', //在上方显示
// // formatter: '{c}%',//显示百分号
// textStyle: { //数值样式
// color: 'black',//字体颜色
// fontSize: 12//字体大小
// }
// }
},
{
name: '缺陷率',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + '%';
}
},
data: listRatioArr
}
]
}
myChart.clear()
option && myChart.setOption(option);
})
},
/** 获取搜索栏的产线列表 */
async getDict() {
// const res = await getProductList()
// const result = await getWorkOrderList()
const res = await this.$axios({
url: '/extend/check-isra-standards/page',
method: 'get',
params: {
pageSize: 100,
pageNo:1
}
});
// console.log(res)
this.searchBarFormConfig[1].selectOptions = res.data.list
await getPdList().then((res) => {
// console.log(res);
this.searchBarFormConfig[2].selectOptions = res.data;
})
// this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
// return {
// name: item.name,
// id:item.id
// }
// })
// this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
},
// getProductLineList() {
// this.$axios('/base/production-line/listAll').then((response) => {
// this.searchBarFormConfig[0].selectOptions = response.data.map(
// (item) => {
// return {
// name: item.name,
// id: item.id,
// };
// }
// );
// });
// },
getList() {
this.getDataList()
},
/** 查询列表 */
async getDataList() {
console.log('查询条件', this.queryParams);
this.loading = true;
// 执行查询
const {
data: { data, otherList, otherMap, nameData },
} = await getQualityIsraPage(this.queryParams)
console.log(this.queryParams);
this.dynamicProps = this.filterNameData(nameData)
this.list = this.filterData(data);
},
filterNameData(nameData) {
const ndSet = new Set();
nameData.forEach((nd) => {
ndSet.add(nd.name);
});
return Array.from(ndSet.values())
.sort()
.map((name) => ({
prop: name,
label: name,
}));
},
filterData(data) {
return data.map((item) => {
const { data: innerData } = item;
const keyValuePairs = {};
innerData.map((d) => {
keyValuePairs[d.dynamicName] = d.dynamicValue;
});
return {
// inspectionContent: item.inspectionContent,
...keyValuePairs,
sumNum: item.sumNum,
// sumInput: item.sumInput,
// productionName: item.productionName,
checkType: item.checkType,
// scrapRatio: item.scrapRatio,
};
});
},
/** 取消按钮 */
handleSearchBarBtnClick(val) {
console.log('11111', val)
if (val.btnName === 'search') {
this.queryParams.checkDiscard = (val?.checkDiscard === 0 || val?.checkDiscard === 1) ? val?.checkDiscard : undefined
this.queryParams.lineName = val.lineName ? val.lineName : undefined
this.queryParams.checkType = val.checkType ? val.checkType : undefined
// this.queryParams.productionId = val.productionId ? val.productionId : undefined
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
this.getList()
this.getData()
}
console.log(val);
}
},
};
</script>
<style lang="scss">
.blue-title {
position: relative;
padding: 4px 0;
padding-left: 12px;
font-size: 14px;
color: #606266;
font-weight: 700;
margin-bottom: 12px;
&::before {
content: '';
position: absolute;
left: 0;
top: 6px;
height: 16px;
width: 4px;
border-radius: 1px;
background: #0b58ff;
}
}
</style>

View File

@@ -0,0 +1,305 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table :max-height="tableH" :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize"
:table-data="list" @emitFun="handleEmitFun">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
</div>
</template>
<script>
import moment from 'moment';
import { getPdList,} from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { getTranslucentPage, exportTranslucent } from '@/api/monitoring/defectSummary';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
name: 'QualityInspectionType',
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
// tableBtn: [
// this.$auth.hasPermi('base:quality-inspection-type:update')
// ? {
// type: 'edit',
// btnName: '修改',
// }
// : undefined,
// this.$auth.hasPermi('base:quality-inspection-type:delete')
// ? {
// type: 'delete',
// btnName: '删除',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '添加时间',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'timeVal', label: '时间段' },
{ prop: 'totalNum', label: '玻璃总数' },
{ prop: 'goodNum', label: '一等品数量' },
{ prop: 'passNum', label: '二等品数量' },
{ prop: 'scrapNum', label: '废片数' },
{ prop: 'passRate', label: '合格率' },
],
//
searchBarFormConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
},
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
{
type: 'separate',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:create')
// ? 'button'
// : '',
// btnName: '新增',
// name: 'add',
// plain: true,
// color: 'success',
// },
{
type: this.$auth.hasPermi('monitoring:translucent:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
// 表单配置
// formRows: [
// [
// {
// input: true,
// label: '检测类型名称',
// prop: 'name',
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// // bind: {
// // disabled: true, // some condition, like detail mode...
// // }
// },
// ],
// [{ input: true, label: '检测类型编码', prop: 'code' }],
// [{ input: true, label: '备注', prop: 'remark' }],
// ],
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: undefined,
factoryId: undefined,
startTime: undefined,
endTime: undefined,
},
// 表单参数
form: {},
};
},
// watch: {
// form: {
// handler: (val) => {
// console.log('form changed', val);
// },
// deep: true
// },
// },
created() {
this.getList();
this.getDict()
},
methods: {
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];
});
getFactoryPage({ pageSize: 100, pageNo: 1 }).then(res => {
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
});
},
/** base table related */
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
}
},
/** search bar related */
handleSearchBarBtnClick(btn) {
console.log('btn',btn);
// const keys = ['name'];
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineId ? btn.lineId : undefined
this.queryParams.factoryId = btn.factoryId ? btn.factoryId : undefined
this.queryParams.startTime = btn.timeVal ? btn.timeVal[0] : undefined
this.queryParams.endTime = btn.timeVal ? btn.timeVal[1] : undefined
// keys.forEach((key) => {
// this.queryParams[key] = btn[key] || null;
// });
this.getList();
break;
case 'add':
this.handleAdd();
break;
case 'export':
this.handleExport();
break;
case 'reset':
this.$refs['search-bar'].resetForm();
this.resetQuery();
break;
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
getTranslucentPage(this.queryParams).then((res) => {
this.list = res.data.list ? res.data.list.map((item) => {
const startTime = item.startTime ? moment(item.startTime).format('YYYY-MM-DD HH:mm:ss') : '';
const endTime = item.endTime ? moment(item.endTime).format('YYYY-MM-DD HH:mm:ss') : '';
// 拼接开始时间和结束时间,中间用“至”连接
const timeVal = startTime && endTime ? `${startTime}${endTime}` : '';
return {
...item,
timeVal: timeVal
};
}) :[]
this.total = res.data.total;
this.loading = false;
});
},
/** 表单重置 */
// reset() {
// this.form = {
// id: undefined,
// name: undefined,
// code: undefined,
// remark: undefined,
// };
// this.resetForm('form');
// },
/** 新增按钮操作 */
// handleAdd() {
// this.reset();
// this.open = true;
// this.title = '添加质量检测类型基础';
// },
/** 修改按钮操作 */
// handleUpdate(row) {
// this.reset();
// const id = row.id;
// getQualityInspectionType(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '修改质量检测类型基础';
// });
// },
/** 提交按钮 */
// submitForm() {
// // console.log('this.$refs.form', this.$refs.form);
// // return;
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
// }
// console.log('final form', JSON.stringify(this.form));
// // 修改的提交
// if (this.form.id != null) {
// updateQualityInspectionType(this.form).then((response) => {
// this.$modal.msgSuccess('修改成功');
// this.open = false;
// this.getList();
// });
// return;
// }
// // 添加的提交
// createQualityInspectionType(this.form).then((response) => {
// this.$modal.msgSuccess('新增成功');
// this.open = false;
// this.getList();
// });
// });
// },
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
// params.pageNo = undefined;
// params.pageSize = undefined;
this.$modal
.confirm('是否确认导出透光率检测?')
.then(() => {
this.exportLoading = true;
return exportTranslucent(params);
})
.then((response) => {
this.$download.excel(response, '透光率检测.xls');
this.exportLoading = false;
})
.catch(() => { });
},
},
};
</script>

View File

@@ -3157,6 +3157,11 @@
"resolved" "https://registry.npmmirror.com/check-types/-/check-types-8.0.3.tgz"
"version" "8.0.3"
"chinese-lunar@^0.1.4":
"integrity" "sha512-E4seb9UZkSJtkm65Ry2ZLWTw5Z87DOyGcCePdg3ft7da342hnEliMtcDAPSn+YSo/o0xl1Egmhh671kxEJgY+g=="
"resolved" "https://registry.npmmirror.com/chinese-lunar/-/chinese-lunar-0.1.4.tgz"
"version" "0.1.4"
"chokidar@^2.1.8":
"integrity" "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg=="
"resolved" "https://registry.npmmirror.com/chokidar/-/chokidar-2.1.8.tgz"