更新实验报告功能
This commit is contained in:
parent
6bd36e8e80
commit
db9b1cfb70
8
Assets/Plugins/Asp.meta
Normal file
8
Assets/Plugins/Asp.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5245db37ffaf5384482cd9ae581d921b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/Aspose.Words.dll
Normal file
BIN
Assets/Plugins/Asp/Aspose.Words.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/Aspose.Words.dll.meta
Normal file
33
Assets/Plugins/Asp/Aspose.Words.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c076867c77afa19408ff0411f1661b29
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.CJK.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.CJK.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.CJK.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.CJK.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa629f83f57078048a17fc3f5e3720af
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.MidEast.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.MidEast.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.MidEast.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.MidEast.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c950e361e6b1e2f4d872bc7669507a26
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.Other.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.Other.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.Other.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.Other.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5899f8e7237f4f4ea175ecb305b5d1d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.Rare.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.Rare.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.Rare.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.Rare.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 102f3f34ce012904e890960c7a5fb81a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.West.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.West.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.West.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.West.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76a80607cca61d244885781bf220a8d2
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Plugins/Asp/I18N.dll
Normal file
BIN
Assets/Plugins/Asp/I18N.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Asp/I18N.dll.meta
Normal file
33
Assets/Plugins/Asp/I18N.dll.meta
Normal file
@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 815eaf607fce2fa449ee031177df3c5f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord.meta
Normal file
8
Assets/WebGLDownLoadWord.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66a963eef57758a4bbfada0dbebd2905
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord/Plugins.meta
Normal file
8
Assets/WebGLDownLoadWord/Plugins.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c30ea19771718df4082a72c69a62a2da
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
27
Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib
Normal file
27
Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
mergeInto(LibraryManager.library, {
|
||||
WebGLDownloadWord : function(array,size,reportjson)
|
||||
{
|
||||
var reportdata= UTF8ToString(reportjson);
|
||||
var bytes = new Uint8Array(size);
|
||||
for (var i = 0; i < size; i++)
|
||||
{
|
||||
bytes[i] = HEAPU8[array + i];
|
||||
}
|
||||
|
||||
HtmlDownloadWord(bytes,reportdata);
|
||||
|
||||
},
|
||||
CopyToClipboard: function(text) {
|
||||
|
||||
var str = Pointer_stringify(text);
|
||||
|
||||
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(str).then(function() {
|
||||
}).catch(function(error) {
|
||||
});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c5db0930befe7d419f28aed73f4dcd9
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord/Resources.meta
Normal file
8
Assets/WebGLDownLoadWord/Resources.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f8ba2d94d39cde4497a65c1ececf209
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/WebGLDownLoadWord/Resources/下载Word配置文件.asset
Normal file
17
Assets/WebGLDownLoadWord/Resources/下载Word配置文件.asset
Normal file
@ -0,0 +1,17 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bca17604ecf2ff74a8c8bc9974e71bb3, type: 3}
|
||||
m_Name: "\u4E0B\u8F7DWord\u914D\u7F6E\u6587\u4EF6"
|
||||
m_EditorClassIdentifier:
|
||||
Author: Chao
|
||||
PackPathName: KunChong
|
||||
TemplatePath: Assets/StreamingAssets/Template/
|
||||
8
Assets/WebGLDownLoadWord/Resources/下载Word配置文件.asset.meta
Normal file
8
Assets/WebGLDownLoadWord/Resources/下载Word配置文件.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c37e63a24fee820468a5815cbf92ec10
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord/Scripts.meta
Normal file
8
Assets/WebGLDownLoadWord/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e590c4ae3cc2b3428e1aee0548579e6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord/Scripts/DownLoadWord.meta
Normal file
8
Assets/WebGLDownLoadWord/Scripts/DownLoadWord.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63ad792ad5744fb4e86f31716e3e26fe
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fce78ddffb926bf4cba621fc565358ba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95cfb9a8de2c1274fb9b3219d5518aec
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ScreenShot : MonoBehaviour
|
||||
{
|
||||
public Texture2D screenImage;
|
||||
public void Shot(Action<string> callBack)
|
||||
{
|
||||
//if (MVC.GetModel<KunChongModel>().IsKaoHe)
|
||||
//{
|
||||
// StartCoroutine(ScrrenCapture(callBack));
|
||||
//}
|
||||
}
|
||||
|
||||
IEnumerator ScrrenCapture(Action<string> callBack)
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
// 创建一个新的Texture2D对象,尺寸为屏幕当前分辨率
|
||||
screenImage = new Texture2D(Screen.width, Screen.height);
|
||||
// 读取屏幕上当前帧的像素
|
||||
screenImage.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
|
||||
screenImage.Apply();
|
||||
//生成Base64
|
||||
string base64 = "data:image/png;base64," + Texture2DToBase64(screenImage);
|
||||
// 清理
|
||||
callBack?.Invoke(base64);
|
||||
}
|
||||
|
||||
public string Texture2DToBase64(Texture2D texture)
|
||||
{
|
||||
byte[] data = texture.EncodeToPNG();
|
||||
return Convert.ToBase64String(data);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f66816bedeb18345a5f4f55bef8f9b0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df4bb7b1427ea994c935597c8276fd22
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,259 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
/// <summary>
|
||||
/// 实验报告基础参数
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class LabReprotData
|
||||
{
|
||||
public string realname;
|
||||
|
||||
#region 选择题基础数据
|
||||
public string xuanzeti_1;
|
||||
public string xuanzeti_2;
|
||||
public string xuanzeti_3;
|
||||
public string xuanzeti_4;
|
||||
public string xuanzeti_5;
|
||||
public string xuanzeti_6;
|
||||
public string xuanzeti_7;
|
||||
public string xuanzeti_8;
|
||||
public string xuanzeti_9;
|
||||
public string xuanzeti_10;
|
||||
public string xuanzeti_11;
|
||||
public string xuanzeti_12;
|
||||
public string xuanzeti_13;
|
||||
public string xuanzeti_14;
|
||||
public string xuanzeti_15;
|
||||
#endregion
|
||||
|
||||
#region 标本采集1基础数据
|
||||
public string biaobencaiji_1_name;
|
||||
public string biaobencaiji_1_shijian;
|
||||
public string biaobencaiji_1_buzhou_1;
|
||||
public string biaobencaiji_1_jilu_1;
|
||||
public string biaobencaiji_1_image_1;
|
||||
public string biaobencaiji_1_daan_1;
|
||||
public string biaobencaiji_1_buzhou_2;
|
||||
public string biaobencaiji_1_jilu_2;
|
||||
public string biaobencaiji_1_image_2;
|
||||
public string biaobencaiji_1_daan_2;
|
||||
public string biaobencaiji_1_buzhou_3;
|
||||
public string biaobencaiji_1_jilu_3;
|
||||
public string biaobencaiji_1_image_3;
|
||||
public string biaobencaiji_1_daan_3;
|
||||
public string biaobencaiji_1_buzhou_4;
|
||||
public string biaobencaiji_1_jilu_4;
|
||||
public string biaobencaiji_1_image_4;
|
||||
public string biaobencaiji_1_daan_4;
|
||||
public string biaobencaiji_1_buzhou_5;
|
||||
public string biaobencaiji_1_jilu_5;
|
||||
public string biaobencaiji_1_image_5;
|
||||
public string biaobencaiji_1_daan_5;
|
||||
#endregion
|
||||
#region 标本采集2基础数据
|
||||
public string biaobencaiji_2_name;
|
||||
public string biaobencaiji_2_shijian;
|
||||
public string biaobencaiji_2_buzhou_1;
|
||||
public string biaobencaiji_2_jilu_1;
|
||||
public string biaobencaiji_2_image_1;
|
||||
public string biaobencaiji_2_daan_1;
|
||||
public string biaobencaiji_2_buzhou_2;
|
||||
public string biaobencaiji_2_jilu_2;
|
||||
public string biaobencaiji_2_image_2;
|
||||
public string biaobencaiji_2_daan_2;
|
||||
public string biaobencaiji_2_buzhou_3;
|
||||
public string biaobencaiji_2_jilu_3;
|
||||
public string biaobencaiji_2_image_3;
|
||||
public string biaobencaiji_2_daan_3;
|
||||
public string biaobencaiji_2_buzhou_4;
|
||||
public string biaobencaiji_2_jilu_4;
|
||||
public string biaobencaiji_2_image_4;
|
||||
public string biaobencaiji_2_daan_4;
|
||||
#endregion
|
||||
#region 标本采集3基础数据
|
||||
public string biaobencaiji_3_name;
|
||||
public string biaobencaiji_3_shijian;
|
||||
public string biaobencaiji_3_buzhou_1;
|
||||
public string biaobencaiji_3_jilu_1;
|
||||
public string biaobencaiji_3_image_1;
|
||||
public string biaobencaiji_3_daan_1;
|
||||
public string biaobencaiji_3_buzhou_2;
|
||||
public string biaobencaiji_3_jilu_2;
|
||||
public string biaobencaiji_3_image_2;
|
||||
public string biaobencaiji_3_daan_2;
|
||||
public string biaobencaiji_3_buzhou_3;
|
||||
public string biaobencaiji_3_jilu_3;
|
||||
public string biaobencaiji_3_image_3;
|
||||
public string biaobencaiji_3_daan_3;
|
||||
public string biaobencaiji_3_buzhou_4;
|
||||
public string biaobencaiji_3_jilu_4;
|
||||
public string biaobencaiji_3_image_4;
|
||||
public string biaobencaiji_3_daan_4;
|
||||
#endregion
|
||||
#region 标本采集4基础数据
|
||||
public string biaobencaiji_4_name;
|
||||
public string biaobencaiji_4_shijian;
|
||||
public string biaobencaiji_4_buzhou_1;
|
||||
public string biaobencaiji_4_jilu_1;
|
||||
public string biaobencaiji_4_image_1;
|
||||
public string biaobencaiji_4_daan_1;
|
||||
public string biaobencaiji_4_buzhou_2;
|
||||
public string biaobencaiji_4_jilu_2;
|
||||
public string biaobencaiji_4_image_2;
|
||||
public string biaobencaiji_4_daan_2;
|
||||
public string biaobencaiji_4_buzhou_3;
|
||||
public string biaobencaiji_4_jilu_3;
|
||||
public string biaobencaiji_4_image_3;
|
||||
public string biaobencaiji_4_daan_3;
|
||||
public string biaobencaiji_4_buzhou_4;
|
||||
public string biaobencaiji_4_jilu_4;
|
||||
public string biaobencaiji_4_image_4;
|
||||
public string biaobencaiji_4_daan_4;
|
||||
#endregion
|
||||
#region 标本采集5基础数据
|
||||
public string biaobencaiji_5_name;
|
||||
public string biaobencaiji_5_shijian;
|
||||
public string biaobencaiji_5_buzhou_1;
|
||||
public string biaobencaiji_5_jilu_1;
|
||||
public string biaobencaiji_5_image_1;
|
||||
public string biaobencaiji_5_daan_1;
|
||||
public string biaobencaiji_5_buzhou_2;
|
||||
public string biaobencaiji_5_jilu_2;
|
||||
public string biaobencaiji_5_image_2;
|
||||
public string biaobencaiji_5_daan_2;
|
||||
public string biaobencaiji_5_buzhou_3;
|
||||
public string biaobencaiji_5_jilu_3;
|
||||
public string biaobencaiji_5_image_3;
|
||||
public string biaobencaiji_5_daan_3;
|
||||
public string biaobencaiji_5_buzhou_4;
|
||||
public string biaobencaiji_5_jilu_4;
|
||||
public string biaobencaiji_5_image_4;
|
||||
public string biaobencaiji_5_daan_4;
|
||||
#endregion
|
||||
#region 标本采集6基础数据
|
||||
public string biaobencaiji_6_name;
|
||||
public string biaobencaiji_6_shijian;
|
||||
public string biaobencaiji_6_buzhou_1;
|
||||
public string biaobencaiji_6_jilu_1;
|
||||
public string biaobencaiji_6_image_1;
|
||||
public string biaobencaiji_6_daan_1;
|
||||
public string biaobencaiji_6_buzhou_2;
|
||||
public string biaobencaiji_6_jilu_2;
|
||||
public string biaobencaiji_6_image_2;
|
||||
public string biaobencaiji_6_daan_2;
|
||||
public string biaobencaiji_6_buzhou_3;
|
||||
public string biaobencaiji_6_jilu_3;
|
||||
public string biaobencaiji_6_image_3;
|
||||
public string biaobencaiji_6_daan_3;
|
||||
public string biaobencaiji_6_buzhou_4;
|
||||
public string biaobencaiji_6_jilu_4;
|
||||
public string biaobencaiji_6_image_4;
|
||||
public string biaobencaiji_6_daan_4;
|
||||
#endregion
|
||||
|
||||
#region 标本制作1基础数据
|
||||
public string biaobenzhizuo_1_name;
|
||||
public string biaobenzhizuo_1_jilu_1;
|
||||
public string biaobenzhizuo_1_image_1;
|
||||
public string biaobenzhizuo_1_daan_1;
|
||||
public string biaobenzhizuo_1_jilu_2;
|
||||
public string biaobenzhizuo_1_image_2;
|
||||
public string biaobenzhizuo_1_daan_2;
|
||||
public string biaobenzhizuo_1_jilu_3;
|
||||
public string biaobenzhizuo_1_image_3;
|
||||
public string biaobenzhizuo_1_daan_3;
|
||||
public string biaobenzhizuo_1_jilu_4;
|
||||
public string biaobenzhizuo_1_image_4;
|
||||
public string biaobenzhizuo_1_daan_4;
|
||||
public string biaobenzhizuo_1_jilu_5;
|
||||
public string biaobenzhizuo_1_image_5;
|
||||
public string biaobenzhizuo_1_daan_5;
|
||||
#endregion
|
||||
#region 标本制作2基础数据
|
||||
public string biaobenzhizuo_2_name;
|
||||
public string biaobenzhizuo_2_jilu_1;
|
||||
public string biaobenzhizuo_2_image_1;
|
||||
public string biaobenzhizuo_2_daan_1;
|
||||
public string biaobenzhizuo_2_jilu_2;
|
||||
public string biaobenzhizuo_2_image_2;
|
||||
public string biaobenzhizuo_2_daan_2;
|
||||
public string biaobenzhizuo_2_jilu_3;
|
||||
public string biaobenzhizuo_2_image_3;
|
||||
public string biaobenzhizuo_2_daan_3;
|
||||
#endregion
|
||||
#region 标本制作3基础数据
|
||||
public string biaobenzhizuo_3_name;
|
||||
public string biaobenzhizuo_3_jilu_1;
|
||||
public string biaobenzhizuo_3_image_1;
|
||||
public string biaobenzhizuo_3_daan_1;
|
||||
public string biaobenzhizuo_3_jilu_2;
|
||||
public string biaobenzhizuo_3_image_2;
|
||||
public string biaobenzhizuo_3_daan_2;
|
||||
public string biaobenzhizuo_3_jilu_3;
|
||||
public string biaobenzhizuo_3_image_3;
|
||||
public string biaobenzhizuo_3_daan_3;
|
||||
#endregion
|
||||
#region 标本制作4基础数据
|
||||
public string biaobenzhizuo_4_name;
|
||||
public string biaobenzhizuo_4_jilu_1;
|
||||
public string biaobenzhizuo_4_image_1;
|
||||
public string biaobenzhizuo_4_daan_1;
|
||||
public string biaobenzhizuo_4_jilu_2;
|
||||
public string biaobenzhizuo_4_image_2;
|
||||
public string biaobenzhizuo_4_daan_2;
|
||||
public string biaobenzhizuo_4_jilu_3;
|
||||
public string biaobenzhizuo_4_image_3;
|
||||
public string biaobenzhizuo_4_daan_3;
|
||||
public string biaobenzhizuo_4_jilu_4;
|
||||
public string biaobenzhizuo_4_image_4;
|
||||
public string biaobenzhizuo_4_daan_4;
|
||||
public string biaobenzhizuo_4_jilu_5;
|
||||
public string biaobenzhizuo_4_image_5;
|
||||
public string biaobenzhizuo_4_daan_5;
|
||||
public string biaobenzhizuo_4_jilu_6;
|
||||
public string biaobenzhizuo_4_image_6;
|
||||
public string biaobenzhizuo_4_daan_6;
|
||||
public string biaobenzhizuo_4_jilu_7;
|
||||
public string biaobenzhizuo_4_image_7;
|
||||
public string biaobenzhizuo_4_daan_7;
|
||||
public string biaobenzhizuo_4_jilu_8;
|
||||
public string biaobenzhizuo_4_image_8;
|
||||
public string biaobenzhizuo_4_daan_8;
|
||||
public string biaobenzhizuo_4_jilu_9;
|
||||
public string biaobenzhizuo_4_image_9;
|
||||
public string biaobenzhizuo_4_daan_9;
|
||||
public string biaobenzhizuo_4_jilu_10;
|
||||
public string biaobenzhizuo_4_image_10;
|
||||
public string biaobenzhizuo_4_daan_10;
|
||||
public string biaobenzhizuo_4_jilu_11;
|
||||
public string biaobenzhizuo_4_image_11;
|
||||
public string biaobenzhizuo_4_daan_11;
|
||||
public string biaobenzhizuo_4_jilu_12;
|
||||
public string biaobenzhizuo_4_image_12;
|
||||
public string biaobenzhizuo_4_daan_12;
|
||||
public string biaobenzhizuo_4_jilu_13;
|
||||
public string biaobenzhizuo_4_image_13;
|
||||
public string biaobenzhizuo_4_daan_13;
|
||||
#endregion
|
||||
#region 标本制作5蝶翅画
|
||||
public string biaobenzhizuo_diechihua_image;
|
||||
#endregion
|
||||
|
||||
#region 昆虫解剖1基础数据
|
||||
public string kunchongjiepou_1_name;
|
||||
public string kunchongjiepou_1_buzhou_1;
|
||||
public string kunchongjiepou_1_jilu_1;
|
||||
public string kunchongjiepou_1_image_1;
|
||||
public string kunchongjiepou_1_daan_1;
|
||||
public string kunchongjiepou_1_buzhou_2;
|
||||
public string kunchongjiepou_1_jilu_2;
|
||||
public string kunchongjiepou_1_image_2;
|
||||
public string kunchongjiepou_1_daan_2;
|
||||
public string kunchongjiepou_1_buzhou_3;
|
||||
public string kunchongjiepou_1_jilu_3;
|
||||
public string kunchongjiepou_1_image_3;
|
||||
public string kunchongjiepou_1_daan_3;
|
||||
#endregion
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88f29195f280e2b4aaff177780c5bcd0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bd960b5c0324a542b043cc588092b8a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b448d06c5c5ff52468263f9ad64fad22
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
/// <summary>
|
||||
/// 下载Word脚本
|
||||
/// </summary>
|
||||
public class WebGLDownLoadFile : MonoBehaviour
|
||||
{
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void WebGLDownloadWord(byte[] array, int size, string reportjson);
|
||||
|
||||
public static WebGLDownLoadFile instance;
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载Word 方法
|
||||
/// </summary>
|
||||
public void Download(string json)
|
||||
{
|
||||
#region 初始化
|
||||
//LabReprotData reprotData = new LabReprotData();
|
||||
//// 转json
|
||||
//string json = JsonUtility.ToJson(reprotData, true);
|
||||
#endregion
|
||||
|
||||
// 调用携程下载数据
|
||||
StartCoroutine(WebGLDownloadWord(json));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下载Word
|
||||
/// </summary>
|
||||
/// <param name="json">实验报告json</param>
|
||||
/// <returns></returns>
|
||||
IEnumerator WebGLDownloadWord(string json)
|
||||
{
|
||||
UnityWebRequest request = UnityWebRequest.Get(Global.reportDemoPath);
|
||||
yield return request.SendWebRequest();
|
||||
|
||||
if (string.IsNullOrEmpty(request.error) == false)
|
||||
{
|
||||
Debug.Log("错误路径:" + request.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 下载word
|
||||
DownloadDocx(request.downloadHandler.data, json);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 调用下载Word
|
||||
/// </summary>
|
||||
/// <param name="bytes">支持多种文件格式下载(doc docx xml xlsx txt等)</param>
|
||||
/// <param name="reportjson">json数据</param>
|
||||
public void DownloadDocx(byte[] bytes, string reportjson)
|
||||
{
|
||||
WebGLDownloadWord(bytes, bytes.Length, reportjson);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40ec725cf2804f149acc5f79096b0f59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/WebGLDownLoadWord/Scripts/Editor.meta
Normal file
8
Assets/WebGLDownLoadWord/Scripts/Editor.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98a6b80550e33de4c8d7a6880d9d6eb7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
70
Assets/WebGLDownLoadWord/Scripts/Editor/CreateHtml.cs
Normal file
70
Assets/WebGLDownLoadWord/Scripts/Editor/CreateHtml.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEditor.ProjectWindowCallback;
|
||||
using UnityEngine;
|
||||
public class CreateHtml
|
||||
{
|
||||
|
||||
[MenuItem("Assets/Create/创建WordAssets文件/Webgl Index Html", false, 60)]
|
||||
public static void CreateIndex()
|
||||
{
|
||||
//参数为传递给CreateEventCSScriptAsset类action方法的参数
|
||||
|
||||
var endNameEditAction = ScriptableObject.CreateInstance<CreateEventCSScriptAsset>();
|
||||
|
||||
var icon = EditorGUIUtility.FindTexture("html Script Icon");
|
||||
|
||||
var resourceFile = "Assets/StreamingAssets/Template/" + "Index.html.txt";
|
||||
|
||||
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, endNameEditAction, "index.html", icon, resourceFile);
|
||||
}
|
||||
}
|
||||
public class CreateEventCSScriptAsset : EndNameEditAction
|
||||
{
|
||||
public override void Action(int instanceId, string pathName, string resourceFile)
|
||||
{
|
||||
//创建资源
|
||||
UnityEngine.Object obj = CreateScriptAssetFromTemplate(pathName, resourceFile);
|
||||
ProjectWindowUtil.ShowCreatedAsset(obj);//高亮显示资源
|
||||
}
|
||||
|
||||
private static UnityEngine.Object CreateScriptAssetFromTemplate(string pathName, string resourceFile)
|
||||
{
|
||||
//获取要创建资源的绝对路径
|
||||
string fullPath = Path.GetFullPath(pathName);
|
||||
|
||||
//读取本地的模板文件
|
||||
StreamReader streamReader = new StreamReader(resourceFile);
|
||||
string text = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
//获取文件名,不含扩展名
|
||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pathName);
|
||||
text = Regex.Replace(text, "#ScriptName#", fileNameWithoutExtension);
|
||||
text = Regex.Replace(text, "#Author#", WordConfig.Instance.Author);
|
||||
text = Regex.Replace(text, "#ProgramName#", PlayerSettings.productName);
|
||||
text = Regex.Replace(text, "#NowTime#", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
text = Regex.Replace(text, "#ReleasePathName#", WordConfig.Instance.PackPathName);
|
||||
|
||||
//写入配置文件
|
||||
bool encoderShouldEmitUTF8Identifier = true; //参数指定是否提供 Unicode 字节顺序标记
|
||||
bool throwOnInvalidBytes = false;//是否在检测到无效的编码时引发异常
|
||||
bool append = false;
|
||||
UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
|
||||
StreamWriter streamWriter = new StreamWriter(fullPath, append, encoding);
|
||||
streamWriter.Write(text);
|
||||
streamWriter.Close();
|
||||
|
||||
//刷新资源管理器
|
||||
AssetDatabase.ImportAsset(pathName);
|
||||
AssetDatabase.Refresh();
|
||||
return AssetDatabase.LoadAssetAtPath(pathName, typeof(UnityEngine.Object));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
Assets/WebGLDownLoadWord/Scripts/Editor/CreateHtml.cs.meta
Normal file
11
Assets/WebGLDownLoadWord/Scripts/Editor/CreateHtml.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b73c4f0759d3ca4e96d8a83388d6e8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfig.cs
Normal file
50
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfig.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
[CreateAssetMenu(fileName = "下载Word配置文件", menuName = "创建WordAssets文件/配置文件")]
|
||||
public class WordConfig : ScriptableObject
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 作者
|
||||
/// </summary>
|
||||
[Header("作者")]
|
||||
public string Author = "ChenXiang";
|
||||
|
||||
/// <summary>
|
||||
/// 项目发布目录名称
|
||||
/// </summary>
|
||||
[Header("项目发布目录名称")]
|
||||
public string PackPathName = "目录名称";
|
||||
|
||||
/// <summary>
|
||||
/// 模板路径
|
||||
/// </summary>
|
||||
[Header("模板路径")]
|
||||
public string TemplatePath = "Assets/StreamingAssets/Template/";
|
||||
|
||||
private static WordConfig instance;
|
||||
|
||||
public static WordConfig Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
instance = Resources.Load<WordConfig>("下载Word配置文件");
|
||||
if (instance == null)
|
||||
{
|
||||
Debug.Log("Resources资源为空请创建文件");
|
||||
instance = CreateInstance<WordConfig>();
|
||||
AssetDatabase.CreateAsset(instance, Application.dataPath + "/Resources");
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfig.cs.meta
Normal file
11
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfig.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: befc8bc5bf204f047a84c5781e59ffc4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
55
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfigWindow.cs
Normal file
55
Assets/WebGLDownLoadWord/Scripts/Editor/WordConfigWindow.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
/// <summary>
|
||||
/// 脚本配置窗口
|
||||
/// </summary>
|
||||
public class WordConfigWindow : EditorWindow
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 脚本配置菜单
|
||||
/// </summary>
|
||||
// 添加一个新的菜单项 CTRL-SHIFT-A
|
||||
[MenuItem("WordConfig/WordConfigWindow &f")]
|
||||
static void ScriptsConfig()
|
||||
{
|
||||
WordConfigWindow configWindow = new WordConfigWindow();
|
||||
configWindow.minSize = new Vector2(600, 300);
|
||||
configWindow.maxSize = new Vector2(600, 300);
|
||||
configWindow.Show();
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void OnGUI()
|
||||
{
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Space(30);
|
||||
GUI.skin.label.fontSize = 15;
|
||||
|
||||
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
||||
this.titleContent = new GUIContent("脚本生成配置");
|
||||
|
||||
WordConfig.Instance.Author = EditorGUILayout.TextField("作者:", WordConfig.Instance.Author);
|
||||
GUILayout.Space(10);
|
||||
WordConfig.Instance.PackPathName = EditorGUILayout.TextField("项目发布路径名称:", WordConfig.Instance.PackPathName);
|
||||
GUILayout.Space(10);
|
||||
WordConfig.Instance.TemplatePath = EditorGUILayout.TextField("模板路径:", WordConfig.Instance.TemplatePath);
|
||||
GUILayout.Space(10);
|
||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||
GUILayout.Space(20);
|
||||
GUI.color = Color.red;
|
||||
|
||||
|
||||
if (GUILayout.Button("完成"))
|
||||
{
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
this.Close();
|
||||
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40feb81115ab2284e8d2f91c2b43fb93
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -2445,6 +2445,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 1619907666}
|
||||
- component: {fileID: 1619907667}
|
||||
- component: {fileID: 1619907668}
|
||||
m_Layer: 0
|
||||
m_Name: WebGL
|
||||
m_TagString: Untagged
|
||||
@ -2481,6 +2482,18 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
RSA: {fileID: 0}
|
||||
uploadUrl:
|
||||
--- !u!114 &1619907668
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1619907665}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 40ec725cf2804f149acc5f79096b0f59, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1623041755
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -33,6 +33,7 @@ namespace ZXK.LouDiXvMuNiu
|
||||
/// </summary>
|
||||
private Dictionary<string, Dictionary<string, float>> _examScore = new Dictionary<string, Dictionary<string, float>>();
|
||||
|
||||
public Dictionary<string, string> scoreTime = new Dictionary<string, string>();
|
||||
public DataNiuHandler()
|
||||
{
|
||||
InitAppData();
|
||||
@ -40,11 +41,11 @@ namespace ZXK.LouDiXvMuNiu
|
||||
|
||||
public void InitAppData()
|
||||
{
|
||||
//#if UNITY_EDITOR || UNITY_STANDALONE_WIN
|
||||
// string[] excelList = Directory.GetFiles(Application.streamingAssetsPath + ConstCtrl.EXCEL_PATH, "*.xlsx");
|
||||
// ExcelUtility excel = new ExcelUtility(excelList[0]);
|
||||
// excel.ConvertToJson(Application.streamingAssetsPath + ConstCtrl.JSON_PATH + Path.GetFileNameWithoutExtension(excelList[0]) + ".txt", new UTF8Encoding(false));
|
||||
//#endif
|
||||
//#if UNITY_EDITOR || UNITY_STANDALONE_WIN
|
||||
// string[] excelList = Directory.GetFiles(Application.streamingAssetsPath + ConstCtrl.EXCEL_PATH, "*.xlsx");
|
||||
// ExcelUtility excel = new ExcelUtility(excelList[0]);
|
||||
// excel.ConvertToJson(Application.streamingAssetsPath + ConstCtrl.JSON_PATH + Path.GetFileNameWithoutExtension(excelList[0]) + ".txt", new UTF8Encoding(false));
|
||||
//#endif
|
||||
string Niupath = Application.streamingAssetsPath + ConstCtrl.JSON_PATH + "NiuData.txt";
|
||||
TxtFileHandle.ReadAllTxt(Niupath, (string vul) =>
|
||||
{
|
||||
@ -67,7 +68,7 @@ namespace ZXK.LouDiXvMuNiu
|
||||
});
|
||||
}
|
||||
|
||||
public NiuData GetNextStep(NiuData curStep=null)
|
||||
public NiuData GetNextStep(NiuData curStep = null)
|
||||
{
|
||||
if (curStep == null) curStep = CurNiuHandler.Value;
|
||||
List<NiuData> tempData = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType];
|
||||
@ -110,7 +111,7 @@ namespace ZXK.LouDiXvMuNiu
|
||||
|
||||
for (int i = 0; i < _niuDataArray.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_niuDataArray[i].TaskName)|| _niuDataArray[i].TaskName==ConstCtrl.TaskName_JieShao) continue;
|
||||
if (string.IsNullOrEmpty(_niuDataArray[i].TaskName) || _niuDataArray[i].TaskName == ConstCtrl.TaskName_JieShao) continue;
|
||||
curstep = _niuDataArray[i];
|
||||
if (i == _niuDataArray.Count - 1)
|
||||
{
|
||||
@ -152,6 +153,16 @@ namespace ZXK.LouDiXvMuNiu
|
||||
_examScore[bigStepName].Add(smallStepName, 0);
|
||||
}
|
||||
_examScore[bigStepName][smallStepName] += score;
|
||||
|
||||
if (scoreTime.ContainsKey(bigStepName + smallStepName) == false)
|
||||
{
|
||||
scoreTime.Add(bigStepName + smallStepName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
else
|
||||
{
|
||||
scoreTime[bigStepName + smallStepName] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
return _examScore[bigStepName][smallStepName];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
using CG.Framework;
|
||||
using CG.UTility;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
/*******************************************************************************
|
||||
*Create By CG
|
||||
@ -61,38 +64,95 @@ namespace ZXK.LouDiXvMuNiu
|
||||
{
|
||||
if (!CheckInfo()) return;
|
||||
Queue<string[]> scoreQueue = GameManager.Instance._DataNiuHandler.GetExamScore();
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
string json = string.Empty;
|
||||
|
||||
string savePath = CG.UTility.FolderBrowserHelper.GetPathFromWindowsExplorer();
|
||||
if (!string.IsNullOrEmpty(savePath))
|
||||
|
||||
// 模块内容,三级任务名称,总成绩,实际成绩
|
||||
Dictionary<string, object> data = new Dictionary<string, object>();
|
||||
data.Add("name", _studentNameInF.text);
|
||||
|
||||
foreach (var item in scoreQueue)
|
||||
{
|
||||
string systemTypeName = GameManager.Instance._CurModelType;
|
||||
string fileName = "实训成绩单_牛的胚胎移植.pdf";
|
||||
string filePath = System.IO.Path.Combine(savePath, fileName);
|
||||
PDFGreadeManager.Instance.GreatePDFPC(filePath
|
||||
, systemTypeName
|
||||
, scoreQueue
|
||||
, GameManager.Instance._StudentName
|
||||
, GameManager.Instance._StudentNumber
|
||||
, () =>
|
||||
{
|
||||
PopUpMng.PopConBox("打开文件", $"文件已经保存在\"{filePath}\",是否直接打开", "打开", "取消",
|
||||
() => { FolderBrowserHelper.OpenFolder(filePath); });
|
||||
});
|
||||
data.Add(item[0] + item[1], item[3]);
|
||||
}
|
||||
#elif UNITY_WEBGL
|
||||
string systemTypeName = GameManager.Instance._CurModelType;
|
||||
string fileName = "实训成绩单_牛的胚胎移植.pdf";
|
||||
PDFGreadeManager.Instance.GreatePDFWeb(fileName
|
||||
, systemTypeName
|
||||
, scoreQueue
|
||||
, GameManager.Instance._StudentName
|
||||
, GameManager.Instance._StudentNumber);
|
||||
|
||||
foreach (var item in GameManager.Instance._DataNiuHandler.scoreTime)
|
||||
{
|
||||
data.Add(item.Key + "Time", item.Value);
|
||||
}
|
||||
json = JsonConvert.SerializeObject(data);
|
||||
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
AsposeHelper.Writer(json, filePath =>
|
||||
{
|
||||
PopUpMng.PopConBox("打开文件", $"文件已经保存在\"{filePath}\",是否直接打开", "打开", "取消",
|
||||
() => { FolderBrowserHelper.OpenFolder(filePath); });
|
||||
});
|
||||
|
||||
#else
|
||||
|
||||
StartCoroutine(DownLoadReport(bytes =>
|
||||
{
|
||||
WebGLDownLoadFile.instance.DownloadDocx(bytes, json);
|
||||
}));
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
//#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
|
||||
// string savePath = CG.UTility.FolderBrowserHelper.GetPathFromWindowsExplorer();
|
||||
// if (!string.IsNullOrEmpty(savePath))
|
||||
// {
|
||||
// string systemTypeName = GameManager.Instance._CurModelType;
|
||||
// string fileName = "实训成绩单_牛的胚胎移植.pdf";
|
||||
// string filePath = System.IO.Path.Combine(savePath, fileName);
|
||||
// PDFGreadeManager.Instance.GreatePDFPC(filePath
|
||||
// , systemTypeName
|
||||
// , scoreQueue
|
||||
// , GameManager.Instance._StudentName
|
||||
// , GameManager.Instance._StudentNumber
|
||||
// , () =>
|
||||
// {
|
||||
// PopUpMng.PopConBox("打开文件", $"文件已经保存在\"{filePath}\",是否直接打开", "打开", "取消",
|
||||
// () => { FolderBrowserHelper.OpenFolder(filePath); });
|
||||
// });
|
||||
// }
|
||||
//#elif UNITY_WEBGL
|
||||
// string systemTypeName = GameManager.Instance._CurModelType;
|
||||
// string fileName = "实训成绩单_牛的胚胎移植.pdf";
|
||||
// PDFGreadeManager.Instance.GreatePDFWeb(fileName
|
||||
// , systemTypeName
|
||||
// , scoreQueue
|
||||
// , GameManager.Instance._StudentName
|
||||
// , GameManager.Instance._StudentNumber);
|
||||
//#endif
|
||||
});
|
||||
ShowScore(GameManager.Instance._DataNiuHandler.GetExamScore());
|
||||
CG.UTility.PopUpMng._TriAble = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载实验报告模板
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerator DownLoadReport(Action<byte[]> callback)
|
||||
{
|
||||
UnityWebRequest request = new UnityWebRequest(Global.reportDemoPath);
|
||||
request.downloadHandler = new DownloadHandlerBuffer();
|
||||
yield return request.SendWebRequest();
|
||||
if (string.IsNullOrEmpty(request.error))
|
||||
{
|
||||
callback?.Invoke(request.downloadHandler.data);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(request.error);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ÏÔʾ½çÃæ³É¼¨
|
||||
/// </summary>
|
||||
|
||||
8
Assets/_Scripts/Tools.meta
Normal file
8
Assets/_Scripts/Tools.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31cd026807f5a364795f42049111747b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
96
Assets/_Scripts/Tools/AsposeHelper.cs
Normal file
96
Assets/_Scripts/Tools/AsposeHelper.cs
Normal file
@ -0,0 +1,96 @@
|
||||
using Aspose.Words;
|
||||
using Aspose.Words.Replacing;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public class AsposeHelper : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
//public static void Writer(string json, Action callback = null)
|
||||
//{
|
||||
// // 加载Word文档
|
||||
// Document doc = new Document(Global.reportDemoPath);
|
||||
|
||||
// JObject jObject = JObject.Parse(json);
|
||||
|
||||
// foreach (JProperty property in jObject.Properties())
|
||||
// {
|
||||
// string key = property.Name;
|
||||
// string value = property.Value.ToString();
|
||||
// doc.Range.Replace($"{{{key}}}", $"{value}", new FindReplaceOptions());
|
||||
// }
|
||||
|
||||
// string filePath = ChinarFileController.SaveProject(Path.GetFileName(Global.reportDemoPath).Split('.')[1]);
|
||||
// if (string.IsNullOrEmpty(filePath) == false)
|
||||
// {
|
||||
// doc.Save(filePath);
|
||||
// }
|
||||
// callback?.Invoke();
|
||||
// // 替换文本
|
||||
// //SaveWithDialog(doc, callback);
|
||||
// //Debug.Log("文档处理完成,新文档已保存到: " + outputFilePath);
|
||||
//}
|
||||
|
||||
public static void Writer(string json, Action<string> callback = null)
|
||||
{
|
||||
// 加载Word文档
|
||||
Document doc = new Document(Global.reportDemoPath);
|
||||
|
||||
JToken jToken = JToken.Parse(json);
|
||||
TraverseAndReplace(jToken, doc);
|
||||
|
||||
string filePath = ChinarFileController.SaveProject(Path.GetFileName(Global.reportDemoPath).Split('.')[1]);
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
doc.Save(filePath);
|
||||
}
|
||||
callback?.Invoke(filePath);
|
||||
}
|
||||
|
||||
private static void TraverseAndReplace(JToken jToken, Document doc)
|
||||
{
|
||||
if (jToken.Type == JTokenType.Object)
|
||||
{
|
||||
foreach (JProperty property in ((JObject)jToken).Properties())
|
||||
{
|
||||
if (property.Value.Type == JTokenType.Object || property.Value.Type == JTokenType.Array)
|
||||
{
|
||||
TraverseAndReplace(property.Value, doc);
|
||||
}
|
||||
else
|
||||
{
|
||||
string key = property.Name;
|
||||
string value = property.Value.ToString();
|
||||
doc.Range.Replace($"{{{key}}}", $"{value}", new FindReplaceOptions());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (jToken.Type == JTokenType.Array)
|
||||
{
|
||||
foreach (JToken item in jToken)
|
||||
{
|
||||
TraverseAndReplace(item, doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//private static void SaveWithDialog(Document doc, Action<DialogResult> callback)
|
||||
//{
|
||||
// SaveFileDialog dialog = new SaveFileDialog();
|
||||
// dialog.Filter = "Word文档|*.docx";
|
||||
// var result = dialog.ShowDialog();
|
||||
// if (result == DialogResult.OK)
|
||||
// {
|
||||
// doc.Save(dialog.FileName);
|
||||
// }
|
||||
// callback?.Invoke(result);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
11
Assets/_Scripts/Tools/AsposeHelper.cs.meta
Normal file
11
Assets/_Scripts/Tools/AsposeHelper.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b8efffae1f8a8f48a8097dd7af0912e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
65
Assets/_Scripts/Tools/ChinarFileController.cs
Normal file
65
Assets/_Scripts/Tools/ChinarFileController.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 文件控制脚本
|
||||
/// </summary>
|
||||
public class ChinarFileController : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 打开项目
|
||||
/// </summary>
|
||||
public static string OpenProject()
|
||||
{
|
||||
string originalDir = Environment.CurrentDirectory;
|
||||
string filepath = string.Empty;
|
||||
OpenFileDlg pth = new OpenFileDlg();
|
||||
pth.structSize = Marshal.SizeOf(pth);
|
||||
// 修正过滤器格式(移除末尾多余的竖线)
|
||||
//pth.filter = @"All Files (*.*)|*.jpg";
|
||||
pth.file = new string(new char[256]);
|
||||
pth.maxFile = pth.file.Length;
|
||||
pth.fileTitle = new string(new char[64]);
|
||||
pth.maxFileTitle = pth.fileTitle.Length;
|
||||
pth.initialDir = Application.dataPath.Replace("/", "\\") + "\\Resources";
|
||||
pth.title = "打开项目";
|
||||
pth.defExt = "dat";
|
||||
// 简化Flags设置(保留关键选项)
|
||||
pth.flags = 0x00080000 | 0x00001000 | 0x00000800; // OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST
|
||||
|
||||
if (OpenFileDialog.GetOpenFileName(pth))
|
||||
{
|
||||
filepath = pth.file;
|
||||
}
|
||||
Environment.CurrentDirectory = originalDir;
|
||||
return filepath;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存文件项目
|
||||
/// </summary>
|
||||
public static string SaveProject(string ext)
|
||||
{
|
||||
string filepath = string.Empty;
|
||||
SaveFileDlg pth = new SaveFileDlg();
|
||||
pth.structSize = Marshal.SizeOf(pth);
|
||||
pth.filter = "All files (*.*)|*.*";
|
||||
pth.file = new string(new char[256]);
|
||||
pth.maxFile = pth.file.Length;
|
||||
pth.fileTitle = new string(new char[64]);
|
||||
pth.maxFileTitle = pth.fileTitle.Length;
|
||||
pth.initialDir = Application.dataPath; //默认路径
|
||||
pth.title = "保存项目";
|
||||
pth.defExt = ext;
|
||||
pth.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008;
|
||||
if (SaveFileDialog.GetSaveFileName(pth))
|
||||
{
|
||||
filepath = pth.file; //选择的文件路径;
|
||||
}
|
||||
return filepath;
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/_Scripts/Tools/ChinarFileController.cs.meta
Normal file
11
Assets/_Scripts/Tools/ChinarFileController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 455fa6f266eceb84bafae54e439f93ca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/_Scripts/Tools/ChinarFileDlog.cs
Normal file
57
Assets/_Scripts/Tools/ChinarFileDlog.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 文件日志类
|
||||
/// </summary>
|
||||
// [特性(布局种类.有序,字符集=字符集.自动)]
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public class ChinarFileDlog
|
||||
{
|
||||
public int structSize = 0;
|
||||
public IntPtr dlgOwner = IntPtr.Zero;
|
||||
public IntPtr instance = IntPtr.Zero;
|
||||
public String filter = null;
|
||||
public String customFilter = null;
|
||||
public int maxCustFilter = 0;
|
||||
public int filterIndex = 0;
|
||||
public String file = null;
|
||||
public int maxFile = 0;
|
||||
public String fileTitle = null;
|
||||
public int maxFileTitle = 0;
|
||||
public String initialDir = null;
|
||||
public String title = null;
|
||||
public int flags = 0;
|
||||
public short fileOffset = 0;
|
||||
public short fileExtension = 0;
|
||||
public String defExt = null;
|
||||
public IntPtr custData = IntPtr.Zero;
|
||||
public IntPtr hook = IntPtr.Zero;
|
||||
public String templateName = null;
|
||||
public IntPtr reservedPtr = IntPtr.Zero;
|
||||
public int reservedInt = 0;
|
||||
public int flagsEx = 0;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public class OpenFileDlg : ChinarFileDlog
|
||||
{
|
||||
}
|
||||
|
||||
public class OpenFileDialog
|
||||
{
|
||||
[DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
|
||||
public static extern bool GetOpenFileName([In, Out] OpenFileDlg ofd);
|
||||
}
|
||||
|
||||
public class SaveFileDialog
|
||||
{
|
||||
[DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
|
||||
public static extern bool GetSaveFileName([In, Out] SaveFileDlg ofd);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public class SaveFileDlg : ChinarFileDlog
|
||||
{
|
||||
}
|
||||
11
Assets/_Scripts/Tools/ChinarFileDlog.cs.meta
Normal file
11
Assets/_Scripts/Tools/ChinarFileDlog.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f631b0046aaa78a4a94df55fc69fbefb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/_Scripts/Tools/Global.cs
Normal file
22
Assets/_Scripts/Tools/Global.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
public class Global
|
||||
{
|
||||
Global() { }
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
public static string dataPath = Application.dataPath + "/Data";
|
||||
#else
|
||||
public static string dataPath = Application.dataPath + "/../Data";
|
||||
#endif
|
||||
public static string deviceIconsPath = dataPath + "/DeviceIcons/";
|
||||
public static string audioPath = dataPath + "/Audio/";
|
||||
public static string appXmlPath = dataPath + "/App.xml";
|
||||
public static string imagePath = dataPath + "/Image/";
|
||||
public static string videoPath = dataPath + "/Video/";
|
||||
public static string xmlPath = dataPath + "/Xml/";
|
||||
public static string reportPath = dataPath + "/Report/";
|
||||
public static string reportDemoPath = reportPath + "Demo.docx";
|
||||
|
||||
|
||||
|
||||
}
|
||||
11
Assets/_Scripts/Tools/Global.cs.meta
Normal file
11
Assets/_Scripts/Tools/Global.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7254632d4e952454ea2b56b2c1f08519
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
data/Report/demo.docx
Normal file
BIN
data/Report/demo.docx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user