From f4e622d70c5d207accac8af304ae448ad3684da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=20=E6=9D=A8?= Date: Thu, 15 Jun 2023 14:11:37 +0800 Subject: [PATCH] init --- .gitattributes | 63 ++ .gitignore | 363 +++++++++ .vscode/settings.json | 3 + App_Code/CommonUse.cs | 1494 +++++++++++++++++++++++++++++++++++ Marking.Template.sln | 40 + Temp/Default.aspx | 263 ++++++ Temp/Default.aspx.cs | 1043 ++++++++++++++++++++++++ Temp/GetUseImageMap.aspx | 33 + Temp/GetUseImageMap.aspx.cs | 23 + Temp/SplitQuestion.aspx | 321 ++++++++ Temp/SplitQuestion.aspx.cs | 406 ++++++++++ Temp/SuccessCut.aspx | 13 + Temp/SuccessCut.aspx.cs | 14 + Temp/TempDraw.aspx | 1 + Temp/TempDraw.aspx.cs | 881 +++++++++++++++++++++ Temp/UserTemp.aspx | 170 ++++ Temp/UserTemp.aspx.cs | 263 ++++++ Web.Debug.config | 32 + Web.config | 31 + css/SplitQuestion.css | 70 ++ css/default.css | 322 ++++++++ css/index.css | 85 ++ js/index.js | 1168 +++++++++++++++++++++++++++ js/indexuser.js | 707 +++++++++++++++++ js/jquery-1.10.2.min.js | 66 ++ js/jquery.cookie.js | 117 +++ 26 files changed, 7992 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 App_Code/CommonUse.cs create mode 100644 Marking.Template.sln create mode 100644 Temp/Default.aspx create mode 100644 Temp/Default.aspx.cs create mode 100644 Temp/GetUseImageMap.aspx create mode 100644 Temp/GetUseImageMap.aspx.cs create mode 100644 Temp/SplitQuestion.aspx create mode 100644 Temp/SplitQuestion.aspx.cs create mode 100644 Temp/SuccessCut.aspx create mode 100644 Temp/SuccessCut.aspx.cs create mode 100644 Temp/TempDraw.aspx create mode 100644 Temp/TempDraw.aspx.cs create mode 100644 Temp/UserTemp.aspx create mode 100644 Temp/UserTemp.aspx.cs create mode 100644 Web.Debug.config create mode 100644 Web.config create mode 100644 css/SplitQuestion.css create mode 100644 css/default.css create mode 100644 css/index.css create mode 100644 js/index.js create mode 100644 js/indexuser.js create mode 100644 js/jquery-1.10.2.min.js create mode 100644 js/jquery.cookie.js diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3d308ea --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 6601 +} \ No newline at end of file diff --git a/App_Code/CommonUse.cs b/App_Code/CommonUse.cs new file mode 100644 index 0000000..dad6cdb --- /dev/null +++ b/App_Code/CommonUse.cs @@ -0,0 +1,1494 @@ +using Emgu.CV; +using Emgu.CV.CvEnum; +using Emgu.CV.Structure; +using Emgu.CV.UI; +using Emgu.CV.Util; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + + +public class CommonUse +{ + /// + /// 获取给定图像的最大矩形边界 + /// + /// + /// + public VectorOfVectorOfPoint GetBoundaryOfPic(Mat src) + { + Mat dst = new Mat(); + Mat src_gray = new Mat(); + CvInvoke.CvtColor(src, src_gray, Emgu.CV.CvEnum.ColorConversion.Bgr2Gray); + + //边缘检测 + CvInvoke.Canny(src_gray, dst, 20, 255, 3, true); + + //寻找答题卡矩形边界(最大的矩形) + VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//创建VectorOfVectorOfPoint数据类型用于存储轮廓 + + CvInvoke.FindContours(dst, contours, null, Emgu.CV.CvEnum.RetrType.External, Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);//提取轮廓 + + VectorOfVectorOfPoint max_contour = new VectorOfVectorOfPoint();//用于存储筛选过后的轮廓 + + int ksize = contours.Size; //获取连通区域个数 + if (ksize == 1) + { + max_contour = contours; + } + else + { + //double maxLength = -1;//用于保存轮廓周长的最大值 + double maxArea = -1;//面积 + int index = -1;//轮廓周长的最大值的序号 + for (int i = 0; i < ksize; i++) + { + VectorOfPoint contour = contours[i];//获取独立的连通轮廓 + //double length = CvInvoke.ArcLength(contour, true);//计算连通轮廓的周长 + + //if (length > maxLength) + //{ + // maxLength = length; + // index = i; + //} + + double area = CvInvoke.ContourArea(contour, false); + if (area > maxArea) + { + maxArea = area; + index = i; + } + } + max_contour.Push(contours[index]);//筛选后的连通轮廓 + } + return max_contour; + } + + /// + /// 进行透视操作,获取矫正后图像 + /// + /// + /// + public Mat MyWarpPerspective(Mat src, VectorOfVectorOfPoint max_contour) + { + //拟合答题卡的几何轮廓,保存点集pts并顺时针排序 + VectorOfPoint pts = new VectorOfPoint();//用于存放逼近的结果 + VectorOfPoint tempContour = max_contour[0];//临时用 + double result_length = CvInvoke.ArcLength(tempContour, true); + CvInvoke.ApproxPolyDP(tempContour, pts, result_length * 0.02, true); //几何逼近,获取矩形4个顶点坐标 + + if (pts.Size != 4) + { + //最大轮廓不是矩形时,将原图转灰度图后返回 + Mat src_gray = new Mat(); + CvInvoke.CvtColor(src, src_gray, Emgu.CV.CvEnum.ColorConversion.Bgr2Gray);//转灰度图 + return src_gray; + } + else + { + //Point[]转换为PointF[]类型 + PointF[] pts_src = Array.ConvertAll(pts.ToArray(), new Converter(PointToPointF)); + + //点集顺时针排序 + pts_src = SortPointsByClockwise(pts_src); + + //确定透视变换的宽度、高度 + Size sizeOfRect = CalSizeOfRect(pts_src); + int width = src.Bitmap.Width; + int height = src.Bitmap.Height; + + //计算透视变换矩阵 + PointF[] pts_target = new PointF[] { new PointF(0, 0), new PointF(width - 1, 0) , + new PointF(width - 1, height - 1) ,new PointF(0, height - 1)}; + + //计算透视矩阵 + Mat data = CvInvoke.GetPerspectiveTransform(pts_src, pts_target); + //进行透视操作 + Mat src_gray = new Mat(); + Mat mat_Perspective = new Mat(); + CvInvoke.CvtColor(src, src_gray, Emgu.CV.CvEnum.ColorConversion.Bgr2Gray); + CvInvoke.WarpPerspective(src_gray, mat_Perspective, data, new Size(width, height)); + + return mat_Perspective; + } + } + + /// + /// 根据给定XY初始坐标、间距、数量画网格 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public Bitmap DrawGridByXYDraw(Bitmap bmp, int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num) + { + + + Mat src = new Image(bmp).Mat; + //转换颜色空间 + Mat mat_color = new Mat(); + if (src.NumberOfChannels == 1) + CvInvoke.CvtColor(src, mat_color, Emgu.CV.CvEnum.ColorConversion.Gray2Bgr); + else + mat_color = src; + + for (int i = 0; i <= x_num; i++) + { + //先画竖线 + Point p1 = new Point(x_begin + x_interval * i, y_begin); + Point p2 = new Point(x_begin + x_interval * i, y_begin + y_interval * y_num); + CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 2); + } + for (int i = 0; i <= y_num; i++) + { + //再画横线 + Point p1 = new Point(x_begin, y_begin + y_interval * i); + Point p2 = new Point(x_begin + x_interval * x_num, y_begin + y_interval * i); + CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 2); + } + return mat_color.Bitmap; + } + + /// + /// 获取偏移量 通过矩形查找 + /// + /// + /// + /// + /// + /// + /// + public Mat GetPostionXYByFindPostionAndXieLv(Mat color_mat, VectorOfVectorOfPoint selected_contours, string postionCut, out string PYPostion, Image currentFrame, out double xielv) + { + + + CommonUse commonUse = new CommonUse(); + string[] postionc = postionCut.Split('^'); + PYPostion = ""; + Point GrXY; + int PostionWW = 0; + int PostionHH = 0; + + int Y2 = 0, Y1 = 0, X2 = 0, X1 = 0; + + for (int i = 0; i < postionc.Length; i++) + { + string[] postCutList = postionc[i].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(postCutList[0])); + int Y = Convert.ToInt32(Convert.ToDouble(postCutList[1])); + int W = Convert.ToInt32(Convert.ToDouble(postCutList[2])); + int H = Convert.ToInt32(Convert.ToDouble(postCutList[3])); + + + + string mx = ""; + try + { + mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY); + } + catch + { + xielv = -100; + return null; + mx = "null"; + GrXY = new Point(0, 0); + } + + if (mx.Trim() != "A") + { + xielv = -100; + return null; + break; + } + Point Mx = GrXY; + if (i == 0)//左上角 + { + PYPostion = GrXY.X + "," + GrXY.Y; + Y1 = GrXY.Y; + X1 = GrXY.X; + } + if (i == 1)//右上角 + { + PostionWW = GrXY.X; + } + if (i == 2)//左下角 + { + PostionHH = GrXY.Y; + X2 = GrXY.X; + Y2 = GrXY.Y; + } + } + string[] posList = PYPostion.Split(','); + xielv = Math.Atan2((Y2 - Y1), (X2 - X1)) * 180 / Math.PI; + int PostionX = Convert.ToInt32(posList[0]); + int PostionY = Convert.ToInt32(posList[1]); + int PostionW = PostionWW - PostionX; + int PostionH = PostionHH - PostionY; + //裁剪 + Rectangle rectangle = new Rectangle(PostionX, PostionY, PostionW, PostionH); + Image Sub = new Image(currentFrame.Bitmap).GetSubRect(rectangle); + Image CropImage = new Image(Sub.Size); + CvInvoke.cvCopy(Sub, CropImage, IntPtr.Zero); + //获取偏移量 + return CropImage.Mat; + + } + + /// + /// 将给定点集顺时针排序 + /// + /// 四边形四个顶点组成的点集 + /// + public PointF[] SortPointsByClockwise(PointF[] pts_src) + { + if (pts_src.Length != 4) return null;//确保为四边形 + + //求四边形中心点?坐标 + float x_average = 0; + float y_average = 0; + float x_sum = 0; + float y_sum = 0; + for (int i = 0; i < 4; i++) + { + x_sum += pts_src[i].X; + y_sum += pts_src[i].Y; + } + x_average = x_sum / 4; + y_average = y_sum / 4; + PointF center = new PointF(x_average, y_average); + + PointF[] result = new PointF[4]; + for (int i = 0; i < 4; i++) + { + if (pts_src[i].X < center.X && pts_src[i].Y < center.Y) + { + result[0] = pts_src[i];//左上角点 + continue; + } + if (pts_src[i].X > center.X && pts_src[i].Y < center.Y) + { + result[1] = pts_src[i];//右上角点 + continue; + } + if (pts_src[i].X > center.X && pts_src[i].Y > center.Y) + { + result[2] = pts_src[i];//右下角点 + continue; + } + if (pts_src[i].X < center.X && pts_src[i].Y > center.Y) + { + result[3] = pts_src[i];//左下角点 + continue; + } + } + + return result; + } + + /// + /// 计算给定四个坐标点四边形的宽、高 + /// + /// + /// + public Size CalSizeOfRect(PointF[] pts_src) + { + if (pts_src.Length != 4) return new Size(0, 0);//确保为四边形 + + //点集顺时针排序 + pts_src = SortPointsByClockwise(pts_src); + + //确定透视变换的宽度、高度 + int width; + int height; + + double width1 = Math.Pow(pts_src[0].X - pts_src[1].X, 2) + Math.Pow(pts_src[0].Y - pts_src[1].Y, 2); + double width2 = Math.Pow(pts_src[2].X - pts_src[3].X, 2) + Math.Pow(pts_src[2].Y - pts_src[3].Y, 2); + + width = width1 > width2 ? (int)Math.Sqrt(width1) : (int)Math.Sqrt(width2);//根号下a方+b方,且取宽度最大的 + + double height1 = Math.Pow(pts_src[0].X - pts_src[3].X, 2) + Math.Pow(pts_src[0].Y - pts_src[3].Y, 2); + double height2 = Math.Pow(pts_src[1].X - pts_src[2].X, 2) + Math.Pow(pts_src[1].Y - pts_src[2].Y, 2); + + height = height1 > height2 ? (int)Math.Sqrt(height1) : (int)Math.Sqrt(height2); + + return new Size(width, height); + } + + /// + /// Point转换为PointF类型 + /// + /// + /// + public static PointF PointToPointF(Point p) + { + return new PointF(p.X, p.Y); + } + + /// + /// 形态学膨胀 + /// + /// + /// + public Mat MyDilate(Mat mat) + { + //1.膨胀,改善轮廓 + Mat struct_element = CvInvoke.GetStructuringElement(Emgu.CV.CvEnum.ElementShape.Cross, + new Size(3, 3), new Point(-1, -1));//结构元素 + Mat mat_dilate = new Mat(); + CvInvoke.MorphologyEx(mat, mat_dilate, Emgu.CV.CvEnum.MorphOp.Dilate, struct_element, new Point(-1, -1), 1, + Emgu.CV.CvEnum.BorderType.Default, new MCvScalar(0, 0, 0));//形态学膨胀 + + return mat_dilate; + } + + /// + /// 筛选图中符合给定条件的轮廓 + /// + /// 要提取轮廓的图片 + /// 轮廓外接矩形大于该宽度值 + /// 轮廓外接矩形小于该宽度值 + /// 轮廓外接矩形大于该高度值 + /// 轮廓外接矩形小于该高度值 + public VectorOfVectorOfPoint GetUsefulContours(Mat mat, double ratio) + { + VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓 + VectorOfVectorOfPoint selected_contours = new VectorOfVectorOfPoint();//用于存储筛选过后的轮廓 + CvInvoke.FindContours(mat, contours, null, Emgu.CV.CvEnum.RetrType.List, + Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);//提取所有轮廓,操作过程中会对输入图像进行修改 + + //筛选轮廓。筛选条件:长宽比大于给定值 + for (int i = 0; i < contours.Size; i++) + { + Rectangle rect = CvInvoke.BoundingRectangle(contours[i]);//外接矩形 + Mat temp = new Mat(mat, rect);//提取ROI矩形区域 + int pxNums = CvInvoke.CountNonZero(temp);//计算图像内非零像素个数 + + double area = CvInvoke.ContourArea(contours[i]);//计算连通轮廓的面积 + double length = CvInvoke.ArcLength(contours[i], false); //计算连通轮廓的周长 + + VectorOfPoint approx_curve = new VectorOfPoint();//用于存放逼近的结果 + CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.05, true); + bool bo = ((rect.Width > 8 && rect.Height > 3) && (area > 200 && area < 8000) && (rect.Width < 50 && rect.Height < 50) && pxNums > 100); + if (bo) + { + selected_contours.Push(contours[i]); + } + } + + return selected_contours; + } + + /// + /// 筛选图中符合给定条件的轮廓 + /// + /// 要提取轮廓的图片 + /// 轮廓外接矩形大于该宽度值 + /// 轮廓外接矩形小于该宽度值 + /// 轮廓外接矩形大于该高度值 + /// 轮廓外接矩形小于该高度值 + public VectorOfVectorOfPoint GetUsefulContoursDingWei(Mat mat, double ratio) + { + VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓 + VectorOfVectorOfPoint selected_contours = new VectorOfVectorOfPoint();//用于存储筛选过后的轮廓 + CvInvoke.FindContours(mat, contours, null, Emgu.CV.CvEnum.RetrType.List, + Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);//提取所有轮廓,操作过程中会对输入图像进行修改 + + //筛选轮廓。筛选条件:长宽比大于给定值 + for (int i = 0; i < contours.Size; i++) + { + Rectangle rect = CvInvoke.BoundingRectangle(contours[i]);//外接矩形 + Mat temp = new Mat(mat, rect);//提取ROI矩形区域 + int pxNums = CvInvoke.CountNonZero(temp);//计算图像内非零像素个数 + + double area = CvInvoke.ContourArea(contours[i]);//计算连通轮廓的面积 + double length = CvInvoke.ArcLength(contours[i], false); //计算连通轮廓的周长 + + VectorOfPoint approx_curve = new VectorOfPoint();//用于存放逼近的结果 + CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.02, true); + + //外接矩形宽、高需在给定范围内 + // bool bo = (rect.Width / rect.Height >= ratio && (rect.Width > 3 && rect.Height > 2) && (area > 200 && area <= 4500)); + bool bo = ((rect.Width > 3 && rect.Height > 2) && (area > 100 && area <= 15000)); + //bool bo = pxNums > 130 && pxNums < 300; + if (bo) + { + selected_contours.Push(contours[i]); + } + } + return selected_contours; + } + + + + /// + /// 筛选图中符合给定条件的轮廓 + /// + /// 要提取轮廓的图片 + /// 轮廓外接矩形大于该宽度值 + /// 轮廓外接矩形小于该宽度值 + /// 轮廓外接矩形大于该高度值 + /// 轮廓外接矩形小于该高度值 + public VectorOfVectorOfPoint GetUsefulContoursDingWeiSanJiao(Mat mat, double ratio) + { + + VectorOfVectorOfPoint selected_contours = new VectorOfVectorOfPoint(); + using (VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint()) + { + // 参数:输入图像,点向量,,检索类型,方法 + CvInvoke.FindContours(mat, contours, null, RetrType.List, ChainApproxMethod.ChainApproxSimple); + for (int i = 0; i < contours.Size; i++) + { + using (VectorOfPoint contour = contours[i]) //点的标准矢量 + using (VectorOfPoint approxContour = new VectorOfPoint()) + { + // CvInvoke.ApproxPolyDP:指定精度的多边形曲线 参数:输入向量(轮廓),近似轮廓,近似精度,true:则闭合形状 + // CvInvoke.ArcLength:计算轮廓长度 参数:轮廓,曲线是否闭合 + CvInvoke.ApproxPolyDP(contour, approxContour, CvInvoke.ArcLength(contour, true) * 0.08, true); //0.08的相似度 + //CvInvoke.ContourArea:计算轮廓面积 参数:轮廓,返回值是否为绝对值 + //仅考虑面积大于50的轮廓 + if (CvInvoke.ContourArea(approxContour, false) > 500) + { + if (approxContour.Size == 3)//轮廓有3个顶点:三角形 + { + Point[] points = approxContour.ToArray(); //转化为数组 + selected_contours.Push(contours[i]); + } + } + } + } + return selected_contours; + + } + } + + + + + /// + /// 筛选图中符合给定条件的轮廓 + /// + /// 要提取轮廓的图片 + /// 轮廓外接矩形大于该宽度值 + /// 轮廓外接矩形小于该宽度值 + /// 轮廓外接矩形大于该高度值 + /// 轮廓外接矩形小于该高度值 + public VectorOfVectorOfPoint GetUsefulContoursYueJuan(Mat mat, double ratio) + { + VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓 + VectorOfVectorOfPoint selected_contours = new VectorOfVectorOfPoint();//用于存储筛选过后的轮廓 + CvInvoke.FindContours(mat, contours, null, Emgu.CV.CvEnum.RetrType.List, + Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);//提取所有轮廓,操作过程中会对输入图像进行修改 + + //筛选轮廓。筛选条件:长宽比大于给定值 + for (int i = 0; i < contours.Size; i++) + { + Rectangle rect = CvInvoke.BoundingRectangle(contours[i]);//外接矩形 + Mat temp = new Mat(mat, rect);//提取ROI矩形区域 + int pxNums = CvInvoke.CountNonZero(temp);//计算图像内非零像素个数 + + double area = CvInvoke.ContourArea(contours[i]);//计算连通轮廓的面积 + double length = CvInvoke.ArcLength(contours[i], false); //计算连通轮廓的周长 + + VectorOfPoint approx_curve = new VectorOfPoint();//用于存放逼近的结果 + CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.02, true); + + //外接矩形宽、高需在给定范围内 + bool bo = (rect.Width / rect.Height >= ratio && (rect.Width > 3 && rect.Height > 2) && (area > 200 && area <= 4500)); + // bool bo = ((rect.Width > 3 && rect.Height > 2) && (area > 200 && area <= 4500)); + //bool bo = ((rect.Width > 3 && rect.Height > 2) && (area > 200 && area <= 4500)); + //bool bo = pxNums > 130 && pxNums < 300; + if (bo) + { + selected_contours.Push(contours[i]); + } + } + + return selected_contours; + } + + + /// + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + 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) + { + int[] result = new int[x_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < x_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + + gravityXY = new Point(0, 0); + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + int x_id = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval);//向下取整 + int value = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval); + + if (result[x_id] != -1) + { + string str = string.Format("第{0}列存在多个答案!请擦拭干净后再扫描", x_id); + result[x_id] = Convert.ToInt32(result[x_id].ToString() + value.ToString()); + gravityXY = gravity[i]; + + } + else + { + Rectangle rect = CvInvoke.BoundingRectangle(contour); + //这里有修改 + result[x_id] = value; + gravityXY = gravity[i]; + gravityXY.X = rect.X; + gravityXY.Y = rect.Y; + break; + } + } + return result; + } + + + + /// + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public int[] GetTargetValues(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num, + int y_begin, int y_interval, int y_num) + { + int[] result = new int[x_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < x_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + int x_id = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval);//向下取整 + int value = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval); + + if (result[x_id] != -1) + { + string str = string.Format("第{0}列存在多个答案!请擦拭干净后再扫描", x_id); + //MessageBox.Show(x_id.ToString()); + result[x_id] = Convert.ToInt32(result[x_id].ToString() + value.ToString()); + //result[x_id] = -1; + } + else + { + result[x_id] = value; + } + } + return result; + } + + /// + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public int[] GetTargetValuesOnlyOne(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num, + int y_begin, int y_interval, int y_num) + { + int[] result = new int[x_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < x_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + int x_id = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval);//向下取整 + int value = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval); + + if (result[x_id] != -1) + { + //string str = string.Format("第{0}列存在多个答案!请擦拭干净后再扫描", x_id); + //MessageBox.Show(x_id.ToString()); + //result[x_id] = Convert.ToInt32(result[x_id].ToString() + value.ToString()); + //result[x_id] = -1; + } + else + { + result[x_id] = value; + } + } + return result; + } + + + + // + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public int[] GetTargetValues_L(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num, + int y_begin, int y_interval, int y_num) + { + int[] result = new int[y_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < y_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + + + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + + int x_id = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval);//向右取整数 + int value = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval); + + if (result[x_id] != -1) + { + string str = string.Format("第{0}列存在多个答案!请擦拭干净后再扫描", x_id); + result[x_id] = Convert.ToInt32(result[x_id].ToString() + value.ToString()); + + } + else + { + result[x_id] = value; + } + } + return result; + } + + // + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public int[] GetTargetValues_L_only(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num, + int y_begin, int y_interval, int y_num) + { + int[] result = new int[y_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < y_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + + + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + + int x_id = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval);//向右取整数 + int value = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval); + + if (result[x_id] != -1) + { + //string str = string.Format("第{0}列存在多个答案!请擦拭干净后再扫描", x_id); + //result[x_id] = Convert.ToInt32(result[x_id].ToString() + value.ToString()); + + } + else + { + result[x_id] = value; + } + } + return result; + } + + + + + + + + + + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + //public string GetValueAndDrawGridZhunKao(ImageBox img, VectorOfVectorOfPoint contours, + // int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + //{ + // //画网格 + // //Mat src = new Image(img.Image.Bitmap).Mat; + // //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + // int[] intArray = GetTargetValues(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + // int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + // string str = ""; + // //str += Environment.NewLine;//回车 + // str += strText; + + // str += GetStringOfIntArray(intArray); + + + // return str; + //} + + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public string GetValueAndDrawGridZhunKao(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + //画网格 + int[] intArray = GetTargetValuesOnlyOne(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + string str = ""; + str += strText; + str += GetStringOfIntArray(intArray); + return str; + } + + + ///// + ///// 画出网格并返回填图结果 + ///// + ///// + ///// + ///// 左边距 + ///// 方块长度 + ///// 方块数量 + ///// 上边距 + ///// 方块高度 + ///// 方块竖数量 + ///// 输出文字 + ///// + //public string GetValueAndDrawGrid(ImageBox img, VectorOfVectorOfPoint contours, + // int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + //{ + // //画网格 + // //Mat src = new Image(img.Image.Bitmap).Mat; + // //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + // int[] intArray = GetTargetValues(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + // int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + // string str = ""; + // //str += Environment.NewLine;//回车 + // str += strText; + // if (maxValue >= 4 && maxValue <10) + // { + // str += GetStringOfIntArray(intArray); + // } + // else + // { + // if (maxValue >= 10) + // { + // str += GetStringOfIntArray(intArray, "ABCD"); + // } + // else + // { + // str += GetStringOfIntArray(intArray, "ABCD"); + // } + + // } + + // return str; + //} + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public string GetValueAndDrawGrid(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + + //画网格 + // Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + int[] intArray = GetTargetValuesOnlyOne(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + string str = ""; + //str += Environment.NewLine;//回车 + str += strText; + if (maxValue >= 4 && maxValue < 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + else + { + if (maxValue >= 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + + } + + return str; + } + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public string GetValueAndDrawGrid_L(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + //画网格 + //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + + int[] intArray = GetTargetValues_L_only(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + string str = ""; + //str += Environment.NewLine;//回车 + str += strText; + if (maxValue >= 4 && maxValue < 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + else + { + if (maxValue >= 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + + } + + return str; + } + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + 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) + { + //画网格 + Point pFind; + int[] intArray = GetTargetGravityFind(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num, out pFind); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + pFindX = pFind; + string str = ""; + //str += Environment.NewLine;//回车 + str += strText; + if (maxValue >= 4 && maxValue < 10) + { + str += GetStringOfIntArray(intArray); + } + else + { + if (maxValue >= 10) + { + str += GetStringOfIntArray(intArray, "ABCDEF"); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEF"); + } + + } + + return str; + } + + + + + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + //public Mat GetDrawGrid(ImageBox img, VectorOfVectorOfPoint contours, + // int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + //{ + // //画网格 + // Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + // return mat_grid; + //} + + public Mat GetDrawGrid(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + //画网格 + Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + return mat_grid; + } + + + ///// + ///// 画出网格并返回填图结果 + ///// + ///// + ///// + ///// 左边距 + ///// 方块长度 + ///// 方块数量 + ///// 上边距 + ///// 方块高度 + ///// 方块竖数量 + ///// 输出文字 + ///// + //public string GetValueAndDrawGridMore(ImageBox img, VectorOfVectorOfPoint contours, + // int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + //{ + // //画网格 + // //Mat src = new Image(img.Image.Bitmap).Mat; + // //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + // int[] intArray = GetTargetValues(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + // int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + // string str = ""; + // str += strText; + // if (maxValue >= 7&& maxValue <10) + // { + // str += GetStringOfIntArray(intArray); + // } + // else + // { + // str += GetStringOfIntArray(intArray, "ABCDEFG"); + // } + + // return str; + //} + + + + + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public string GetValueAndDrawGridMore(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + + //画网格 + //Mat src = new Image(img.Image.Bitmap).Mat; + //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + int[] intArray = GetTargetValues(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + string str = ""; + str += strText; + if (maxValue >= 7 && maxValue < 10) + { + str += GetStringOfIntArray(intArray); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + + return str; + } + + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public string GetValueAndDrawGridMoreL(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + //画网格 + //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + int[] intArray = GetTargetValues_L(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + string str = ""; + str += strText; + if (maxValue >= 7 && maxValue < 10) + { + str += GetStringOfIntArray(intArray); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEFG"); + } + return str; + } + + + + + + /// + /// 计算轮廓中心点坐标 + /// + /// 要计算中心点的轮廓 + /// + public Point[] GetGravityOfContours(VectorOfVectorOfPoint selected_contours) + { + int ksize = selected_contours.Size; + + double[] m00 = new double[ksize]; + double[] m01 = new double[ksize]; + double[] m10 = new double[ksize]; + Point[] gravity = new Point[ksize];//用于存储轮廓中心点坐标 + MCvMoments[] moments = new MCvMoments[ksize]; + + for (int i = 0; i < ksize; i++) + { + VectorOfPoint contour = selected_contours[i]; + //计算当前轮廓的矩 + moments[i] = CvInvoke.Moments(contour, false); + + + m00[i] = moments[i].M00; + m01[i] = moments[i].M01; + m10[i] = moments[i].M10; + int x = Convert.ToInt32(m10[i] / m00[i]);//计算当前轮廓中心点坐标 + int y = Convert.ToInt32(m01[i] / m00[i]); + gravity[i] = new Point(x, y); + + } + return gravity; + } + ///// + ///// 根据给定XY初始坐标、间距、数量画网格 + ///// + ///// + ///// + ///// + ///// + ///// + ///// + ///// + ///// + //public Mat DrawGridByXY(ImageBox img, int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num) + //{ + + + // Mat src = new Image(img.Image.Bitmap).Mat; + + // //转换颜色空间 + // Mat mat_color = new Mat(); + // if (src.NumberOfChannels == 1) + // CvInvoke.CvtColor(src, mat_color, Emgu.CV.CvEnum.ColorConversion.Gray2Bgr); + // else + // mat_color = src; + + // for (int i = 0; i <= x_num; i++) + // { + // //先画竖线 + // Point p1 = new Point(x_begin + x_interval * i, y_begin); + // Point p2 = new Point(x_begin + x_interval * i, y_begin + y_interval * y_num); + // CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 1); + // } + + // for (int i = 0; i <= y_num; i++) + // { + // //再画横线 + // Point p1 = new Point(x_begin, y_begin + y_interval * i); + // Point p2 = new Point(x_begin + x_interval * x_num, y_begin + y_interval * i); + // CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 1); + // } + + // img.Image = mat_color; + + + // return mat_color; + //} + + /// + /// 根据给定XY初始坐标、间距、数量画网格 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public Mat DrawGridByXY(Bitmap img, int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num) + { + + + Mat src = new Image(img).Mat; + + //转换颜色空间 + Mat mat_color = new Mat(); + if (src.NumberOfChannels == 1) + CvInvoke.CvtColor(src, mat_color, Emgu.CV.CvEnum.ColorConversion.Gray2Bgr); + else + mat_color = src; + + for (int i = 0; i <= x_num; i++) + { + //先画竖线 + Point p1 = new Point(x_begin + x_interval * i, y_begin); + Point p2 = new Point(x_begin + x_interval * i, y_begin + y_interval * y_num); + CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 1); + } + + for (int i = 0; i <= y_num; i++) + { + //再画横线 + Point p1 = new Point(x_begin, y_begin + y_interval * i); + Point p2 = new Point(x_begin + x_interval * x_num, y_begin + y_interval * i); + CvInvoke.Line(mat_color, p1, p2, new MCvScalar(0, 0, 255), 1); + } + + //img.Image = mat_color; + + + return mat_color; + } + + /// + /// 画出给定轮廓 + /// + /// + /// + /// + public Mat DrawContours(Mat mat, VectorOfVectorOfPoint contours) + { + //转换颜色空间 + Mat mat_color = new Mat(); + CvInvoke.CvtColor(mat, mat_color, Emgu.CV.CvEnum.ColorConversion.Gray2Bgr); + + CvInvoke.DrawContours(mat_color, contours, -1, new MCvScalar(255, 0, 0), 2); + return mat_color; + } + + /// + /// 拼接给定int数组内容,并返回拼接后字符串 + /// + /// + /// + public string GetStringOfIntArray(int[] arr) + { + string str = ""; + foreach (int a in arr) + { + str += a.ToString() + ""; + } + return str; + } + + /// + /// 拼接给定int数组内容,并返回拼接后字符串 + /// + /// + /// + public string GetStringOfIntArray(int[] arr, string ss = "ABCD") + { + string str = ""; + //char[] ch = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G' }; + char[] ch = ss.ToCharArray(); + foreach (int a in arr) + { + /// + if (a >= 10) + { + string x = a.ToString(); + char[] cc = x.ToArray(); + + int[] result = new int[cc.Length]; + + for (int i = 0; i < cc.Length; i++) + { + result[i] = Convert.ToInt32(x.Substring(i, 1)); + } + Array.Sort(result); + + int[] finalResult = result; + for (int j = 0; j < finalResult.Length; j++) + { + if (finalResult[j] == -1) + { + str += "null"; + } + else + { + str += ch[finalResult[j]]; + } + } + str += " "; + } + else + { + if (a == -1) + { + str += "null ";//未识别时,标示为空 + } + else + { + str += ch[a] + " "; + } + + } + } + return str; + } + + + + /// + /// 获取一维int数组中最大值 + /// + /// + /// + public int GetMaxValueOfArray(int[] arr) + { + int[] dst = new int[arr.Length]; + Array.Copy(arr, dst, arr.Length);//深度复制数组,防止排序对原数组产生影响 + Array.Sort(dst);//数组排序 + int maxValue = dst[arr.Length - 1];//数组最大值 + return maxValue; + } + /// + /// 显示图像,并等待按下任意按键后继续 + /// + /// + /// + /// + public void ShowMatWaitKey(string title, Mat mat, double zoomRatio) + { + CvInvoke.Resize(mat, mat, new Size(), zoomRatio, zoomRatio, Inter.Cubic); + CvInvoke.Imshow(title, mat); + CvInvoke.WaitKey(0); + } + + + public Bitmap RotateByOrientation(Bitmap bitmap) + { + // 获取图片的方向信息并根据方向调整图片 + if (bitmap.PropertyIdList.Contains(0x0112)) + { + var orientation = (int)bitmap.GetPropertyItem(0x0112).Value[0]; + switch (orientation) + { + case 2: + bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX); + break; + case 3: + bitmap.RotateFlip(RotateFlipType.Rotate180FlipNone); + break; + case 4: + bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY); + break; + case 5: + bitmap.RotateFlip(RotateFlipType.Rotate90FlipX); + break; + case 6: + bitmap.RotateFlip(RotateFlipType.Rotate90FlipNone); + break; + case 7: + bitmap.RotateFlip(RotateFlipType.Rotate270FlipX); + break; + case 8: + bitmap.RotateFlip(RotateFlipType.Rotate270FlipNone); + break; + } + } + + return bitmap; + } + +} + + +public class ZhuguantiList +{ + public int QuestionSmallNum + { + get; set; + } + public Bitmap btm + { + get; set; + } + public string num + { + get; set; + } +} + + + +public class otherBitmaplist +{ + public Bitmap btm + { + get; set; + } + public string Text + { + get; set; + } +} \ No newline at end of file diff --git a/Marking.Template.sln b/Marking.Template.sln new file mode 100644 index 0000000..b6d52d1 --- /dev/null +++ b/Marking.Template.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Marking.Template", ".", "{518C91BB-5B56-4710-A01C-589243B25125}" + ProjectSection(WebsiteProperties) = preProject + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.8" + Debug.AspNetCompiler.VirtualPath = "/localhost_6056" + Debug.AspNetCompiler.PhysicalPath = "F:\Marking.Program.Code\Marking.Template\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_6056\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/localhost_6056" + Release.AspNetCompiler.PhysicalPath = "F:\Marking.Program.Code\Marking.Template\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_6056\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "6056" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {518C91BB-5B56-4710-A01C-589243B25125}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {518C91BB-5B56-4710-A01C-589243B25125}.Debug|Any CPU.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2B0FC6C2-1D25-430E-998C-BFE706262D4D} + EndGlobalSection +EndGlobal diff --git a/Temp/Default.aspx b/Temp/Default.aspx new file mode 100644 index 0000000..cd74986 --- /dev/null +++ b/Temp/Default.aspx @@ -0,0 +1,263 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="外部答题卡_Default" %> + + + + + + + 导入外部答题卡制作模板 + + + + +
+
+ + + + + +

单选题:15题

+ + +
+ + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
选定锚点 +
左上锚点
+
右上锚点
+
左下锚点
+
右下锚点
+
+ 版面: + + +
+ 学号: + + 设置学号 +
+
+
设置条码
+
+
设置缺考
+
+
标准涂点
+
+
增加屏蔽
+
+ + + +
+
+
+
+ + +
+
+ +
+
折叠
+ +
+
    +
  • 客观题设置
  • +
  • +
    +

    + 题号:- +

    + +


    + 选项: + + +


    + 类型: + 分数: + +

    +
    开始配置
    +
    +
  • +
+ + + +
    +
  • 主观题设置
  • +
  • + 切割成两半 如11题 如 第一半11X1 第二半11X2 + +
    + 题号:小题: + 分数: + +

    + 阅卷分值间隔: + + 类型: + +
    + + +


    +
    开始配置
    + +
    + 先批后阅题号: + + + <%-- --%> +
    + +
  • +
+
模板删减区
+
    + +
+
+ + + + + + + + diff --git a/Temp/Default.aspx.cs b/Temp/Default.aspx.cs new file mode 100644 index 0000000..b276384 --- /dev/null +++ b/Temp/Default.aspx.cs @@ -0,0 +1,1043 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data.SqlClient; +using System.Data; +using Lucee.WebBase.Utils; +using Lucee.WebBase.Data; +using System.Drawing; +using Emgu.CV; +using Emgu.CV.Util; +using Emgu.CV.Structure; +using System.Drawing.Drawing2D; +using System.Net; +using Newtonsoft; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json; +using System.Web.Script.Serialization; +using MySql.Data.MySqlClient; +using Emgu.CV.Flann; +using System.Data.SqlTypes; +using System.Security.AccessControl; + +public partial class 外部答题卡_Default : System.Web.UI.Page +{ + public long TempID = 0; + public string PageIndex = "0"; + public string Bindlist = ""; + public string imgage = ""; + public string ExamNO = ""; + public string isLocked = ""; + public string HideAreaText = ""; + public string IsPostionValue = ""; + public long tenant = 0; + public string pager = ""; + public int isHand = 0; + public string MainTempId = "0"; + protected void Page_Load(object sender, EventArgs e) + { + + int action = Globals.Request("action") == "" ? 0 : Convert.ToInt32(Globals.Request("action")); + tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); + isHand = Globals.Request("isHand") == "" ? 0 : Convert.ToInt32(Globals.Request("isHand")); + pager = Globals.Request("pager").ToLower() ; + + if (action != 0) + { + Response.Clear(); + switch (action) + { + case 1: + UpdateTempData(); + break; + case 2: + LockTemp(); + break; + } + Response.End(); + } + else + { + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + if (TempID == 0) { + Response.Write(""); + return; + } + string sql = "select * from MK_TempleteData where ID_bigint=" + TempID; + DataTable dtx = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dtx.Rows.Count > 0) + { + Bindlist = dtx.Rows[0]["TempValue_nvarchar"].ToString(); + imgage = dtx.Rows[0]["TempPicture64_nvarchar"].ToString(); + isLocked = dtx.Rows[0]["islock_bit"] == null ? "" : dtx.Rows[0]["islock_bit"].ToString(); + HideAreaText = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString(); + IsPostionValue = dtx.Rows[0]["HideAreaPostionList_nvarchar"] == null ? "" : dtx.Rows[0]["HideAreaPostionList_nvarchar"].ToString(); + PageIndex = dtx.Rows[0]["PageIndex_int"] == null ? "" : dtx.Rows[0]["PageIndex_int"].ToString(); + sql = "select HasPosition FROM MK_TempleteMain WHERE ID_bigint=" + dtx.Rows[0]["MainID_bigint"].ToString(); + MainTempId = dtx.Rows[0]["MainID_bigint"].ToString(); + IsPostionValue = new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString(); + + } + } + + } + + private void UpdateTempData() { + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + string totalHtml = Server.UrlDecode(Globals.Request("totalHtml")); + string HideAreaPostionList= Server.UrlDecode(Globals.Request("HideAreaPostionList")); + + if (AnsyTemp(HideAreaPostionList, totalHtml)) { + string sql = "Update MK_TempleteData SET TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar where ID_bigint=" + TempID; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempValue_nvarchar",totalHtml), + new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList) + }; + string[] totalHtmlList = totalHtml.Split('$'); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + } + + + + + //if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) == 1) + //{ + // if (totalHtmlList[0] == "") + // { + // Response.Write("ok"); + // } + // else + // { + // AnsyTemp(HideAreaPostionList); + // } + //} + //else { + // Response.Write("0"); + //} + + } + + private void LockTemp() + { + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + string totalHtml = Server.UrlDecode(Globals.Request("totalHtml")); + string HideAreaPostionList = Server.UrlDecode(Globals.Request("HideAreaPostionList")); + string[] totalHtmlList = totalHtml.Split('$'); + + if (AnsyTemp(HideAreaPostionList, totalHtml)) + { + string sql = "Update MK_TempleteData SET TempValue_nvarchar=@TempValue_nvarchar,HideAreaPostionList_nvarchar=@HideAreaPostionList_nvarchar,islock_bit=1 where ID_bigint=" + TempID; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempValue_nvarchar",totalHtml), + new MySqlParameter("@HideAreaPostionList_nvarchar",HideAreaPostionList) + }; + AddQuestionData(totalHtml); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + } + //if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) == 1) + //{ + // if (totalHtmlList[0] == "") + // { + // Response.Write("ok"); + // } + // else { + // AnsyTemp(HideAreaPostionList); + // } + //} + //else + //{ + // Response.Write("0"); + //} + } + + private void AddQuestionData(string totalHtml) { + TempID = Convert.ToInt64(Globals.Request("TempID")); + string[] totalHtmlList = totalHtml.Split('$'); + string kg = totalHtmlList[2]; + string zg = totalHtmlList[3]; + + string[] questionlist = kg.Trim('^').Split('^'); + string[] zglist = zg.Trim('^').Split('^'); + string sql = ""; + if (kg != "") + { + for (int i = 0; i < questionlist.Length; i++) + { + string[] detailtList = questionlist[i].Split(','); + string starNum = detailtList[4].ToUpper(); + string endNum = detailtList[5].ToUpper(); + + string score = detailtList[9]; + if (score == "") { + score = "0"; + } + string selectNum = detailtList[6]; + string isselectmore = detailtList[8]; + + + + string bigNum = ""; + if (starNum.Contains("M")) + { + bigNum = starNum.Split('M')[0]; + int startSmallNum = Convert.ToInt32(starNum.Split('M')[1]); + int endSmallNum = Convert.ToInt32(endNum.Split('M')[1]); + for (int j = Convert.ToInt32(startSmallNum); j <= Convert.ToInt32(endSmallNum); j++) + { + sql = "SELECT COUNT(1) FROM MK_TempQuestionData WHERE TempID_bigint=" + TempID + " AND QuestionIndex_int='" + (bigNum + "." + j) + "'"; + if (new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() == "0") + { + sql = "INSERT INTO MK_TempQuestionData(TempID_bigint,QuestionIndex_int,SmallQuestionDetail_nvarchar,Score_float,createdtime_datetime,smallQuestionNum_int,questiontype_int,selectNum_int,selecttype_int) VALUES(@TempID_bigint,@QuestionIndex_int,@SmallQuestionDetail_nvarchar,@Score_float,'" + DateTime.Now + "',@smallQuestionNum_int,0,@selectNum_int,@selecttype_int)"; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempID_bigint",TempID), + new MySqlParameter("@QuestionIndex_int",bigNum+"."+j), + new MySqlParameter("@SmallQuestionDetail_nvarchar",""), + new MySqlParameter("@smallQuestionNum_int","1"), + new MySqlParameter("@Score_float",score), + new MySqlParameter("@selectNum_int",selectNum), + new MySqlParameter("@selecttype_int",isselectmore), + + }; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + } + } + + } + else + { + for (int j = Convert.ToInt32(starNum); j <= Convert.ToInt32(endNum); j++) + { + sql = "SELECT COUNT(1) FROM MK_TempQuestionData WHERE TempID_bigint=" + TempID + " AND QuestionIndex_int='" + j + "'"; + if (new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() == "0") + { + sql = "INSERT INTO MK_TempQuestionData(TempID_bigint,QuestionIndex_int,SmallQuestionDetail_nvarchar,Score_float,createdtime_datetime,smallQuestionNum_int,questiontype_int,selectNum_int,selecttype_int) VALUES(@TempID_bigint,@QuestionIndex_int,@SmallQuestionDetail_nvarchar,@Score_float,'" + DateTime.Now + "',@smallQuestionNum_int,0,@selectNum_int,@selecttype_int)"; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempID_bigint",TempID), + new MySqlParameter("@QuestionIndex_int",j), + new MySqlParameter("@SmallQuestionDetail_nvarchar",""), + new MySqlParameter("@smallQuestionNum_int","1"), + new MySqlParameter("@Score_float",score), + new MySqlParameter("@isSelectMore_bit",isselectmore), + new MySqlParameter("@selectNum_int",selectNum), + new MySqlParameter("@selecttype_int",isselectmore), + + }; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + } + } + } + } + } + if (zg != "") + { + for (int i = 0; i < zglist.Length; i++) + { + string[] detailtList = zglist[i].Split(','); + bool issplit = false; + if (detailtList[4].Contains("X")) + { + issplit = true; + detailtList[4] = detailtList[4].Split('X')[0]; + } + + //sql = "SELECT COUNT(1) FROM MK_TempQuestionData WHERE TempID_bigint=" + TempID + " AND QuestionIndex_int='" + detailtList[4] + "'"; + sql = String.Format("SELECT COUNT(1) FROM MK_TempQuestionData where TempID_bigint in(select ID_bigint from MK_TempleteData where MainID_bigint =(SELECT MainID_bigint FROM " + + "`MK_TempleteData` where ID_bigint={0})) AND QuestionIndex_int='{1}';", TempID, detailtList[4]); + + + string mkscoretype = ""; + if (string.IsNullOrEmpty(detailtList[7])) + { + mkscoretype = "1"; + } + else { + mkscoretype = detailtList[7]; + } + + + if (new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() == "0") + { + sql = "INSERT INTO MK_TempQuestionData(TempID_bigint,QuestionIndex_int,SmallQuestionDetail_nvarchar,Score_float,createdtime_datetime,smallQuestionNum_int,questiontype_int,mkscoretype_float,is_split) VALUES(@TempID_bigint,@QuestionIndex_int,@SmallQuestionDetail_nvarchar,@Score_float,'" + DateTime.Now + "',@smallQuestionNum_int,1,@mkscoretype_float,@is_split)"; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempID_bigint",TempID), + new MySqlParameter("@QuestionIndex_int",detailtList[4]), + new MySqlParameter("@SmallQuestionDetail_nvarchar",""), + new MySqlParameter("@Score_float",detailtList[6]==""? "0" : detailtList[6]), + new MySqlParameter("@smallQuestionNum_int",detailtList[5]), + new MySqlParameter("@mkscoretype_float",mkscoretype), + new MySqlParameter("@is_split",issplit) + }; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + } + } + } + } + + /// + /// 锁定模板数据 + /// + public bool AnsyTemp(string HideAreaPostionList,string totalHtml) + { + try + { + CommonUse commonUse = new CommonUse(); + long TempID =Convert.ToInt64(Globals.Request("TempID")); + string sql = "SELECT * FROM MK_TempleteData WHERE ID_bigint=" + TempID; + DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dt.Rows.Count <= 0) + { + Response.Write("NO DATA"); + return false; + } + Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString()); + + //var PictureBoxBitMap = commonUse.RotateByOrientation(tempPictureBoxBitMap); + if (PictureBoxBitMap == null) + { + Response.Write("NO PICTURE"); + } + string[] GetData = totalHtml.Split('$'); + string PYPostionList = ""; + + + + if (GetData[0] != "")//如果有定位点 + { + //计算模板图片参数 + double xielv = 0; + int width = Convert.ToInt32(GetData[6].Split(',')[0]); + int height = Convert.ToInt32(GetData[6].Split(',')[1]); + PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height); + Image imagex = new Image(PictureBoxBitMap); + + Mat mat_threshold1 = new Mat(); + CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1); + VectorOfVectorOfPoint selected_contours1; + selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1); + Image currentFramext = new Image(PictureBoxBitMap); + + Mat color_mxxx = commonUse.GetPostionXYByFindPostionAndXieLv(imagex.Mat, selected_contours1, GetData[0], out PYPostionList, currentFramext, out xielv); + if (xielv == -100) { + Response.Write("模板配置错误,斜率无法计算"); + return false; + } + int oldWidth = color_mxxx.Bitmap.Width; + int oldHeight = color_mxxx.Bitmap.Height; + string tempEx = TempV(GetData, PYPostionList, oldWidth, oldHeight, HideAreaPostionList); + if (tempEx != "ok") + { + Response.Write(tempEx); + return false; + } + + + + int PageIndex = Convert.ToInt32(Globals.Request("PageIndex")); + if (PageIndex == 1) { + int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]); + if (mx == 0) + { + Response.Write("标准点数据错误,请重新框选"); + return false; + } + else + { + long MainTempId = Convert.ToInt64(Globals.Request("MainTempId")); + sql = "UPDATE MK_TempleteMain SET option_pixel_options=" + mx + " WHERE ID_bigint=" + MainTempId; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + } + } + + + sql = "UPDATE MK_TempleteData SET XieLv_float =@XieLv_float,CutWidth_int=@CutWidth_int,CutHeight_int=@CutHeight_int,PyPPostion_nvarchar=@PyPPostion_nvarchar WHERE ID_bigint=" + TempID; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@XieLv_float",xielv), + new MySqlParameter("@CutWidth_int",oldWidth), + new MySqlParameter("@CutHeight_int",oldHeight), + new MySqlParameter("@PyPPostion_nvarchar",PYPostionList) + }; + + if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) > 0) + { + + } + imagex.Dispose(); + color_mxxx.Dispose(); + PictureBoxBitMap.Dispose(); + Response.Write("ok"); + return true; + } + else + { + int width = Convert.ToInt32(GetData[6].Split(',')[0]); + int height = Convert.ToInt32(GetData[6].Split(',')[1]); + PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height); + Image imagex = new Image(PictureBoxBitMap); + Mat mat_threshold1 = new Mat(); + CvInvoke.Threshold(imagex, mat_threshold1, 160, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1); + VectorOfVectorOfPoint selected_contours1; + selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1); + Image currentFramext = new Image(PictureBoxBitMap); + + int PageIndex = Convert.ToInt32(Globals.Request("PageIndex")); + if (PageIndex == 1) + { + int mx = GetOtherBitmaplist(currentFramext.Mat, 160, PYPostionList.Split(','), GetData[9]); + long MainTempId = Convert.ToInt64(Globals.Request("MainTempId")); + if (mx == 0) + { + Response.Write("标准点数据错误,请重新框选"); + return false; + } + else + { + sql = "UPDATE MK_TempleteMain SET option_pixel_options=" + mx + " WHERE ID_bigint=" + MainTempId; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + } + } + //计算模板图片参数 + double xielv = 0; + width = Convert.ToInt32(GetData[6].Split(',')[0]); + height = Convert.ToInt32(GetData[6].Split(',')[1]); + sql = "UPDATE MK_TempleteData SET XieLv_float =@XieLv_float,CutWidth_int=@CutWidth_int,CutHeight_int=@CutHeight_int,PyPPostion_nvarchar=@PyPPostion_nvarchar WHERE ID_bigint=" + TempID; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@XieLv_float",xielv), + new MySqlParameter("@CutWidth_int",width), + new MySqlParameter("@CutHeight_int",height), + new MySqlParameter("@PyPPostion_nvarchar",PYPostionList) + }; + if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) > 0) + { + + } + PictureBoxBitMap.Dispose(); + Response.Write("ok"); + return true; + } + } + catch (Exception ex) + { + return false; + Response.Write("TEMPERRO"); + } + } + + /// + /// 获取其他截图 + /// + /// + /// + /// + /// + /// + /// + public static int GetOtherBitmaplist(Mat color_mat, int Threshold, string[] PYPostion, string postiontiaomaX) + { + CommonUse commonUse = new CommonUse(); + string[] quekao = postiontiaomaX.Split(','); + //int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) - Convert.ToInt32(PYPostion[0]); + //int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) - Convert.ToInt32(PYPostion[1]); + int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) ; + int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) ; + int W = Convert.ToInt32(Convert.ToDouble(quekao[2])); + int H = Convert.ToInt32(Convert.ToDouble(quekao[3])); + int xuanXiang = 1;//选项数量 + int tiliang = 1;//题量 + string mx = ""; + int wL = Convert.ToInt32(W / xuanXiang); + int hL = Convert.ToInt32(H / tiliang); + + Image bytimg = GetMatCutImg(color_mat.Bitmap, X, Y, W, H); + X = 0; Y = 0; + Mat src = bytimg.Mat; + Mat mat_threshold = new Mat(); + CvInvoke.Threshold(src, mat_threshold, Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + Mat mat_dilate = commonUse.MyDilate(mat_threshold); + VectorOfVectorOfPoint selected_contours; + int option_pixel_options =0; + selected_contours = GetUsefulContoursSelectoOptionQK(mat_dilate, 1, out option_pixel_options); + + mx = GetValueAndDrawGrid_Other(src.Bitmap, selected_contours, X, wL, xuanXiang, Y, hL, tiliang, ""); + bytimg.Dispose(); + src.Dispose(); + return option_pixel_options; + } + + /// + /// 筛选图中符合给定条件的轮廓 + /// + /// 要提取轮廓的图片 + /// 轮廓外接矩形大于该宽度值 + /// 轮廓外接矩形小于该宽度值 + /// 轮廓外接矩形大于该高度值 + /// 轮廓外接矩形小于该高度值 + public static VectorOfVectorOfPoint GetUsefulContoursSelectoOptionQK(Mat mat, double ratio,out int option_pixel_options) + { + option_pixel_options = 0; + VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint();//所有的轮廓 + VectorOfVectorOfPoint selected_contours = new VectorOfVectorOfPoint();//用于存储筛选过后的轮廓 + CvInvoke.FindContours(mat, contours, null, Emgu.CV.CvEnum.RetrType.External, + Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);//提取所有轮廓,操作过程中会对输入图像进行修改 + + //筛选轮廓。筛选条件:长宽比大于给定值 + for (int i = 0; i < contours.Size; i++) + { + Rectangle rect = CvInvoke.BoundingRectangle(contours[i]);//外接矩形 + Mat temp = new Mat(mat, rect);//提取ROI矩形区域 + int pxNums = CvInvoke.CountNonZero(temp);//计算图像内非零像素个数 + + double area = CvInvoke.ContourArea(contours[i]);//计算连通轮廓的面积 + double length = CvInvoke.ArcLength(contours[i], false); //计算连通轮廓的周长 + + VectorOfPoint approx_curve = new VectorOfPoint();//用于存放逼近的结果 + CvInvoke.ApproxPolyDP(contours[i], approx_curve, length * 0.02, true); + //bool bo = (area > 500 && area < 12000);//&& rect.Height<100 + //bool bo = ((area > 20 && area < 150000) && rect.Height > 8 ); + bool bo = ((area > 10 && area < 150000) && rect.Height > 5 ); + if (bo) + { + if (pxNums > (area * 0.7)) { + option_pixel_options = pxNums; + selected_contours.Push(contours[i]); + } + } + } + return selected_contours; + } + + /// + /// 画出网格并返回填图结果 + /// + /// + /// + /// 左边距 + /// 方块长度 + /// 方块数量 + /// 上边距 + /// 方块高度 + /// 方块竖数量 + /// 输出文字 + /// + public static string GetValueAndDrawGrid_Other(Bitmap img, VectorOfVectorOfPoint contours, + int x_begin, int x_interval, int x_num, int y_begin, int y_interval, int y_num, string strText) + { + //画网格 + //Mat mat_grid = DrawGridByXY(img, x_begin, x_interval, x_num, y_begin, y_interval, y_num); + + + int[] intArray = GetTargetValues_L_Other(contours, x_begin, x_interval, x_num, y_begin, y_interval, y_num, img, strText); + int maxValue = GetMaxValueOfArray(intArray);//数组最大值 + + string str = ""; + //str += Environment.NewLine;//回车 + str += strText; + if (maxValue >= 4 && maxValue < 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFGH"); + } + else + { + if (maxValue >= 10) + { + str += GetStringOfIntArray(intArray, "ABCDEFGH"); + } + else + { + str += GetStringOfIntArray(intArray, "ABCDEFGH"); + } + + } + + return str; + } + + /// + /// 拼接给定int数组内容,并返回拼接后字符串 + /// + /// + /// + public static string GetStringOfIntArray(int[] arr, string ss = "ABCD") + { + string str = ""; + //char[] ch = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G' }; + char[] ch = ss.ToCharArray(); + foreach (int a in arr) + { + /// + if (a >= 10) + { + string x = a.ToString(); + char[] cc = x.ToArray(); + + int[] result = new int[cc.Length]; + + for (int i = 0; i < cc.Length; i++) + { + result[i] = Convert.ToInt32(x.Substring(i, 1)); + } + Array.Sort(result); + + int[] finalResult = result; + for (int j = 0; j < finalResult.Length; j++) + { + if (finalResult[j] == -1) + { + str += "null"; + } + else + { + str += ch[finalResult[j]]; + } + } + str += " "; + } + else + { + if (a == -1) + { + str += "null ";//未识别时,标示为空 + } + else + { + str += ch[a] + " "; + } + + } + } + return str; + } + + + /// + /// 获取一维int数组中最大值 + /// + /// + /// + public static int GetMaxValueOfArray(int[] arr) + { + int[] dst = new int[arr.Length]; + Array.Copy(arr, dst, arr.Length);//深度复制数组,防止排序对原数组产生影响 + Array.Sort(dst);//数组排序 + int maxValue = dst[arr.Length - 1];//数组最大值 + return maxValue; + } + + // + /// 根据给定的轮廓及范围信息计算涂卡的结果,返回int数组 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static int[] GetTargetValues_L_Other(VectorOfVectorOfPoint contours, int x_begin, int x_interval, int x_num, + int y_begin, int y_interval, int y_num, Bitmap img, string strText) + { + int[] result = new int[y_num];//结果数组 + //数组初值默认为-1 + for (int i = 0; i < y_num; i++) + { + result[i] = -1; + } + int x_max = x_begin + x_interval * x_num; + int y_max = y_begin + y_interval * y_num; + + + VectorOfVectorOfPoint targetContours = new VectorOfVectorOfPoint(); + Point[] gravity = GetGravityOfContours(contours);//轮廓中心点坐标 + for (int i = 0; i < contours.Size; i++) + { + VectorOfPoint contour = contours[i]; + + if (gravity[i].X < x_begin || gravity[i].X > x_max || gravity[i].Y < y_begin || gravity[i].Y > y_max) + { + continue;//判断中心点是否超出范围 + } + + int x_id = (int)Math.Floor((double)(gravity[i].Y - y_begin) / y_interval);//向右取整数 + int value = (int)Math.Floor((double)(gravity[i].X - x_begin) / x_interval); + + if (result[x_id] != -1) + { + + + } + else + { + + result[x_id] = value; + } + } + + return result; + } + + /// + /// 计算轮廓中心点坐标 + /// + /// 要计算中心点的轮廓 + /// + public static Point[] GetGravityOfContours(VectorOfVectorOfPoint selected_contours) + { + int ksize = selected_contours.Size; + + double[] m00 = new double[ksize]; + double[] m01 = new double[ksize]; + double[] m10 = new double[ksize]; + Point[] gravity = new Point[ksize];//用于存储轮廓中心点坐标 + MCvMoments[] moments = new MCvMoments[ksize]; + + for (int i = 0; i < ksize; i++) + { + VectorOfPoint contour = selected_contours[i]; + //计算当前轮廓的矩 + moments[i] = CvInvoke.Moments(contour, false); + + + m00[i] = moments[i].M00; + m01[i] = moments[i].M01; + m10[i] = moments[i].M10; + int x = Convert.ToInt32(m10[i] / m00[i]);//计算当前轮廓中心点坐标 + int y = Convert.ToInt32(m01[i] / m00[i]); + gravity[i] = new Point(x, y); + } + return gravity; + } + + + + + /// + /// 获取裁剪 L T W H + /// + /// + public static Image GetMatCutImg(Bitmap bmp, int sX, int sT, int sW, int sH) + { + List> postionimageCut = new List>(); + int L = sX; + int T = sT; + int W = sW; + int H = sH; + Rectangle rectangle = new Rectangle(L, T, W, H); + + Image Sub = new Image(bmp).GetSubRect(rectangle); + Image CropImage = new Image(Sub.Size); + CvInvoke.cvCopy(Sub, CropImage, IntPtr.Zero); + + return CropImage; + } + + + + /// + /// 检查边距是否合格 + /// + /// + private string TempV(string[] GetData,string PYPostionList,int oldWidth,int oldHeight,string HideAreaPostionList) { + double pyLeft = Convert.ToInt32(PYPostionList.Split(',')[0]); + double pyTop = Convert.ToInt32(PYPostionList.Split(',')[1]); + double Xtop = 0; + double Xleft = 0; + double Xwidth = 0; + double Xheight = 0; + if (GetData[1] != "") + { + string[] list = GetData[1].Split(','); + Xleft = Convert.ToDouble(list[0]); + Xtop = Convert.ToDouble(list[1]); + Xwidth = Convert.ToDouble(list[2]); + Xheight = Convert.ToDouble(list[3]); + if (Xleft < pyLeft) + { + return "学号编辑框左边超过定位点边界!"; + + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "学号编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "学号编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "学号编辑框下边超过定位点边界!"; + } + } + + if (GetData[2] != "")//客观题 + { + string[] keguantiList = GetData[2].Split('^'); + foreach (string slist in keguantiList) { + 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] + "-" + list[5]; + if (Xleft < pyLeft) + { + return "客观题"+ tihao + "编辑框左边超过定位点边界!"; + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "客观题" + tihao + "编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "客观题" + tihao + "编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "客观题" + tihao + "编辑框下边超过定位点边界!"; + } + } + } + if (GetData[3] != "")//主观题 + { + string[] keguantiList = GetData[3].Split('^'); + foreach (string slist in keguantiList) + { + 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 "主观题" + tihao + "编辑框左边超过定位点边界!"; + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "主观题" + tihao + "编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "主观题" + tihao + "编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "主观题" + tihao + "编辑框下边超过定位点边界!"; + } + } + } + if (GetData[4] != "")//主观题 + { + string[] keguantiList = GetData[4].Split('^'); + foreach (string slist in keguantiList) + { + 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 "" + tihao + "编辑框左边超过定位点边界!"; + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "" + tihao + "编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "" + tihao + "编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "" + tihao + "编辑框下边超过定位点边界!"; + } + } + } + + if (GetData[5] != "") + { + string[] list = GetData[5].Split(','); + Xleft = Convert.ToDouble(list[0]); + Xtop = Convert.ToDouble(list[1]); + Xwidth = Convert.ToDouble(list[2]); + Xheight = Convert.ToDouble(list[3]); + if (Xleft < pyLeft) + { + return "条码编辑框左边超过定位点边界!"; + + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "条码编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "条码编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "条码编辑框下边超过定位点边界!"; + } + } + + if (GetData[7] != "") + { + string[] list = GetData[7].Split(','); + Xleft = Convert.ToDouble(list[0]); + Xtop = Convert.ToDouble(list[1]); + Xwidth = Convert.ToDouble(list[2]); + Xheight = Convert.ToDouble(list[3]); + if (Xleft < pyLeft) + { + return "条码编辑框左边超过定位点边界!"; + + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "条码编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "条码编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "条码编辑框下边超过定位点边界!"; + } + } + if (GetData[8] != "") + { + string[] list = GetData[8].Split(','); + Xleft = Convert.ToDouble(list[0]); + Xtop = Convert.ToDouble(list[1]); + Xwidth = Convert.ToDouble(list[2]); + Xheight = Convert.ToDouble(list[3]); + if (Xleft < pyLeft) + { + return "批阅分数编辑框左边超过定位点边界!"; + + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "批阅分数编辑框编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "批阅分数编辑框编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "批阅分数编辑框编辑框下边超过定位点边界!"; + } + } + if (HideAreaPostionList != "") { + + JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); + List ht = javaScriptSerializer.Deserialize>(HideAreaPostionList); + int count =0; + foreach (HideAreaData h in ht) + { + count++; + Xleft = Convert.ToDouble(h.left); + Xtop = Convert.ToDouble(h.top); + Xwidth = Convert.ToDouble(h.width); + Xheight = Convert.ToDouble(h.height); + if (Xleft < pyLeft) + { + return "屏蔽区"+count+"编辑框左边超过定位点边界!"; + + } + if (Xleft + Xwidth - pyLeft > oldWidth) + { + return "屏蔽区" + count + "编辑框右边超过定位点边界!"; + } + if (Xtop < pyTop) + { + return "屏蔽区" + count + "编辑框上边超过定位点边界!"; + } + + if (Xtop + Xheight - pyTop > oldHeight) + { + return "屏蔽区" + count + "编辑框下边超过定位点边界!"; + } + } + } + return "ok"; + } + + private Bitmap ScaleToSize(Bitmap bitmap, int width, int height) + { + if (bitmap == null) + { + return null; + } + if (bitmap.Width == width && bitmap.Height == height) + { + return bitmap; + } + + var scaledBitmap = new Bitmap(width, height); + using (var g = Graphics.FromImage(scaledBitmap)) + { + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.DrawImage(bitmap, 0, 0, width, height); + } + return scaledBitmap; + } + + // + /// 图片另存为 + /// + /// 路径 + public Bitmap ImgGet(string url) + { + WebRequest imgRequest = WebRequest.Create(url); + + HttpWebResponse res; + try + { + res = (HttpWebResponse)imgRequest.GetResponse(); + } + catch (WebException ex) + { + + res = (HttpWebResponse)ex.Response; + } + + if (res.StatusCode.ToString() == "OK") + { + return new Bitmap((System.Drawing.Image)new Bitmap(imgRequest.GetResponse().GetResponseStream())); + } + else + { + return null; + } + } + + + + +} + + +public class HideAreaData +{ + public Double width { get; set; } + public Double height { get; set; } + public Double left { get; set; } + public Double top { get; set; } +} \ No newline at end of file diff --git a/Temp/GetUseImageMap.aspx b/Temp/GetUseImageMap.aspx new file mode 100644 index 0000000..8c76e14 --- /dev/null +++ b/Temp/GetUseImageMap.aspx @@ -0,0 +1,33 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetUseImageMap.aspx.cs" Inherits="Temp_GetUseImageMap" %> + + + + + + + + + + + + + + +
+ + +
+ + + diff --git a/Temp/GetUseImageMap.aspx.cs b/Temp/GetUseImageMap.aspx.cs new file mode 100644 index 0000000..ba22584 --- /dev/null +++ b/Temp/GetUseImageMap.aspx.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class Temp_GetUseImageMap : System.Web.UI.Page +{ + public string TempID = ""; + public long tenant = 0; + public string UserID = ""; + public string url = ""; + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) { + TempID = Lucee.WebBase.Utils.Globals.Request("TempID"); + UserID = Lucee.WebBase.Utils.Globals.Request("UserID"); + tenant = Lucee.WebBase.Utils.Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Lucee.WebBase.Utils.Globals.Request("tenant")); + url = Server.UrlDecode(Lucee.WebBase.Utils.Globals.Request("ImgURL")); + } + } +} \ No newline at end of file diff --git a/Temp/SplitQuestion.aspx b/Temp/SplitQuestion.aspx new file mode 100644 index 0000000..3cab1a7 --- /dev/null +++ b/Temp/SplitQuestion.aspx @@ -0,0 +1,321 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SplitQuestion.aspx.cs" Inherits="Temp_SplitQuestion" %> + + + + + + + 题目拆分 + + + + + + + + + + + + + + + + + +
+

题目拆分

+
+
+ +
+
+
+

题目拆分

+
+
    +
  • 序号: + + 小题:
    + 分数: + 阅卷跳分:
  • +
+
+

重新布置

+
+ 题号:
+
+ 小题: + 分数: + +
+
+ 间隔: + + + 类型: + +
+
+
开始配置
+
+
+

拆题数据

+ +
+ +
+
+ 总分数: + 拆分题数: +
+
+ +
+ + +
+
+
+ + + + diff --git a/Temp/SplitQuestion.aspx.cs b/Temp/SplitQuestion.aspx.cs new file mode 100644 index 0000000..d92322b --- /dev/null +++ b/Temp/SplitQuestion.aspx.cs @@ -0,0 +1,406 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Lucee.WebBase.Data; +using Lucee.WebBase.Utils; +using System.Data; +using System.Data.SqlClient; +using ZXing.Client.Result; +using MySql.Data.MySqlClient; +using System.IO; +using System.Net; +using System.Text; +using Newtonsoft; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json; +using Emgu.CV.UI.GLView; +using System.Net.Http; +using System.Net.Http.Json; + +public partial class Temp_SplitQuestion : System.Web.UI.Page +{ + public long tenant = 0; + public string QuestionTempValue = ""; + public string PaperType = ""; + public string TempPicture64_nvarchar = ""; + public string ystihaoList = ""; + public string TempID = ""; + public string TempMainID = ""; + public string questionNum = ""; + public string xuhao, xiaoti, fenshu, yuejuanfen; + public long exam_subject_id = 0; + public long subjective = 0; + public string token = ""; + + private void UpdateData() + { + long TemDataID = Convert.ToInt64(Globals.Request("TemDataID")); + string tempMainID = Globals.Request("TempMainID"); + string zhuguantiList = Server.UrlDecode(Globals.Request("zhuguantiList")); + string questionNum = Globals.Request("questionNum"); + tenant = Convert.ToInt64(Globals.Request("tenant")); + string sql = "SELECT TempValue_nvarchar FROM MK_TempleteData WHERE ID_bigint=" + TemDataID; + string TempValue = new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString(); + if (TempValue != "") + { + string[] list = TempValue.Split('$');//拿模板 + string zhuguanti = list[3];//拿主观题 + bool isP = false; + if (zhuguanti != "") + { + string[] quList = zhuguanti.Split('^');//切题 + + for (int i = 0; i < quList.Length; i++) + { + + if (questionNum == quList[i].Split(',')[4])//匹配哪道题 + { + quList[i] = zhuguantiList; + isP = true; + break; + } + } + + + if (!isP) + { + Response.Write("该题数据不存在,请刷新后重试!"); + } + else + {//重新组装题 + + long exam_subject_id = Convert.ToInt64(Globals.Request("exam_subject_id")); + if (!CheckStatus(exam_subject_id)) + { + return; + } + + string[] newQuestionList = zhuguantiList.Split('^'); + long subjective = Convert.ToInt64(Globals.Request("subjective")); + List lt = new List(); + //写入拆分题目 + foreach (string x in newQuestionList) + { + string[] questionList = x.Split(','); + + string mkscoretype = ""; + if (string.IsNullOrEmpty(questionList[7])) + { + mkscoretype = "1"; + } + else + { + mkscoretype = questionList[7]; + } + + CutList cl = new CutList(); + cl.questionNum = Server.UrlEncode(questionList[4]); + cl.subQuestionCount = Convert.ToInt32(questionList[5]); + cl.scoreInterval = mkscoretype; + cl.score = questionList[6]; + lt.Add(cl); + } + //调用接口 + result r = (result)JavaScriptConvert.DeserializeObject(RequestPost(subjective.ToString(), lt.ToJsonString()), typeof(result)); + if (r.code == "200" && r.data.ToLower() == "true") + { + + string zhuguanlistString = ""; + foreach (string x in quList) + { + zhuguanlistString += x + "^"; + } + list[3] = zhuguanlistString.Trim('^'); + string allData = ""; + foreach (string x in list) + { + allData += x + "$"; + } + allData = allData.Trim('$'); + + //更新原始模板 + sql = "UPDATE MK_TempleteData SET TempValue_nvarchar=@TempValue_nvarchar WHERE ID_bigint=" + TemDataID; + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempValue_nvarchar",allData) + }; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + //删除原始记录表 + sql = "DELETE FROM MK_TempQuestionData WHERE QuestionIndex_int='" + questionNum + "' AND TempID_bigint='" + TemDataID + "'"; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + + + + string ids = "";//获取返回值,拆分后ID值 + + string questionNumList = ""; + //写入拆分题目 + foreach (string x in newQuestionList) + { + string[] questionList = x.Split(','); + + string mkscoretype = ""; + if (string.IsNullOrEmpty(questionList[7])) + { + mkscoretype = "1"; + } + else + { + mkscoretype = questionList[7]; + } + + questionNumList += questionList[4] + "$"; + sql = string.Format(@"INSERT INTO MK_TempQuestionData( + TempID_bigint, + QuestionIndex_int, + SmallQuestionDetail_nvarchar, + Score_float, + smallQuestionNum_int, + questiontype_int, + mkscoretype_float) VALUES + ({0},{1},{2},{3},{4},1,{5});select @@IDENTITY", + TemDataID, + "'" + questionList[4] + "'", + "''", + questionList[6] == "" ? "0" : questionList[6], + questionList[5], + mkscoretype + ); + ids += new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString() + ","; + } + questionNumList = questionNumList.Trim('$'); + //写入任务表 + 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 + "',0," + exam_subject_id + ",'" + ids.Trim(',') + "','" + zhuguantiList + "','" + questionNumList + "')"; + new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp); + + Response.Write("1"); + } + else + { + Response.Write(r.message); + } + } + } + else + { + Response.Write("找不到该题"); + } + } + else + { + Response.Write("无模板数据"); + } + + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + int action = Globals.Request("action") == "" ? 0 : Convert.ToInt32(Globals.Request("action")); + tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); + subjective = Convert.ToInt64(Globals.Request("subjective")); + token = Globals.Request("token"); + if (action == 0) + { + string sql = "SELECT exam_subject_id,question_num FROM marking_setting_subjective WHERE id=" + subjective; + DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dt.Rows.Count == 0) + { + Response.Write(""); + return; + } + exam_subject_id = Convert.ToInt64(dt.Rows[0]["exam_subject_id"]); + questionNum = dt.Rows[0]["question_num"].ToString(); + + sql = "SELECT template_id FROM exam_subject WHERE id=" + exam_subject_id; + long template_id_main = Convert.ToInt64(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + + sql = "SELECT PaperType FROM MK_TempleteMain WHERE ID_bigint=" + template_id_main; + PaperType = new MysqlDBHelper(tenant).ExecuteScalar(sql).ToString(); + TempMainID = template_id_main.ToString(); + + sql = "SELECT ID_bigint,TempValue_nvarchar,TempPicture64_nvarchar FROM MK_TempleteData WHERE MainID_bigint=" + template_id_main; + dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + bool isHave = false; + TempID = ""; + + foreach (DataRow dr in dt.Rows) + { + string data = dr["TempValue_nvarchar"].ToString(); + if (data != "") + { + string[] list = data.Split('$'); + string zhuguanti = list[3]; + if (zhuguanti != "") + { + string[] quList = zhuguanti.Split('^'); + foreach (string q in quList) + { + if (questionNum == q.Split(',')[4]) + { + TempID = dr["ID_bigint"].ToString(); + TempPicture64_nvarchar = dr["TempPicture64_nvarchar"].ToString(); + QuestionTempValue = q; + xuhao = questionNum; + xiaoti = q.Split(',')[5]; + fenshu = q.Split(',')[6]; + yuejuanfen = q.Split(',')[8]; + isHave = true; + break; + } + } + } + } + } + + foreach (DataRow dr in dt.Rows) + { + string data = dr["TempValue_nvarchar"].ToString(); + if (data != "") + { + string[] list = data.Split('$'); + string zhuguanti = list[3]; + if (zhuguanti != "") + { + string[] quList = zhuguanti.Split('^'); + foreach (string q in quList) + { + ystihaoList += q.Split(',')[4] + ","; + } + } + } + } + ystihaoList = ystihaoList.Trim(','); + + + if (TempID == "") + { + Response.Write(""); + } + else + { + // Response.Write(TempID); + } + // Response.Write(TempID+"*"+ QuestionTempValue); + } + if (action == 1) + { + Response.Clear(); + try + { + UpdateData(); + } + catch + { + Response.Write("拆题失败"); + } + + Response.End(); + } + } + } + + private bool CheckStatus(long exam_subject_id) + { + if (exam_subject_id <= 0) + { + Response.Write("考试id有误,保存失败!"); + return false; + } + + string sql = "SELECT `status` FROM exam_subject WHERE id=" + exam_subject_id; + var examStatus = Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + if (examStatus != 1 && examStatus != 2) + { + Response.Write("当前考试状态无法执行该操作!"); + return false; + } + sql = "SELECT COUNT(1) FROM ScanResult WHERE IsMarking=0 AND IsDeleted=0 AND ExamSubjectId=" + exam_subject_id; + var unScanCount = Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + if (unScanCount > 0) + { + Response.Write("系统正在识别试卷,请全部识别完成后再保存!"); + return false; + } + + sql = "SELECT COUNT(1) FROM MK_ExamResult WHERE ExamSubjectId=" + exam_subject_id + " AND IsSync=0 AND IsObjectiveQuestions_bit=0 " + + " and GroupNO_nvarchar not in (SELECT GroupNo FROM ScanResult WHERE ExamSubjectId=" + exam_subject_id + " and IsDeleted=1)"; + var unSyncCount = Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + if (unSyncCount > 0 && examStatus == 2) + { + Response.Write("系统正在识别分配试题,请等待1分钟后重试!"); + return false; + } + + + return true; + } + + private string RequestPost(string id, string body) + { + // 测试地址 + string url = "http://192.168.2.9:6500/"; + string bearer = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5OGQxOGRjNC1lZDAzLTRiNzMtYTczZS1iMTIxZTRhYzliNWUiLCJpYXQiOiIwNS8yOS8yMDIzIDA5OjM3OjU0IiwidXNlciI6IjIiLCJyb2xlIjoiNSIsInRlbmFudCI6IjEwMDc4IiwibmJmIjoxNjg1MzI0Mjc0LCJleHAiOjE2ODU5MjkwNzQsImlzcyI6Im1rLWFkIiwiYXVkIjoiRXhhbU1hcmtpbmdBZG1pbkNsaWVudCJ9.lVYA6Z2RRhQFYYdj1DgxA7kB6eaYWqvB1wHmaQDBr3Y"; + if (Request.Url.Host.ToLower().Contains("23544.com")) + { + // 正式地址 + url = "https://mk-api.23544.com/ad/"; + bearer = token; + } + else if (Request.Url.Host.ToLower().Contains("localhost")) + { + // 开发地址 + url = "https://192.168.2.8:6500/"; + } + url += "api/marking-setting/sub/" + id + "/cut"; + WebRequest request = WebRequest.Create(url); + request.Method = "POST"; + //post传参数 + byte[] bytes = Encoding.ASCII.GetBytes(body); + request.Headers.Add("Authorization", bearer); + request.ContentType = "application/json"; + request.ContentLength = body.Length; + Stream sendStream = request.GetRequestStream(); + sendStream.Write(bytes, 0, bytes.Length); + sendStream.Close(); + //得到返回值 + WebResponse response = request.GetResponse(); + string OrderQuantity = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("UTF-8")).ReadToEnd(); + return OrderQuantity; + } + + //private string RequestPost(string id, List body) + //{ + // string url = "http://tx.486255.com:6505/api/marking-setting/sub/" + id + "/cut"; + // HttpClient httpClient = new HttpClient(); + // var requestContent = JsonContent.Create(body); + // var response= httpClient.PostAsync(url, requestContent).Result; + // if (!response.IsSuccessStatusCode) + // { + // return string.Empty; + // } + // return response.Content.ReadAsStringAsync().Result; + //} + + public class CutList + { + public string questionNum { get; set; } + public int subQuestionCount { get; set; } + public string score { get; set; } + public string scoreInterval { get; set; } + } + + public class result + { + public string message { get; set; } + public string code { get; set; } + + public string data { get; set; } + + } + + +} \ No newline at end of file diff --git a/Temp/SuccessCut.aspx b/Temp/SuccessCut.aspx new file mode 100644 index 0000000..950afbe --- /dev/null +++ b/Temp/SuccessCut.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SuccessCut.aspx.cs" Inherits="Temp_SuccessCut" %> + + + + + + + + + +
拆题成功
+ + diff --git a/Temp/SuccessCut.aspx.cs b/Temp/SuccessCut.aspx.cs new file mode 100644 index 0000000..7b1764c --- /dev/null +++ b/Temp/SuccessCut.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class Temp_SuccessCut : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/Temp/TempDraw.aspx b/Temp/TempDraw.aspx new file mode 100644 index 0000000..5c83340 --- /dev/null +++ b/Temp/TempDraw.aspx @@ -0,0 +1 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TempDraw.aspx.cs" Inherits="Temp_TempDraw" %> diff --git a/Temp/TempDraw.aspx.cs b/Temp/TempDraw.aspx.cs new file mode 100644 index 0000000..fc7859b --- /dev/null +++ b/Temp/TempDraw.aspx.cs @@ -0,0 +1,881 @@ +using Emgu.CV; +using Emgu.CV.CvEnum; +using Emgu.CV.Structure; +using Emgu.CV.Util; +using Lucee.WebBase.Data; +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Lucee.WebBase.Utils; +using System.Net; + +public partial class Temp_TempDraw : System.Web.UI.Page +{ + public static BoxType bt = null; + public long tenant = 0; + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + int action = Convert.ToInt32(Globals.Request("action")==""?0:Convert.ToInt32(Globals.Request("action"))); + if (action == 1) { + Response.Clear(); + DrawGo(); + Response.End(); + } + + } + } + + private void DrawGo() + { + long TempID = Convert.ToInt64(Globals.Request("TempID")); + long UserID = Convert.ToInt64(Globals.Request("UserID")); + tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); + + //开始阅卷 + //获取主模板ID + DataTable dt = MK_Data.GetMainTempData(TempID); + if (dt.Rows.Count > 0) + { + //获取机阅基础数据 + bt = MK_Data.GetBoxType(MK_Data.GetMainTempDataMainBoxType(Convert.ToInt32(dt.Rows[0]["MainID_bigint"]))); + string[] GetData = dt.Rows[0]["TempValue_nvarchar"].ToString().Split('$'); + int width = Convert.ToInt32(GetData[6].Split(',')[0]); + int height = Convert.ToInt32(GetData[6].Split(',')[1]); + dt = MK_Data.GetMinTempDataUser(TempID, UserID); + + string imgUrl = Globals.Request("imgUrl"); + Bitmap bmp; + if (imgUrl == "") + { + bmp = new Bitmap(UrlToImage(dt.Rows[0]["TempPicture64_nvarchar"].ToString())); + } + else + { + bmp = new Bitmap(UrlToImage(imgUrl)); + } + //还原图片大小,这里可能有逻辑错误 + bmp = MK_Operater.ScaleToSize(bmp, width, height); + //获取旋转偏移量 + string[] PXGetData = dt.Rows[0]["TempValue_nvarchar"].ToString().Split('$'); + bmp = MK_Operater.ImageRotates(bmp, (float)Convert.ToDouble(dt.Rows[0]["Rotate_float"])).Bitmap; + //切换模板数据 + dt = MK_Data.GetMainTempData(TempID); + string[] FinleGetData = dt.Rows[0]["TempValue_nvarchar"].ToString().Split('$'); + FinleGetData[0] = PXGetData[0]; + //斜率 + double xielv = Convert.ToDouble(dt.Rows[0]["XieLv_float"]); + //原始宽度 + int oldWidth = Convert.ToInt32(dt.Rows[0]["CutWidth_int"]); + //原始高度 + int oldHeight = Convert.ToInt32(dt.Rows[0]["CutHeight_int"]); + //原始坐标 + string PYPostionList = dt.Rows[0]["PyPPostion_nvarchar"].ToString(); + //切换执行数组,如果没得定位点就不要覆盖原始数据 + Mat color_mat; + Mat mat_dilate; + VectorOfVectorOfPoint selected_contours; + CommonUse commonUse = new CommonUse(); + string[] PYPostion; + if (GetData[0] != "") + { + string[] postionc = GetData[0].Split('^'); + //pb_image.Image = bmp; + for (int i = 0; i < postionc.Length; i++) + { + string[] postCutList = postionc[i].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(postCutList[0])); + int Y = Convert.ToInt32(Convert.ToDouble(postCutList[1])); + int W = Convert.ToInt32(Convert.ToDouble(postCutList[2])); + int H = Convert.ToInt32(Convert.ToDouble(postCutList[3])); + //bmp = commonUse.DrawGridByXYDraw(bmp, X, W, 1, Y, H, 1); + } + + GetData = FinleGetData; + + + + + + + + //换算未灰度图片 并选取点 + Image EmguImagex = new Image(bmp); + Mat mat_threshold = new Mat(); + CvInvoke.Threshold(EmguImagex, mat_threshold, 120, 253, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + mat_dilate = commonUse.MyDilate(mat_threshold); + selected_contours = commonUse.GetUsefulContours(mat_dilate, 1); + + + //color_mat = commonUse.DrawContours(mat_dilate, selected_contours); + //Response.Write(ImgToBase64String(color_mat.Bitmap)); + //bmp.Dispose(); + //return; + + + + //获取当前斜率 + float myXielv = MK_Operater.GetPostionXYByFindRoteBmp(EmguImagex.Mat, selected_contours, GetData[0]); + if (myXielv == -100||myXielv==0) + { + Response.Write("-1"); + return; + } + + + + + + + //同步主图斜率 + float flagxie = ((90 - myXielv) - (90 - (float)xielv)); + //更新图片 + EmguImagex.Bitmap = MK_Operater.ImageRotates(bmp, flagxie).Bitmap; + //重新查找点阵 + CvInvoke.Threshold(EmguImagex, mat_threshold, bt.Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + Mat mat_dilate6 = commonUse.MyDilate(mat_threshold); + VectorOfVectorOfPoint selected_contours6; + selected_contours6 = commonUse.GetUsefulContours(mat_dilate6, 1); + + + //color_mat = EmguImagex.Mat; + //color_mat = commonUse.DrawContours(color_mat, selected_contours6); + //Response.Write(ImgToBase64String(color_mat.Bitmap)); + //bmp.Dispose(); + //return; + + + + + //根据定位点重新裁剪图片 + EmguImagex = MK_Operater.GetPostionXYByFind(EmguImagex.Mat, selected_contours6, GetData[0]); + if (EmguImagex == null) + { + return; + } + //等比例同步 + EmguImagex.Bitmap = MK_Operater.ScaleToSize(EmguImagex.Bitmap, oldWidth, oldHeight); + //下列操作项定位点数据 + PYPostion = PYPostionList.Split(','); + //最终选取图形 + CvInvoke.Threshold(EmguImagex, mat_threshold, bt.Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + mat_dilate = commonUse.MyDilate(mat_threshold); + selected_contours = commonUse.GetUsefulContoursYueJuan(mat_dilate, 1); + color_mat = EmguImagex.Mat; + color_mat = commonUse.DrawContours(color_mat, selected_contours); + bmp = color_mat.Bitmap; + } + else + { + PYPostion = "0,0".Split(','); + Image EmguImagex = new Image(bmp); + Mat mat_threshold = new Mat(); + CvInvoke.Threshold(EmguImagex, mat_threshold, bt.Threshold, 254, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + mat_dilate = commonUse.MyDilate(mat_threshold); + selected_contours = commonUse.GetUsefulContoursYueJuan(mat_dilate, 1); + color_mat = EmguImagex.Mat; + color_mat = commonUse.DrawContours(color_mat, selected_contours); + bmp = color_mat.Bitmap; + } + + //如果要取条码 + if (GetData[5] != "") + { + string[] tiaomaData = GetData[5].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(tiaomaData[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(tiaomaData[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(tiaomaData[2])); + int H = Convert.ToInt32(Convert.ToDouble(tiaomaData[3])); + bmp= commonUse.DrawGridByXYDraw(bmp, X, W, 1, Y, H, 1); + } + + //如果要取填涂 + if (GetData[1] != "") + { + string[] XuehaoData = GetData[1].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(XuehaoData[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(XuehaoData[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(XuehaoData[2])); + int H = Convert.ToInt32(Convert.ToDouble(XuehaoData[3])); + int num = Convert.ToInt32(Convert.ToDouble(XuehaoData[4])); + int wL = Convert.ToInt32(W / num); + int hL = Convert.ToInt32(H / 10); + bmp = commonUse.DrawGridByXYDraw(bmp, X, wL, num, Y, hL, 10); + } + //缺考 + if (GetData[4] != "") + { + string[] quekao = GetData[4].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(quekao[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(quekao[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(quekao[2])); + int H = Convert.ToInt32(Convert.ToDouble(quekao[3])); + bmp = commonUse.DrawGridByXYDraw(bmp, X, W, 1, Y, H, 1); + } + if (GetData[2] != "") + { + string[] keguantiList = GetData[2].Split('^'); + for (int i = 0; i < keguantiList.Length; i++) + { + string[] keguanPos = keguantiList[i].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(keguanPos[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(keguanPos[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(keguanPos[2])); + int H = Convert.ToInt32(Convert.ToDouble(keguanPos[3])); + int xuanXiang = Convert.ToInt32(keguanPos[6]);//选项数量 + + + string bigTihao = ""; + if (keguanPos[5].ToUpper().Contains("M")) // 如果存在客观题 + { + bigTihao = keguanPos[5].ToUpper().Split('M')[0] + "M"; + keguanPos[5] = keguanPos[5].ToUpper().Split('M')[1]; + keguanPos[4] = keguanPos[4].ToUpper().Split('M')[1]; + } + int tiliang = Convert.ToInt32(keguanPos[5]) - Convert.ToInt32(keguanPos[4]) + 1;//题量 + + + if (keguanPos[7].ToString() == "0")//横向取值 + { + int wL = Convert.ToInt32(W / xuanXiang); + int hL = Convert.ToInt32(H / tiliang); + bmp = commonUse.DrawGridByXYDraw(bmp, X, wL, xuanXiang, Y, hL, tiliang); + } + else + { + int wL = Convert.ToInt32(W / tiliang); + int hL = Convert.ToInt32(H / xuanXiang); + bmp = commonUse.DrawGridByXYDraw(bmp, X, wL, tiliang, Y, hL, xuanXiang); + } + } + } + if (GetData[3] != "") + { + string[] Datalist = GetData[3].Split('^'); + foreach (string postiontiaoma in Datalist) + { + string[] tiaomaData = postiontiaoma.Split(','); + int X = Convert.ToInt32(Convert.ToDouble(tiaomaData[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(tiaomaData[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(tiaomaData[2])); + int H = Convert.ToInt32(Convert.ToDouble(tiaomaData[3])); + bmp = commonUse.DrawGridByXYDraw(bmp, X, W, 1, Y, H, 1); + } + } + Response.Write(ImgToBase64String(bmp)); + bmp.Dispose(); + } + + } + + public static Bitmap UrlToImage(string url) + { + WebRequest imgRequest = WebRequest.Create(url); + + HttpWebResponse res=null; + try + { + res = (HttpWebResponse)imgRequest.GetResponse(); + imgRequest.Timeout = 50000; + if (res.StatusCode.ToString() == "OK") + { + return new Bitmap(imgRequest.GetResponse().GetResponseStream()); + } + else + { + return null; + } + } + catch (WebException ex) + { + res = (HttpWebResponse)ex.Response; + return null; + } + finally + { + if (res != null) { + res.Dispose(); + res.Close(); + } + imgRequest.Abort(); + } + } + + + /// + /// 检查图片是否空白图片 + /// + /// Image + /// 是否空白图片 + public static bool CheckTransparentImg(System.Drawing.Image img) + { + bool blnIsTransparent = false; + //加载位图 + Bitmap bitMap = new Bitmap(img); + //图片总像素 + int intAll = img.Height * img.Width; + int intCount = 0; + //按像素遍历 + for (int intY = 0; intY < img.Height; intY++) + { + for (int intX = 0; intX < img.Width; intX++) + { + if (bitMap.GetPixel(intX, intY).GetBrightness() == 1) + { + intCount += 1; + } + } + } + + float a = (float)intCount / (float)intAll; + Console.WriteLine(a.ToString()); + Console.WriteLine(intCount.ToString() + "---" + intAll.ToString()); + + + //释放资源 + bitMap.Dispose(); + int al = intAll - 1000; + if (intCount > al) + { + blnIsTransparent = true; + } + return blnIsTransparent; + } + + + + public static Bitmap Base64StringToImage(string strbase64) + { + try + { + byte[] arr = Convert.FromBase64String(strbase64); + MemoryStream ms = new MemoryStream(arr); + Bitmap bmp = new Bitmap(ms); + ms.Close(); + return bmp; + } + catch (Exception ex) + { + return null; + } + } + public static string ImgToBase64String(Bitmap bmp) + { + try + { + MemoryStream ms = new MemoryStream(); + bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); + byte[] arr = new byte[ms.Length]; + ms.Position = 0; + ms.Read(arr, 0, (int)ms.Length); + ms.Dispose(); + ms.Close(); + return Convert.ToBase64String(arr); + } + catch (Exception ex) + { + return null; + } + } +} +public class MK_Data +{ + + public static long tenant = 0; + + + public static void GetTenant(){ + tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); + } + + /// + /// 获取我需要扫描的试卷 + /// + /// + public static DataTable GetScanResult() + { + GetTenant(); + string sql = "SELECT top 1 * FROM ScanResult WHERE IsMarking=0 order by GroupNo ASC"; + DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dt.Rows.Count > 0) + { + return dt; + } + else + { + return null; + } + } + + /// + /// 获取我需要扫描的试卷 + /// + /// + public static DataTable GetScanResultDetail(int GroupNo) + { + GetTenant(); + string sql = "SELECT * FROM ScanResult WHERE GroupNo=" + GroupNo + " AND IsMarking=0 order by pageindex ASC"; + DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dt.Rows.Count > 0) + { + return dt; + } + else + { + return null; + } + } + + /// + /// 获取主模板数据 + /// + /// + /// + public static DataTable GetMainTempData(long temID) + { + + GetTenant(); + string sql = "select detaID_bigint from MK_TempleteDataUser where ID_bigint=" + temID; + long detaID_bigint = Convert.ToInt64(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + + + sql = "SELECT * FROM MK_TempleteData WHERE ID_bigint = " + detaID_bigint + " ORDER BY PageIndex_int ASC"; + return new MysqlDBHelper(tenant).ExecuteQuery(sql); + } + + /// + /// 获取主模板数据 + /// + /// + /// + public static int GetMainTempDataMainBoxType(long temID) + { + GetTenant(); + string sql = "SELECT BoxType FROM MK_TempleteMain WHERE ID_bigint=" + temID; + return Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + + } + + /// + /// 获取用户模板数据 + /// + /// + /// + /// + public static DataTable GetMinTempDataUser(long tempID, long userID) + { + GetTenant(); + string sql = "SELECT * FROM MK_TempleteDataUser WHERE UserID_bigint=" + userID + " AND ID_bigint=" + tempID; + return new MysqlDBHelper(tenant).ExecuteQuery(sql); + + } + + /// + /// 判断是否有重复试卷扫入 + /// + /// + /// + /// + public static bool CheckRepeatMKFlag(string ksNum, string StudentNO) + { + GetTenant(); + string sql = "SELECT COUNT(1) FROM ScanResult WHERE ExamSubjectSchoolId='" + ksNum + "' AND OCRStudentExamNum='" + StudentNO + "' AND ismarking=1"; + int count = Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + if (count > 0) + { + return false; + } + return true; + } + + /// + /// 清理所有该用户数据 + /// + public static void DeleteAllMKSTData(string GroupNo, string StudentNO) + { + GetTenant(); + string sql = string.Format("DELETE MK_ExamResult WHERE GroupNO_nvarchar = {0} AND StudentNo_nvarchar = '{1}'", GroupNo, StudentNO); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + } + + + /// + /// 删除已有考号数据 + /// + /// + /// + public static void DeleteStudentExamResultData(string ksNum, string StudentNO) + { + GetTenant(); + //删除原始表中的数据 + string sql = string.Format("DELETE MK_ExamResult WHERE ExamID_bigint = {0} AND StudentNo_nvarchar = '{1}'", ksNum, StudentNO); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + + } + + + + + /// + /// 新增一条错误数据 + /// + /// + /// + /// + /// + /// + /// + public static void UpdateMkGo(string groupID, string orcStudentNum) + { + + GetTenant(); + string sql = string.Format("UPDATE ScanResult SET IsMarking=1,OCRStudentExamNum='" + orcStudentNum + "' WHERE GroupNo=" + groupID); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + } + + /// + /// 新增一条错误数据 + /// + /// + /// + /// + /// + /// + /// + public static void UpdateMkGoNoOrcStudentNum(string groupID) + { + + GetTenant(); + string sql = string.Format("UPDATE ScanResult SET IsMarking=1 WHERE GroupNo=" + groupID); + new MysqlDBHelper(tenant).ExecuteNoQuery(sql); + } + + + + /// + /// 获取扫描类型 + /// + /// + /// + public static BoxType GetBoxType(int type) + { + BoxType b = new BoxType(); + //红框 + if (type == 1) + { + b.fillRate = 30; + b.Threshold = 50; + } + if (type == 2) + { + b.fillRate = 60; + b.Threshold = 60; + } + if (type == 3) + { + b.fillRate = 45; + b.Threshold = 18; + } + return b; + } +} +public class BoxType +{ + public int fillRate { get; set; } + public int Threshold { get; set; } +} + + + +public class MK_Operater +{ + // + /// 缩放图片 + /// + /// 原图片 + /// 新图片宽度 + /// 新图片高度 + /// 新图片 + public static Bitmap ScaleToSize(Bitmap bitmap, int width, int height) + { + try + { + + + if (bitmap == null) + { + return null; + } + if (bitmap.Width == width && bitmap.Height == height) + { + return bitmap; + } + + var scaledBitmap = new Bitmap(width, height); + using (var g = Graphics.FromImage(scaledBitmap)) + { + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.DrawImage(bitmap, 0, 0, width, height); + } + return scaledBitmap; + } + catch + { + return null; + } + } + + public static Image ImageRotates(Bitmap Map, double Dou, bool Bol = true) + { + try + { + Image Imga1 = new Image(Map); + //Image Imga2 = Imga1.Rotate(Dou, new Bgra(0, 0, 0, 0), Bol); + // Image Imga2 = Imga1.Rotate(Dou, new Bgra(0, 0, 0, 0), Bol) 等同于 + Image Imga2 = Imga1.Rotate(Dou, new PointF(Imga1.Width / 2, Imga1.Height / 2), Inter.Cubic, new Bgra(255, 255, 255, 255), Bol); + return Imga2; + } + catch + { + return null; + } + } + + /// + /// 获取偏移量 通过矩形查找 + /// + /// + /// + /// + /// + /// + /// + public static float GetPostionXYByFindRoteBmp(Mat color_mat, VectorOfVectorOfPoint selected_contours, string postionCut) + { + + try + { + CommonUse commonUse = new CommonUse(); + string[] postionc = postionCut.Split('^'); + Point GrXY; + int Y2 = 0, Y1 = 0, X2 = 0, X1 = 0; + for (int i = 0; i < postionc.Length; i++) + { + string[] postCutList = postionc[i].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(postCutList[0])); + int Y = Convert.ToInt32(Convert.ToDouble(postCutList[1])); + int W = Convert.ToInt32(Convert.ToDouble(postCutList[2])); + int H = Convert.ToInt32(Convert.ToDouble(postCutList[3])); + //commonUse.DrawGridByXY(测试查找坐标.myFrom.PB_guodu, X, W, 1, Y, H, 1);Response.Write(ImgToBase64String(bmp)); + string mx = ""; + try + { + mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY); + } + catch + { + mx = "null"; + GrXY = new Point(0, 0); + } + + if (mx.Trim() != "A") + { + break; + } + Point Mx = GrXY; + if (i == 0)//左上角 + { + Y1 = GrXY.Y; + X1 = GrXY.X; + + } + if (i == 2)//左下角 + { + X2 = GrXY.X; + Y2 = GrXY.Y; + } + } + return (float)(Math.Atan2((Y2 - Y1), (X2 - X1)) * (180 / Math.PI)); + } + catch + { + return -100; + } + } + + + /// + /// 获取偏移量 通过矩形查找 + /// + /// + /// + /// + /// + /// + /// + public static Image GetPostionXYByFind(Mat color_mat, VectorOfVectorOfPoint selected_contours, string postionCut) + { + + try + { + CommonUse commonUse = new CommonUse(); + string[] postionc = postionCut.Split('^'); + string PYPostion = ""; + Point GrXY; + int PostionWW = 0; + int PostionHH = 0; + + + int Y2 = 0, Y1 = 0, X2 = 0, X1 = 0; + + for (int i = 0; i < postionc.Length; i++) + { + string[] postCutList = postionc[i].Split(','); + int X = Convert.ToInt32(Convert.ToDouble(postCutList[0])); + int Y = Convert.ToInt32(Convert.ToDouble(postCutList[1])); + int W = Convert.ToInt32(Convert.ToDouble(postCutList[2])); + int H = Convert.ToInt32(Convert.ToDouble(postCutList[3])); + string mx = ""; + try + { + mx = commonUse.GetValueAndDrawGrid_Find(color_mat.Bitmap, selected_contours, X, W, 1, Y, H, 1, "", out GrXY); + } + catch + { + mx = "null"; + GrXY = new Point(0, 0); + } + + if (mx.Trim() != "A") + { + break; + } + Point Mx = GrXY; + if (i == 0)//左上角 + { + PYPostion = GrXY.X + "," + GrXY.Y; + Y1 = GrXY.Y; + X1 = GrXY.X; + + } + if (i == 1)//右上角 + { + PostionWW = GrXY.X; + } + if (i == 2)//左下角 + { + PostionHH = GrXY.Y; + X2 = GrXY.X; + Y2 = GrXY.Y; + } + } + string[] posList = PYPostion.Split(','); + int PostionX = Convert.ToInt32(posList[0]); + int PostionY = Convert.ToInt32(posList[1]); + int PostionW = PostionWW - PostionX; + int PostionH = PostionHH - PostionY; + + //裁剪 + Rectangle rectangle = new Rectangle(PostionX, PostionY, PostionW, PostionH); + Image Sub = new Image(color_mat.Bitmap).GetSubRect(rectangle); + Image CropImage = new Image(Sub.Size); + CvInvoke.cvCopy(Sub, CropImage, IntPtr.Zero); + //获取偏移量 + return CropImage; + } + catch + { + return null; + } + } + + + + + + + /// + /// 获取裁剪 L T W H + /// + /// + public static Image GetMatCutImg(Bitmap bmp, int sX, int sT, int sW, int sH) + { + List> postionimageCut = new List>(); + int L = sX; + int T = sT; + int W = sW; + int H = sH; + Rectangle rectangle = new Rectangle(L, T, W, H); + Image Sub = new Image(bmp).GetSubRect(rectangle); + Image CropImage = new Image(Sub.Size); + CvInvoke.cvCopy(Sub, CropImage, IntPtr.Zero); + return CropImage; + } + + + + /// + /// 获取主观题 + /// + /// + /// + /// + /// + public static List GetZhuguantiText(Mat color_mat, string[] PYPostion, string postiontiaomaX, int pageIndex) + { + string[] Datalist = postiontiaomaX.Split('^'); + List lt = new List(); + CommonUse commonUse = new CommonUse(); + + foreach (string postiontiaoma in Datalist) + { + ZhuguantiList zd = new ZhuguantiList(); + string[] tiaomaData = postiontiaoma.Split(','); + int X = Convert.ToInt32(Convert.ToDouble(tiaomaData[0])) - Convert.ToInt32(PYPostion[0]); + int Y = Convert.ToInt32(Convert.ToDouble(tiaomaData[1])) - Convert.ToInt32(PYPostion[1]); ; + int W = Convert.ToInt32(Convert.ToDouble(tiaomaData[2])); + int H = Convert.ToInt32(Convert.ToDouble(tiaomaData[3])); + Image bytimg = GetMatCutImg(color_mat.Bitmap, X, Y, W, H); + zd.btm = new Bitmap(bytimg.Bitmap); + zd.num = tiaomaData[4]; + zd.QuestionSmallNum = Convert.ToInt32(tiaomaData[5]); + lt.Add(zd); + bytimg.Bitmap.Dispose(); + } + return lt; + } + + + + + public static Bitmap GetDrawRectangleWhite(Bitmap bit) + { + Bitmap bmp = new Bitmap(bit); + float w = (float)(2);//边框的宽度,可取任意值 + using (Graphics g = Graphics.FromImage(bmp)) + { + // g.CopyFromScreen(0, 0, 0, 0, Screen.AllScreens[0].Bounds.Size);//抓取背景图 + using (Pen pen = new Pen(Color.White, w)) + { + + g.DrawRectangle(pen, new Rectangle(0, 0, Math.Abs(bmp.Width), Math.Abs(bmp.Height)));//加边框 + g.Dispose(); + } + } + return bmp; + } + + + + + + +} \ No newline at end of file diff --git a/Temp/UserTemp.aspx b/Temp/UserTemp.aspx new file mode 100644 index 0000000..cd71e1c --- /dev/null +++ b/Temp/UserTemp.aspx @@ -0,0 +1,170 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserTemp.aspx.cs" Inherits="Temp_UserTemp" %> + + + + + + + 导入外部答题卡制作模板 + + + + + + + + + + + + +
+ + + +
+
+

+ 1.如果图片倾斜,请调整倾斜角度,让他水平,如果倾斜角度过大,影响阅卷 +

+

+ 2.请保证定位点在黑框内,且黑框框选处减少干扰,例如线条文字等。 +

+
+ +
+ +
+
+ + + + + +
+
+ + + + + + + \ No newline at end of file diff --git a/Temp/UserTemp.aspx.cs b/Temp/UserTemp.aspx.cs new file mode 100644 index 0000000..b87a30f --- /dev/null +++ b/Temp/UserTemp.aspx.cs @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data.SqlClient; +using System.Data; +using Lucee.WebBase.Utils; +using Lucee.WebBase.Data; +using System.Drawing; +using Emgu.CV; +using Emgu.CV.Util; +using Emgu.CV.Structure; +using System.Drawing.Drawing2D; +using System.Net; +using MySql.Data.MySqlClient; + +public partial class Temp_UserTemp : System.Web.UI.Page +{ + + + public long TempID = 0; + public string Bindlist = ""; + public string imgage = ""; + public string UserID = ""; + public string Rotate = ""; + public string ID_bigint = ""; + public string islocked = ""; + public string pager = ""; + public long tenant = 0; + + protected void Page_Load(object sender, EventArgs e) + { + + + int action = Globals.Request("action") == "" ? 0 : Convert.ToInt32(Globals.Request("action")); + tenant = Globals.Request("tenant") == "" ? 0 : Convert.ToInt64(Globals.Request("tenant")); + if (action != 0) + { + + Response.Clear(); + switch (action) + { + case 1: + UpdateTempData(); + break; + case 2: + AnsyTemplete(); + break; + } + Response.End(); + } + else + { + + UserID = Globals.Decrypt(Globals.Request("UserID")); + pager = Globals.Request("pager"); + if (string.IsNullOrEmpty(UserID)) + { + Response.Write(""); + return; + } + else + { + long UID = Convert.ToInt64(UserID); + + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID + " AND UserID_bigint=" + UID; + //string sql = "select * from MK_TempleteDataUser where DetaID_bigint=" + TempID ; + DataTable dtx = new MysqlDBHelper(tenant).ExecuteQuery(sql); + + if (dtx.Rows.Count > 0) + { + ID_bigint = dtx.Rows[0]["ID_bigint"].ToString(); + Bindlist = dtx.Rows[0]["TempValue_nvarchar"].ToString(); + imgage = dtx.Rows[0]["TempPicture64_nvarchar"].ToString(); + Rotate = dtx.Rows[0]["Rotate_float"].ToString(); + islocked = dtx.Rows[0]["islocked_int"].ToString(); + } + else + { + Response.Write(""); + } + } + + } + } + + public void AnsyTemplete() + { + UserID = Globals.Request("UserID"); + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + string totalHtml = Server.UrlDecode(Globals.Request("totalHtml")); + string Rotate_float = Globals.Request("roteDY"); + string sql = "Update MK_TempleteDataUser SET islocked_int=1 where DetaID_bigint=" + TempID + " AND UserID_bigint=" + Convert.ToInt64(UserID); + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempValue_nvarchar",totalHtml), + new MySqlParameter("@Rotate_float",Rotate_float), + }; + + if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) == 1) + { + AnsyTemp(Convert.ToInt64(UserID), TempID); + } + } + + private void UpdateTempData() + { + + + UserID = Globals.Request("UserID"); + TempID = Globals.Request("TempID") == "" ? 0 : Convert.ToInt32(Globals.Request("TempID"));//获取小模板ID + string totalHtml = Server.UrlDecode(Globals.Request("totalHtml")); + string Rotate_float = Globals.Request("roteDY"); + string sql = "Update MK_TempleteDataUser SET TempValue_nvarchar=@TempValue_nvarchar,Rotate_float=@Rotate_float where DetaID_bigint=" + TempID + " AND UserID_bigint="+ Convert.ToInt64(UserID); + MySqlParameter[] sp = new MySqlParameter[] { + new MySqlParameter("@TempValue_nvarchar",totalHtml), + new MySqlParameter("@Rotate_float",Rotate_float), + }; + + if (new MysqlDBHelper(tenant).ExecuteNoQuery(sql, sp) == 1) { + AnsyTemp(Convert.ToInt64(UserID), TempID); + } + } + + /// + /// 获取主模板数据 + /// + /// + /// + public int GetMainTempDataMainBoxType(long temID) + { + string sql = "SELECT BoxType FROM MK_TempleteMain WHERE ID_bigint=" + temID; + return Convert.ToInt32(new MysqlDBHelper(tenant).ExecuteScalar(sql)); + + } + /// + /// 锁定模板数据 + /// + public void AnsyTemp(long userID, long TempID) + { + try + { + string sql = "SELECT * FROM MK_TempleteDataUser WHERE detaID_bigint=" + TempID + " AND UserID_bigint=" + UserID; + DataTable dt = new MysqlDBHelper(tenant).ExecuteQuery(sql); + if (dt.Rows.Count <= 0) + { + Response.Write("NODATA"); + return; + } + Bitmap PictureBoxBitMap = ImgGet(dt.Rows[0]["TempPicture64_nvarchar"].ToString()); + if (PictureBoxBitMap == null) + { + Response.Write("NOPICTURE"); + } + string[] GetData = dt.Rows[0]["TempValue_nvarchar"].ToString().Split('$'); + string PYPostionList = ""; + //BoxType bt = null; + //bt = GetBoxType(GetMainTempDataMainBoxType(Convert.ToInt32(dt.Rows[0]["MainID_bigint"]))); + + if (GetData[0] != "") + { + //计算模板图片参数 + double xielv = 0; + int width = Convert.ToInt32(GetData[6].Split(',')[0]); + int height = Convert.ToInt32(GetData[6].Split(',')[1]); + PictureBoxBitMap = ScaleToSize(PictureBoxBitMap, width, height); + Image imagex = new Image(PictureBoxBitMap); + CommonUse commonUse = new CommonUse(); + Mat mat_threshold1 = new Mat(); + + + + + CvInvoke.Threshold(imagex, mat_threshold1, 254, 255, Emgu.CV.CvEnum.ThresholdType.BinaryInv); + Mat mat_dilate1 = commonUse.MyDilate(mat_threshold1); + VectorOfVectorOfPoint selected_contours1; + selected_contours1 = commonUse.GetUsefulContoursDingWei(mat_dilate1, 1); + Image currentFramext = new Image(PictureBoxBitMap); + Mat color_mxxx = commonUse.GetPostionXYByFindPostionAndXieLv(imagex.Mat, selected_contours1, GetData[0], out PYPostionList, currentFramext, out xielv); + if (xielv == -100) + { + Response.Write("TEMPERRO"); + return; + } + imagex.Dispose(); + color_mxxx.Dispose(); + PictureBoxBitMap.Dispose(); + Response.Write("ok"); + return; + } + Response.Write("ok"); + + } + catch (Exception ex) + { + Response.Write("TEMPERRO"); + } + } + + + private Bitmap ScaleToSize(Bitmap bitmap, int width, int height) + { + if (bitmap == null) + { + return null; + } + if (bitmap.Width == width && bitmap.Height == height) + { + return bitmap; + } + + var scaledBitmap = new Bitmap(width, height); + using (var g = Graphics.FromImage(scaledBitmap)) + { + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + g.DrawImage(bitmap, 0, 0, width, height); + } + return scaledBitmap; + } + + // + /// 图片另存为 + /// + /// 路径 + public Bitmap ImgGet(string url) + { + + WebRequest imgRequest = WebRequest.Create(url); + HttpWebResponse res=null; + + try + { + res = (HttpWebResponse)imgRequest.GetResponse(); + if (res.StatusCode.ToString() == "OK") + { + return new Bitmap(imgRequest.GetResponse().GetResponseStream()); + } + else + { + return null; + } + } + catch (WebException ex) + { + return null; + } + finally { + res.Dispose(); + imgRequest.Abort(); + res.Close(); + } + + + + + GC.Collect(); + } + + + +} \ No newline at end of file diff --git a/Web.Debug.config b/Web.Debug.config new file mode 100644 index 0000000..59941db --- /dev/null +++ b/Web.Debug.config @@ -0,0 +1,32 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Web.config b/Web.config new file mode 100644 index 0000000..7281bce --- /dev/null +++ b/Web.config @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/css/SplitQuestion.css b/css/SplitQuestion.css new file mode 100644 index 0000000..8a2d669 --- /dev/null +++ b/css/SplitQuestion.css @@ -0,0 +1,70 @@ +.rigthtControl { + float:right;width:300px; border-left:1px solid #ddd;border-left:1px solid #999; padding-left:10px; min-height:1200px; background:#fff; height:100%; position:fixed; right:0; top:0; +} +.leftControl { + width:auto; overflow:hidden; float:left; +} +.leftControl img { + width:100%; float:left; +} + +.rigthtControl .xul { + width: 100%; + margin: 0; + padding: 0; + margin-top: 10px; + float: left; +} + .rigthtControl .xul li { + float: left; + width: 90%; + padding: 5%; + font-size: 14px; + border-top: 1px solid #ff3300; + } + .rigthtControl ul li label { + margin-right:10px; + } +.goPeizhi { + cursor: pointer; + width: 120px; + border-radius: 5px; + float: left; + border: 1px solid #ddd; + overflow: hidden; + color: #666; + text-align: center; + font-size: 12px; + margin-left: 38px; + height: 30px; + background: #cd0a0a; + color: #fff; + line-height: 30px; +} +.goPeizhi:hover { + background: #999; + color: #fff; + border-radius: 5px; +} +.boxscore { + width: 130px; margin-right:5px; + font-size: 12px; + border: 1px solid #ddd; + height: 80px; + float: left; + margin-top: 10px; padding:10px; + position: relative; border-radius:3px; box-shadow:3px 3px 3px #333; +} + .boxscore label { + float: left; + width: 50%; + font-size: 14px; + margin-bottom: 5px; + margin-top: 5px; + } + .boxscore label.row { + width:100%; + } + .boxscore span { + position:absolute; right:0; bottom:0; border-radius:10px; width:30px; height:20px; line-height:20px; text-align:center; background:#ff3300; color:#fff; + } \ No newline at end of file diff --git a/css/default.css b/css/default.css new file mode 100644 index 0000000..8d0318a --- /dev/null +++ b/css/default.css @@ -0,0 +1,322 @@ + + +body {height: 100%; overflow-x:hidden;font-family:'Microsoft YaHei UI'; } +::-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 { + border: 0 none; + color: inherit; + margin: 0; + padding: 0; + vertical-align: baseline; + max-height: 1000rem;font-family:'Microsoft YaHei UI'; +} + +.divBG { + background: gray; + position: fixed; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + z-index: 99998; + opacity: 0.6; +} + +.divbgbox { + width: 300px; + height: 150px; + position: fixed; + z-index: 99999; padding:30px; border-radius:10px; + margin: auto; background:#fff; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + + + + +.right_list { + position: fixed; + right: 0; + top: 0; + height: auto; + overflow: hidden; + border-left: 1px solid #363636; + width: 350px; + height: 100%; + background: #fff; +} +.right_list .ul { float:left; width:100%;} +.right_list .ul li { float:left; width:100%; text-align:center; font-size:14px; padding-top:10px; padding-bottom:10px; box-shadow:3px 3px 3px #000; } +.right_list .ul li.hover { border-bottom:1px solid #ddd; background:#363636; color:#fff; height:20px; line-height:20px; margin-top:0; box-shadow:5px 5px 5px #999;} +.right_list .ul li.hover_b { border-bottom:1px solid #ddd; background:#cd0a0a; color:#fff; height:40px; line-height:40px;} +.right_list .ul li input { width:50px; } + .right_list .ul li .goPeizhi { + cursor: pointer; + width: 120px; border-radius:5px; + float:left; + border: 1px solid #ddd; + overflow: hidden; + color: #666; + text-align: center; + font-size: 12px; + margin-left:38px; + height: 30px; background:#cd0a0a; color:#fff; + line-height:30px; + } + .right_list .ul li .goPeizhi:hover { + background: #999; + color: #fff; + border-radius: 5px; + } + .right_list .ul li div { + font-size: 12px; + float: left; + + width: 100%; + text-align: center; + } +.right_list .ul li select{ padding:5px;} +.right_list .ul li input { padding:5px;} + .right_list .ul li label { + font-size: 12px; + border: 1px solid #ddd; + padding: 5px; + cursor: pointer; + } + .right_list .ul li span{ float:right; border:1px solid #ddd; background:#fff; color:#555;} + +.right_list .lineul { float:left; width:100%; } +.right_list .lineul li { background:#fff; float:left; padding:5px; font-size:12px; width:100%; height:20px; line-height:20px; margin-bottom:10px;} +.right_list .lineul li div.sp { float:left; width:40px; background:#ff3300; padding:5px; height:20px; padding-left:5px; padding-right:5px; line-height:20px; overflow:hidden; } + .right_list .lineul li div.sp .go { + width: 30px; + height: 20px; + overflow: hidden; + + height: 20px; + line-height: 20px; + } + .right_list .lineul li div.sf { + float: left; + width: 80px; + background: #18a301; + text-align: center; + padding: 5px; + height: 20px; + line-height: 20px; + } +.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.ss { + float: left; + width: 40px; + text-align: center; + background: #fcefa1; + color: #fff; + text-align: center; + padding: 5px; + float: left; + height: 20px; + line-height: 20px; + font-size: 12px; + color: #363636 + } + .right_list .lineul li div.ssd { + float: left; + width: 50px; + text-align: center; + background: #ff006e; + color: #fff; + text-align: center; + padding: 5px; + float: left; + height: 20px; + line-height: 20px; + font-size: 12px; + color: #fff + } + + +.tiaomasz { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ddd; + cursor: pointer; +} +.tiaomasz_hover { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ff3300; + cursor: pointer; + color: #ff3300; +} + +.quelapsz { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ddd; + cursor: pointer; +} +.quelapsz_hover { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ff3300; + cursor: pointer; + color: #ff3300; +} + + +.biaozhundian { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ddd; + cursor: pointer; +} + +.biaozhundian_hover { + width: 90px; + height: 20px; + font-size: 14px; + letter-spacing: 5px; + padding: 5px; + text-align: center; + border: 1px solid #ff3300; + cursor: pointer; + color: #ff3300; +} + + + + +.pingbi{width:80px; height:20px; font-size:14px; letter-spacing:5px; padding:5px; text-align:center; border:1px solid #000; cursor:pointer; } + +.hidearea { width: 200px;height:200px;background:#fff; text-align:center; border:1px solid #ddd; opacity:0.7; + line-height:100px; z-index:999; background:#333; position:absolute; color:#333; z-index:1;} +.hideareaclose { + background: #fff; + color: #808080; + width: 30px; + height: 30px; + text-align: center; + line-height: 30px; + margin: 10px; + border-radius: 50px; + font-size: 12px; + cursor: pointer; + position: absolute; + margin-top: -40px; + margin-left: 120px; +} +.hidetext { width:120px; height:40px; position:absolute; margin-top:-40px; line-height:40px;} + +/*! jQuery UI - v1.10.4 - 2014-01-17 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} + +.main { + width: 1920px; + height: auto; + margin: 0 auto; + font-size: 14px; +} +.main_tool { + width: 1570px; + border: 1px solid #ddd; + font-size: 14px; + +} + .main_tool table { padding:0; margin:0; width:100%; overflow:hidden;} + .main_tool table th { + font-size: 14px; + height: 20px; overflow:hidden; + text-align: left; + } + .main_tool table td { + padding: 5px; + text-align: left; + height: 20px; + overflow: hidden; + } + .main_tool table td select { padding:3px; border:1px solid #ddd; padding-right:10px; } + .main_tool table td .maodian { float:left; padding:5px; margin-right:10px; cursor:pointer; width:60px;border:1px solid #ddd; text-align:center; opacity:0.3; } + .main_tool table td .maodian_hover { + padding: 5px; + margin-right: 10px; + float: left; + cursor: pointer; + width: 60px; + border: 1px solid #ddd; + text-align: center; + padding: 5px; + opacity: 0.3; + margin-top: 15px; + opacity: 0.3; + background: #ff3300; + color: #fff; + } +.main_papermain { + width: 1920px; + height: auto; + overflow: hidden; + + position: relative; + min-height: 500px; + border: 1px solid #ddd; margin:0 auto; +} + .main_tabletop{width: 200px;height:120px;background:#fff; text-align:center; border:1px solid #ddd; opacity:0.7; line-height:20px; + z-index:999; background:#333; position:absolute; color:#ff3300; left:100px; top:100px;} + +.main_select_one { + font-size: 14px; + margin-top: 5px; +} + .main_select_set { width:100px; padding:7px; margin-left:5px; border:1px solid #ddd; padding-left:10px; padding-right:10px; cursor:pointer;} + .main_select_set_hover { padding:7px; line-height:20px; margin-left:5px; border:1px solid #ff3300; color:#999; padding-left:10px; padding-right:10px; cursor:pointer;} + .main_select_one select { width:50px; text-align:center; padding:5px; } + .main_select_one span { line-height:20px;} + .xuehaotable_list { width:100%; height:100%; overflow:hidden; border-bottom:1px solid #ddd;border-left:1px solid #ddd; } + .xuehaotable_list td { border-top:1px solid #ddd;border-right:1px solid #ddd; } + + .keguan_list { width:100%; height:100%; overflow:hidden; border-bottom:1px solid #ddd;border-left:1px solid #ddd; } + .keguan_list td { border-top:1px solid #ddd;border-right:1px solid #ddd; } + +#NowSelect { +padding:0; margin:0; +} +#NowSelect li { + height: 20px; + line-height: 20px; + background: #666; + color: #fff; +} +#NowSelect li.hover { background:#ff3300; color:#fff; } \ No newline at end of file diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..6169844 --- /dev/null +++ b/css/index.css @@ -0,0 +1,85 @@ + + +body {height: 100%; overflow-x:hidden;font-family:'Microsoft YaHei UI'; } +::-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 { + border: 0 none; + font-size:.55rem; + color: inherit; + margin: 0; + padding: 0; + vertical-align: baseline; + max-height: 1000rem;font-family:'Microsoft YaHei UI'; +} + + + + + +.right_list { position:fixed; right:0; height:auto; overflow:hidden; border-left:1px solid #363636; width:300px; height:100%; background:#fff;} +.right_list ul { float:left; width:100%;} +.right_list ul li { float:left; width:100%; text-align:center; font-size:14px; margin-top:10px; margin-bottom:10px; } +.right_list ul li.hover { border-bottom:1px solid #ddd; background:#363636; color:#fff; height:60px; line-height:60px; margin-top:0; box-shadow:5px 5px 5px #999;} +.right_list ul li.hover_b { border-bottom:1px solid #ddd; background:#cd0a0a; color:#fff; height:40px; line-height:40px;} +.right_list ul li input { width:50px; } +.right_list ul li .goPeizhi { cursor:pointer; width:100px; float:none; border:1px solid #ddd; overflow:hidden; color:#666; text-align:center; font-size:14px; margin: 0 auto; height:40px; line-height:40px; } + .right_list ul li .goPeizhi:hover { background:#ff3300;color:#fff; } + .right_list ul li div{ font-size:14px; float:left; margin-bottom:20px; width:100%; text-align:center;} +.right_list ul li select{ padding:5px;} +.right_list ul li input { padding:5px;} + .right_list ul li label { font-size:14px; border:1px solid #ddd; margin-top:5px; padding:5px; cursor:pointer;} + .right_list ul li span{ float:right; border:1px solid #ddd; background:#fff; color:#555;} +/*! jQuery UI - v1.10.4 - 2014-01-17 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} + +.main { + width: 4956px; + height: auto; + margin: 0 auto; +} +.main_tool { + width: 1920px; + border: 1px solid #ddd; + float: left; + font-size: 16px; + padding-top: 20px; + padding-bottom: 20px; +} + .main_tool table { padding:0; margin:0; width:100%;} + .main_tool table th {font-size:16px; padding:5px;text-align:left;} + .main_tool table td { padding:5px; text-align:left;} + .main_tool table td select { padding:3px; border:1px solid #ddd; padding-right:10px; } + .main_tool table td .maodian { float:left; cursor:pointer; width:100px;border:1px solid #ddd; text-align:center; position:absolute; padding:10px; opacity:0.3 } + .main_tool table td .maodian_hover { float:left; cursor:pointer; width:100px;border:1px solid #ddd; text-align:center; position:absolute; padding:10px; opacity:0.3; background:#ff3300; color:#fff; } +.main_papermain { + width: 1920px; + height: auto; + + float: left; + position: relative; + min-height: 500px; + border: 1px solid #ddd; +} + .main_tabletop{width: 100px;height:100px;background:#fff; text-align:center; border:1px solid #ddd; opacity:0.7; + line-height:20px; z-index:999; background:#333; position:absolute; color:#ff3300;} + + .main_select_one { font-size:14px; margin-top:5px;} + .main_select_set { width:100px; padding:7px; margin-left:5px; border:1px solid #ddd; padding-left:10px; padding-right:10px; cursor:pointer;} + .main_select_set_hover { padding:7px; line-height:20px; margin-left:5px; border:1px solid #ff3300; color:#999; padding-left:10px; padding-right:10px; cursor:pointer;} + .main_select_one select { width:50px; text-align:center; padding:5px; } + .main_select_one span { line-height:20px;} + .xuehaotable_list { width:100%; height:100%; overflow:hidden; border-bottom:1px solid #ddd;border-left:1px solid #ddd; } + .xuehaotable_list td { border-top:1px solid #ddd;border-right:1px solid #ddd; } + + .keguan_list { width:100%; height:100%; overflow:hidden; border-bottom:1px solid #ddd;border-left:1px solid #ddd; } + .keguan_list td { border-top:1px solid #ddd;border-right:1px solid #ddd; } + +#NowSelect li { height:30px; line-height:30px; background:#666; color:#fff; margin-top:10px; } +#NowSelect li.hover { background:#ff3300; color:#fff; } \ No newline at end of file diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..a35dfe4 --- /dev/null +++ b/js/index.js @@ -0,0 +1,1168 @@ +var IsPostionValue = $("#IsPostionValue").val(); + + +//设置页面大小 +function ChangePageSize(obj) { + $(".main_papermain").width(obj.value); +} + +//设定全卷遮挡区域 +function SetHideArea() { + var html=""; + html += "
"; + html += "
屏蔽显示区
"; + html += "
x
"; + html += "
"; + $(".main_papermain").append(html); + $(".hidearea").draggable({ containment: ".main_papermain" }); + $(".hidearea").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 +} +//删除全屏遮挡区域 +function CloseHideArea(obj) { + $(obj).parent().remove(); +} + +///设置锚点 +function SetMao(obj, index) { + if (IsPostionValue == "False") { + alert("无法设置定位点,请修改主模板数据."); + return; + } + if ($(obj).attr("class") == "maodian_hover") { + $("#draggable_" + index).remove(); + $(obj).attr("class", "maodian"); + return; + } + var style = ""; + var pright=parseInt($(".main_papermain").width()) -120; + var pheight=parseInt($(".main_papermain").height())-100; + if (index == 0) { + style = "left:60px; top:40px;" + } + + if (index == 1) { + style = "left:"+pright+"px; top:30px;" + } + if (index == 2) { + style = "left:60px; top:"+pheight+"px;" + } + if (index == 3) { + style = "left:"+pright+"px; top:"+pheight+"px;" + } + $(obj).attr("class", "maodian_hover"); + + $(".main_papermain").append("
" + $(obj).html() + "
"); + + + $("#draggable_" + index).draggable({ containment: ".main_papermain" }); + $("#draggable_" + index).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 +} +///设置锚点 +///设置学号 +function SetXuehao(obj) { + if ($(obj).attr("class") == "main_select_set_hover") { + $("#xuehaoTable").remove(); + $(obj).attr("class", "main_select_set"); + return; + } + $(obj).attr("class", "main_select_set_hover"); + var num = $("#xuehaonum").val(); + var html = ""; + for (var i = 0; i < 10; i++) { + html += ""; + for (var j = 0; j < num; j++) { + html += ""; + } + html += ""; + } + html += "
"; + + $(".main_papermain").append("
" + html + "
"); + $("#xuehaoTable").draggable({ containment: ".main_papermain" }); + $("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 +} +//设置学号 + + +/////////设置客观题////////////////// +function SetKeguanTi() { + var tihao = $("#tihao").val().toUpperCase().replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@", "@");//题号 + var tihao_end = $("#tihao_end").val().toUpperCase().replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@", "@"); + var tihaoM = tihao + "-" + tihao_end; + + var score = $("#questionscroe").val(); + var tihaoList = tihaoM.toString().split('-'); + + if (tihaoList.length != 2) { + alert("题号规则错误,请重新输入"); + return; + } + + + + if (document.getElementById("keguan_" + tihaoM) != undefined) { + alert("题目配置重复:" + tihaoM); + return; + } + + var rd_listtype = document.getElementsByName("listtype");//题目横竖向 + var listtype = 0; + var selectNum = $("#selectNum").val(); + + for (var i = 0; i < rd_listtype.length; i++) { + if (rd_listtype[i].checked) { + listtype = rd_listtype[i].value; + } + } + + var questiontype = $("#questiontype").val(); + + var startnum = parseInt(tihaoList[0]); + var endnum = parseInt(tihaoList[1]); + if (endnum == undefined) + { + endnum = startnum; + } + var html = ""; + + var BigTihao = ""; + if (tihao.indexOf('M') > -1) { + BigTihao = tihaoList[0].split('M')[0] + "M"; + startnum = tihaoList[0].split('M')[1]; + endnum = tihaoList[1].split('M')[1]; + } + + if (listtype == 0)//横向 + { + for (var i = parseInt(startnum); i <=parseInt(endnum); i++) + { + + html += ""; + for (var j = 0; j < selectNum; j++) + { + html += ""; + } + html += ""; + } + } + else {//竖向 + for (var i = 0; i < selectNum; i++) { + html += ""; + for (var j = startnum; j <= endnum; j++) { + html += ""; + } + html += ""; + } + } + html += "
"; + var selectMore = 0; + + var questionHtml = "单选题"; + if (questiontype == 1) { + questionHtml = "多选题"; + } + if (questiontype == 2) { + questionHtml = "判断"; + } + + $(".main_papermain").append("
" + tihaoM + "
" + html + "
"); + $("#keguan_" + tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 + var listtypeText = listtype == 0 ? "横向" : "竖向"; + $("#NowSelect").append("
  • " + questionHtml + "
    " + tihaoM + "
    " + selectNum + "
    " + listtypeText + "
    " + score + "
    x
  • "); + +} +function DeleteKeguanti(tihao) { + $("#keguan_" + tihao).remove(); + $("#selectNow_" + tihao).remove(); + $("#pyti_" + tihao).remove(); + if (tihao.indexOf('X') > -1) { + $("#pyti_" + tihao.split('X')[0]).remove(); + } + GetZhuguantiScoreList(); +} +/////////设置客观题///////////// + +/////////////////设置主观题////////////////////// + +function SetZhuguanTi() { + + var zhuguan_tihao = $("#zhuguan_tihao").val().toUpperCase().replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@","@"); + + if (zhuguan_tihao == "") { + alert("主观题 题号不能为空"); + return; + } + var score = $("#zgquestionscroe").val(); + var scoretype = $("#questionscroetype").val(); + var questiontype_zg = $("#questiontype_zg").val(); + //var scoretypeText = scoretype == "1" ? "全分" : "半分"; + var scoretypeText = scoretype; + + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined) { + alert("0题目配置重复:" + zhuguan_tihao); + return; + } + var zhuguan_xiaoti = $("#zhuguan_xiaoti").val(); + if (zhuguan_xiaoti == "") { + zhuguan_xiaoti = "0"; + } + var lineWh = "width:800px;height:200px;"; + var lineWhTx = "大题"; + if (questiontype_zg == "2") { + var lineWh = "width:200px;height:90px;"; + lineWhTx="填空" + } + $(".main_papermain").append("
    " + lineWhTx+":" + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + + $("#NowSelect").append("
  • 主观题
    " + zhuguan_tihao + "
    " + zhuguan_xiaoti + "
    " + score + "
    " + scoretypeText + "
    x
  • "); + //如果是手阅 + GetZhuguantiScoreList(); +} +////////////////设置主观题////////////////////// + + +/////////////////设置条码识别区////////////////////// + +function SetTiaoMa(obj) { + if ($(obj).attr("class") == "tiaomasz_hover") { + $(obj).attr("class", "tiaomasz"); + DeleteKeguanti('tiaomashibie'); + return; + } + else { + $(obj).attr("class", "tiaomasz_hover"); + } + $(".main_papermain").append("
    条码
    "); + setTimeout(function () { + $("#keguan_tiaomashibie").draggable({ containment: ".main_papermain" }); + $("#keguan_tiaomashibie").resizable({ containment: ".main_papermain", handles: 'all' }); + }, 500); + +} + +////////////////设置条码识别区////////////////////// + + +/////////////////准考证号识别区////////////////////// + +function SetZunkaoZheng() { + if (document.getElementById("zhunkaozhenghaoshibie") != undefined) { + alert("准考证号配置重复"); + return; + } + $(".main_papermain").append("
    准考证号
    "); + $("#keguan_zhunkaozhenghaoshibie").draggable({ containment: ".main_papermain" }); + $("#keguan_zhunkaozhenghaoshibie").resizable({ containment: ".main_papermain", handles: 'all' }); + $("#NowSelect").append("
  • 准考证号删除
  • "); +} + +////////////////准考证号识别区////////////////////// + + + + + +/////////////////设置缺考标记////////////////////// + +function SetWenziQuyu(obj) { + var zhuguan_tihao = "缺考"; + if ($(obj).attr("class") == "quelapsz_hover") { + $(obj).attr("class", "quelapsz"); + DeleteKeguanti(zhuguan_tihao); + return; + } + else { + $(obj).attr("class", "quelapsz_hover"); + } + + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined) { + alert("缺考已标记"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); +} + + +////////////////设置文字区域////////////////////// + +/////////////////设置标准店////////////////////// + +function SetBiaoZhunDian(obj) { + var zhuguan_tihao = "标准点"; + + if ($(obj).attr("class") == "biaozhundian_hover") { + $(obj).attr("class", "biaozhundian"); + DeleteKeguanti(zhuguan_tihao); + return; + } + else { + $(obj).attr("class", "biaozhundian_hover"); + } + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined) { + alert("标准点已标记"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); +} + + + + + + +////设置先批后阅////// +function SetPYPostion(type) { + + var py_tihao = $("#py_tihao").val(); + var isHaveX = false; + if (document.getElementById("pyti_" + py_tihao) != null) { + alert("已有先批后阅该主观题"); + return; + } + if (document.getElementById("keguan_" + py_tihao) == null) { + if (document.getElementById("keguan_" + py_tihao + "X1") == null) { + alert("找不到该主观题题号"); + return; + } + else { + isHaveX = true; + } + } + var lineWhTx = "填空题打分"; + var score = 0; + + if (isHaveX) { + score = $("#keguan_" + py_tihao + "X1").attr("score"); + type = $("#keguan_" + py_tihao+"X1").attr("questiontype_zg"); + } + else { + score = $("#keguan_" + py_tihao).attr("score"); + type = $("#keguan_" + py_tihao).attr("questiontype_zg"); + } + ///如果是填空题,批阅类型为0 + if (type == "2") { + type = "0"; + } + + var lineWh = "width:35px;height:35px;"; + + + + + if (type == "") { + type == "1"; + } + + + if (type == 1) { + lineWhTx = "主观题打分"; + lineWh = "width:736px;height:30px;"; + } + + if (score.indexOf(".") > -1) { + alert("题目分数不能有小数点"); + return; + } + + var html = ""; + + html += "
    "; + html += "
    " + lineWhTx + ":" + py_tihao + "x
    "; + html += "
    "; + html += "
    "; + html += "
    "; + $(".main_papermain").append(html); + $("#pyti_" + py_tihao).draggable({ containment: ".main_papermain" }); + $("#pyti_" + py_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + GetZhuguantiScoreList(); +} + +function closepy_hi(obj) { + $(obj).parent().parent().remove(); + GetZhuguantiScoreList(); +} +////设置先批后阅////// + + +///////////////////统计数据////////////////////////// +//获取锚点位置 +function GetMaoPostion() { + if ($(".maodian_hover").length == 0) { + return ""; + } + var xy = ""; + if ($(".maodian_hover").length == 4) { + for (var i = 0; i < 4; i++) { + xy += parseFloat($("#draggable_" + i).position().left) + "," + parseFloat($("#draggable_" + i).position().top) + "," + parseFloat($("#draggable_" + i).width()) + "," + parseFloat($("#draggable_" + i).height()) + "^"; + } + } + else { + //alert("锚点未设置完成"); + return ""; + } + + return xy.trim('^');; +} + +//获取学号数据 +function GetXuehaoPostion() { + if (document.getElementById("xuehaoTable") == undefined) { + return ""; + } + var xy = ""; + xy = parseFloat($("#xuehaoTable").position().left) + "," + parseFloat($("#xuehaoTable").position().top) + "," + parseFloat($("#xuehaoTable").width()) + "," + parseFloat($("#xuehaoTable").height()) + "," + $("#xuehaoTable").attr("listNum"); + return xy; +} +//获取客观题 +function GetKeguanPostion() { + if ($(".keguanti").length == 0) { + return ""; + } + var xy = ""; + $(".keguanti").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("startnum") + "," + $(this).attr("endNum") + "," + $(this).attr("selectNum") + "," + $(this).attr("listtype") + "," + $(this).attr("questiontype") + "," + $(this).attr("score") + "^"; + }) + return xy.trim('^'); +} + +//获取主观题 +function GetZhuguanPostion() { + var xy = ""; + if ($(".zhuguanti").length == 0) { + return ""; + } + $(".zhuguanti").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("zhuguan_xiaoti") + "," + $(this).attr("score") + "," + $(this).attr("scoretype") + "," + $(this).attr("questiontype_zg")+"^"; + }) + return xy.trim('^'); +} +//获取条码 +function GettiaomaPostion() { + var xy = ""; + if (document.getElementById("keguan_tiaomashibie") == undefined) { + return ""; + } + xy += parseFloat($("#keguan_tiaomashibie").position().left) + "," + parseFloat($("#keguan_tiaomashibie").position().top) + "," + parseFloat($("#keguan_tiaomashibie").width()) + "," + parseFloat($("#keguan_tiaomashibie").height()); + return xy.trim('^'); +} +//获取准考证号 +function GetZKZHPostion() { + var xy = ""; + if (document.getElementById("keguan_zhunkaozhenghaoshibie") == undefined) { + return ""; + } + xy += parseFloat($("#keguan_zhunkaozhenghaoshibie").position().left) + "," + parseFloat($("#keguan_zhunkaozhenghaoshibie").position().top) + "," + parseFloat($("#keguan_zhunkaozhenghaoshibie").width()) + "," + parseFloat($("#keguan_zhunkaozhenghaoshibie").height()); + return xy.trim('^'); +} + +//获取文字截获 +function GetWenziPostion() { + var xy = ""; + if ($(".wenzimiaoshu").length == 0) { + return ""; + } + $(".wenzimiaoshu").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("wenzimiaoshu") + "^"; + }) + return xy.trim('^'); +} + +//获取标准点 +function GetBiaoZhunDianPostion() { + var xy = ""; + if ($(".biaozhundian_select").length == 0) { + return ""; + } + $(".biaozhundian_select").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("wenzimiaoshu") + "^"; + }) + return xy.trim('^'); +} + + +//获取屏蔽区数据 +function GetHideAreaPostion() { + var xy = ""; + if ($(".hidearea").length == 0) { + return ""; + } + var jsonstr = []; + $(".hidearea").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "^"; + var json = {}; + json.width = parseFloat($(this).width()); + json.height = parseFloat($(this).height()); + json.left = parseFloat($(this).position().left); + json.top = parseFloat($(this).position().top); + jsonstr.push(json); + }) + return JSON.stringify(jsonstr); +} +//获取先批后阅数学 +function GetPyAreaPostion() { + var xy = ""; + if ($(".pyti").length == 0) { + return ""; + } + $(".pyti").each(function () { + xy += parseFloat($(this).position().left) + "," + parseFloat($(this).position().top) + "," + parseFloat($(this).width()) + "," + parseFloat($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("score") + "," + $(this).attr("piyueType")+"^"; + }) + + return xy.trim('^'); +} + + + +///////////////////统计数据////////////////////////// +function GetDataTotal(objvalue,tenant) { + if ($("#hd_isHand").val() == "1") { + if ($("#py_tihao").val() != "all") { + alert("主观题有未批阅分数,请先配置好主观题分数选择框!"); + return; + } + } + + + + var maodian = GetMaoPostion();//左边距,右边距,长,高 + var xuehao = GetXuehaoPostion();//左边距,右边距,长,高,学号数量 + var keguanti = GetKeguanPostion(); //左边距,右边距,长,高,题号开始,题号结束,选择几项,横排还是竖排,单选多选或者判断 + var zhuguanti = GetZhuguanPostion();//左边距,右边距,长,高,题号,小题数量 + var wenzimiaoshu = GetWenziPostion();//左边距,右边距,长,高,文字描述 + var tiaoma = GettiaomaPostion();////左边距,右边距,长,高 + var zhunkaozhenghao = GetZKZHPostion();///获取准考证号识别区域 + var hideArea = GetHideAreaPostion();//获取屏蔽区数据 + var pytiArea = GetPyAreaPostion();//获取批阅条件 + var biaoZhunDian = GetBiaoZhunDianPostion();//设置标准点 + + + var selectPageSize = $("#selectPageSize").val(); + if (selectPageSize == null) { + $("#selectPageSize").focus(); + alert("请选择版面"); + return; + } + + if (document.getElementById("keguan_标准点") == undefined && $("#PageIndex").val() == "1") { + alert("您尚未设置标准点,无法保存数据"); + return; + } + + if (document.getElementById("keguan_缺考") == undefined && $("#PageIndex").val()=="1") { + if (confirm("您尚未设置缺考标记,无需设置点击取消按钮")) { + return; + } + } + + + var PageIndex = $("#PageIndex").val(); + var MainTempId = $("#MainTempId").val(); + var WandH = parseFloat($("#SelectImg").width()) + "," + parseFloat($("#SelectImg").height()); + var totalHtml = maodian + "$" + xuehao + "$" + keguanti + "$" + zhuguanti + "$" + wenzimiaoshu + "$" + tiaoma + "$" + WandH + "$" + zhunkaozhenghao + "$" + pytiArea + "$" + biaoZhunDian; + if (maodian == "") { + //alert("必须设置4个锚点"); + //return; + } + if (objvalue == "1") { + if (confirm("锁定模板后,仅可修改识别区域,无法增删主客观题!")) { + $("#ansyButton").attr("disabled", "disabled"); + $("#ansyButton").attr("value", "正在更新数据"); + $.post("default.aspx", { action: "2", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea),tenant:tenant }, function (res) { + if (res == "ok") { + $("#ansyButton").attr("disabled", "disabled"); + $("#ansyButton").attr("value", "模板已锁定"); + alert("数据更新成功"); + LockFunction(1); + } + + else { + $("#ansyButton").removeAttr("disabled"); + $("#ansyButton").attr("value", "锁定模板"); + alert(res + "更新失败"); + } + }) + } + } + else { + $("#noButton").attr("disabled", "disabled"); + $("#noButton").attr("value", "正在更新数据"); + $.post("default.aspx", { action: "1", rd: Math.round(), MainTempId: MainTempId, PageIndex: PageIndex, totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), HideAreaPostionList: encodeURIComponent(hideArea),tenant:tenant }, function (res) { + $("#noButton").removeAttr("disabled"); + $("#noButton").attr("value", "保存数据"); + if (res == "ok") { + alert("数据更新成功"); + } + else { + + alert(res +"或更新失败,定位点错误"); + } + }) + } +} + + +///////////////////统计数据////////////////////////// + + +//初始化绑定数据 +function BaseDataBind() { + + + + var Bindlist = $("#Bindlist").val() + var list = Bindlist.split('$'); + var maodian = "";//左边距,右边距,长,高 + var xuehao = "";//左边距,右边距,长,高,学号数量 + var keguanti = ""; //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + var zhuguanti = "";//左边距,右边距,长,高,题号,小题数量 + var wenzimiaoshu = "";//左边距,右边距,长,高,文字描述 + var tiaoma = "";//左边距,右边距,长,高,文字描述 + var pageWidth = ""; + var HideAreaText = $("#HideAreaText").val(); + var piyueList = ""; + var zhunkaozhenghao = ""; + var biaozhundian = ""; + if (Bindlist != "") { + maodian = list[0].trim('^');//左边距,右边距,长,高 + xuehao = list[1].trim('^');//左边距,右边距,长,高,学号数量 + keguanti = list[2].trim('^'); //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + zhuguanti = list[3].trim('^');//左边距,右边距,长,高,题号,小题数量 + wenzimiaoshu = list[4].trim('^');//左边距,右边距,长,高,文字描述 + tiaoma = list[5].toString().trim('^');//左边距,右边距,长,高,文字描述 + pageWidth = list[6].toString().trim('^').split(',')[0]; + if (list[7] != undefined) { + zhunkaozhenghao = list[7].toString().trim('^'); + } + if (list[8] != undefined) { + piyueList = list[8].toString().trim('^'); + } + if (list[9] != undefined) { + biaozhundian = list[9].toString().trim('^'); + } + } + + if (pageWidth == 1200 || pageWidth == 1199 || pageWidth == 1198 || pageWidth == 1201) { + pageWidth = 1200; + } + if (pageWidth == 1570 || pageWidth == 1569 || pageWidth == 1571 || pageWidth == 1572 || pageWidth == 1573) { + pageWidth = 1570; + } + + //if(pageWidth==""){ + var pageType= $("#pager_A").val(); + if(pageType=="a3"){ + pageWidth = 1570; + } + else{ + pageWidth = 1200; + } + //} + + + $(".main_papermain").width(pageWidth+"px"); + if ($("#pager_A").val() == "a3") { + + $("#selectPageSize").val("1570"); + } + if ($("#pager_A").val() == "a4") { + $("#selectPageSize").val("1200"); + } + + + $("#selectPageSize").val(pageWidth); + $("#selectPageSize").change(); + + SetMaoPostion(maodian); + SetXuehaoPostion(xuehao); + SetKeguanTiPostion(keguanti); + SetZhuguanTiPostion(zhuguanti); + SetWenziQuyuPostion(wenzimiaoshu); + SetTiaomaPostion(tiaoma); + SetZhunkaozhengPostion(zhunkaozhenghao); + SetHideAreaBind(HideAreaText); + SetPyPostion(piyueList); + GetZhuguantiScoreList(); + SetBiaoZhunDianPostion(biaozhundian); +} + + +/////////////////批阅////////////////////// +function SetPyPostion(PostionData) { + //alert(PostionData); + // $(this).attr("tihaovalue") + "," + $(this).attr("score") + "," + $(this).attr("piyueType")+"^"; + + if (PostionData == "" || PostionData == undefined) { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + + for (var i = 0; i < listdata.length; i++) { + var zhuguanList = listdata[i].split(','); + var py_tihao = zhuguanList[4]; + var score = zhuguanList[5] == undefined ? "" : zhuguanList[5]; + var type = zhuguanList[6] == undefined ? "1" : zhuguanList[6]; + + + + + + var lineWhTx = "大题批阅"; + if (type == "0") { + lineWhTx = "填空批阅" + } + var style = ""; + style = "left:" + zhuguanList[0] + "px; top: " + zhuguanList[1] + "px; width:" + zhuguanList[2] + "px;height:" + zhuguanList[3] + "px;"; + var html = ""; + html += "
    "; + html += "
    " + lineWhTx + ":" + py_tihao + "x
    "; + html += "
    "; + html += "
    "; + html += "
    "; + $(".main_papermain").append(html); + $("#pyti_" + py_tihao).draggable({ containment: ".main_papermain" }); + $("#pyti_" + py_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + + + + } +} +////////////////设置主观题////////////////////// + + +//设置屏蔽区 +function SetHideAreaBind(data) { + if (data == "") { + return; + } + var json = JSON.parse(data); + var html = ""; + for (var i = 0; i < json.length; i++) { + var style = "left:" + json[i].left + "px; top: " + json[i].top + "px; width:" + json[i].width + "px;height:" + json[i].height + "px;"; + html += "
    "; + html += "
    屏蔽显示区
    "; + html += "
    x
    "; + html += "
    "; + } + $(".main_papermain").append(html); + $(".hidearea").draggable({ containment: ".main_papermain" }); + $(".hidearea").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 +} + +///设置锚点 +function SetMaoPostion(postiondata) { + //alert(postiondata); + //alert(IsPostionValue); + + if (postiondata == "") { + if (IsPostionValue == "1") { + SetMao(document.getElementById("point_0"), 0); + SetMao(document.getElementById("point_1"), 1); + SetMao(document.getElementById("point_2"), 2); + SetMao(document.getElementById("point_3"), 3); + } + return; + } + if (IsPostionValue == "0") { + $("#draggable_0").remove(); + $("#draggable_1").remove(); + $("#draggable_2").remove(); + $("#draggable_3").remove(); + return; + } + + + var list = postiondata.split('^'); + for (var i = 0; i < list.length; i++) + { + var obj = document.getElementById("point_" + i); + //左边距,右边距,长,高 + if ($(obj).attr("class") == "maodian_hover") { + $("#draggable_" + i).remove(); + $(obj).attr("class", "maodian"); + return; + } + var postionList = list[i].split(','); + var style = ""; + style = "left:" + postionList[0] + "px; top: " + postionList[1] + "px; width:" + postionList[2] + "px;height:" + postionList[3] + "px;"; + $(obj).attr("class", "maodian_hover"); + $(".main_papermain").append("
    " + $(obj).html() + "
    "); + $("#draggable_" + i).draggable({ containment: ".main_papermain" }); + $("#draggable_" + i).resizable({ containment: ".main_papermain", handles: 'all' }); + } +} + +///设置学号 +function SetXuehaoPostion(postionData) { + if (postionData == "") { + return; + } + var obj = document.getElementById("main_select_set"); + var postionList = postionData.split(','); + if ($(obj).attr("class") == "main_select_set_hover") { + $("#xuehaoTable").remove(); + $(obj).attr("class", "main_select_set"); + return; + } + //左边距,右边距,长,高,学号数量 + $(obj).attr("class", "main_select_set_hover"); + var num = postionList[4]; + $("#xuehaonum").val(num); + var html = ""; + for (var i = 0; i < 10; i++) { + html += ""; + for (var j = 0; j < num; j++) { + html += ""; + } + html += ""; + } + html += "
    "; + $(".main_papermain").append("
    " + html + "
    "); + $("#xuehaoTable").draggable({ containment: ".main_papermain" }); + $("#xuehaoTable").resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 +} +//设置学号 + +/////////设置客观题////////////////// +function SetKeguanTiPostion(PostionData) { + if (PostionData == "") { + return; + } + //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + + var listOption = PostionData.split('^') + for (var jt = 0; jt < listOption.length; jt++) + { + var listpostion = listOption[jt].split(','); + var tihao = listpostion[4].replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@", "@") + "-" + listpostion[5].replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@", "@");//题号 + + if (document.getElementById("keguan_" + tihao) != undefined) { + alert("题目配置重复:" + tihao); + return; + } + var rd_listtype = document.getElementsByName("listtype");//题目横竖向 + var listtype = listpostion[7]; + var selectNum = listpostion[6]; + var questiontype = listpostion[8]; + var score = listpostion[9] == undefined ? "" : listpostion[9]; + for (var i = 0; i < rd_listtype.length; i++) { + if (rd_listtype[i].value == listtype) { + rd_listtype[i].checked + } + } + + + var tihaolist = tihao.split('-'); + + + var startnum = tihaolist[0]; + var endnum = tihaolist[1]; + if (endnum == undefined) { + endnum = startnum; + } + var BigTihao = ""; + if (tihao.indexOf('M') > -1) { + BigTihao = tihaolist[0].split('M')[0] + "M"; + startnum = tihaolist[0].split('M')[1]; + endnum = tihaolist[1].split('M')[1]; + } + var html = ""; + if (listtype == 0)//横向 + { + + for (var i = parseInt(startnum) ; i <= parseInt(endnum) ; i++) { + + html += ""; + for (var j = 0; j < selectNum; j++) { + html += ""; + } + html += ""; + } + } + else {//竖向 + for (var i = 0; i < selectNum; i++) { + html += ""; + for (var j = parseInt(startnum); j <= parseInt(endnum); j++) { + html += ""; + } + html += ""; + } + } + html += "
    "; + var questionHtml = "单选题"; + if (questiontype == 1) { + questionHtml = "多选题"; + } + if (questiontype == 2) { + questionHtml = "判断"; + } + + $(".main_papermain").append("
    " + tihao + "
    " + html + "
    "); + $("#keguan_" + tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + tihao).resizable({ containment: ".main_papermain", handles: 'all' });//设置缩放 + var listtypeText = listtype == 0 ? "横向" : "竖向"; + $("#NowSelect").append("
  • " + questionHtml + "
    " + tihao + "
    " + selectNum + "
    " + listtypeText + "
    " + score + "
    x
  • "); + } + +} + +/////////////////设置主观题////////////////////// +function SetZhuguanTiPostion(PostionData) { + + if (PostionData == "" || PostionData == undefined) + { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + + for (var i = 0; i < listdata.length; i++) + { + var zhuguanList = listdata[i].split(','); + var zhuguan_tihao = zhuguanList[4].toUpperCase().replace(".", "·").replace("(", "(").replace(")", ")").replace(")", ")").replace("=", "=").replace("@", "@"); + var score = zhuguanList[6] == undefined ? "" : zhuguanList[6]; + + var scoretype = zhuguanList[7] == undefined ? "1" : zhuguanList[7]; + + //var scoretypetext = scoretype; + var scoretypetext = scoretype; + var questiontype_zg = zhuguanList[8] == undefined ? "1" : zhuguanList[8]; + + + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined && document.getElementById("keguan_" + zhuguan_tihao) != null) { + alert("2题目配置重复:" + zhuguan_tihao); + return; + } + var lineWhTx = "大题"; + if (questiontype_zg == "2") { + lineWhTx = "填空" + } + var zhuguan_xiaoti = zhuguanList[5]; + $(".main_papermain").append("
    " + lineWhTx+":" + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + $("#NowSelect").append("
  • 主观题
    " + zhuguan_tihao + "
    " + zhuguan_xiaoti + "
    " + score + "
    " + scoretypetext + "
    x
  • "); + } +} +////////////////设置主观题////////////////////// + +/////////////////设置文字区域////////////////////// + +function SetWenziQuyuPostion(PostionData) { + if (PostionData == "" || PostionData == undefined) { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + for (var i = 0; i < listdata.length; i++) { + var zhuguanList = listdata[i].split(','); + var zhuguan_tihao = zhuguanList[4]; + if (document.getElementById("keguan_缺考") != undefined) { + alert("缺考配置重复"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + $(".quelapsz").attr("class", "quelapsz_hover"); + } +} + + +////////////////设置文字区域////////////////////// + + +/////////////////设置标准点////////////////////// + +function SetBiaoZhunDianPostion(PostionData) { + if (PostionData == "" || PostionData == undefined) { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + for (var i = 0; i < listdata.length; i++) { + var zhuguanList = listdata[i].split(','); + var zhuguan_tihao = zhuguanList[4]; + if (document.getElementById("keguan_标准点") != undefined) { + alert("标准点配置重复"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain", handles: 'all' }); + $(".biaozhundian").attr("class", "biaozhundian_hover"); + } +} + +////////////////设置文字区域////////////////////// + + + +/////////////////设置条码////////////////////// + +function SetTiaomaPostion(PostionData) { + + if (PostionData == "") { + return; + } + var zhuguanList = PostionData.split(','); + $(".main_papermain").append("
    条码
    "); + $(".tiaomasz").attr("class", "tiaomasz_hover"); + $("#keguan_tiaomashibie").resizable({ containment: ".main_papermain", handles: 'all' }); + $("#keguan_tiaomashibie").draggable({ containment: ".main_papermain" }); +} + + +/////////////////设置准考证号////////////////////// + +function SetZhunkaozhengPostion(PostionData) { + if (PostionData == "") { + return; + } + var zhuguanList = PostionData.split(','); + $(".main_papermain").append("
    准考证号
    "); + $("#keguan_zhunkaozhenghaoshibie").draggable({ containment: ".main_papermain" }); + $("#keguan_zhunkaozhenghaoshibie").resizable({ containment: ".main_papermain", handles: 'all' }); + $("#NowSelect").append("
  • 准考证号删除
  • "); +} + + +////////////////设置文字区域////////////////////// +//初始化绑定数据 +BaseDataBind(); + +function LockFunction(flag) { + var islocked = $("#isLocked").val(); + if (islocked == true || islocked=="True"||flag==1) { + $("#ansyButton").attr("disabled", "disabled"); + $("#ansyButton").attr("value", "模板已锁定"); + $(".sd").hide(); + $(".lockHide").hide(); + } + +} +LockFunction(); + +var hd_isHand = $("#hd_isHand").val(); +if (hd_isHand == 0) { + $("#isHand_Py").hide(); +} +//批阅判定 +function GetZhuguantiScoreList(){ + if ($("#hd_isHand").val() == "1") { + var py_tihao = ""; + var git = document.getElementById("py_tihao"); + var i = 0; + var isallPY = true; + var html = ""; + $(".zhuguanti").each(function () { + var tihaovalue = $(this).attr("tihaovalue").toUpperCase(); + //如果有分割 + + if (tihaovalue.indexOf("X") > -1) { + var mx = tihaovalue.split('X'); + if (mx[1] != 1) { + return true; + } + } + var isok = true; + + if ($(".pyti").each(function () { + if ($(this).attr("tihaovalue") == tihaovalue) { + isok = false; + } + })) + if (isok) { + if (tihaovalue.indexOf("X") > -1) { + html += ""; + } + else { + html += ""; + } + + // git.options[i] = new Option("主观题" + tihaovalue, tihaovalue); + isallPY = false; + } + i++; + }) + if (isallPY) { + $("#py_tihao").html(""); + $("#pytimups").attr("disabled", "disabled"); + } + else { + $("#py_tihao").html(html); + $("#pytimups").removeAttr("disabled"); + } + + } +} + + + +function UpdateBaseData(type, score, selectID, title) { + $("#scoreShow").hide(); + $("#dfxShow").hide(); + $("#git_fix").val(score); + $("#TiMU_num").val(selectID); + $("#TiMU_Type").val(type); + //客观题 + if (type == 1) { + $("#git_fix").val(score); + $("#scoreShow").show(); + } + if (type == 2) { + $("#git_sd_fix").val(score); + $("#dfxShow").show(); + } + $("#divbig_title").html(title + ":" + selectID) + $(".backgroundGo").show(500); +} + +function GoChange() { + var selectID = $("#TiMU_num").val(); + var type = $("#TiMU_Type").val(); + var score = $("#git_fix").val(); + var sdscore = $("#git_sd_fix").val(); + if (type == "1") { + $("#ss_" + selectID).html(score); + $("#keguan_" + selectID).attr("score", score); + } + + if (type == "2") { + if (sdscore == "0") { + //$("#ssd_" + selectID).html("半分"); + } + else { + //$("#ssd_" + selectID).html("全分"); + } + $("#ssd_" + selectID).html(sdscore); + $("#keguan_" + selectID).attr("scoretype", sdscore); + } + + + DeleteUpdateBaseData(); +} + +function DeleteUpdateBaseData() { + $(".backgroundGo").hide(500); +} + +//扩展方法 +String.prototype.trim = function (char, type) { + if (char) { + if (type == 'left') { + return this.replace(new RegExp('^\\' + char + '+', 'g'), ''); + } else if (type == 'right') { + return this.replace(new RegExp('\\' + char + '+$', 'g'), ''); + } + return this.replace(new RegExp('^\\' + char + '+|\\' + char + '+$', 'g'), ''); + } + return this.replace(/^\s+|\s+$/g, ''); +}; \ No newline at end of file diff --git a/js/indexuser.js b/js/indexuser.js new file mode 100644 index 0000000..64e1490 --- /dev/null +++ b/js/indexuser.js @@ -0,0 +1,707 @@ + +var islocked = $("#islocked").val(); +if (islocked == "" || islocked == "null") { + islocked = 0; +} +//设置页面大小 +function ChangePageSize(obj) { + $(".main_papermain").width(obj.value); + $(".main").width(obj.value); +} + +///设置锚点 +function SetMao(obj, index) { + if ($(obj).attr("class") == "maodian_hover") { + $("#draggable_" + index).remove(); + $(obj).attr("class", "maodian"); + return; + } + var style = ""; + if (index == 0) { + style = "left:100px; top 10px;" + } + if (index == 1) { + style = "left:200px; top 10px;" + } + if (index == 2) { + style = "left:300px; top 10px;" + } + if (index == 3) { + style = "left:400px; top 10px;" + } + $(obj).attr("class", "maodian_hover"); + $(".main_papermain").append("
    " + $(obj).html() + "
    "); + $("#draggable_" + index).draggable({ containment: ".main_papermain" }); + $("#draggable_" + index).resizable({ containment: ".main_papermain" });//设置缩放 +} +///设置锚点 +///设置学号 +function SetXuehao(obj) { + if ($(obj).attr("class") == "main_select_set_hover") { + $("#xuehaoTable").remove(); + $(obj).attr("class", "main_select_set"); + return; + } + $(obj).attr("class", "main_select_set_hover"); + var num = $("#xuehaonum").val(); + var html = ""; + for (var i = 0; i < 10; i++) { + html += ""; + for (var j = 0; j < num; j++) { + html += ""; + } + html += ""; + } + html += "
    "; + + + + $(".main_papermain").append("
    " + html + "
    "); + $("#xuehaoTable").draggable({ containment: ".main_papermain" }); + $("#xuehaoTable").resizable({ containment: ".main_papermain" });//设置缩放 +} +//设置学号 + + +/////////设置客观题////////////////// +function SetKeguanTi() { + var tihao = $("#tihao").val();//题号 + + var tihaoList = tihao.split('-'); + if (tihaoList.length != 2) { + alert("题号规则错误,请重新输入"); + return; + } + if (document.getElementById("keguan_" + tihao) != undefined) { + alert("题目配置重复"); + return; + } + var rd_listtype = document.getElementsByName("listtype");//题目横竖向 + var listtype = 0; + var selectNum = $("#selectNum").val(); + + for (var i = 0; i < rd_listtype.length; i++) { + + if (rd_listtype[i].checked) { + listtype = rd_listtype[i].value; + } + } + var questiontype = $("#questiontype").val(); + var tihaolist = tihao.split('-'); + var startnum = parseInt(tihaolist[0]); + var endnum = parseInt(tihaolist[1]); + if (endnum == undefined) + { + endnum = startnum; + } + var html = ""; + + var BigTihao = ""; + if (tihao.indexOf('M') > -1) { + BigTihao = tihaolist[0].split('M')[0] + "M"; + startnum = tihaolist[0].split('M')[1]; + endnum = tihaolist[1].split('M')[1]; + } + if (listtype == 0)//横向 + { + for (var i = parseInt(startnum); i <=parseInt(endnum); i++) + { + + html += ""; + for (var j = 0; j < selectNum; j++) + { + html += ""; + } + html += ""; + } + } + else {//竖向 + for (var i = 0; i < selectNum; i++) { + html += ""; + for (var j = startnum; j <= endnum; j++) { + html += ""; + } + html += ""; + } + } + html += "
    "; + var selectMore = 0; + + var questionHtml = "单选题"; + if (questiontype == 1) { + questionHtml = "多选题"; + } + if (questiontype == 2) { + questionHtml = "判断"; + } + + $(".main_papermain").append("
    " + tihao + "
    " + html + "
    "); + $("#keguan_" + tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + tihao).resizable({ containment: ".main_papermain" });//设置缩放 + var listtypeText = listtype == 0 ? "横向" : "竖向"; + + + $("#NowSelect").append("
  • 客观题:" + questionHtml + ":" + tihao + " 选项:" + selectNum + " 排列:" + listtypeText + " 删除
  • "); +} +function DeleteKeguanti(tihao) { + $("#keguan_" + tihao).remove(); + $("#selectNow_" + tihao).remove(); +} +/////////设置客观题///////////// + +/////////////////设置主观题////////////////////// + +function SetZhuguanTi() { + var zhuguan_tihao = $("#zhuguan_tihao").val(); + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined) { + alert("题目配置重复"); + return; + } + var zhuguan_xiaoti = $("#zhuguan_xiaoti").val(); + if (zhuguan_xiaoti == "") { + zhuguan_xiaoti = "0"; + } + + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain" }); + $("#NowSelect").append("
  • 题号:" + zhuguan_tihao + "删除
  • "); + +} + +////////////////设置主观题////////////////////// + + +/////////////////设置条码识别区////////////////////// + +function SetTiaoMa() { + if (document.getElementById("keguan_tiaomashibie") != undefined) { + alert("条码配置重复"); + return; + } + $(".main_papermain").append("
    条码
    "); + $("#keguan_tiaomashibie").draggable({ containment: ".main_papermain" }); + $("#keguan_tiaomashibie").resizable({ containment: ".main_papermain" }); + $("#NowSelect").append("
  • 条码删除
  • "); +} + +////////////////设置条码识别区////////////////////// + + +/////////////////准考证号识别区////////////////////// + +function SetZunkaoZheng() { + if (document.getElementById("zhunkaozhenghaoshibie") != undefined) { + alert("准考证号配置重复"); + return; + } + $(".main_papermain").append("
    准考证号
    "); + $("#keguan_zhunkaozhenghaoshibie").draggable({ containment: ".main_papermain" }); + $("#keguan_zhunkaozhenghaoshibie").resizable({ containment: ".main_papermain" }); + $("#NowSelect").append("
  • 准考证号删除
  • "); +} + +////////////////准考证号识别区////////////////////// + + + + + +/////////////////设置缺考标记////////////////////// + +function SetWenziQuyu() { + var zhuguan_tihao = $("#wenzi_tihao").val(); + if (document.getElementById("selectNow_" + zhuguan_tihao) != undefined) { + alert("缺考已标记"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#keguan_" + zhuguan_tihao).draggable({ containment: ".main_papermain" }); + $("#keguan_" + zhuguan_tihao).resizable({ containment: ".main_papermain" }); + $("#NowSelect").append("
  • 文字描述:" + zhuguan_tihao + "删除
  • "); + +} + +////////////////设置文字区域////////////////////// + + + +///////////////////统计数据////////////////////////// +//获取锚点位置 +function GetMaoPostion() { + if ($(".maodian_hover").length == 0) { + return ""; + } + var xy = ""; + if ($(".maodian_hover").length == 4) { + for (var i = 0; i < 4; i++) { + xy += parseInt($("#draggable_" + i).position().left) + "," + parseInt($("#draggable_" + i).position().top) + "," + parseInt($("#draggable_" + i).width()) + "," + parseInt($("#draggable_" + i).height()) + "^"; + } + } + else { + alert("锚点未设置完成"); + return ""; + } + return xy.trim('^');; +} + +//获取学号数据 +function GetXuehaoPostion() { + if (document.getElementById("xuehaoTable") == undefined) { + return ""; + } + var xy = ""; + + xy = parseInt($("#xuehaoTable").position().left) + "," + parseInt($("#xuehaoTable").position().top) + "," + parseInt($("#xuehaoTable").width()) + "," + parseInt($("#xuehaoTable").height()) + "," + $("#xuehaoTable").attr("listNum") ; + return xy; +} +//获取客观题 +function GetKeguanPostion() { + if ($(".keguanti").length == 0) { + return ""; + } + var xy = ""; + $(".keguanti").each(function () { + + xy += parseInt($(this).position().left) + "," + parseInt($(this).position().top) + "," + parseInt($(this).width()) + "," + parseInt($(this).height()) + "," + $(this).attr("startnum") + "," + $(this).attr("endNum") + "," + $(this).attr("selectNum") + "," + $(this).attr("listtype") + "," + $(this).attr("questiontype") + "^"; + }) + return xy.trim('^'); +} + +//获取主观题 +function GetZhuguanPostion() { + var xy = ""; + if ($(".zhuguanti").length == 0) { + return ""; + } + $(".zhuguanti").each(function () { + xy += parseInt($(this).position().left) + "," + parseInt($(this).position().top) + "," + parseInt($(this).width()) + "," + parseInt($(this).height()) + "," + $(this).attr("tihaovalue") + "," + $(this).attr("zhuguan_xiaoti") + "^"; + }) + return xy.trim('^'); +} +//获取条码 +function GettiaomaPostion() { + var xy = ""; + if (document.getElementById("keguan_tiaomashibie") == undefined) { + return ""; + } + xy += parseInt($("#keguan_tiaomashibie").position().left) + "," + parseInt($("#keguan_tiaomashibie").position().top) + "," + parseInt($("#keguan_tiaomashibie").width()) + "," + parseInt($("#keguan_tiaomashibie").height()); + return xy.trim('^'); +} +//获取准考证号 +function GetZKZHPostion() { + var xy = ""; + if (document.getElementById("keguan_zhunkaozhenghaoshibie") == undefined) { + return ""; + } + xy += parseInt($("#keguan_zhunkaozhenghaoshibie").position().left) + "," + parseInt($("#keguan_zhunkaozhenghaoshibie").position().top) + "," + parseInt($("#keguan_zhunkaozhenghaoshibie").width()) + "," + parseInt($("#keguan_zhunkaozhenghaoshibie").height()); + return xy.trim('^'); +} + +//获取文字截获 +function GetWenziPostion() { + var xy = ""; + if ($(".wenzimiaoshu").length == 0) { + return ""; + } + $(".wenzimiaoshu").each(function () { + xy += parseInt($(this).position().left) + "," + parseInt($(this).position().top) + "," + parseInt($(this).width()) + "," + parseInt($(this).height()) + "," + $(this).attr("wenzimiaoshu") + "^"; + }) + return xy.trim('^'); +} + + + + +///////////////////统计数据////////////////////////// +function GetDataTotal(flag,tenant) { + + var maodian = GetMaoPostion();//左边距,右边距,长,高 + var xuehao = GetXuehaoPostion();//左边距,右边距,长,高,学号数量 + var keguanti = GetKeguanPostion(); //左边距,右边距,长,高,题号开始,题号结束,选择几项,横排还是竖排,单选多选或者判断 + var zhuguanti = GetZhuguanPostion();//左边距,右边距,长,高,题号,小题数量 + var wenzimiaoshu = GetWenziPostion();//左边距,右边距,长,高,文字描述 + var tiaoma = GettiaomaPostion();////左边距,右边距,长,高 + var zhunkaozhenghao = GetZKZHPostion();///获取准考证号识别区域 + + var WandH = $("#SelectImg").width() + "," + $("#SelectImg").height(); + var totalHtml = maodian + "$" + xuehao + "$" + keguanti + "$" + zhuguanti + "$" + wenzimiaoshu + "$" + tiaoma + "$" + WandH + "$" + zhunkaozhenghao; + + //if (maodian == "") { + // alert("必须设置4个锚点"); + // return; + //} + var roteDY = rote;//获取定义 + $("#saveData_btn").attr("value", "正在保存数据"); + $("#saveData_btn").attr("disabled", "disabled"); + + $.post("UserTemp.aspx", { action: "1", tenant:tenant,rd: Math.round(), totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), UserID: $("#UserID").val(), roteDY: roteDY }, function (res) { + if (res == "ok") { + if (flag == "1") { + alert("更新成功"); + } + } + else { + alert("无法定位,请调整定位模块"); + } + $("#saveData_btn").attr("value", "保存数据"); + $("#saveData_btn").removeAttr("disabled"); + }) + +} + +function GetDataTotalAnsy(tenant) { + if (!confirm("锁定后开始阅卷,无法修改定位数据,请谨慎操作")) { + return; + } + var maodian = GetMaoPostion();//左边距,右边距,长,高 + var xuehao = GetXuehaoPostion();//左边距,右边距,长,高,学号数量 + var keguanti = GetKeguanPostion(); //左边距,右边距,长,高,题号开始,题号结束,选择几项,横排还是竖排,单选多选或者判断 + var zhuguanti = GetZhuguanPostion();//左边距,右边距,长,高,题号,小题数量 + var wenzimiaoshu = GetWenziPostion();//左边距,右边距,长,高,文字描述 + var tiaoma = GettiaomaPostion();////左边距,右边距,长,高 + var zhunkaozhenghao = GetZKZHPostion();///获取准考证号识别区域 + var WandH = $("#SelectImg").width() + "," + $("#SelectImg").height(); + var totalHtml = maodian + "$" + xuehao + "$" + keguanti + "$" + zhuguanti + "$" + wenzimiaoshu + "$" + tiaoma + "$" + WandH + "$" + zhunkaozhenghao; + //if (maodian == "") { + // alert("必须设置4个锚点"); + // return; + //} + var roteDY = rote;//获取定义 + $.post("TempDraw.aspx", { action: 1, rd: Math.random(), TempID: $("#ID_bigint").val(), UserID: $("#UserID").val(), tenant:tenant}, function (res) { + if (res == "-100" || res == "") { + alert("无法锁定模板,无法获取定位点"); + } + else { + $.post("UserTemp.aspx", { action: "2", tenant:tenant, rd: Math.round(), totalHtml: encodeURIComponent(totalHtml), TempID: $("#TempID").val(), UserID: $("#UserID").val(), roteDY: roteDY }, function (res) { + if (res == "ok") { + alert("锁定成功"); + document.location.href = document.location.href; + } + else { + alert("无法定位,请调整定位模块"); + } + }) + $("#SelectImg").attr("src", "data:image/jpg;base64," + res); + } + + + }) + + + +} + +///////////////////统计数据////////////////////////// + + + +//初始化绑定数据 +function BaseDataBind() { + var Bindlist = $("#Bindlist").val() + + var list = Bindlist.split('$'); + var maodian = "";//左边距,右边距,长,高 + var xuehao = "";//左边距,右边距,长,高,学号数量 + var keguanti = ""; //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + var zhuguanti = "";//左边距,右边距,长,高,题号,小题数量 + var wenzimiaoshu = "";//左边距,右边距,长,高,文字描述 + var tiaoma = "";//左边距,右边距,长,高,文字描述 + var pageWidth = ""; + var pageHeight=""; + var zhunkaozhenghao = ""; + if (Bindlist != "") { + maodian = list[0].trim('^');//左边距,右边距,长,高 + xuehao = list[1].trim('^');//左边距,右边距,长,高,学号数量 + keguanti = list[2].trim('^'); //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + zhuguanti = list[3].trim('^');//左边距,右边距,长,高,题号,小题数量 + wenzimiaoshu = list[4].trim('^');//左边距,右边距,长,高,文字描述 + tiaoma = list[5].toString().trim('^');//左边距,右边距,长,高,文字描述 + pageWidth = list[6].toString().trim('^').split(',')[0]; + pageHeight=list[6].toString().trim('^').split(',')[1]; + if (list[7] != undefined) { + zhunkaozhenghao = list[7].toString().trim('^'); + } + } + + + if (pageWidth == 1200 || pageWidth == 1199 || pageWidth == 1198 || pageWidth == 1201) { + pageWidth = 1200; + } + if (pageWidth == 1570 || pageWidth == 1569 || pageWidth == 1571 || pageWidth == 1572 || pageWidth == 1573) { + pageWidth = 1570; + } + + //if(pageWidth==""){ + var pageType = $("#pager_A").val().toLowerCase(); + + if (pageType == "a3") { + pageWidth = 1570; + } + else { + pageWidth = 1200; + } + + + + $("#kaochi_Line").draggable({ containment: ".main_papermain" }); + $("#kaochi_Line").css("top", (pageHeight / 2) + "px"); + + $("#selectPageSize").val(pageWidth); + $("#selectPageSize").change(); + SetMaoPostion(maodian); + SetXuehaoPostion(xuehao); + SetKeguanTiPostion(keguanti); + SetZhuguanTiPostion(zhuguanti); + SetWenziQuyuPostion(wenzimiaoshu); + SetTiaomaPostion(tiaoma); + SetZhunkaozhengPostion(zhunkaozhenghao); + + if (islocked == 1) { + $("#draggable_0").hide(); + $("#draggable_1").hide(); + $("#draggable_2").hide(); + $("#draggable_3").hide(); + $(".btn_XY").attr("disabled", "disabled"); + $("#kaochi_Line").hide(); + } +} +///设置锚点 +function SetMaoPostion(postiondata) { + if (postiondata == "") { + return; + } + var list = postiondata.split('^'); + + for (var i = 0; i < list.length; i++) + { + + + var obj = document.getElementById("point_" + i); + //左边距,右边距,长,高 + if ($(obj).attr("class") == "maodian_hover") { + $("#draggable_" + i).remove(); + $(obj).attr("class", "maodian"); + return; + } + var postionList = list[i].split(','); + var style = ""; + style = "left:" + postionList[0] + "px; top: " + postionList[1] + "px; width:" + postionList[2] + "px;height:" + postionList[3] + "px;"; + $(obj).attr("class", "maodian_hover"); + $(".main_papermain").append("
    " + $(obj).html() + "
    "); + $("#draggable_" + i).draggable({ containment: ".main_papermain" }); + $("#draggable_" + i).resizable({ containment: ".main_papermain" }); + } +} + +///设置学号 +function SetXuehaoPostion(postionData) { + if (postionData == "") { + return; + } + var obj = document.getElementById("main_select_set"); + var postionList = postionData.split(','); + if ($(obj).attr("class") == "main_select_set_hover") { + $("#xuehaoTable").remove(); + $(obj).attr("class", "main_select_set"); + return; + } + //左边距,右边距,长,高,学号数量 + $(obj).attr("class", "main_select_set_hover"); + var num = postionList[4]; + $("#xuehaonum").val(num); + var html = ""; + for (var i = 0; i < 10; i++) { + html += ""; + for (var j = 0; j < num; j++) { + html += ""; + } + html += ""; + } + html += "
    "; + $(".main_papermain").append("
    " + html + "
    "); + +} +//设置学号 + +/////////设置客观题////////////////// +function SetKeguanTiPostion(PostionData) { + if (PostionData == "") { + return; + } + //左边距,右边距,长,高,题号开始,题号结束,横排还是竖排 + + var listOption = PostionData.split('^') + for (var jt = 0; jt < listOption.length; jt++) + { + var listpostion = listOption[jt].split(','); + var tihao = listpostion[4] + "-" + listpostion[5];//题号 + + if (document.getElementById("keguan_" + tihao) != undefined) { + alert("题目配置重复"); + return; + } + var rd_listtype = document.getElementsByName("listtype");//题目横竖向 + var listtype = listpostion[7]; + var selectNum = listpostion[6]; + var questiontype = listpostion[8]; + for (var i = 0; i < rd_listtype.length; i++) { + if (rd_listtype[i].value == listtype) { + rd_listtype[i].checked + } + } + + + var tihaolist = tihao.split('-'); + + + var startnum = tihaolist[0]; + var endnum = tihaolist[1]; + if (endnum == undefined) { + endnum = startnum; + } + var BigTihao = ""; + if (tihao.indexOf('M') > -1) { + BigTihao = tihaolist[0].split('M')[0] + "M"; + startnum = tihaolist[0].split('M')[1]; + endnum = tihaolist[1].split('M')[1]; + + } + + var html = ""; + + if (listtype == 0)//横向 + { + + for (var i = parseInt(startnum) ; i <= parseInt(endnum) ; i++) { + + html += ""; + for (var j = 0; j < selectNum; j++) { + html += ""; + } + html += ""; + } + } + else {//竖向 + for (var i = 0; i < selectNum; i++) { + html += ""; + for (var j = parseInt(startnum); j <= parseInt(endnum); j++) { + html += ""; + } + html += ""; + } + } + html += "
    "; + var questionHtml = "单选题"; + if (questiontype == 1) { + questionHtml = "多选题"; + } + if (questiontype == 2) { + questionHtml = "判断"; + } + + $(".main_papermain").append("
    " + tihao + "
    " + html + "
    "); + var listtypeText = listtype == 0 ? "横向" : "竖向"; + $("#NowSelect").append("
  • " + questionHtml + ":" + tihao + " 选项:" + selectNum + " 排列:" + listtypeText + " 删除
  • "); + } + +} + +/////////////////设置主观题////////////////////// + +function SetZhuguanTiPostion(PostionData) { + + if (PostionData == "" || PostionData == undefined) + { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + + for (var i = 0; i < listdata.length; i++) + { + + var zhuguanList = listdata[i].split(','); + + + var zhuguan_tihao = zhuguanList[4]; + if (document.getElementById("keguan_" + zhuguan_tihao) != undefined) { + alert("题目配置重复"); + return; + } + var zhuguan_xiaoti = zhuguanList[5]; + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + $("#NowSelect").append("
  • 题号:" + zhuguan_tihao + "删除
  • "); + } + + + +} + +////////////////设置主观题////////////////////// + +/////////////////设置文字区域////////////////////// + +function SetWenziQuyuPostion(PostionData) { + if (PostionData == "" || PostionData == undefined) { + return; + } + //左边距,右边距,长,高,题号,小题数量 + var listdata = PostionData.split('^'); + for (var i = 0; i < listdata.length; i++) { + var zhuguanList = listdata[i].split(','); + var zhuguan_tihao = zhuguanList[4]; + if (document.getElementById("keguan_缺考") != undefined) { + alert("题目配置重复"); + return; + } + $(".main_papermain").append("
    " + zhuguan_tihao + "
    "); + + $(".quelapsz").attr("class", "quelapsz_hover"); + } + +} + +////////////////设置文字区域////////////////////// + + +/////////////////设置条码////////////////////// + +function SetTiaomaPostion(PostionData) { + if (PostionData == "") { + return; + } + var zhuguanList = PostionData.split(','); + $(".main_papermain").append("
    条码
    "); + $("#NowSelect").append("
  • 条码删除
  • "); +} + + +/////////////////设置准考证号////////////////////// + +function SetZhunkaozhengPostion(PostionData) { + if (PostionData == "") { + return; + } + var zhuguanList = PostionData.split(','); + $(".main_papermain").append("
    准考证号
    "); + $("#NowSelect").append("
  • 准考证号删除
  • "); +} + + +////////////////设置文字区域////////////////////// +//初始化绑定数据 +BaseDataBind(); + +//扩展方法 +String.prototype.trim = function (char, type) { + if (char) { + if (type == 'left') { + return this.replace(new RegExp('^\\' + char + '+', 'g'), ''); + } else if (type == 'right') { + return this.replace(new RegExp('\\' + char + '+$', 'g'), ''); + } + return this.replace(new RegExp('^\\' + char + '+|\\' + char + '+$', 'g'), ''); + } + return this.replace(/^\s+|\s+$/g, ''); +}; \ No newline at end of file diff --git a/js/jquery-1.10.2.min.js b/js/jquery-1.10.2.min.js new file mode 100644 index 0000000..ec08653 --- /dev/null +++ b/js/jquery-1.10.2.min.js @@ -0,0 +1,66 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.2.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
    ",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("