Compare commits
No commits in common. "3dc95e768654daf77df28839ef2a7d3cbc2b8b2b" and "b747fb6378acf44c6af099dd369ee997422264bc" have entirely different histories.
3dc95e7686
...
b747fb6378
|
|
@ -171,7 +171,7 @@ public class CommonUse
|
||||||
message = string.Empty;
|
message = string.Empty;
|
||||||
CommonUse commonUse = new CommonUse();
|
CommonUse commonUse = new CommonUse();
|
||||||
string[] postionc = postionCut.Split(new string[] { "^" }, StringSplitOptions.RemoveEmptyEntries);
|
string[] postionc = postionCut.Split(new string[] { "^" }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
PYPostion = "0,0";
|
PYPostion = "";
|
||||||
Point GrXY;
|
Point GrXY;
|
||||||
int PostionWW = 0;
|
int PostionWW = 0;
|
||||||
int PostionHH = 0;
|
int PostionHH = 0;
|
||||||
|
|
@ -191,11 +191,9 @@ public class CommonUse
|
||||||
//ShowMatWaitKey("123", aaa, 0.8);
|
//ShowMatWaitKey("123", aaa, 0.8);
|
||||||
|
|
||||||
string mx = "";
|
string mx = "";
|
||||||
Rectangle rt = new Rectangle();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY, out message);
|
||||||
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY, out message, out rt);
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -226,7 +224,7 @@ public class CommonUse
|
||||||
}
|
}
|
||||||
if (i == 1)//右上角
|
if (i == 1)//右上角
|
||||||
{
|
{
|
||||||
PostionWW = GrXY.X + rt.Width;
|
PostionWW = GrXY.X;
|
||||||
}
|
}
|
||||||
if (i == 2)//左下角
|
if (i == 2)//左下角
|
||||||
{
|
{
|
||||||
|
|
@ -450,8 +448,8 @@ public class CommonUse
|
||||||
//bool bo = pxNums > 130 && pxNums < 300;
|
//bool bo = pxNums > 130 && pxNums < 300;
|
||||||
bool bo = (CvInvoke.IsContourConvex(approx_curve)
|
bool bo = (CvInvoke.IsContourConvex(approx_curve)
|
||||||
&& (rect.Width > 10 && rect.Height > 10)
|
&& (rect.Width > 10 && rect.Height > 10)
|
||||||
&& (area > 200 && area < 3000)
|
&& (area > 200 && area < 2000)
|
||||||
&& (rect.Width < 80 && rect.Height < 80)
|
&& (rect.Width < 50 && rect.Height < 50)
|
||||||
&& pxNums > 200);
|
&& pxNums > 200);
|
||||||
if (bo)
|
if (bo)
|
||||||
{
|
{
|
||||||
|
|
@ -562,7 +560,7 @@ public class CommonUse
|
||||||
/// <param name="y_num"></param>
|
/// <param name="y_num"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int[] GetTargetGravityFind(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num,
|
public int[] GetTargetGravityFind(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num,
|
||||||
int y_begin, int y_interval, int y_num, out Point gravityXY, out string messag, out Rectangle rectDT)
|
int y_begin, int y_interval, int y_num, out Point gravityXY, out string messag)
|
||||||
{
|
{
|
||||||
messag = string.Empty;
|
messag = string.Empty;
|
||||||
int[] result = new int[x_num];//结果数组
|
int[] result = new int[x_num];//结果数组
|
||||||
|
|
@ -577,7 +575,6 @@ public class CommonUse
|
||||||
Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标
|
Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标
|
||||||
|
|
||||||
gravityXY = new Point(0, 0);
|
gravityXY = new Point(0, 0);
|
||||||
rectDT = new Rectangle(0, 0, 0, 0);
|
|
||||||
for (int i = 0; i < contours.Size; i++)
|
for (int i = 0; i < contours.Size; i++)
|
||||||
{
|
{
|
||||||
VectorOfPoint contour = contours[i];
|
VectorOfPoint contour = contours[i];
|
||||||
|
|
@ -604,7 +601,6 @@ public class CommonUse
|
||||||
gravityXY = gravity[i];
|
gravityXY = gravity[i];
|
||||||
gravityXY.X = rect.X;
|
gravityXY.X = rect.X;
|
||||||
gravityXY.Y = rect.Y;
|
gravityXY.Y = rect.Y;
|
||||||
rectDT = rect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (result[x_id] != -1)
|
//if (result[x_id] != -1)
|
||||||
|
|
@ -1058,11 +1054,11 @@ public class CommonUse
|
||||||
/// <param name="strText">输出文字</param>
|
/// <param name="strText">输出文字</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string GetValueAndDrawGrid_Find(Bitmap img, VectorOfVectorOfPoint contours,
|
public string GetValueAndDrawGrid_Find(Bitmap img, VectorOfVectorOfPoint contours,
|
||||||
int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText, out Point pFindX, out string message, out Rectangle rt)
|
int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText, out Point pFindX, out string message)
|
||||||
{
|
{
|
||||||
//画网格
|
//画网格
|
||||||
Point pFind;
|
Point pFind;
|
||||||
int[] intArray = GetTargetGravityFind(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num, out pFind, out message, out rt);
|
int[] intArray = GetTargetGravityFind(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num, out pFind, out message);
|
||||||
int maxValue = GetMaxValueOfArray(intArray);//数组最大值
|
int maxValue = GetMaxValueOfArray(intArray);//数组最大值
|
||||||
pFindX = pFind;
|
pFindX = pFind;
|
||||||
string str = "";
|
string str = "";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
using PaddleOCRSharp;
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
public class OcrHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
//private static TesseractEngine engine = new TesseractEngine("./ocr_models", "chi_sim");
|
||||||
|
//public static OCRResult GetOcrResult(Bitmap bitmap)
|
||||||
|
//{
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// using var tempBitmap = new Bitmap(bitmap);
|
||||||
|
// var ocrResult = paddleOCREngine.DetectText(tempBitmap);
|
||||||
|
// return ocrResult;
|
||||||
|
// }
|
||||||
|
// catch (Exception ex)
|
||||||
|
// {
|
||||||
|
// ExceptionNotice.SendAsync(ex, "Ocr文字识别异常!");
|
||||||
|
// throw;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
private static string RootDirectory = EngineBase.GetRootDirectory().TrimEnd('\\') + "\\inference";
|
||||||
|
|
||||||
|
//建议程序全局初始化一次即可,不必每次识别都初始化,容易报错。
|
||||||
|
private static PaddleOCREngine paddleOCREngine = paddleOCREngine = new PaddleOCREngine(new OCRModelConfig()
|
||||||
|
{
|
||||||
|
det_infer = RootDirectory + "\\ch_PP-OCRv3_det_infer",
|
||||||
|
cls_infer= RootDirectory + "\\ch_ppocr_mobile_v2.0_cls_infer",
|
||||||
|
rec_infer = RootDirectory + "\\ch_PP-OCRv3_rec_infer",
|
||||||
|
keys = RootDirectory + "\\ppocr_keys.txt",
|
||||||
|
}, new OCRParameter());
|
||||||
|
|
||||||
|
public static OCRResult GetOcrResult(Bitmap bitmap)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var tempBitmap = new Bitmap(bitmap))
|
||||||
|
{
|
||||||
|
return paddleOCREngine.DetectText(tempBitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OCRResult GetOcrResult(byte[] bytes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var ocrResult = paddleOCREngine.DetectText(bytes);
|
||||||
|
return ocrResult;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -352,13 +352,6 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 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>
|
|
||||||
<ul id="NowSelect" class="lineul" style="overflow-y: scroll; height: 240px;">
|
<ul id="NowSelect" class="lineul" style="overflow-y: scroll; height: 240px;">
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ using Emgu.CV.Flann;
|
||||||
using System.Data.SqlTypes;
|
using System.Data.SqlTypes;
|
||||||
using System.Security.AccessControl;
|
using System.Security.AccessControl;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
public partial class 外部答题卡_Default : System.Web.UI.Page
|
public partial class 外部答题卡_Default : System.Web.UI.Page
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +56,6 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
|
||||||
case 1:
|
case 1:
|
||||||
UpdateTempData();
|
UpdateTempData();
|
||||||
break;
|
break;
|
||||||
// 锁定
|
|
||||||
case 2:
|
case 2:
|
||||||
LockTemp();
|
LockTemp();
|
||||||
break;
|
break;
|
||||||
|
|
@ -323,7 +321,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
|
||||||
Response.Write("NO PICTURE");
|
Response.Write("NO PICTURE");
|
||||||
}
|
}
|
||||||
string[] GetData = totalHtml.Split('$');
|
string[] GetData = totalHtml.Split('$');
|
||||||
string PYPostionList = "0,0";
|
string PYPostionList = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -515,11 +513,7 @@ public partial class 外部答题卡_Default : System.Web.UI.Page
|
||||||
int wL = Convert.ToInt32(W / xuanXiang);
|
int wL = Convert.ToInt32(W / xuanXiang);
|
||||||
int hL = Convert.ToInt32(H / tiliang);
|
int hL = Convert.ToInt32(H / tiliang);
|
||||||
|
|
||||||
|
|
||||||
Image<Gray, byte> bytimg = GetMatCutImg(color_mat.Bitmap, X, Y, W, H);
|
Image<Gray, byte> bytimg = GetMatCutImg(color_mat.Bitmap, X, Y, W, H);
|
||||||
//Bitmap bmp = ScaleToSize(tempImage.Bitmap, tempImage.Bitmap.Width * 4, tempImage.Bitmap.Height * 4, groupNo);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
X = 0; Y = 0;
|
X = 0; Y = 0;
|
||||||
Mat src = bytimg.Mat;
|
Mat src = bytimg.Mat;
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,8 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
Score_float,
|
Score_float,
|
||||||
smallQuestionNum_int,
|
smallQuestionNum_int,
|
||||||
questiontype_int,
|
questiontype_int,
|
||||||
mkscoretype_float,
|
mkscoretype_float) VALUES
|
||||||
Createdtime_datetime,selectNum_int,selecttype_int,is_split) VALUES
|
({0},{1},{2},{3},{4},1,{5});select @@IDENTITY",
|
||||||
({0},{1},{2},{3},{4},1,{5},now(),0,-1,0);select @@IDENTITY",
|
|
||||||
TemDataID,
|
TemDataID,
|
||||||
"'" + questionList[4] + "'",
|
"'" + questionList[4] + "'",
|
||||||
"''",
|
"''",
|
||||||
|
|
@ -182,7 +181,7 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
}
|
}
|
||||||
|
|
||||||
//写入任务表
|
//写入任务表
|
||||||
sql = "Insert Into mk_subjective_cut_record(temp_main_id,temp_detail_id,temp_question_num,is_cutout,exam_subject_id,temp_question_Newdata_ids,subjective_questions_data,cutted_question_num,create_date) VALUES(" + tempMainID + "," + TemDataID + ",'" + questionNum + "'," + is_cutout + "," + exam_subject_id + ",'" + ids.Trim(',') + "','" + zhuguantiList + "','" + questionNumList + "',now())";
|
sql = "Insert Into mk_subjective_cut_record(temp_main_id,temp_detail_id,temp_question_num,is_cutout,exam_subject_id,temp_question_Newdata_ids,subjective_questions_data,cutted_question_num) VALUES(" + tempMainID + "," + TemDataID + ",'" + questionNum + "'," + is_cutout + "," + exam_subject_id + ",'" + ids.Trim(',') + "','" + zhuguantiList + "','" + questionNumList + "')";
|
||||||
new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp);
|
new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -221,14 +220,8 @@ public partial class Temp_SplitQuestion : System.Web.UI.Page
|
||||||
/// <param name="getdata"></param>
|
/// <param name="getdata"></param>
|
||||||
private string TempV(string GetData, string PYPostionList, int oldWidth, int oldHeight)
|
private string TempV(string GetData, string PYPostionList, int oldWidth, int oldHeight)
|
||||||
{
|
{
|
||||||
|
double pyLeft = Convert.ToInt32(PYPostionList.Split(',')[0]);
|
||||||
double pyLeft=0, pyTop = 0;
|
double pyTop = Convert.ToInt32(PYPostionList.Split(',')[1]);
|
||||||
if (!string.IsNullOrWhiteSpace(PYPostionList) && PYPostionList.Contains(","))
|
|
||||||
{
|
|
||||||
pyLeft = Convert.ToInt32(PYPostionList.Split(',')[0]);
|
|
||||||
pyTop = Convert.ToInt32(PYPostionList.Split(',')[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
double Xtop = 0;
|
double Xtop = 0;
|
||||||
double Xleft = 0;
|
double Xleft = 0;
|
||||||
double Xwidth = 0;
|
double Xwidth = 0;
|
||||||
|
|
|
||||||
|
|
@ -677,11 +677,10 @@ public class MK_Operater
|
||||||
int H = Convert.ToInt32(Convert.ToDouble(postCutList[3]));
|
int H = Convert.ToInt32(Convert.ToDouble(postCutList[3]));
|
||||||
//commonUse.DrawGridByXY(测试查找坐标.myFrom.PB_guodu, X, W, 1, Y, H, 1);Response.Write(ImgToBase64String(bmp));
|
//commonUse.DrawGridByXY(测试查找坐标.myFrom.PB_guodu, X, W, 1, Y, H, 1);Response.Write(ImgToBase64String(bmp));
|
||||||
string mx = "";
|
string mx = "";
|
||||||
Rectangle rt = new Rectangle();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string message = string.Empty;
|
string message = string.Empty;
|
||||||
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY,out message ,out rt);
|
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY,out message);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -747,11 +746,10 @@ public class MK_Operater
|
||||||
int W = Convert.ToInt32(Convert.ToDouble(postCutList[2]));
|
int W = Convert.ToInt32(Convert.ToDouble(postCutList[2]));
|
||||||
int H = Convert.ToInt32(Convert.ToDouble(postCutList[3]));
|
int H = Convert.ToInt32(Convert.ToDouble(postCutList[3]));
|
||||||
string mx = "";
|
string mx = "";
|
||||||
Rectangle rt = new Rectangle();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string message = string.Empty;
|
string message = string.Empty;
|
||||||
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY,out message ,out rt);
|
mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY,out message);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
@ -773,7 +771,7 @@ public class MK_Operater
|
||||||
}
|
}
|
||||||
if (i == 1)//右上角
|
if (i == 1)//右上角
|
||||||
{
|
{
|
||||||
PostionWW = GrXY.X+ rt.Width;
|
PostionWW = GrXY.X;
|
||||||
}
|
}
|
||||||
if (i == 2)//左下角
|
if (i == 2)//左下角
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -150,81 +150,20 @@
|
||||||
<input type="button" class="btn_XY" value="左倾斜" onclick="PicRotate(0)" style="float: left; padding: 10px; padding-left: 30px; padding-right: 30px; font-size: 14px; margin-left: 150px; margin-right: 10px;" />
|
<input type="button" class="btn_XY" value="左倾斜" onclick="PicRotate(0)" style="float: left; padding: 10px; padding-left: 30px; padding-right: 30px; font-size: 14px; margin-left: 150px; margin-right: 10px;" />
|
||||||
<input type="button" class="btn_XY" value="右倾斜" onclick="PicRotate(1)" style="float: left; padding: 10px; padding-left: 30px; padding-right: 30px; margin-right: 10px; font-size: 14px; margin-left: 10px;" />
|
<input type="button" class="btn_XY" value="右倾斜" onclick="PicRotate(1)" style="float: left; padding: 10px; padding-left: 30px; padding-right: 30px; margin-right: 10px; font-size: 14px; margin-left: 10px;" />
|
||||||
<label style="float: left; padding: 10px; margin-right: 10px; font-size: 14px; margin-left: 10px;">卷子是否存在定位点:</label>
|
<label style="float: left; padding: 10px; margin-right: 10px; font-size: 14px; margin-left: 10px;">卷子是否存在定位点:</label>
|
||||||
<select id="select_ishaspostion" style="float: left; padding: 10px; padding-left: 10px; padding-right: 10px; margin-right: 10px; font-size: 14px; margin-left: 10px;" disabled>
|
<select id="select_ishaspostion" style="float: left; padding: 10px; padding-left: 10px; padding-right: 10px; margin-right: 10px; font-size: 14px; margin-left: 10px;">
|
||||||
<option value="1">有定位点</option>
|
<option value="1">有定位点</option>
|
||||||
<option value="0">无定位点</option>
|
<option value="0">无定位点</option>
|
||||||
</select>
|
</select>
|
||||||
<script>
|
<script>
|
||||||
$("#select_ishaspostion").val("<%=ishaspostion%>");
|
$("#select_ishaspostion").val("<%=ishaspostion%>");
|
||||||
var originalValue = $("#select_ishaspostion").val();
|
|
||||||
$("#select_ishaspostion").change(function () {
|
$("#select_ishaspostion").change(function () {
|
||||||
var groupNo ="<%=GroupNo %>";
|
if ($(this).val() == 0) {
|
||||||
var batchId ="<%=BatchID %>";
|
document.location.href = document.location.href.replace("ishaspostion=1", "ishaspostion=0");
|
||||||
|
|
||||||
if (confirm("该操作将重置当前模板数据,是否继续?")) {
|
|
||||||
let token = localStorage.getItem("token");
|
|
||||||
if (!token) {
|
|
||||||
$("#select_ishaspostion").val(originalValue)
|
|
||||||
alert("登录失效,请重新登录后再试!");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var url = 'http://192.168.2.9:6500/api/';
|
|
||||||
if (window.location.hostname.includes("w.23544.com")) {
|
|
||||||
url = "https://mka.w.23544.com:8843/api/";
|
|
||||||
} else if (window.location.hostname.includes("23544.com")) {
|
|
||||||
url = "https://mk-api.23544.com/ad/api/";
|
|
||||||
} else if (window.location.hostname.includes("localhost")) {
|
|
||||||
url = "http://192.168.2.8:6500/api/";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (groupNo) {
|
|
||||||
url += "ocr/onepaper-tmp?paperNum=" + groupNo + "&isReset=true"
|
|
||||||
} else if (batchId) {
|
|
||||||
url += "ocr/batch-tmp?batchNo=" + batchId + "&isReset=true"
|
|
||||||
}
|
|
||||||
var newValue = $(this).val();
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: url,
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Authorization": token
|
|
||||||
},
|
|
||||||
success: function (response) {
|
|
||||||
// 请求成功时的处理逻辑
|
|
||||||
if (response.code != 200) {
|
|
||||||
alert(response.message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (newValue == 0) {
|
|
||||||
window.location.href = response.data.replace("ishaspostion=1", "ishaspostion=0");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.location.href = response.data.replace("ishaspostion=0", "ishaspostion=1");
|
document.location.href = document.location.href.replace("ishaspostion=0", "ishaspostion=1");
|
||||||
}
|
}
|
||||||
},
|
|
||||||
error: function (xhr, status, error) {
|
|
||||||
// 请求失败时的处理逻辑
|
|
||||||
if (xhr.status == 401) {
|
|
||||||
alert("登录失效,请重新登录后再试!")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
alert("请求失败:" + error);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if ($(this).val() == 0) {
|
|
||||||
// document.location.href = document.location.href.replace("ishaspostion=1", "ishaspostion=0");
|
|
||||||
//}
|
|
||||||
//else {
|
|
||||||
// document.location.href = document.location.href.replace("ishaspostion=0", "ishaspostion=1");
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#select_ishaspostion").val(originalValue)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ using Emgu.CV.Flann;
|
||||||
using System.Data.SqlTypes;
|
using System.Data.SqlTypes;
|
||||||
using System.Security.AccessControl;
|
using System.Security.AccessControl;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using Microsoft.SqlServer.Server;
|
|
||||||
|
|
||||||
public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
||||||
{
|
{
|
||||||
|
|
@ -96,12 +95,12 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(GroupNo))
|
if (!string.IsNullOrEmpty(GroupNo))
|
||||||
{
|
{
|
||||||
sql = "select * from MK_TempleteDataUserOnePaper where DetaID_bigint=" + TempID + " AND GroupNo_varchar='" + GroupNo + "'";
|
sql = "select * from MK_TempleteDataUserOnePaper where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID + " AND GroupNo_varchar='" + GroupNo + "'";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(BatchID))
|
if (!string.IsNullOrEmpty(BatchID))
|
||||||
{
|
{
|
||||||
sql = "select * from MK_TempleteDataUserBatch where DetaID_bigint=" + TempID + " AND BatchID_nvarchar='" + BatchID + "'";
|
sql = "select * from MK_TempleteDataUserBatch where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID + " AND BatchID_nvarchar='" + BatchID + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -166,7 +165,7 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
||||||
MySqlParameter[] sp;
|
MySqlParameter[] sp;
|
||||||
if (BatchID != "")
|
if (BatchID != "")
|
||||||
{
|
{
|
||||||
sql = "Update MK_TempleteDataUserBatch SET Rotate_float=@Rotate_float, TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar,islocked_int=1 where DetaID_bigint=" + TempID + " AND BatchID_nvarchar='" + BatchID + "'";
|
sql = "Update MK_TempleteDataUserBatch SET Rotate_float=@Rotate_float, TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar,islocked_int=1 where DetaID_bigint=" + TempID + " AND UserID_bigint=" + Convert.ToInt64(UserID) + " AND BatchID_nvarchar='" + BatchID + "'";
|
||||||
sp = new MySqlParameter[] {
|
sp = new MySqlParameter[] {
|
||||||
new MySqlParameter("@TempValue_nvarchar",totalHtml),
|
new MySqlParameter("@TempValue_nvarchar",totalHtml),
|
||||||
new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList),
|
new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList),
|
||||||
|
|
@ -176,7 +175,7 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
||||||
else if (GroupNo != "")
|
else if (GroupNo != "")
|
||||||
{
|
{
|
||||||
|
|
||||||
sql = "Update MK_TempleteDataUserOnePaper SET Rotate_float=@Rotate_float, TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar,islocked_int=1 where DetaID_bigint=" + TempID + " AND GroupNo_varchar='" + GroupNo + "'";
|
sql = "Update MK_TempleteDataUserOnePaper SET Rotate_float=@Rotate_float, TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar,islocked_int=1 where DetaID_bigint=" + TempID + " AND UserID_bigint=" + Convert.ToInt64(UserID) + " AND GroupNo_varchar='" + GroupNo + "'";
|
||||||
sp = new MySqlParameter[] {
|
sp = new MySqlParameter[] {
|
||||||
new MySqlParameter("@TempValue_nvarchar",totalHtml),
|
new MySqlParameter("@TempValue_nvarchar",totalHtml),
|
||||||
new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList),
|
new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList),
|
||||||
|
|
@ -393,49 +392,39 @@ public partial class Temp_UserNoPostionTemp : System.Web.UI.Page
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CommonUse commonUse = new CommonUse();
|
CommonUse commonUse = new CommonUse();
|
||||||
string BatchID = Globals.Request("BatchID");
|
|
||||||
string GroupNo = Globals.Request("GroupNo");
|
|
||||||
long TempID = Convert.ToInt64(Globals.Request("TempID"));
|
long TempID = Convert.ToInt64(Globals.Request("TempID"));
|
||||||
string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
|
string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UserID;
|
||||||
if (BatchID != "")
|
|
||||||
{
|
|
||||||
sql = @"select * from MK_TempleteDataUserBatch where DetaID_bigint=" + TempID + " AND BatchID_nvarchar='" + BatchID + "'";
|
|
||||||
}
|
|
||||||
else if (GroupNo != "")
|
|
||||||
{
|
|
||||||
sql = @"select * from MK_TempleteDataUserOnePaper where DetaID_bigint=" + TempID + " AND GroupNo_varchar='" + GroupNo + "'";
|
|
||||||
}
|
|
||||||
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
|
DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql);
|
||||||
if (dt.Rows.Count <= 0)
|
if (dt.Rows.Count <= 0)
|
||||||
{
|
{
|
||||||
Response.Write("NO DATA");
|
Response.Write("NO DATA");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString());
|
Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString());
|
||||||
|
|
||||||
////var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap);
|
//var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap);
|
||||||
//if (PictureBoxBitMap == null)
|
if (PictureBoxBitMap == null)
|
||||||
//{
|
{
|
||||||
// Response.Write("NO PICTURE");
|
Response.Write("NO PICTURE");
|
||||||
//}
|
}
|
||||||
//string[] GetData = totalHtml.Split('$');
|
string[] GetData = totalHtml.Split('$');
|
||||||
//string PYPostionList = "";
|
string PYPostionList = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//int width = Convert.ToInt32(GetData[6].Split(',')[0]);
|
int width = Convert.ToInt32(GetData[6].Split(',')[0]);
|
||||||
//int height = Convert.ToInt32(GetData[6].Split(',')[1]);
|
int height = Convert.ToInt32(GetData[6].Split(',')[1]);
|
||||||
//PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height);
|
PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height);
|
||||||
//Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap);
|
Image<Gray, byte> imagex = new Image<Gray, byte>(PictureBoxBitMap);
|
||||||
//Mat mat_threshold1 = new Mat();
|
Mat mat_threshold1 = new Mat();
|
||||||
//CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
|
CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv);
|
||||||
//Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1);
|
Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1);
|
||||||
//VectorOfVectorOfPoint selected_contours1;
|
VectorOfVectorOfPoint selected_contours1;
|
||||||
//selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1);
|
selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1);
|
||||||
//Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
|
Image<Gray, byte> currentFramext = new Image<Gray, byte>(PictureBoxBitMap);
|
||||||
|
|
||||||
//int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
|
int PageIndex = Convert.ToInt32(Globals.Request("PageIndex"));
|
||||||
//if (PageIndex == 1)
|
//if (PageIndex == 1)
|
||||||
//{
|
//{
|
||||||
// int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]);
|
// int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]);
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ function SetKeguanTi() {
|
||||||
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
|
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
|
||||||
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
|
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
|
||||||
var listtypeText = listtype == 0 ? "横向" : "竖向";
|
var listtypeText = listtype == 0 ? "横向" : "竖向";
|
||||||
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihaoM + "</div> <div class='sm'>" + selectNum + "</div><div class='ss' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sx'>" + listtypeText + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
|
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihaoM + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
|
||||||
|
|
||||||
}
|
}
|
||||||
function DeleteKeguanti(tihao) {
|
function DeleteKeguanti(tihao) {
|
||||||
|
|
@ -959,7 +959,7 @@ function SetKeguanTiPostion(PostionData) {
|
||||||
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
|
$("#keguan_" + tihao).draggable({ containment: ".main_papermain" });
|
||||||
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
|
$("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放
|
||||||
var listtypeText = listtype == 0 ? "横向" : "竖向";
|
var listtypeText = listtype == 0 ? "横向" : "竖向";
|
||||||
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihao + "</div> <div class='sm'>" + selectNum + "</div><div class='ss' id='ss_" + tihao + "' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sx'>" + listtypeText + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
|
$("#NowSelect").append("<li style='background:#fff;' id='selectNow_" + tihao + "' ><div class='sp'><div class='go'>" + questionHtml + "</div></div><div class='sf'>" + tihao + "</div> <div class='sm'>" + selectNum + "</div><div class='sx'>" + listtypeText + "</div><div class='ss' id='ss_" + tihao + "' idAtt='keguan_" + tihao + "' onclick=\"UpdateBaseData(1,'" + score + "','" + tihao + "','客观题')\">" + score + "</div><div class='sd' onclick=\"DeleteKeguanti('" + tihao + "')\">x</div></li>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -482,7 +482,6 @@ function GetBiaoZhunDianPostion() {
|
||||||
$(".biaozhundian_select").each(function () {
|
$(".biaozhundian_select").each(function () {
|
||||||
xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("wenzimiaoshu") + "^";
|
xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("wenzimiaoshu") + "^";
|
||||||
})
|
})
|
||||||
|
|
||||||
return xy.trim('^');
|
return xy.trim('^');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -688,19 +687,6 @@ function BaseDataBind() {
|
||||||
SetPyPostion(piyueList);
|
SetPyPostion(piyueList);
|
||||||
GetZhuguantiScoreList();
|
GetZhuguantiScoreList();
|
||||||
SetBiaoZhunDianPostion(biaozhundian);
|
SetBiaoZhunDianPostion(biaozhundian);
|
||||||
|
|
||||||
if (IsPostionValue == "1" || IsPostionValue == "True") {
|
|
||||||
|
|
||||||
|
|
||||||
$(".main_tabletop").draggable("destroy")
|
|
||||||
$(".main_tabletop").resizable("destroy")
|
|
||||||
|
|
||||||
for (var i = 0; i <= 3;i++) {
|
|
||||||
$("#draggable_" + i).draggable({ containment: ".main_papermain" });
|
|
||||||
$("#draggable_" + i).resizable({ containment: ".main_papermain", handles: 'all' });
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
|
|
||||||
var islocked = $("#islocked").val();
|
var islocked = $("#islocked").val();
|
||||||
if (islocked == "" || islocked == "null" || islocked == "False" || islocked == "0") {
|
if (islocked == "" || islocked == "null") {
|
||||||
islocked = 0;
|
islocked = 0;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
islocked = 1;
|
|
||||||
}
|
|
||||||
//设置页面大小
|
//设置页面大小
|
||||||
function ChangePageSize(obj) {
|
function ChangePageSize(obj) {
|
||||||
$(".main_papermain").width(obj.value);
|
$(".main_papermain").width(obj.value);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net48" />
|
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net48" />
|
||||||
|
<package id="PaddleOCRSharp" version="4.0.1" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
Reference in New Issue