Переглянути джерело

😎清理代码及升级依赖

zuohuaijun 1 рік тому
батько
коміт
a045ed60ce

+ 1 - 1
Admin.NET/Admin.NET.Application/Configuration/Limit.json

@@ -59,7 +59,7 @@
   "IpRateLimitPolicies": {
   "IpRateLimitPolicies": {
     "IpRules": [
     "IpRules": [
       {
       {
-        "Ip": "0.0.0.0", // IP可用:"::1/10" 
+        "Ip": "0.0.0.0", // IP可用:"::1/10"
         "Rules": [
         "Rules": [
           {
           {
             "Endpoint": "*",
             "Endpoint": "*",

+ 4 - 4
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -13,7 +13,7 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.0.0" />
+    <PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.1.0" />
     <PackageReference Include="AngleSharp" Version="1.1.2" />
     <PackageReference Include="AngleSharp" Version="1.1.2" />
     <PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
     <PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
     <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
     <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
@@ -36,10 +36,10 @@
     <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
     <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.5.0" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.5.0" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.8.0" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.8.0" />
-    <PackageReference Include="SqlSugarCore" Version="5.1.4.169" />
+    <PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
     <PackageReference Include="SSH.NET" Version="2024.1.0" />
     <PackageReference Include="SSH.NET" Version="2024.1.0" />
-    <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.6" />
-    <PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1109" />
+    <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.7" />
+    <PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1112" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
   </ItemGroup>
   </ItemGroup>

+ 84 - 84
Admin.NET/Admin.NET.Core/Extension/DataTypeExtension.cs

@@ -11,99 +11,99 @@ namespace Admin.NET.Core;
 /// </summary>
 /// </summary>
 public static class DataTypeExtension
 public static class DataTypeExtension
 {
 {
-	/// <summary>转为SByte整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static sbyte ToSByte(this object value, sbyte defaultValue = default)
-	{
-		if (value is sbyte num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为SByte整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static sbyte ToSByte(this object value, sbyte defaultValue = default)
+    {
+        if (value is sbyte num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (sbyte.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (sbyte.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 
 
-	/// <summary>转为Byte整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static byte ToByte(this object value, byte defaultValue = default)
-	{
-		if (value is byte num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为Byte整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static byte ToByte(this object value, byte defaultValue = default)
+    {
+        if (value is byte num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (byte.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (byte.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 
 
-	/// <summary>转为Int16整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static short ToInt16(this object value, short defaultValue = default)
-	{
-		if (value is short num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为Int16整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static short ToInt16(this object value, short defaultValue = default)
+    {
+        if (value is short num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (short.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (short.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 
 
-	/// <summary>转为UInt16整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static ushort ToUInt16(this object value, ushort defaultValue = default)
-	{
-		if (value is ushort num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为UInt16整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static ushort ToUInt16(this object value, ushort defaultValue = default)
+    {
+        if (value is ushort num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (ushort.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (ushort.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 
 
-	/// <summary>转为UInt32整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static uint ToUInt32(this object value, uint defaultValue = default)
-	{
-		if (value is uint num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为UInt32整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static uint ToUInt32(this object value, uint defaultValue = default)
+    {
+        if (value is uint num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (uint.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (uint.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 
 
-	/// <summary>转为UInt64整数,转换失败时返回默认值。</summary>
-	/// <remarks></remarks>
-	/// <param name="value">待转换对象</param>
-	/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
-	/// <returns></returns>
-	public static ulong ToUInt64(this object value, ulong defaultValue = default)
-	{
-		if (value is ulong num) return num;
-		if (value == null || value == DBNull.Value) return defaultValue;
+    /// <summary>转为UInt64整数,转换失败时返回默认值。</summary>
+    /// <remarks></remarks>
+    /// <param name="value">待转换对象</param>
+    /// <param name="defaultValue">默认值。待转换对象无效时使用</param>
+    /// <returns></returns>
+    public static ulong ToUInt64(this object value, ulong defaultValue = default)
+    {
+        if (value is ulong num) return num;
+        if (value == null || value == DBNull.Value) return defaultValue;
 
 
-		if (ulong.TryParse(value.ToString(), out var result))
-			return result;
-		else
-			return defaultValue;
-	}
+        if (ulong.TryParse(value.ToString(), out var result))
+            return result;
+        else
+            return defaultValue;
+    }
 }
 }

+ 1 - 1
Admin.NET/Admin.NET.Core/Utils/VerifyFileExtensionName.cs

@@ -67,7 +67,7 @@ public static class VerifyFileExtensionName
         // 程序文件
         // 程序文件
         dics_ext.Add("3C3F786D6C", ".xml");
         dics_ext.Add("3C3F786D6C", ".xml");
         dics_ext.Add("68746D6C3E", ".html");
         dics_ext.Add("68746D6C3E", ".html");
-		dics_ext.Add("04034b50", ".apk");
+        dics_ext.Add("04034b50", ".apk");
         //dics_ext.Add("7061636B", ".java");
         //dics_ext.Add("7061636B", ".java");
         //dics_ext.Add("3C254020", ".jsp");
         //dics_ext.Add("3C254020", ".jsp");
         //dics_ext.Add("4D5A9000", ".exe");
         //dics_ext.Add("4D5A9000", ".exe");

+ 2 - 0
Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Const/DingTalkConst.cs

@@ -36,10 +36,12 @@ public class DingTalkConst
     /// 主部门Id
     /// 主部门Id
     /// </summary>
     /// </summary>
     public const string DeptId = "sys00-mainDeptId";
     public const string DeptId = "sys00-mainDeptId";
+
     /// <summary>
     /// <summary>
     /// 主部门
     /// 主部门
     /// </summary>
     /// </summary>
     public const string Dept = "sys00-mainDept";
     public const string Dept = "sys00-mainDept";
+
     /// <summary>
     /// <summary>
     /// 职位
     /// 职位
     /// </summary>
     /// </summary>

+ 3 - 1
Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Entity/DingTalkUser.cs

@@ -73,23 +73,25 @@ public class DingTalkUser : EntityBase
     [SugarColumn(ColumnDescription = "工号", Length = 16)]
     [SugarColumn(ColumnDescription = "工号", Length = 16)]
     [MaxLength(16)]
     [MaxLength(16)]
     public string? JobNumber { get; set; }
     public string? JobNumber { get; set; }
+
     /// <summary>
     /// <summary>
     /// 主部门Id
     /// 主部门Id
     /// </summary>
     /// </summary>
     [SugarColumn(ColumnDescription = "主部门Id", Length = 16)]
     [SugarColumn(ColumnDescription = "主部门Id", Length = 16)]
     [MaxLength(16)]
     [MaxLength(16)]
     public string? DeptId { get; set; }
     public string? DeptId { get; set; }
+
     /// <summary>
     /// <summary>
     /// 主部门
     /// 主部门
     /// </summary>
     /// </summary>
     [SugarColumn(ColumnDescription = "主部门", Length = 16)]
     [SugarColumn(ColumnDescription = "主部门", Length = 16)]
     [MaxLength(16)]
     [MaxLength(16)]
     public string? Dept { get; set; }
     public string? Dept { get; set; }
+
     /// <summary>
     /// <summary>
     /// 职位
     /// 职位
     /// </summary>
     /// </summary>
     [SugarColumn(ColumnDescription = "职位", Length = 16)]
     [SugarColumn(ColumnDescription = "职位", Length = 16)]
     [MaxLength(16)]
     [MaxLength(16)]
     public string? Position { get; set; }
     public string? Position { get; set; }
-
 }
 }

+ 0 - 1
Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Startup.cs

@@ -6,7 +6,6 @@
 
 
 using Admin.NET.Core;
 using Admin.NET.Core;
 using Admin.NET.Plugin.ReZero.Service;
 using Admin.NET.Plugin.ReZero.Service;
-using Furion.Localization;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;

+ 1 - 1
Web/package.json

@@ -2,7 +2,7 @@
 	"name": "admin.net",
 	"name": "admin.net",
 	"type": "module",
 	"type": "module",
 	"version": "2.4.33",
 	"version": "2.4.33",
-	"lastBuildTime": "2024.10.22",
+	"lastBuildTime": "2024.10.27",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"author": "zuohuaijun",
 	"author": "zuohuaijun",
 	"license": "MIT",
 	"license": "MIT",

+ 335 - 340
Web/src/views/system/print/component/hiprint/index.vue

@@ -1,125 +1,120 @@
 <template>
 <template>
-  <el-row :gutter="8" style="margin-bottom: 10px">
-    <!-- 流程下拉 模板选择 -->
-    <el-col :span="4">
-      <el-select v-model="mode" showSearch @change="changeMode" :defaultValue="0" option-label-prop="label"
-        class="w100">
-        <el-option v-for="(opt, idx) in state.modeList" :key="idx" :label="opt.name" :value="idx">
-          {{ opt.name }}
-        </el-option>
-      </el-select>
-    </el-col>
-
-    <el-col :span="20">
-      <el-select v-model="state.curPaper.type" placeholder="默认纸张" style="width: 120px" @change="setPaper">
-        <el-option v-for="item in state.paperTypes" :key="item.type" :label="item.type" :value="item.type" />
-      </el-select>
-      <el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
-      <!-- 纸张设置 -->
-      <el-button-group>
-        <el-popover v-model="state.paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
-          <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px">
-            <el-input type="number" v-model="state.paperWidth" style="width: 100px; text-align: center"
-              place="宽(mm)"></el-input>~
-            <el-input type="number" v-model="state.paperHeight" style="width: 100px; text-align: center"
-              place="高(mm)"></el-input>
-          </div>
-          <div>
-            <el-button type="primary" style="width: 100%" @click="otherPaper">确定</el-button>
-          </div>
-          <template #reference>
-            <el-button :type="'other' == curPaperType ? 'primary' : ''">自定义宽高</el-button>
-          </template>
-        </el-popover>
-      </el-button-group>
-      <el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
-      <el-input-number style="margin-left: 5px;width: 130px;" v-model="state.scaleValue" :precision="2" :step="0.1"
-        :min="state.scaleMin" :max="state.scaleMax" @change="changeScale"></el-input-number>
-      <el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
-      <el-button-group>
-        <el-tooltip content="左对齐" placement="bottom">
-          <el-button icon="ele-Back" @click="setElsAlign('left')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="居中" placement="bottom">
-          <el-button icon="ele-FullScreen" @click="setElsAlign('vertical')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="右对齐" placement="bottom">
-          <el-button icon="ele-Right" @click="setElsAlign('right')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="顶对齐" placement="bottom">
-          <el-button icon="ele-Top" @click="setElsAlign('top')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="垂直居中" placement="bottom">
-          <el-button icon="ele-DCaret" @click="setElsAlign('horizontal')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="底对齐" placement="bottom">
-          <el-button icon="ele-Bottom" @click="setElsAlign('bottom')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="横向分散" placement="bottom">
-          <el-button icon="ele-Sort" @click="setElsAlign('distributeHor')"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="纵向分散" placement="bottom">
-          <el-button icon="ele-Switch" @click="setElsAlign('distributeVer')"> </el-button>
-        </el-tooltip>
-      </el-button-group>
-      <el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
-      <el-button-group>
-        <el-tooltip content="旋转" placement="bottom">
-          <el-button icon="ele-RefreshRight" @click="rotatePaper"></el-button>
-        </el-tooltip>
-        <el-tooltip content="预览" placement="bottom">
-          <el-button icon="ele-View" @click="preView"></el-button>
-        </el-tooltip>
-        <el-tooltip content="清空模板" placement="bottom">
-          <el-button icon="ele-Delete" @click="clearPaper"></el-button>
-        </el-tooltip>
-        <el-tooltip content="直接打印" placement="bottom">
-          <el-button icon="ele-Printer" @click="print"> </el-button>
-        </el-tooltip>
-        <el-tooltip content="模板JSON" placement="bottom">
-          <el-button icon="ele-Coin" @click="viewJson"> </el-button>
-        </el-tooltip>
-      </el-button-group>
-    </el-col>
-  </el-row>
-
-  <el-row :gutter="8">
-    <el-col :span="4">
-      <el-card style="height: 100%" shadow="never">
-        <el-row>
-          <el-col :span="24" id="hiprintEpContainer" class="rect-printElement-types hiprintEpContainer"> </el-col>
-        </el-row>
-      </el-card>
-    </el-col>
-    <el-col :span="14">
-      <el-card shadow="never" class="card-design" :body-style="{ padding: '18px' }">
-        <div id="hiprint-printTemplate" class="hiprint-printTemplate"></div>
-      </el-card>
-    </el-col>
-    <el-col :span="6" class="params_setting_container">
-      <el-tabs type="border-card" style="height: 100%;">
-        <el-tab-pane label="属性" style="height: 100%">
-          <el-card shadow="never" :body-style="{ padding: '0px' }">
-            <el-row class="hinnn-layout-sider">
-              <div id="PrintElementOptionSetting"></div>
-            </el-row>
-          </el-card>
-        </el-tab-pane>
-        <el-tab-pane label="测试数据">
-          <el-button @click="formatPrintDataDemo()" style="margin-bottom: 10px; width: 100%">格式化字符串</el-button>
-          <el-input v-model="printDataDemo" type="textarea" style="width: 100%;" :rows="30"
-            placeholder="对整个文档的完整测试数据"></el-input>
-        </el-tab-pane>
-      </el-tabs>
-    </el-col>
-  </el-row>
-
-  <el-drawer title="打印模板" v-model="state.templateDialogVisible">
-    <vue-json-pretty :data="state.templateContent" showLength showIcon showLineNumber showSelectController />
-  </el-drawer>
-
-  <!-- 预览 -->
-  <PrintPreview ref="preViewRef" title="预览" />
+	<el-row :gutter="8" style="margin-bottom: 10px">
+		<!-- 流程下拉 模板选择 -->
+		<el-col :span="4">
+			<el-select v-model="mode" showSearch @change="changeMode" :defaultValue="0" option-label-prop="label" class="w100">
+				<el-option v-for="(opt, idx) in state.modeList" :key="idx" :label="opt.name" :value="idx">
+					{{ opt.name }}
+				</el-option>
+			</el-select>
+		</el-col>
+
+		<el-col :span="20">
+			<el-select v-model="state.curPaper.type" placeholder="默认纸张" style="width: 120px" @change="setPaper">
+				<el-option v-for="item in state.paperTypes" :key="item.type" :label="item.type" :value="item.type" />
+			</el-select>
+			<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
+			<!-- 纸张设置 -->
+			<el-button-group>
+				<el-popover v-model="state.paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
+					<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px">
+						<el-input type="number" v-model="state.paperWidth" style="width: 100px; text-align: center" place="宽(mm)"></el-input>~
+						<el-input type="number" v-model="state.paperHeight" style="width: 100px; text-align: center" place="高(mm)"></el-input>
+					</div>
+					<div>
+						<el-button type="primary" style="width: 100%" @click="otherPaper">确定</el-button>
+					</div>
+					<template #reference>
+						<el-button :type="'other' == curPaperType ? 'primary' : ''">自定义宽高</el-button>
+					</template>
+				</el-popover>
+			</el-button-group>
+			<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
+			<el-input-number style="margin-left: 5px; width: 130px" v-model="state.scaleValue" :precision="2" :step="0.1" :min="state.scaleMin" :max="state.scaleMax" @change="changeScale"></el-input-number>
+			<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
+			<el-button-group>
+				<el-tooltip content="左对齐" placement="bottom">
+					<el-button icon="ele-Back" @click="setElsAlign('left')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="居中" placement="bottom">
+					<el-button icon="ele-FullScreen" @click="setElsAlign('vertical')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="右对齐" placement="bottom">
+					<el-button icon="ele-Right" @click="setElsAlign('right')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="顶对齐" placement="bottom">
+					<el-button icon="ele-Top" @click="setElsAlign('top')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="垂直居中" placement="bottom">
+					<el-button icon="ele-DCaret" @click="setElsAlign('horizontal')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="底对齐" placement="bottom">
+					<el-button icon="ele-Bottom" @click="setElsAlign('bottom')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="横向分散" placement="bottom">
+					<el-button icon="ele-Sort" @click="setElsAlign('distributeHor')"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="纵向分散" placement="bottom">
+					<el-button icon="ele-Switch" @click="setElsAlign('distributeVer')"> </el-button>
+				</el-tooltip>
+			</el-button-group>
+			<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
+			<el-button-group>
+				<el-tooltip content="旋转" placement="bottom">
+					<el-button icon="ele-RefreshRight" @click="rotatePaper"></el-button>
+				</el-tooltip>
+				<el-tooltip content="预览" placement="bottom">
+					<el-button icon="ele-View" @click="preView"></el-button>
+				</el-tooltip>
+				<el-tooltip content="清空模板" placement="bottom">
+					<el-button icon="ele-Delete" @click="clearPaper"></el-button>
+				</el-tooltip>
+				<el-tooltip content="直接打印" placement="bottom">
+					<el-button icon="ele-Printer" @click="print"> </el-button>
+				</el-tooltip>
+				<el-tooltip content="模板JSON" placement="bottom">
+					<el-button icon="ele-Coin" @click="viewJson"> </el-button>
+				</el-tooltip>
+			</el-button-group>
+		</el-col>
+	</el-row>
+
+	<el-row :gutter="8">
+		<el-col :span="4">
+			<el-card style="height: 100%" shadow="never">
+				<el-row>
+					<el-col :span="24" id="hiprintEpContainer" class="rect-printElement-types hiprintEpContainer"> </el-col>
+				</el-row>
+			</el-card>
+		</el-col>
+		<el-col :span="14">
+			<el-card shadow="never" class="card-design" :body-style="{ padding: '18px' }">
+				<div id="hiprint-printTemplate" class="hiprint-printTemplate"></div>
+			</el-card>
+		</el-col>
+		<el-col :span="6" class="params_setting_container">
+			<el-tabs type="border-card" style="height: 100%">
+				<el-tab-pane label="属性" style="height: 100%">
+					<el-card shadow="never" :body-style="{ padding: '0px' }">
+						<el-row class="hinnn-layout-sider">
+							<div id="PrintElementOptionSetting"></div>
+						</el-row>
+					</el-card>
+				</el-tab-pane>
+				<el-tab-pane label="测试数据">
+					<el-button @click="formatPrintDataDemo()" style="margin-bottom: 10px; width: 100%">格式化字符串</el-button>
+					<el-input v-model="printDataDemo" type="textarea" style="width: 100%" :rows="30" placeholder="对整个文档的完整测试数据"></el-input>
+				</el-tab-pane>
+			</el-tabs>
+		</el-col>
+	</el-row>
+
+	<el-drawer title="打印模板" v-model="state.templateDialogVisible">
+		<vue-json-pretty :data="state.templateContent" showLength showIcon showLineNumber showSelectController />
+	</el-drawer>
+
+	<!-- 预览 -->
+	<PrintPreview ref="preViewRef" title="预览" />
 </template>
 </template>
 
 
 <script lang="ts" setup name="hiprintDesign">
 <script lang="ts" setup name="hiprintDesign">
@@ -135,10 +130,10 @@ import printDataDefault from './print-data';
 import { IPaperType } from './type';
 import { IPaperType } from './type';
 
 
 var props = defineProps({
 var props = defineProps({
-  modeIndex: {
-    type: Number,
-    default: 0,
-  },
+	modeIndex: {
+		type: Number,
+		default: 0,
+	},
 });
 });
 
 
 let hiprintTemplate = ref();
 let hiprintTemplate = ref();
@@ -147,120 +142,120 @@ let mode = ref(0); // 模板选择
 const preViewRef = ref();
 const preViewRef = ref();
 const printDataDemo = ref('');
 const printDataDemo = ref('');
 const state = reactive({
 const state = reactive({
-  modeList: [] as any,
-  // 当前纸张
-  curPaper: {
-    type: 'A4',
-    width: 220,
-    height: 296.6,
-  } as IPaperType,
-  // 纸张类型
-  paperTypes: [
-    {
-      type: 'A3',
-      width: 420,
-      height: 296.6,
-    },
-    {
-      type: 'A4',
-      width: 210,
-      height: 296.6,
-    },
-    {
-      type: 'A5',
-      width: 210,
-      height: 147.6,
-    },
-    {
-      type: 'B3',
-      width: 500,
-      height: 352.6,
-    },
-    {
-      type: 'B4',
-      width: 250,
-      height: 352.6,
-    },
-    {
-      type: 'B5',
-      width: 250,
-      height: 175.6,
-    },
-    {
-      type: '4R',
-      width: 152,
-      height: 102,
-    },
-    {
-      type: '6R',
-      width: 203,
-      height: 152,
-    },
-  ] as IPaperType[],
-  scaleValue: 1,
-  scaleMax: 5,
-  scaleMin: 0.5,
-  // 自定义纸张
-  paperPopVisible: false,
-  paperWidth: 220,
-  paperHeight: 80,
-
-  templateDialogVisible: false,
-  templateContent: '',
+	modeList: [] as any,
+	// 当前纸张
+	curPaper: {
+		type: 'A4',
+		width: 220,
+		height: 296.6,
+	} as IPaperType,
+	// 纸张类型
+	paperTypes: [
+		{
+			type: 'A3',
+			width: 420,
+			height: 296.6,
+		},
+		{
+			type: 'A4',
+			width: 210,
+			height: 296.6,
+		},
+		{
+			type: 'A5',
+			width: 210,
+			height: 147.6,
+		},
+		{
+			type: 'B3',
+			width: 500,
+			height: 352.6,
+		},
+		{
+			type: 'B4',
+			width: 250,
+			height: 352.6,
+		},
+		{
+			type: 'B5',
+			width: 250,
+			height: 175.6,
+		},
+		{
+			type: '4R',
+			width: 152,
+			height: 102,
+		},
+		{
+			type: '6R',
+			width: 203,
+			height: 152,
+		},
+	] as IPaperType[],
+	scaleValue: 1,
+	scaleMax: 5,
+	scaleMin: 0.5,
+	// 自定义纸张
+	paperPopVisible: false,
+	paperWidth: 220,
+	paperHeight: 80,
+
+	templateDialogVisible: false,
+	templateContent: '',
 });
 });
 
 
 // 计算当前纸张类型
 // 计算当前纸张类型
 const curPaperType = computed(() => {
 const curPaperType = computed(() => {
-  let { width, height } = state.curPaper;
-  let type = 'other';
-  let types: any = state.paperTypes;
-  for (const key in types) {
-    let item = types[key];
-    if (item.width === width && item.height === height) {
-      type = key;
-      break;
-    }
-  }
-  return type;
+	let { width, height } = state.curPaper;
+	let type = 'other';
+	let types: any = state.paperTypes;
+	for (const key in types) {
+		let item = types[key];
+		if (item.width === width && item.height === height) {
+			type = key;
+			break;
+		}
+	}
+	return type;
 });
 });
 
 
 // 选择模板
 // 选择模板
 const changeMode = () => {
 const changeMode = () => {
-  let provider = providers[mode.value];
-  hiprint.init({
-    providers: [provider.f],
-  });
-  // 渲染自定义选项
-  const hiprintEpContainerEl = document.getElementById('hiprintEpContainer');
-  if (hiprintEpContainerEl) {
-    hiprintEpContainerEl.innerHTML = '';
-  }
-  hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value);
-
-  // 渲染绘画模板
-  const hiprintPrintTemplate = document.getElementById('hiprint-printTemplate');
-  if (hiprintPrintTemplate) {
-    hiprintPrintTemplate.innerHTML = '';
-  }
-  // 初始化打印模板设计器
-  let template = {};
-  hiprintTemplate.value = new hiprint.PrintTemplate({
-    template: template,
-    settingContainer: '#PrintElementOptionSetting',
-    paginationContainer: '.hiprint-printPagination',
-    fontList: [
-      { title: '微软雅黑', value: 'Microsoft YaHei' },
-      { title: '黑体', value: 'STHeitiSC-Light' },
-      { title: 'Arial', value: 'Arial' },
-      { title: '宋体', value: 'SimSun' },
-      { title: '华为楷体', value: 'STKaiti' },
-      { title: 'cursive', value: 'cursive' },
-      { title: 'Vector', value: 'Vector' },
-    ],
-  });
-  hiprintTemplate.value.design('#hiprint-printTemplate');
-  // 获取当前放大比例, 当zoom时传true才会有
-  state.scaleValue = hiprintTemplate.value.editingPanel?.scale ?? 1;
+	let provider = providers[mode.value];
+	hiprint.init({
+		providers: [provider.f],
+	});
+	// 渲染自定义选项
+	const hiprintEpContainerEl = document.getElementById('hiprintEpContainer');
+	if (hiprintEpContainerEl) {
+		hiprintEpContainerEl.innerHTML = '';
+	}
+	hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value);
+
+	// 渲染绘画模板
+	const hiprintPrintTemplate = document.getElementById('hiprint-printTemplate');
+	if (hiprintPrintTemplate) {
+		hiprintPrintTemplate.innerHTML = '';
+	}
+	// 初始化打印模板设计器
+	let template = {};
+	hiprintTemplate.value = new hiprint.PrintTemplate({
+		template: template,
+		settingContainer: '#PrintElementOptionSetting',
+		paginationContainer: '.hiprint-printPagination',
+		fontList: [
+			{ title: '微软雅黑', value: 'Microsoft YaHei' },
+			{ title: '黑体', value: 'STHeitiSC-Light' },
+			{ title: 'Arial', value: 'Arial' },
+			{ title: '宋体', value: 'SimSun' },
+			{ title: '华为楷体', value: 'STKaiti' },
+			{ title: 'cursive', value: 'cursive' },
+			{ title: 'Vector', value: 'Vector' },
+		],
+	});
+	hiprintTemplate.value.design('#hiprint-printTemplate');
+	// 获取当前放大比例, 当zoom时传true才会有
+	state.scaleValue = hiprintTemplate.value.editingPanel?.scale ?? 1;
 };
 };
 
 
 /**
 /**
@@ -269,141 +264,141 @@ const changeMode = () => {
  * @param value {width,height} mm
  * @param value {width,height} mm
  */
  */
 const setPaper = (type: string, value?: { width: number; height: number }) => {
 const setPaper = (type: string, value?: { width: number; height: number }) => {
-  try {
-    const paperType = state.paperTypes.find(x => x.type == type);
-    if (paperType) {
-      state.curPaper = { type: type, width: paperType.width || 0, height: paperType.height || 0 };
-      hiprintTemplate.value.setPaper(paperType.width, paperType.height);
-    } else {
-      state.curPaper = { type: 'other', width: value?.width || 0, height: value?.height || 0 };
-      hiprintTemplate.value.setPaper(value?.width, value?.height);
-    }
-  } catch (error) {
-    ElMessage.error(`操作失败: ${error}`);
-  }
+	try {
+		const paperType = state.paperTypes.find((x) => x.type == type);
+		if (paperType) {
+			state.curPaper = { type: type, width: paperType.width || 0, height: paperType.height || 0 };
+			hiprintTemplate.value.setPaper(paperType.width, paperType.height);
+		} else {
+			state.curPaper = { type: 'other', width: value?.width || 0, height: value?.height || 0 };
+			hiprintTemplate.value.setPaper(value?.width, value?.height);
+		}
+	} catch (error) {
+		ElMessage.error(`操作失败: ${error}`);
+	}
 };
 };
 
 
 // 改变缩放比例
 // 改变缩放比例
 const changeScale = (currentValue: number, oldValue: number) => {
 const changeScale = (currentValue: number, oldValue: number) => {
-  let big = false;
-  currentValue <= oldValue ? (big = false) : (big = true);
-
-  let scaleVal = currentValue;
-  if (big) {
-    if (scaleVal > state.scaleMax) scaleVal = 5;
-  } else {
-    if (scaleVal < state.scaleMin) scaleVal = 0.5;
-  }
-  if (hiprintTemplate.value) {
-    // scaleVal: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
-    hiprintTemplate.value.zoom(scaleVal);
-    state.scaleValue = scaleVal;
-  }
+	let big = false;
+	currentValue <= oldValue ? (big = false) : (big = true);
+
+	let scaleVal = currentValue;
+	if (big) {
+		if (scaleVal > state.scaleMax) scaleVal = 5;
+	} else {
+		if (scaleVal < state.scaleMin) scaleVal = 0.5;
+	}
+	if (hiprintTemplate.value) {
+		// scaleVal: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
+		hiprintTemplate.value.zoom(scaleVal);
+		state.scaleValue = scaleVal;
+	}
 };
 };
 
 
 // 旋转模板
 // 旋转模板
 const rotatePaper = () => {
 const rotatePaper = () => {
-  if (hiprintTemplate.value) {
-    hiprintTemplate.value.rotatePaper();
-  }
+	if (hiprintTemplate.value) {
+		hiprintTemplate.value.rotatePaper();
+	}
 };
 };
 
 
 // 对齐模板
 // 对齐模板
 const setElsAlign = (e: any) => {
 const setElsAlign = (e: any) => {
-  hiprintTemplate.value.setElsAlign(e);
+	hiprintTemplate.value.setElsAlign(e);
 };
 };
 
 
 // 清空模板
 // 清空模板
 const clearPaper = () => {
 const clearPaper = () => {
-  ElMessageBox.confirm('是否确认清空模板信息?', '警告', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning',
-  })
-    .then(() => {
-      try {
-        hiprintTemplate.value.clear();
-      } catch (error) {
-        ElMessage.error(`操作失败: ${error}`);
-      }
-    })
-    .catch((err) => {
-      console.log(err);
-    });
+	ElMessageBox.confirm('是否确认清空模板信息?', '警告', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+	})
+		.then(() => {
+			try {
+				hiprintTemplate.value.clear();
+			} catch (error) {
+				ElMessage.error(`操作失败: ${error}`);
+			}
+		})
+		.catch((err) => {
+			console.log(err);
+		});
 };
 };
 
 
 // 自定义纸张
 // 自定义纸张
 const otherPaper = () => {
 const otherPaper = () => {
-  let value = {
-    width: 0,
-    height: 0,
-  };
-  value.width = state.paperWidth;
-  value.height = state.paperHeight;
-  state.paperPopVisible = false;
-  setPaper('other', value);
+	let value = {
+		width: 0,
+		height: 0,
+	};
+	value.width = state.paperWidth;
+	value.height = state.paperHeight;
+	state.paperPopVisible = false;
+	setPaper('other', value);
 };
 };
 
 
 // 预览
 // 预览
 const preView = () => {
 const preView = () => {
-  let { width } = state.curPaper;
-  let printData = null;
-  try {
-    printData = JSON.parse(printDataDemo.value);
-  } catch (e) {
-    console.log('出错:' + e);
-  }
-  if (printData == null) {
-    printData = printDataDefault;
-  }
-  preViewRef.value.showDialog(hiprintTemplate.value, printData, width);
+	let { width } = state.curPaper;
+	let printData = null;
+	try {
+		printData = JSON.parse(printDataDemo.value);
+	} catch (e) {
+		console.log('出错:' + e);
+	}
+	if (printData == null) {
+		printData = printDataDefault;
+	}
+	preViewRef.value.showDialog(hiprintTemplate.value, printData, width);
 };
 };
 // 直接打印
 // 直接打印
 const print = () => {
 const print = () => {
-  preView();
+	preView();
 };
 };
 
 
 // 查看模板JSON
 // 查看模板JSON
 const viewJson = () => {
 const viewJson = () => {
-  if (hiprintTemplate.value) {
-    var templateJson = JSON.stringify(hiprintTemplate.value.getJson() || {});
-    state.templateContent = JSON.parse(templateJson);
-    state.templateDialogVisible = true;
-  }
+	if (hiprintTemplate.value) {
+		var templateJson = JSON.stringify(hiprintTemplate.value.getJson() || {});
+		state.templateContent = JSON.parse(templateJson);
+		state.templateDialogVisible = true;
+	}
 };
 };
 
 
 onMounted(() => {
 onMounted(() => {
-  state.modeList = providers.map((e) => {
-    return { type: e.type, name: e.name, value: e.value };
-  });
-  mode.value = props.modeIndex;
-  changeMode();
-  // otherPaper(); // 默认纸张
+	state.modeList = providers.map((e) => {
+		return { type: e.type, name: e.name, value: e.value };
+	});
+	mode.value = props.modeIndex;
+	changeMode();
+	// otherPaper(); // 默认纸张
 });
 });
 
 
 // 初始化纸张大小
 // 初始化纸张大小
 const initPaper = () => {
 const initPaper = () => {
-  var template = hiprintTemplate.value.getJson();
-  var width = template.panels[0].width;
-  var height = template.panels[0].height;
-  const paperType = state.paperTypes.find(x => x.width == width && x.height == height)
-  state.curPaper = { type: paperType?.type || '', width: width, height: height }; // 计算纸张类型和状态
-  hiprintTemplate.value.setPaper(width, height); // 设置纸张大小
+	var template = hiprintTemplate.value.getJson();
+	var width = template.panels[0].width;
+	var height = template.panels[0].height;
+	const paperType = state.paperTypes.find((x) => x.width == width && x.height == height);
+	state.curPaper = { type: paperType?.type || '', width: width, height: height }; // 计算纸张类型和状态
+	hiprintTemplate.value.setPaper(width, height); // 设置纸张大小
 };
 };
 
 
 // 设置预览测试数据
 // 设置预览测试数据
 const setPrintDataDemo = (strData: string | null | undefined) => {
 const setPrintDataDemo = (strData: string | null | undefined) => {
-  printDataDemo.value = strData as string;
+	printDataDemo.value = strData as string;
 };
 };
 
 
 // 格式化打印测试数据
 // 格式化打印测试数据
 const formatPrintDataDemo = () => {
 const formatPrintDataDemo = () => {
-  try {
-    const obj = JSON.parse(printDataDemo.value);
-    printDataDemo.value = JSON.stringify(obj, null, 2);
-  } catch (e) {
-    ElMessageBox.alert('出错:' + e);
-  }
+	try {
+		const obj = JSON.parse(printDataDemo.value);
+		printDataDemo.value = JSON.stringify(obj, null, 2);
+	} catch (e) {
+		ElMessageBox.alert('出错:' + e);
+	}
 };
 };
 
 
 // 导出对象
 // 导出对象
@@ -412,42 +407,42 @@ defineExpose({ hiprintTemplate, printDataDemo, setPrintDataDemo, initPaper, mode
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 :deep(.rect-printElement-types .hiprint-printElement-type > li > ul > li > a) {
 :deep(.rect-printElement-types .hiprint-printElement-type > li > ul > li > a) {
-  // padding: 4px 4px;
-  //color: #1296db;
-  // line-height: 1;
-  height: auto;
-  text-overflow: ellipsis;
-  color: var(--el-color-primary);
-  box-shadow: none !important;
-  // border: 1px dashed var(--el-color-primary);
+	// padding: 4px 4px;
+	//color: #1296db;
+	// line-height: 1;
+	height: auto;
+	text-overflow: ellipsis;
+	color: var(--el-color-primary);
+	box-shadow: none !important;
+	// border: 1px dashed var(--el-color-primary);
 }
 }
 
 
 // 默认图片
 // 默认图片
 :deep(.hiprint-printElement-image-content) {
 :deep(.hiprint-printElement-image-content) {
-  img {
-    content: url('~@/assets/logo.png');
-  }
+	img {
+		content: url('~@/assets/logo.png');
+	}
 }
 }
 
 
 // 设计容器
 // 设计容器
 .card-design {
 .card-design {
-  overflow: hidden;
-  overflow-x: auto;
-  overflow-y: auto;
-  height: 100%;
-  padding: 2px;
+	overflow: hidden;
+	overflow-x: auto;
+	overflow-y: auto;
+	height: 100%;
+	padding: 2px;
 }
 }
 
 
 :deep(.hiprint-option-item-submitBtn) {
 :deep(.hiprint-option-item-submitBtn) {
-  background: var(--el-color-primary);
+	background: var(--el-color-primary);
 }
 }
 
 
 :deep(.hiprint-option-item-deleteBtn) {
 :deep(.hiprint-option-item-deleteBtn) {
-  background: var(--el-color-danger);
+	background: var(--el-color-danger);
 }
 }
 
 
 :deep(.prop-tabs .prop-tab-items li.active) {
 :deep(.prop-tabs .prop-tab-items li.active) {
-  color: var(--el-color-primary);
-  border-bottom: 2px solid var(--el-color-primary);
+	color: var(--el-color-primary);
+	border-bottom: 2px solid var(--el-color-primary);
 }
 }
 </style>
 </style>