{ "Rows": { "RowColumnAttachedInfos": { "0": { "GridRowColumnDefinition": { "DesignLengthInPixel": 15.0 } }, "1": { "GridRowColumnDefinition": { "DesignLengthInPixel": 102.0, "Mode": 1 } }, "2": { "GridRowColumnDefinition": { "DesignLengthInPixel": 10.0 } }, "3": { "GridRowColumnDefinition": { "DesignLengthInPixel": 83.0, "Mode": 1 } }, "4": { "GridRowColumnDefinition": { "DesignLengthInPixel": 10.0 } }, "5": { "GridRowColumnDefinition": { "DesignLengthInPixel": 300.0 } }, "6": { "GridRowColumnDefinition": { "DesignLengthInPixel": 10.0 } }, "7": { "GridRowColumnDefinition": { "DesignLengthInPixel": 383.0 } }, "8": { "GridRowColumnDefinition": { "DesignLengthInPixel": 10.0 } }, "9": { "GridRowColumnDefinition": { "DesignLengthInPixel": 254.0, "Mode": 2, "MinLength": { "Unit": 1 }, "MaxLength": { "Value": 1.0 } } }, "10": { "GridRowColumnDefinition": { "DesignLengthInPixel": 15.0 } }, "11": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0, "IsHidden": true } } }, "InLogicalVisibleIndexes": [ 11 ], "Count": 12, "DefaultSize": 10.0 }, "Cols": { "RowColumnAttachedInfos": { "0": { "GridRowColumnDefinition": { "DesignLengthInPixel": 24.0 } }, "1": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "2": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "3": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "4": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "5": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "6": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "7": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "8": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "9": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "10": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "11": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "12": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "13": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "14": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "15": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "16": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "17": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "18": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "19": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "20": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "21": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "22": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "23": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "24": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "25": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "26": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "27": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "28": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "29": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "30": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "31": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "32": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "33": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "34": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "35": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0 } }, "36": { "GridRowColumnDefinition": { "DesignLengthInPixel": 32.0, "Mode": 2, "MinLength": { "Unit": 1 }, "MaxLength": { "Value": 1.0 } } }, "37": { "GridRowColumnDefinition": { "DesignLengthInPixel": 10.0 } }, "38": { "GridRowColumnDefinition": { "DesignLengthInPixel": 320.0 } }, "39": { "GridRowColumnDefinition": { "DesignLengthInPixel": 24.0 } } }, "Count": 40, "DefaultSize": 32.0 }, "Values": { "1,1": "工作台_关键信息", "1,38": "公告栏", "3,1": "工作台_快捷入口", "5,1": "工时折线图", "5,38": "项目动态", "7,1": "工时排行榜(柱形图)", "9,1": "反馈统计(饼图+表格)" }, "AttachInfos": { "1,1": { "CellType": { "$type": "Forguncy.ContentContainerCellType, ServerDesignerCommon", "PageName": "工作台_关键信息", "OverflowMode": 1 } }, "3,1": { "CellType": { "$type": "Forguncy.ContentContainerCellType, ServerDesignerCommon", "PageName": "工作台_快捷入口" } }, "5,1": { "CssName": "none-background", "CellType": { "$type": "EchartsCustomCellType.EchartsCustomCellTypeCellType, EchartsCustomCellType", "EChartTitle": "报工趋势表", "DataSourceBinding": "DataSources", "DataSources": [ { "Name": "工时表", "BindingTableOptions": { "$type": "ServerDesignerCommon.Model.BindingDataSourceModel, ServerDesignerCommon", "TableName": "任务工时表", "BindingInfos": [ { "GUID": "dcf5c7c2-1643-4eb4-b2a3-8e94ef7a14e2", "BindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "82e97a2c-9e2f-42e4-937a-453518b48f70" }, "ColumnName": "日期" }, { "GUID": "edd13b7b-55f0-41ed-919f-758450e718b6", "BindingInfo": { "TableName": "任务工时表", "ColumnName": "总工时", "GUID": "786c776d-dcec-411f-8a24-0b19e5ac7564" }, "ColumnName": "总工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "CompareType": 3, "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "6dd90d8a-2da5-49e3-802e-9598cd8ecb7d" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=TODAY()-30" } }, "NullFormulaValueQueryPolicy": 1, "OrderBySqlCondition": { "OrderByColumns": [ { "ColumnBindingInfo": { "TableName": "任务工时表", "ColumnName": "工时日期", "GUID": "7e799144-4ee2-4128-b68c-8c6f41270a5f" }, "Order": 0 } ] }, "CustomColumns": [] } } ], "JSONDataSources": [], "ImageDataSource": [], "Config": "{\"option\":\"let completeXAxisData = [];\\nlet completeYAxisData = []\\n\\n// 打印数据源以进行检查\\nconsole.log(\\\"Context['工时表']:\\\", Context[\\\"工时表\\\"]);\\n\\n// 拆分数据源\\nconst splitData = ForguncyEchartsHelper.splitDataSource(Context[\\\"工时表\\\"]);\\nconsole.log(\\\"拆分后的数据:\\\", splitData);\\n\\n// 使用正确的键名\\nconst { \\\"日期\\\": xData, \\\"总工时\\\": yAxisData } = splitData;\\nconsole.log(\\\"xData:\\\", xData);\\nconsole.log(\\\"yAxisData:\\\", yAxisData);\\n\\n// 生成完整的日期范围\\nfunction getDateRange(startDate, endDate) {\\n const dateList = [];\\n let currentDate = new Date(startDate);\\n\\n while (currentDate <= endDate) {\\n const year = currentDate.getFullYear();\\n const month = (\\\"0\\\" + (currentDate.getMonth() + 1)).slice(-2);\\n const day = (\\\"0\\\" + currentDate.getDate()).slice(-2);\\n\\n dateList.push(`${year}-${month}-${day}`);\\n\\n currentDate.setDate(currentDate.getDate() + 1);\\n }\\n return dateList;\\n}\\n\\n// 转换 Excel 日期数字为日期字符串\\nfunction getDateFormat(value) {\\n // 检查是否为数字类型\\n if (typeof value === \\\"number\\\") {\\n // Excel 日期格式的起始日期是 1899-12-30\\n const excelEpoch = new Date(Date.UTC(1899, 11, 30));\\n // 将整数日期转换为毫秒数\\n const date = new Date(\\n excelEpoch.getTime() + value * 24 * 60 * 60 * 1000,\\n );\\n const year = date.getUTCFullYear();\\n const month = (date.getUTCMonth() + 1).toString().padStart(2, \\\"0\\\");\\n const day = date.getUTCDate().toString().padStart(2, \\\"0\\\");\\n return `${year}-${month}-${day}`;\\n } else if (typeof value === \\\"string\\\") {\\n // 如果已经是字符串,则直接返回\\n return value;\\n } else {\\n // 其他情况返回空字符串\\n return \\\"\\\";\\n }\\n}\\n\\n// 检查 xData 和 yAxisData 是否存在并且是数组\\nif (Array.isArray(xData) && Array.isArray(yAxisData)) {\\n\\n // 批量处理日期\\n const xAxisData = xData.map((item) => getDateFormat(item));\\n\\n // 将日期字符串转换为 Date 对象\\n const dateObjects = xAxisData.map((dateStr) => new Date(dateStr));\\n\\n // 检查是否成功转换为有效的日期对象\\n if (dateObjects.some((date) => isNaN(date))) {\\n console.error(\\\"日期格式不正确,请检查日期数据。\\\");\\n return;\\n }\\n\\n // 获取最小和最大日期\\n const timestamps = dateObjects.map((date) => date.getTime());\\n const minTimestamp = Math.min(...timestamps);\\n const maxTimestamp = Math.max(...timestamps);\\n const minDate = new Date(minTimestamp);\\n const maxDate = new Date(maxTimestamp);\\n\\n // 生成完整的日期范围\\n const completeDateRange = getDateRange(minDate, maxDate);\\n\\n // 将原始数据映射为日期和值的键值对\\n const dataMap = {};\\n xAxisData.forEach((date, index) => {\\n dataMap[date] = yAxisData[index];\\n });\\n\\n // 补全缺失的数据\\n completeYAxisData = completeDateRange.map((date) => {\\n return dataMap[date] !== undefined ? dataMap[date] : 0;\\n });\\n\\n // 更新图表的数据\\n completeXAxisData = completeDateRange;\\n} else {\\n console.error(\\\"数据格式不正确,请检查数据源。\\\");\\n}\\n\\n// 配置 Echarts 图表\\noption = {\\n backgroundColor: \\\"rgba(0, 0, 0, 0)\\\",\\n title: {\\n text: \\\"报工趋势图 (近30天)\\\",\\n left: \\\"center\\\",\\n top: 24,\\n textStyle: {\\n fontSize: 16,\\n fontWeight: \\\"bold\\\",\\n },\\n },\\n grid: {\\n top: 72,\\n left: \\\"24px\\\",\\n right: \\\"24px\\\",\\n bottom: \\\"24px\\\",\\n containLabel: true,\\n },\\n xAxis: {\\n type: \\\"category\\\",\\n data: completeXAxisData,\\n axisLabel: {\\n color: \\\"#abacac\\\",\\n },\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n axisTick: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n },\\n yAxis: {\\n type: \\\"value\\\",\\n axisLabel: {\\n color: \\\"#abacac\\\",\\n },\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n axisTick: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n splitLine: {\\n show: true,\\n lineStyle: {\\n color: \\\"#f8fafc\\\",\\n },\\n },\\n },\\n tooltip: {\\n trigger: \\\"axis\\\",\\n backgroundColor: \\\"#FFFFFF\\\",\\n textStyle: {\\n color: \\\"#000000\\\",\\n },\\n },\\n series: [\\n {\\n data: completeYAxisData,\\n type: \\\"line\\\",\\n lineStyle: {\\n width: 3,\\n shadowColor: \\\"rgba(0, 0, 0, 0.1)\\\",\\n shadowBlur: 10,\\n shadowOffsetX: 0,\\n shadowOffsetY: 4,\\n },\\n smooth: true,\\n symbolSize: 8,\\n symbol: \\\"none\\\",\\n itemStyle: {\\n color: \\\"#2196f3\\\",\\n },\\n areaStyle: {\\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [\\n {\\n offset: 0,\\n color: \\\"rgba(33,150,243,0.3)\\\",\\n },\\n {\\n offset: 1,\\n color: \\\"rgba(33,150,243,0)\\\",\\n },\\n ]),\\n },\\n },\\n ],\\n};\\n\",\"graphTheme\":null,\"displayMode\":\"canvas\",\"jsCode\":\"\\n async ({Context,JSONContext,ImageContext,echarts,myChart,dat,Forguncy,d3,setInterval,setTimeout,ForguncyEchartsHelper,PublicResource})=>{\\n var datGUI=undefined;\\n var option={};\\n let completeXAxisData = [];\\nlet completeYAxisData = [];\\n// 打印数据源以进行检查\\nconsole.log(\\\"Context['工时表']:\\\", Context[\\\"工时表\\\"]);\\n// 拆分数据源\\nconst splitData = ForguncyEchartsHelper.splitDataSource(Context[\\\"工时表\\\"]);\\nconsole.log(\\\"拆分后的数据:\\\", splitData);\\n// 使用正确的键名\\nconst { \\\"日期\\\": xData, \\\"总工时\\\": yAxisData } = splitData;\\nconsole.log(\\\"xData:\\\", xData);\\nconsole.log(\\\"yAxisData:\\\", yAxisData);\\n// 生成完整的日期范围\\nfunction getDateRange(startDate, endDate) {\\n const dateList = [];\\n let currentDate = new Date(startDate);\\n while (currentDate <= endDate) {\\n const year = currentDate.getFullYear();\\n const month = (\\\"0\\\" + (currentDate.getMonth() + 1)).slice(-2);\\n const day = (\\\"0\\\" + currentDate.getDate()).slice(-2);\\n dateList.push(`${year}-${month}-${day}`);\\n currentDate.setDate(currentDate.getDate() + 1);\\n }\\n return dateList;\\n}\\n// 转换 Excel 日期数字为日期字符串\\nfunction getDateFormat(value) {\\n // 检查是否为数字类型\\n if (typeof value === \\\"number\\\") {\\n // Excel 日期格式的起始日期是 1899-12-30\\n const excelEpoch = new Date(Date.UTC(1899, 11, 30));\\n // 将整数日期转换为毫秒数\\n const date = new Date(excelEpoch.getTime() + value * 24 * 60 * 60 * 1000);\\n const year = date.getUTCFullYear();\\n const month = (date.getUTCMonth() + 1).toString().padStart(2, \\\"0\\\");\\n const day = date.getUTCDate().toString().padStart(2, \\\"0\\\");\\n return `${year}-${month}-${day}`;\\n }\\n else if (typeof value === \\\"string\\\") {\\n // 如果已经是字符串,则直接返回\\n return value;\\n }\\n else {\\n // 其他情况返回空字符串\\n return \\\"\\\";\\n }\\n}\\n// 检查 xData 和 yAxisData 是否存在并且是数组\\nif (Array.isArray(xData) && Array.isArray(yAxisData)) {\\n // 批量处理日期\\n const xAxisData = xData.map((item) => getDateFormat(item));\\n // 将日期字符串转换为 Date 对象\\n const dateObjects = xAxisData.map((dateStr) => new Date(dateStr));\\n // 检查是否成功转换为有效的日期对象\\n if (dateObjects.some((date) => isNaN(date))) {\\n console.error(\\\"日期格式不正确,请检查日期数据。\\\");\\n return;\\n }\\n // 获取最小和最大日期\\n const timestamps = dateObjects.map((date) => date.getTime());\\n const minTimestamp = Math.min(...timestamps);\\n const maxTimestamp = Math.max(...timestamps);\\n const minDate = new Date(minTimestamp);\\n const maxDate = new Date(maxTimestamp);\\n // 生成完整的日期范围\\n const completeDateRange = getDateRange(minDate, maxDate);\\n // 将原始数据映射为日期和值的键值对\\n const dataMap = {};\\n xAxisData.forEach((date, index) => {\\n dataMap[date] = yAxisData[index];\\n });\\n // 补全缺失的数据\\n completeYAxisData = completeDateRange.map((date) => {\\n return dataMap[date] !== undefined ? dataMap[date] : 0;\\n });\\n // 更新图表的数据\\n completeXAxisData = completeDateRange;\\n}\\nelse {\\n console.error(\\\"数据格式不正确,请检查数据源。\\\");\\n}\\n// 配置 Echarts 图表\\noption = {\\n backgroundColor: \\\"rgba(0, 0, 0, 0)\\\",\\n title: {\\n text: \\\"报工趋势图 (近30天)\\\",\\n left: \\\"center\\\",\\n top: 24,\\n textStyle: {\\n fontSize: 16,\\n fontWeight: \\\"bold\\\",\\n },\\n },\\n grid: {\\n top: 72,\\n left: \\\"24px\\\",\\n right: \\\"24px\\\",\\n bottom: \\\"24px\\\",\\n containLabel: true,\\n },\\n xAxis: {\\n type: \\\"category\\\",\\n data: completeXAxisData,\\n axisLabel: {\\n color: \\\"#abacac\\\",\\n },\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n axisTick: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n },\\n yAxis: {\\n type: \\\"value\\\",\\n axisLabel: {\\n color: \\\"#abacac\\\",\\n },\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n axisTick: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n },\\n splitLine: {\\n show: true,\\n lineStyle: {\\n color: \\\"#f8fafc\\\",\\n },\\n },\\n },\\n tooltip: {\\n trigger: \\\"axis\\\",\\n backgroundColor: \\\"#FFFFFF\\\",\\n textStyle: {\\n color: \\\"#000000\\\",\\n },\\n },\\n series: [\\n {\\n data: completeYAxisData,\\n type: \\\"line\\\",\\n lineStyle: {\\n width: 3,\\n shadowColor: \\\"rgba(0, 0, 0, 0.1)\\\",\\n shadowBlur: 10,\\n shadowOffsetX: 0,\\n shadowOffsetY: 4,\\n },\\n smooth: true,\\n symbolSize: 8,\\n symbol: \\\"none\\\",\\n itemStyle: {\\n color: \\\"#2196f3\\\",\\n },\\n areaStyle: {\\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [\\n {\\n offset: 0,\\n color: \\\"rgba(33,150,243,0.3)\\\",\\n },\\n {\\n offset: 1,\\n color: \\\"rgba(33,150,243,0)\\\",\\n },\\n ]),\\n },\\n },\\n ],\\n};\\n\\n return {\\n option,\\n datGUI,\\n };\\n }\\n \"}" } }, "7,1": { "CellType": { "$type": "EchartsCustomCellType.EchartsCustomCellTypeCellType, EchartsCustomCellType", "EChartTitle": "工时排行榜", "DataSourceBinding": "DataSources", "DataSources": [ { "Name": "工时统计", "BindingTableOptions": { "$type": "ServerDesignerCommon.Model.BindingDataSourceModel, ServerDesignerCommon", "TableName": "人员工时统计视图", "BindingInfos": [ { "GUID": "8b699743-3aa9-4d92-9903-befbec0b7e5a", "BindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "执行人", "GUID": "49a350f1-88a5-4b57-98c5-e44bfde1da05", "AttachType": { "$type": "ForguncyDataAccess.UserColumnAttachObj, ForguncyDataAccess", "UserColumnAttachType": 1 } }, "ColumnName": "执行人" }, { "GUID": "b5a5da98-fe34-4196-a0c4-f8aaf698b575", "BindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "总上报工时", "GUID": "0b45d04d-ee59-47c1-8dea-3794517e6f8f" }, "ColumnName": "总上报工时" }, { "GUID": "7ca1cd9f-08c4-4384-93e5-176c41214704", "BindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "总核定工时", "GUID": "1658227e-885b-4186-8624-4357b8d11b58" }, "ColumnName": "总核定工时" } ], "SqlCondition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "CompareType": 1, "ColumnBindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "执行人", "GUID": "0b34c9f5-aaee-4d74-9fea-09972a65f116" }, "Value": "%Null%" }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "日期", "GUID": "5d56155e-bbed-4c17-a938-53888dad630a", "AttachType": { "$type": "ForguncyDataAccess.DateColumnAttachObj, ForguncyDataAccess", "ColumnAttachType": 1 } }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=YEAR(TODAY())" } }, { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "日期", "GUID": "d4638e91-990f-415a-8a11-365f7a397486", "AttachType": { "$type": "ForguncyDataAccess.DateColumnAttachObj, ForguncyDataAccess", "ColumnAttachType": 4 } }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=MONTH(TODAY())" } } ] }, "NullFormulaValueQueryPolicy": 2, "OrderBySqlCondition": { "OrderByColumns": [ { "ColumnBindingInfo": { "TableName": "人员工时统计视图", "ColumnName": "总上报工时", "GUID": "68e4253e-8c7e-44c0-95e7-a3bd293eee65" }, "Order": 1 } ] }, "CustomColumns": [] } } ], "JSONDataSources": [], "ImageDataSource": [], "Config": "{\"option\":\"// 获取数据源并拆分数据 \\nvar sourceData = Context[\\\"工时统计\\\"];\\nconsole.log(sourceData);\\nvar splitData = ForguncyEchartsHelper.splitDataSource(sourceData);\\n\\n// 将数据保留到1位小数 \\nfor (var key in splitData) {\\n if (key !== \\\"执行人\\\") {\\n splitData[key] = splitData[key].map(function (value) {\\n return parseFloat(value.toFixed(1));\\n });\\n }\\n}\\n\\n// 将数据按照「总上报工时」降序序 \\nvar indices = splitData[\\\"总上报工时\\\"]\\n .map(function (value, index) { return index; })\\n .sort(function (a, b) { return splitData[\\\"总上报工时\\\"][b] - splitData[\\\"总上报工时\\\"][a]; });\\n\\n// 根据排序后的索引重组数据 \\nvar xData = indices.map(function (index) { return splitData[\\\"执行人\\\"][index]; });\\nvar totalReported = indices.map(function (index) { return splitData[\\\"总上报工时\\\"][index]; });\\nvar totalApproved = indices.map(function (index) { return splitData[\\\"总核定工时\\\"][index]; });\\nvar difference = totalReported.map(function (value, index) {\\n return parseFloat((value - totalApproved[index]).toFixed(1));\\n});\\n\\n// 配置 Echarts 的 option \\noption = {\\n backgroundColor: \\\"rgba(0, 0, 0, 0)\\\",\\n title: {\\n text: \\\"工时排行榜(本月)\\\",\\n left: \\\"center\\\",\\n top: 24,\\n textStyle: {\\n fontSize: 16,\\n fontWeight: \\\"bold\\\",\\n },\\n },\\n grid: {\\n top: 72,\\n left: \\\"24px\\\",\\n right: \\\"24px\\\",\\n bottom: \\\"24px\\\",\\n containLabel: true,\\n },\\n tooltip: {\\n trigger: 'axis',\\n axisPointer: { type: 'shadow' },\\n formatter: function (params) {\\n return params[0].name + '
' + params[0].seriesName + ':' + params[0].value + '小时' + '
' +\\n params[1].seriesName + ':' + params[1].value;\\n }\\n },\\n legend: {\\n show: false\\n },\\n xAxis: {\\n type: 'category',\\n data: xData,\\n },\\n yAxis: {\\n type: 'value',\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n }\\n },\\n series: [\\n {\\n name: '已核定工时',\\n type: 'bar',\\n stack: '总量',\\n data: totalApproved,\\n itemStyle: {\\n color: '#63b5f6',\\n borderRadius:\\\"8px\\\"\\n },\\n label: {\\n show: true,\\n position: 'inside',\\n formatter: '{c}小时',\\n color: '#fff',\\n fontSize: 12\\n }\\n },\\n {\\n name: '未核定工时',\\n type: 'bar',\\n stack: '总量',\\n data: difference,\\n itemStyle: {\\n color: '#2196f3',\\n borderRadius:\\\"8px\\\"\\n },\\n label: {\\n show: true,\\n position: 'inside',\\n formatter: function (params) {\\n if (params.value > 0) {\\n return params.value + '小时';\\n } else {\\n return '';\\n }\\n },\\n color: '#fff',\\n fontSize: 12\\n }\\n }\\n ]\\n}; \",\"graphTheme\":null,\"displayMode\":\"canvas\",\"jsCode\":\"\\n async ({Context,JSONContext,ImageContext,echarts,myChart,dat,Forguncy,d3,setInterval,setTimeout,ForguncyEchartsHelper,PublicResource})=>{\\n var datGUI=undefined;\\n var option={};\\n // 获取数据源并拆分数据 \\nvar sourceData = Context[\\\"工时统计\\\"];\\nconsole.log(sourceData);\\nvar splitData = ForguncyEchartsHelper.splitDataSource(sourceData);\\n// 将数据保留到1位小数 \\nfor (var key in splitData) {\\n if (key !== \\\"执行人\\\") {\\n splitData[key] = splitData[key].map(function (value) {\\n return parseFloat(value.toFixed(1));\\n });\\n }\\n}\\n// 将数据按照「总上报工时」降序序 \\nvar indices = splitData[\\\"总上报工时\\\"]\\n .map(function (value, index) { return index; })\\n .sort(function (a, b) { return splitData[\\\"总上报工时\\\"][b] - splitData[\\\"总上报工时\\\"][a]; });\\n// 根据排序后的索引重组数据 \\nvar xData = indices.map(function (index) { return splitData[\\\"执行人\\\"][index]; });\\nvar totalReported = indices.map(function (index) { return splitData[\\\"总上报工时\\\"][index]; });\\nvar totalApproved = indices.map(function (index) { return splitData[\\\"总核定工时\\\"][index]; });\\nvar difference = totalReported.map(function (value, index) {\\n return parseFloat((value - totalApproved[index]).toFixed(1));\\n});\\n// 配置 Echarts 的 option \\noption = {\\n backgroundColor: \\\"rgba(0, 0, 0, 0)\\\",\\n title: {\\n text: \\\"工时排行榜(本月)\\\",\\n left: \\\"center\\\",\\n top: 24,\\n textStyle: {\\n fontSize: 16,\\n fontWeight: \\\"bold\\\",\\n },\\n },\\n grid: {\\n top: 72,\\n left: \\\"24px\\\",\\n right: \\\"24px\\\",\\n bottom: \\\"24px\\\",\\n containLabel: true,\\n },\\n tooltip: {\\n trigger: 'axis',\\n axisPointer: { type: 'shadow' },\\n formatter: function (params) {\\n return params[0].name + '
' + params[0].seriesName + ':' + params[0].value + '小时' + '
' +\\n params[1].seriesName + ':' + params[1].value;\\n }\\n },\\n legend: {\\n show: false\\n },\\n xAxis: {\\n type: 'category',\\n data: xData,\\n },\\n yAxis: {\\n type: 'value',\\n axisLine: {\\n lineStyle: {\\n color: \\\"#f5f6f6\\\",\\n },\\n }\\n },\\n series: [\\n {\\n name: '已核定工时',\\n type: 'bar',\\n stack: '总量',\\n data: totalApproved,\\n itemStyle: {\\n color: '#63b5f6',\\n borderRadius: \\\"8px\\\"\\n },\\n label: {\\n show: true,\\n position: 'inside',\\n formatter: '{c}小时',\\n color: '#fff',\\n fontSize: 12\\n }\\n },\\n {\\n name: '未核定工时',\\n type: 'bar',\\n stack: '总量',\\n data: difference,\\n itemStyle: {\\n color: '#2196f3',\\n borderRadius: \\\"8px\\\"\\n },\\n label: {\\n show: true,\\n position: 'inside',\\n formatter: function (params) {\\n if (params.value > 0) {\\n return params.value + '小时';\\n }\\n else {\\n return '';\\n }\\n },\\n color: '#fff',\\n fontSize: 12\\n }\\n }\\n ]\\n};\\n\\n return {\\n option,\\n datGUI,\\n };\\n }\\n \"}" } } }, "StyleDatas": { "Styles": [ { "FontSize": 37.33333333333333, "Foreground": 0 } ], "Types": { "Strs": [ "Background 1 -15", "Body", "Center" ] }, "CellStyles": { "1,38": 0, "5,38": 0, "7,1": 0, "9,1": 0 }, "SheetStyle": { "FontFamily": 1, "HorizontalAlignment": 2 } }, "Spans": [ "1,38,3,1", "9,1,1,36", "5,38,5,1", "1,1,1,36", "3,1,1,36", "5,1,1,36", "7,1,1,36" ], "PageInfo": { "$type": "Forguncy.Model.Pages.NormalPage, ServerDesignerCommon", "MasterPageName": "FGC_母版页", "PageOverflowMode": 2, "PageLoadedCommandList": [ { "$type": "Notiflix_Forguncy.Loading_Command, Notiflix_Forguncy", "FunctionName": "remove", "Title": "加载中" } ], "PermissionData": { "$type": "Forguncy.RbacPermission.Core.Impl.Page.PagePermissionData, Forguncy.RbacPermission.Core", "permissionResource": { "$type": "Forguncy.RbacPermission.Core.Impl.Page.PagePermissionResource, Forguncy.RbacPermission.Core" }, "permissionBindings": [ { "$type": "Forguncy.RbacPermission.Core.Impl.Page.PagePermissionBinding, Forguncy.RbacPermission.Core", "roleNames": [ "FGC_LoginUser" ] } ] }, "RowBreakLines": [], "RepeatRangeSettings": [] }, "PrintInfo": { "PaperSize": {}, "Margin": {} }, "BackgroundPictures": [ { "FitToBrowserWidth": true, "FitToBrowserHeight": true, "Name": "f9665113-5057-40ef-8571-aa152a7302ce.png", "DisplayName": "背景图1", "StyleInfo": { "Fill": "Background 2 0" }, "IsAutomaticFill": false, "Size": "1530,1224" }, { "Name": "0f5baa2c-2dec-44c7-8a3f-45868371fe7b.png", "DisplayName": "背景图2", "StyleInfo": { "CornerRadius": 10.0, "Fill": "Background 1 0" }, "IsAutomaticFill": false, "Location": "24,220", "Size": "1152,300" }, { "Name": "7e86b317-11df-41f3-a863-d077d49a760b.png", "DisplayName": "背景图3", "StyleInfo": { "CornerRadius": 10.0, "Fill": "Background 1 0" }, "IsAutomaticFill": false, "Location": "1186,15", "Size": "320,195" }, { "Name": "75cbd09e-882c-427a-a52b-ba015444352e.png", "DisplayName": "背景图4", "StyleInfo": { "CornerRadius": 10.0, "Fill": "Background 1 0" }, "IsAutomaticFill": false, "Location": "1186,220", "Size": "320,957" }, { "Name": "9585c733-c922-4ba2-8923-e5c50a4f429c.png", "DisplayName": "背景图5", "StyleInfo": { "CornerRadius": 10.0, "Fill": "Background 1 0" }, "IsAutomaticFill": false, "Location": "24,530", "Size": "1152,383" }, { "Name": "cc656816-79e5-4f40-957c-c72753c75e5d.png", "DisplayName": "背景图6", "StyleInfo": { "CornerRadius": 10.0, "Fill": "Background 1 0" }, "IsAutomaticFill": false, "Location": "24,923", "Size": "1152,254" } ] }//4C/zbKQY4FYd+Q2u24Iny4u4IaPGTuxgOMGsVAvj9szhhvo2lLoBCb7CYdqal+VTP9EN1ec+YI7akqeYOiQGXfOblRN4xrpmNHQZc2bz6mCMWBiNdmgOZ3P3HFgs9Yh8wLlESMoRu8YYkq4UbFjY5DOM240Bn4Q+C0B60JLPcSDQBivYl73DfGqGuKxKX6sd+rDS42gRt9NfGuRMAZSBri+XY8B4YBhM5orafvpnN70dBvURY7wGhkV7pWzCgkaUkUqqe1IpNHRXY7S9MxJnhpkJ7+fmrWCDe4c/cQW1QXOHXhOZtTeh95qvcfmKm5AqB/cvjiUu6WYZ0Hxx0vDujuU45e4v+Rj0/HoFqD11ZdvI8AcBdll42D4Bn4EpIfqu/ckYzWSfqZk2UWaKEtlo0Zsj45iI3tGkYRB/HUYIlD0tHiS90renRCuIQo+IUICZEFh697jYrQhobvos7YNTx+Iu79rTt7Nj81knI2pykNYnk9uVBSrUDyRPssVm+QFfCJtTNxfO2V2m4mYTyo7+lqf0iwI2rahzkmavAlnr08YRicmP0rkL7NM/J9pTu0C+3u6x2+22nPXb7UHCl81G1o9efkb/ApzKnJbr3M8itv6uI2AEAdCCVormMLXvPyKwP9GMIPIg5dM/07gcJidM38RJvfZQFmk8ypeAVUSyvazy5yMMEqmyKbaKkPebjknJgAVGbSIQCy/k2hk0KjsHpYCp/J7RHL5Fi+hissRoBzNzo7ONzkCimI/g3xMm7MhZ3WhiQARz727CflWWKOjeLMSClkp3h8va3n+gvgmT8AW2tGvsmOHHor0wsU+Db4Q2U2bqQF74+IAZ/jMiqBEVNl9erzqjY4ISSZYTa0GT3GW9Z+0OpRSMWmJqSCnBThvG4+xFLPLkoBRCp/0JSpdv9w==|920