代码优化

master
xiaochanghai 7 months ago
parent 4f3bed919c
commit 821c798c90
  1. 10
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeTemplatePreviewController.cs
  2. 140
      Tiobon.Core.Api/Views/Ghrh_ResumeTemplatePreview/Index.cshtml
  3. 109
      Tiobon.Core.Api/wwwroot/css/resume.css
  4. 2
      Tiobon.Core.Services/CommonServices.cs
  5. 5
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs

@ -1,4 +1,5 @@
using SqlSugar;
using Com.Ctrip.Framework.Apollo.Enums;
using SqlSugar;
using System.Dynamic;
using Tiobon.Core.Common.DB.Dapper.Extensions;
using Tiobon.Core.Model.ViewModels.Extend;
@ -406,6 +407,13 @@ END";
#endregion
string cssUrl = AppSettings.app(["Startup", "FrontUrl"]);
string path = string.Empty;
cssUrl += "/Advanced";
if (App.HostEnvironment.IsDevelopment())
cssUrl = "http://localhost:9292";
cssUrl += "/css/resume.css";
ViewBag.CssUrl = cssUrl;
return View();
}

@ -14,115 +14,8 @@
List<Dictionary<string, object>> TrainingDic = ViewBag.TrainingDic;
Dictionary<string, bool?> StatementDic = ViewBag.StatementDic;
}
<style type="text/css">
body {
color: #000000d9;
font-size: 14px;
font-family: Noto Sans SC, PingFang SC, tahoma, arial, Hiragino Sans GB, Hiragino Sans GB W3, Microsoft Yahei, STHeitiSC-Light, Helvetica-Light, sans-serif !important;
page-break-before: always;
}
<link rel="stylesheet" href="@ViewBag.CssUrl">
.ghr-preview-staff-info .pageContainer {
background-color: #fff;
overflow-y: auto;
}
.ghr-preview-staff-info .pageContainer .a4page {
width: 794px;
/* padding: 40px; */
box-sizing: border-box;
/* page-break-after: always; */
}
.pageContainer .a4page.displayMode {
margin: 20px auto;
/* border: 1px #d3d3d3 solid;
box-shadow: 0 0 5px #0000001a; */
/* display: flex; */
flex-wrap: wrap;
}
.ghr-preview-staff-base-info .staffPhoto {
width: 100px;
height: 100px;
display: inline-block;
vertical-align: top;
position: relative;
}
.ghr-preview-staff-base-info .staffPhoto img {
width: 100%;
height: 100%;
-o-object-fit: contain;
object-fit: contain;
}
.ghr-preview-staff-base-info .staffBaseInfo {
height: 100px;
display: inline-block;
vertical-align: top;
padding-left: 25px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffName {
font-size: 20px;
margin-top: 10px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffEName {
font-size: 16px;
color: #5d5d5d;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffHumanResourcesMsg {
font-size: 16px;
color: #5d5d5d;
margin-top: 15px;
}
.ghr-preview-staff-resume-title {
height: 26px;
line-height: 26px;
font-size: 18px;
color: #242424;
margin: 10px 0;
border-left: 2px solid #ff9300;
padding-left: 15px;
width: 100%
}
.ghr-preview-staff-resume-block-item {
width: 50%;
display: inline-block;
vertical-align: top;
min-height: 25px;
word-break: break-all;
line-height: 25px;
margin: 5px 0;
}
.ghr-preview-staff-resume-block-item .label {
width: 150px;
display: inline-block;
vertical-align: top;
height: 25px;
line-height: 25px;
text-align: right;
}
.ghr-preview-staff-resume-block-item .itemValue {
display: inline-block;
vertical-align: top;
min-height: 25px;
line-height: 25px;
}
.page-break-inside {
page-break-inside: avoid;
}
</style>
<div class="ghr-preview-staff-info">
<div class="pageContainer">
@ -368,6 +261,7 @@
@item.tabName
</div>
}
<div style="float:left;width:80%;padding-left: 10px;color: #ff9300;">员工本人声明(本人填写、提供的资料,是真实的、可靠的。如有虚假,则所签订的劳动合同将自动作废,由此产生的一切后果由本人负责。)</div>
if (item.children != null && item.children.Any())
foreach (var children in item.children)
@ -375,22 +269,26 @@
if (ii > 0)
{
<div style="margin-top:20px;width:100%;float:left;"></div>
<div style="margin-top:5px;width:100%;float:left;"></div>
}
<div class="ghr-preview-staff-resume-block-item" id="Base-0-StaffName" style="display: flex;width:80%">
<div class="itemValue" style="width:80%">@(ii + 1).&nbsp;@(children.placeholder):</div>
<div class="label" style="width:20%">
@{
ii++;
if (StatementDic.ContainsKey("Statement" + ii))
{
if (StatementDic["Statement" + ii] != null)
if (StatementDic["Statement" + ii] == true)
@("是")
else
@("否")
<div class="itemValue" style="float: left;width: 75%;">
<p style="margin: 0;padding: 10px;">
@(ii + 1).&nbsp;@(children.placeholder): @{
ii++;
if (StatementDic.ContainsKey("Statement" + ii))
{
if (StatementDic["Statement" + ii] != null)
if (StatementDic["Statement" + ii] == true)
@("是")
else
@("否")
}
}
}
</p>
</div>
<div class="label" style="float: left;width: 25%;">
</div>
</div>
}

@ -0,0 +1,109 @@

body {
color: #000000d9;
font-size: 14px;
font-family: Noto Sans SC, PingFang SC, tahoma, arial, Hiragino Sans GB, Hiragino Sans GB W3, Microsoft Yahei, STHeitiSC-Light, Helvetica-Light, sans-serif !important;
page-break-before: always;
}
.ghr-preview-staff-info .pageContainer {
background-color: #fff;
overflow-y: auto;
}
.ghr-preview-staff-info .pageContainer .a4page {
width: 794px;
/* padding: 40px; */
box-sizing: border-box;
/* page-break-after: always; */
}
.pageContainer .a4page.displayMode {
margin: 20px auto;
/* border: 1px #d3d3d3 solid;
box-shadow: 0 0 5px #0000001a; */
/* display: flex; */
flex-wrap: wrap;
}
.ghr-preview-staff-base-info .staffPhoto {
width: 100px;
height: 100px;
display: inline-block;
vertical-align: top;
position: relative;
}
.ghr-preview-staff-base-info .staffPhoto img {
width: 100%;
height: 100%;
-o-object-fit: contain;
object-fit: contain;
}
.ghr-preview-staff-base-info .staffBaseInfo {
height: 100px;
display: inline-block;
vertical-align: top;
padding-left: 25px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffName {
font-size: 20px;
margin-top: 10px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffEName {
font-size: 16px;
color: #5d5d5d;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffHumanResourcesMsg {
font-size: 16px;
color: #5d5d5d;
margin-top: 15px;
}
.ghr-preview-staff-resume-title {
height: 26px;
line-height: 26px;
font-size: 18px;
color: #242424;
margin: 10px 0;
border-left: 2px solid #ff9300;
padding-left: 15px;
width: 100%
}
.ghr-preview-staff-resume-block-item {
width: 50%;
display: inline-block;
vertical-align: top;
min-height: 25px;
word-break: break-all;
line-height: 25px;
margin: 5px 0;
flex-flow: row wrap;
}
.ghr-preview-staff-resume-block-item .label {
width: 150px;
display: inline-block;
vertical-align: top;
height: 25px;
line-height: 25px;
text-align: right;
}
.ghr-preview-staff-resume-block-item .itemValue {
display: inline-block;
vertical-align: top;
min-height: 25px;
line-height: 25px;
}
.page-break-inside {
page-break-inside: avoid;
}

@ -1383,7 +1383,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
{
display = true,
fnKey = "TBD14YN",
fnTitle = "安排面试",
fnTitle = "重新推荐",
fnType = "row",
icon = "ess-icon-reject",
position = "left"

@ -1,6 +1,7 @@
using DinkToPdf;
using DinkToPdf.Contracts;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using System.IO.Compression;
using static Tiobon.Core.Model.Consts;
@ -2419,8 +2420,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status";
string frontUrl = AppSettings.app(["Startup", "FrontUrl"]);
string path = string.Empty;
frontUrl += "/Advanced";
//if (Env.IsDevelopment())
// frontUrl = "http://localhost:9292";
if (Env.IsDevelopment())
frontUrl = "http://localhost:9292";
if (ids.Count == 1)
{

Loading…
Cancel
Save