第二页锚定点优化等

This commit is contained in:
强 杨 2024-03-28 10:52:05 +08:00
parent a9837f5f3d
commit 3a6cc97a72
5 changed files with 186 additions and 63 deletions

91
App_Code/MysqlDBHelper.cs Normal file
View File

@ -0,0 +1,91 @@
using Dapper;
using MySql.Data.MySqlClient;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// 数据库操作类 需要nuget 安装 Dapper 和 MySql.Data
/// </summary>
public class MysqlDBHelper
{
// todo 生产环境切换数据库地址
//#if DEBUG
private const string _basicConnectionStr =
"Server=192.168.2.9;Port=3306;Database=marking_basic;Uid=root;Pwd=qwe123!@#;MinimumPoolSize=1;MaximumPoolSize=100;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=True;";
//#else
// private const string _basicConnectionStr =
// "Server=mk-rds.23544.com;Port=33306;Database=marking_basic;Uid=marking;Pwd=poiuytPOIUYT098765)(*&^%;MinimumPoolSize=1;MaximumPoolSize=100;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=True;";
//#endif
private string _tenantConnectionStr;
public MysqlDBHelper(long tenantCode)
{
if (tenantCode <= 0)
{
throw new System.ArgumentNullException("tenantCode");
}
_tenantConnectionStr = GetTenantConnectionString(tenantCode);
}
private string GetTenantConnectionString(long tenantCode)
{
using (IDbConnection connection = new MySqlConnection(_basicConnectionStr))
{
var tenant = connection.QueryFirst<dynamic>("select * from tenant where tenant_code=" + tenantCode);
return "Server=" + tenant.ip_addr + ";Port=" + tenant.port + ";Database=" + tenant.database + ";Uid=" + tenant.dbuser + ";Pwd=" + tenant.password + ";MinimumPoolSize=1;MaximumPoolSize=100;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=True;";
}
}
public DataTable ExecuteQuery(string sql)
{
DataTable dt = new DataTable();
using (IDbConnection connection = new MySqlConnection(_tenantConnectionStr))
{
using (var reader = connection.ExecuteReader(sql))
{
dt.Load(reader);
}
}
return dt;
}
public object ExecuteScalar(string sql)
{
using (IDbConnection connection = new MySqlConnection(_tenantConnectionStr))
{
return connection.ExecuteScalar(sql);
}
}
public int ExecuteNoQuery(string sql)
{
using (IDbConnection connection = new MySqlConnection(_tenantConnectionStr))
{
return connection.Execute(sql);
}
}
public int ExecuteNoQuery(string sql, params MySqlParameter[] sp)
{
using (MySqlConnection connection = new MySqlConnection(_tenantConnectionStr))
{
connection.Open();
using (MySqlCommand cmd = new MySqlCommand(sql, connection))
{
cmd.CommandType = CommandType.Text;
if (sp != null && sp.Length > 0)
{
cmd.Parameters.AddRange(sp);
}
return cmd.ExecuteNonQuery();
}
}
}
}

View File

@ -302,7 +302,7 @@
<span style="float: left; width: 100%; display: block; padding-top: 1px; border: 0; border: 1px solid #ffd800; margin-top: 10px; color: #f00">切割成两半 如11题 如 第一半11X1 第二半11X2</span>
<div style="margin-top: 15px; padding-left: 20px; text-align: left; margin-bottom: 10px;">
题号:<input id="zhuguan_tihao" style="font-size: 14px; width: 60px;" type="text" value="" />小题:<input id="zhuguan_xiaoti" style="width: 40px; font-size: 14px;" type="text" value="0" />
题号:<input id="zhuguan_tihao" style="font-size: 14px; width: 60px;" type="text" value="" /><span style="display: none">小题:<input id="zhuguan_xiaoti" style="width: 40px; font-size: 14px;" type="text" value="0" /></span>
分数:
<select id="zgquestionscroe" style="font-size: 14px; width: 80px; text-align: center;">
<option value="">无分</option>
@ -351,15 +351,16 @@
</li>
</ul>
<div style="width: 100%; text-align: center; float: left; padding-bottom: 10px; font-size: 14px; padding-top: 10px; background: #044775; border-top: 2px solid #000000; color: #fff;">模板删减区</div>
<div><div style="width:40px;height:20px;overflow:hidden;padding:5px;float:left;">题型</div>
<div style="width:70px;height:20px;overflow:hidden;padding:5px;float:left;">题号</div>
<div style="width:50px;height:20px;overflow:hidden;padding:5px;float:left;">选项数</div>
<div style="width:40px;height:20px;overflow:hidden;padding:5px;float:left;">分数</div>
<div style="width:72px;height:20px;overflow:hidden;padding:5px;float:left;">方向/步长</div>
<div style="width: 100%; text-align: center; float: left; padding-bottom: 10px; font-size: 14px; padding-top: 10px; background: #044775; border-top: 2px solid #000000; color: #fff; ">模板删减区(滑动滚轮查看所有题目)</div>
<div>
<div style="width: 40px; height: 18px; overflow: hidden; padding: 3px; float: left;">题型</div>
<div style="width: 70px; height: 18px; overflow: hidden; padding: 3px; float: left;">题号</div>
<div style="width: 50px; height: 18px; overflow: hidden; padding: 3px; float: left;">选项数</div>
<div style="width: 40px; height: 18px; overflow: hidden; padding: 3px; float: left;">分数</div>
<div style="width: 72px; height: 18px; overflow: hidden; padding: 3px; float: left;">方向/步长</div>
</div>
<ul id="NowSelect" class="lineul" style="overflow-y: scroll; height: 240px;">
<ul id="NowSelect" class="lineul" style="overflow-y: scroll; height: 300px;overflow-x: hidden;">
</ul>
</div>

View File

@ -1075,28 +1075,34 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
}
if (GetData[8] != "")
{
string[] list = GetData[8].Split(',');
string[] datipiyue = GetData[8].Split('^');
foreach (string slist in datipiyue)
{
string[] list = slist.Split(',');
Xleft = Convert.ToDouble(list[0]);
Xtop = Convert.ToDouble(list[1]);
Xwidth = Convert.ToDouble(list[2]);
Xheight = Convert.ToDouble(list[3]);
string tihao = list[4];
if (Xleft < pyLeft)
{
return "批阅分数编辑框左边超过定位点边界!";
return "题号:[" + tihao + "]批阅分数编辑框左边超过定位点边界!";
}
if (Xleft + Xwidth - pyLeft > oldWidth)
{
return "批阅分数编辑框编辑框右边超过定位点边界!";
return "题号:[" + tihao + "]批阅分数编辑框右边超过定位点边界!";
}
if (Xtop < pyTop)
{
return "批阅分数编辑框编辑框上边超过定位点边界!";
return "题号:[" + tihao + "]批阅分数编辑框上边超过定位点边界!";
}
if (Xtop + Xheight - pyTop > oldHeight)
{
return "批阅分数编辑框编辑框下边超过定位点边界!";
return "题号:[" + tihao + "]批阅分数编辑框下边超过定位点边界!";
}
}
}
if (HideAreaPostionList != "")

View File

@ -1,10 +1,29 @@

/*// 滚动条宽度*/
::-webkit-scrollbar {
width: 8px;
}
/*// 滚动条轨道*/
::-webkit-scrollbar-track {
background: rgb(239, 239, 239);
border-radius: 2px;
}
/*// 小滑块*/
::-webkit-scrollbar-thumb {
background: #044775;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #40a0ff;
}
body {height: 100%; overflow-x:hidden;font-family:'Microsoft YaHei UI'; }
::-webkit-scrollbar {
/*::-webkit-scrollbar {
width: 0;
height: 0;
}
}*/
ul { text-decoration:none; list-style-type:none; }
img { max-width: 100%;}
a, abbr, address, b, blockquote, body, caption, cite, code, dd, del, dfn, div, dl, dt, em, fieldset, form, h1, h2, h3, h4, h5, h6, html, i, iframe, img, ins, kbd, label, legend, li, object, ol, p, pre, q, samp, small, span, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, ul, var {
@ -115,7 +134,7 @@ a, abbr, address, b, blockquote, body, caption, cite, code, dd, del, dfn, div, d
}
.right_list .lineul li div.sm { float:left; width:30px; background:#cd0a0a; text-align:center; padding:5px; height:20px; line-height:20px;}
.right_list .lineul li div.sx { float:left; width:50px; background:#0361e1; color:#fff; text-align:center; padding:5px;height:20px; line-height:20px;}
.right_list .lineul li div.sd { float:left; width:40px; text-align:center; background:#000; color:#fff; text-align:center; padding:5px; float:right;height:20px; line-height:20px; font-size:12px; }
.right_list .lineul li div.sd { float:left; width:40px; text-align:center; background:#000; color:#fff; text-align:center; padding:5px; float:right;height:20px; line-height:20px; font-size:12px; cursor:pointer; }
.right_list .lineul li div.ss {
float: left;
width: 40px;

View File

@ -214,7 +214,7 @@ function SetZhuguanTi() {
$("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" });
$("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' });
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + zhuguan_tihao + "'><div class='sp'><div class='go'>主观题</div></div><div class='sf'>" + zhuguan_tihao + "</div><div class='sm'>" + zhuguan_xiaoti + "</div><div class='ss' idAtt='keguan_" + zhuguan_tihao + "' id='ss_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + zhuguan_tihao + "','主观题')\">" + score + "</div><div class='ssd' id='ssd_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(2,'" + scoretype + "','" + zhuguan_tihao + "','主观题')\">" + scoretypeText + "</div><div class='sd' onclick=\"DeleteKeguanti('" + zhuguan_tihao + "')\">x</div></li>");
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + zhuguan_tihao + "'><div class='sp'><div class='go'>主观题</div></div><div class='sf'>" + zhuguan_tihao + "</div><div class='sm'>" + zhuguan_xiaoti + "</div><div class='ss' idAtt='keguan_" + zhuguan_tihao + "' id='ss_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + zhuguan_tihao + "','主观题')\">" + score + "</div><div class='ssd' id='ssd_" + zhuguan_tihao + "' onclick=\"UpdateBaseData(2,'" + scoretype + "','" + zhuguan_tihao + "','主观题')\">" + scoretypeText + "</div><div class='sd' onclick=\"DeleteKeguanti('" + zhuguan_tihao + "')\">X</div></li>");
//如果是手阅
GetZhuguantiScoreList();
}
@ -329,7 +329,13 @@ function SetMaoDingDian(obj, pageIndex) {
if (pageIndex == 1) {
ocrText = prompt("请输入学科:");
if (ocrText == '' || ocrText == null) {
alert("请输入学科");
alert("请输入学科!");
return;
}
} else {
ocrText = prompt("请输入识别的文字:", ocrText);
if (ocrText == '' || ocrText == null) {
alert("请输入识别的文字!");
return;
}
}
@ -393,10 +399,10 @@ function SetPYPostion(type) {
lineWh = "width:736px;height:30px;";
}
if (score.indexOf(".") > -1) {
alert("题目分数不能有小数点");
return;
}
//if (score.indexOf(".") > -1) {
// alert("题目分数不能有小数点");
// return;
//}
var html = "";