diff --git a/hs_err_pid14652.log b/hs_err_pid14652.log new file mode 100644 index 00000000..73d9f554 --- /dev/null +++ b/hs_err_pid14652.log @@ -0,0 +1,197 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 266338304 bytes for Failed to commit area from 0x0000000702400000 to 0x0000000712200000 of length 266338304. +# Possible reasons: +# The system is out of physical RAM or swap space +# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# This output file may be truncated or incomplete. +# +# Out of Memory Error (./src/hotspot/os/windows/os_windows.cpp:3303), pid=14652, tid=5900 +# +# JRE version: (11.0.8+10) (build ) +# Java VM: OpenJDK 64-Bit Server VM (11.0.8+10-b944.34, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: org.jetbrains.git4idea.http.GitAskPassApp Username for 'http://121.40.234.130:8899': + +Host: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz, 8 cores, 15G, Windows 10 , 64 bit Build 19041 (10.0.19041.1741) +Time: Thu Jul 14 00:23:31 2022 中国标准时间 elapsed time: 0 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x00000299e7a70000): JavaThread "Unknown thread" [_thread_in_vm, id=5900, stack(0x000000a5a6d00000,0x000000a5a6e00000)] + +Stack: [0x000000a5a6d00000,0x000000a5a6e00000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x5de35a] +V [jvm.dll+0x712355] +V [jvm.dll+0x7138ad] +V [jvm.dll+0x713f63] +V [jvm.dll+0x23e628] +V [jvm.dll+0x5db804] +V [jvm.dll+0x5d0925] +V [jvm.dll+0x2faf9b] +V [jvm.dll+0x2faf0a] +V [jvm.dll+0x2fade2] +V [jvm.dll+0x2ffcb6] +V [jvm.dll+0x3483a3] +V [jvm.dll+0x348aa6] +V [jvm.dll+0x3484a3] +V [jvm.dll+0x2d5be8] +V [jvm.dll+0x2d6d87] +V [jvm.dll+0x6f10e7] +V [jvm.dll+0x6f28dc] +V [jvm.dll+0x3558f9] +V [jvm.dll+0x6d492e] +V [jvm.dll+0x3bdad3] +V [jvm.dll+0x3bfd01] +C [jli.dll+0x5373] +C [ucrtbase.dll+0x21bb2] +C [KERNEL32.DLL+0x17034] +C [ntdll.dll+0x52651] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00000299e5863e30, length=0, elements={ +} + +Java Threads: ( => current thread ) + +Other Threads: + 0x00000299e7a88000 GCTaskThread "GC Thread#0" [stack: 0x000000a5a6e00000,0x000000a5a6f00000] [id=18384] + 0x00000299e7ae5800 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000a5a6f00000,0x000000a5a7000000] [id=28756] + 0x00000299e7ae7000 ConcurrentGCThread "G1 Conc#0" [stack: 0x000000a5a7000000,0x000000a5a7100000] [id=28696] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe280b60c7] + +VM state:not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00000299e7a6c1c0] Heap_lock - owner thread: 0x00000299e7a70000 + +Heap address: 0x0000000702400000, size: 4060 MB, Compressed Oops mode: Non-zero based: 0x0000000702400000 +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0 + +GC Heap History (0 events): +No events + +Deoptimization events (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +Events (1 events): +Event: 0.008 Loaded shared library D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\zip.dll + + +Dynamic libraries: +0x00007ff70cf80000 - 0x00007ff70cf8a000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\java.exe +0x00007ffe6d090000 - 0x00007ffe6d287000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffe6c480000 - 0x00007ffe6c53d000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffe6aba0000 - 0x00007ffe6ae6d000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffe6ae70000 - 0x00007ffe6af70000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffe63940000 - 0x00007ffe63959000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\jli.dll +0x00007ffe3f520000 - 0x00007ffe3f537000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\VCRUNTIME140.dll +0x00007ffe6b3b0000 - 0x00007ffe6b550000 C:\WINDOWS\System32\USER32.dll +0x00007ffe6aaa0000 - 0x00007ffe6aac2000 C:\WINDOWS\System32\win32u.dll +0x00007ffe51a50000 - 0x00007ffe51cea000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll +0x00007ffe6c440000 - 0x00007ffe6c46a000 C:\WINDOWS\System32\GDI32.dll +0x00007ffe6b550000 - 0x00007ffe6b5ee000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffe6afe0000 - 0x00007ffe6b0eb000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffe6aad0000 - 0x00007ffe6ab6d000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffe6d020000 - 0x00007ffe6d050000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffe093b0000 - 0x00007ffe0944d000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\msvcp140.dll +0x00007ffe27dd0000 - 0x00007ffe2888d000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\server\jvm.dll +0x00007ffe6bf70000 - 0x00007ffe6c01e000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffe6b1f0000 - 0x00007ffe6b28c000 C:\WINDOWS\System32\sechost.dll +0x00007ffe6be30000 - 0x00007ffe6bf55000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffe6c470000 - 0x00007ffe6c478000 C:\WINDOWS\System32\PSAPI.DLL +0x00007ffe51ea0000 - 0x00007ffe51ec7000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffe4e440000 - 0x00007ffe4e449000 C:\WINDOWS\SYSTEM32\WSOCK32.dll +0x00007ffe625c0000 - 0x00007ffe625ca000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffe6c540000 - 0x00007ffe6c5ab000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffe69040000 - 0x00007ffe69052000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffe65a90000 - 0x00007ffe65aa1000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\verify.dll +0x00007ffe59cf0000 - 0x00007ffe59ed4000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffe4d460000 - 0x00007ffe4d48c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffe6a7b0000 - 0x00007ffe6a832000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffe64470000 - 0x00007ffe64499000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\java.dll +0x00007ffe64640000 - 0x00007ffe6464b000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\jimage.dll +0x00007ffe63920000 - 0x00007ffe63938000 D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\zip.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\jbr\bin\server + +VM Arguments: +java_command: org.jetbrains.git4idea.http.GitAskPassApp Username for 'http://121.40.234.130:8899': +java_class_path (initial): D:/Program Files/JetBrains/IntelliJ IDEA 2020.2.3/plugins/git4idea/lib/git4idea-rt.jar;D:/Program Files/JetBrains/IntelliJ IDEA 2020.2.3/lib/xmlrpc-2.0.1.jar;D:/Program Files/JetBrains/IntelliJ IDEA 2020.2.3/lib/commons-codec-1.14.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 2 {product} {ergonomic} + uint G1ConcRefinementThreads = 8 {product} {ergonomic} + size_t G1HeapRegionSize = 1048576 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 266338304 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4257218560 {product} {ergonomic} + size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5836300 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122910970 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122910970 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + bool UseCompressedClassPointers = true {lp64_product} {ergonomic} + bool UseCompressedOops = true {lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +JAVA_HOME=C:\software\java\jdk8u131 +PATH=d:\Program Files\Git\mingw64/libexec/git-core;d:\Program Files\Git\mingw64\bin;d:\Program Files\Git\usr\bin;C:\Users\lenovo\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\software\java\jdk8u131\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;D:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;D:\Program Files\Microsoft SQL Server\120\Tools\Binn\;D:\Program Files\Microsoft SQL Server\120\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;D:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;D:\Program Files\Microsoft SQL Server\140\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;D:\Program Files\Microsoft SQL Server\140\DTS\Binn\;D:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\software\gradle-4.9\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\software\Redis\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;D:\software\apache-maven-3.6.1\bin;D:\Program Files (x86)\Bitvise SSH Client;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\MongoDB\Serve +USERNAME=lenovo +DISPLAY=:0.0 +LC_ALL=en_US.UTF-8 +OS=Windows_NT +PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel + + + +--------------- S Y S T E M --------------- + +OS: Windows 10 , 64 bit Build 19041 (10.0.19041.1741) +OS uptime: 1 days 9:09 hours + +CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 142 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, fma + +Memory: 4k page, system-wide physical 16238M (3942M free) +TotalPageFile size 26655M (AvailPageFile size 261M) +current process WorkingSet (physical memory assigned to process): 10M, peak: 10M +current process commit charge ("private bytes"): 60M, peak: 314M + +vm_info: OpenJDK 64-Bit Server VM (11.0.8+10-b944.34) for windows-amd64 JRE (11.0.8+10-b944.34), built on Sep 11 2020 15:32:11 by "" with MS VC++ 14.0 (VS2015) + +END. diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/start/Test01.wql b/mes/hd/nladmin-system/src/main/java/org/nl/start/Test01.wql new file mode 100644 index 00000000..e69de29b diff --git a/wcs/hd/nladmin-system/src/main/resources/config/application-dev.yml b/wcs/hd/nladmin-system/src/main/resources/config/application-dev.yml index baf4fc59..f110a815 100644 --- a/wcs/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/wcs/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -8,11 +8,11 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - #url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.225}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true + url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true +# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.225}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} - password: ${DB_PWD:123456} - #password: ${DB_PWD:Root.123456} +# password: ${DB_PWD:123456} + password: ${DB_PWD:Root.123456} #password: ${DB_PWD:password} # 鍒濆杩炴帴鏁 initial-size: 5 @@ -59,13 +59,13 @@ spring: multi-statement-alagvslow: true data: mongodb: - host: 192.168.46.225 + host: 47.111.78.178 port: 27017 database: nlacs redis: #鏁版嵁搴撶储寮 database: ${REDIS_DB:10} - host: ${REDIS_HOST:192.168.46.225} + host: ${REDIS_HOST:47.111.78.178} port: ${REDIS_PORT:6379} password: ${REDIS_PWD:} #杩炴帴瓒呮椂鏃堕棿 @@ -162,5 +162,5 @@ jetcache: maxIdle: 200 maxTotal: 1000 uri: - - redis://127.0.0.1:6379 + - redis://47.111.78.178:6379 diff --git a/wcs/qd/package.json b/wcs/qd/package.json index 6d2b7c5b..7fa2168e 100644 --- a/wcs/qd/package.json +++ b/wcs/qd/package.json @@ -33,6 +33,8 @@ "url": "https://github.com/elunez/eladmin/issues" }, "dependencies": { + "@logicflow/core": "^1.1.22", + "@logicflow/extension": "^1.1.22", "@riophae/vue-treeselect": "0.4.0", "af-table-column": "^1.0.3", "axios": "0.18.1", @@ -73,7 +75,8 @@ "wangeditor": "^3.1.1", "xe-ajax": "^4.0.5", "xe-utils": "^3.3.1", - "xlsx": "^0.14.5" + "xlsx": "^0.14.5", + "vue-color": "^2.8.1" }, "devDependencies": { "@babel/core": "7.0.0", diff --git a/wcs/qd/src/views/acs/monitor/device/index2.vue b/wcs/qd/src/views/acs/monitor/device/index2.vue new file mode 100644 index 00000000..b9483971 --- /dev/null +++ b/wcs/qd/src/views/acs/monitor/device/index2.vue @@ -0,0 +1,616 @@ + + + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/Diagram.vue b/wcs/qd/src/views/acs/stage/editor/components/Diagram.vue new file mode 100644 index 00000000..f08ed588 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/Diagram.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/DiagramSidebar.vue b/wcs/qd/src/views/acs/stage/editor/components/DiagramSidebar.vue new file mode 100644 index 00000000..6fed18eb --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/DiagramSidebar.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/DiagramToolbar.vue b/wcs/qd/src/views/acs/stage/editor/components/DiagramToolbar.vue new file mode 100644 index 00000000..8850245e --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/DiagramToolbar.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/PropertyPanel.vue b/wcs/qd/src/views/acs/stage/editor/components/PropertyPanel.vue new file mode 100644 index 00000000..92b811a2 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/PropertyPanel.vue @@ -0,0 +1,311 @@ + + + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/config.js b/wcs/qd/src/views/acs/stage/editor/components/config.js new file mode 100644 index 00000000..c36ba603 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/config.js @@ -0,0 +1,12 @@ +// 鍏冪礌灞炴у彸渚ч潰鏉块粯璁ゅ睘鎬 +export const defatuleStyle = { + backgroundColor: '', // 濉厖鑹 + gradientColor: '', // 娓愬彉鑹 + borderType: 0, // 杈规绫诲瀷 + borderColor: '', // 濉厖棰滆壊 + borderWidth: 1, // 杈规瀹藉害 + borderStyle: '', // 杈规绫诲瀷 + fontSize: 12, // 鏂囨湰澶у皬 + fontColor: '', // 鏂囨湰棰滆壊 + fontWeight: '' // 鏂囨湰鍔犵矖 +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Actor.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Actor.vue new file mode 100644 index 00000000..dc3818d8 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Actor.vue @@ -0,0 +1,38 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/AreaSelect.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/AreaSelect.vue new file mode 100644 index 00000000..edb8929f --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/AreaSelect.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Blod.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Blod.vue new file mode 100644 index 00000000..3444a373 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Blod.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Circle.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Circle.vue new file mode 100644 index 00000000..b8355a4a --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Circle.vue @@ -0,0 +1,31 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/ColorFill.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/ColorFill.vue new file mode 100644 index 00000000..1c12d2a9 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/ColorFill.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/ColorText.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/ColorText.vue new file mode 100644 index 00000000..8aa7da1b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/ColorText.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Cross.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Cross.vue new file mode 100644 index 00000000..ba015272 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Cross.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Cylinde.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Cylinde.vue new file mode 100644 index 00000000..c32f508c --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Cylinde.vue @@ -0,0 +1,27 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Diamond.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Diamond.vue new file mode 100644 index 00000000..ae6e48a3 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Diamond.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Divide.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Divide.vue new file mode 100644 index 00000000..32bbd4fb --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Divide.vue @@ -0,0 +1,37 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/DownArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/DownArrow.vue new file mode 100644 index 00000000..01de6a0e --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/DownArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Ellipse.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Ellipse.vue new file mode 100644 index 00000000..e006feee --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Ellipse.vue @@ -0,0 +1,21 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Font.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Font.vue new file mode 100644 index 00000000..e9a1bb21 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Font.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Heptagon.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Heptagon.vue new file mode 100644 index 00000000..1f10cb23 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Heptagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Hexagon.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Hexagon.vue new file mode 100644 index 00000000..1a9c5136 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Hexagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/HorizontalArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/HorizontalArrow.vue new file mode 100644 index 00000000..640f85cd --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/HorizontalArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/LeftArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/LeftArrow.vue new file mode 100644 index 00000000..c62689e2 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/LeftArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Line.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Line.vue new file mode 100644 index 00000000..d4b7141f --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Line.vue @@ -0,0 +1,15 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Minus.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Minus.vue new file mode 100644 index 00000000..e8a5c19c --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Minus.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Parallelogram.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Parallelogram.vue new file mode 100644 index 00000000..1929f729 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Parallelogram.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Pentagon.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Pentagon.vue new file mode 100644 index 00000000..1f41d424 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Pentagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Rect.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Rect.vue new file mode 100644 index 00000000..5a62bb46 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Rect.vue @@ -0,0 +1,31 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/RectRadius.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/RectRadius.vue new file mode 100644 index 00000000..ee233aa6 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/RectRadius.vue @@ -0,0 +1,23 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/RightArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/RightArrow.vue new file mode 100644 index 00000000..50991412 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/RightArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Septagon.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Septagon.vue new file mode 100644 index 00000000..af702420 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Septagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/StepBack.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/StepBack.vue new file mode 100644 index 00000000..254da46d --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/StepBack.vue @@ -0,0 +1,16 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/StepFoward.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/StepFoward.vue new file mode 100644 index 00000000..cd96b6bf --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/StepFoward.vue @@ -0,0 +1,16 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Table.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Table.vue new file mode 100644 index 00000000..50bdceda --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Table.vue @@ -0,0 +1,158 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Text.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Text.vue new file mode 100644 index 00000000..c1af1cd5 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Text.vue @@ -0,0 +1,46 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Times.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Times.vue new file mode 100644 index 00000000..cbe890cc --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Times.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Trapezoid.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Trapezoid.vue new file mode 100644 index 00000000..5d23b928 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Trapezoid.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/Triangle.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/Triangle.vue new file mode 100644 index 00000000..e40db568 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/Triangle.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/UpArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/UpArrow.vue new file mode 100644 index 00000000..2ce28d72 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/UpArrow.vue @@ -0,0 +1,19 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/VerticalArrow.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/VerticalArrow.vue new file mode 100644 index 00000000..360d21bc --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/VerticalArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomIn.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomIn.vue new file mode 100644 index 00000000..a5257169 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomIn.vue @@ -0,0 +1,16 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomOut.vue b/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomOut.vue new file mode 100644 index 00000000..c30a25f2 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/icon/ZoomOut.vue @@ -0,0 +1,16 @@ + + + diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/DownArrowNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/DownArrowNode.js new file mode 100644 index 00000000..e32d3c96 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/DownArrowNode.js @@ -0,0 +1,49 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 涓嬬澶 + +class DownArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 50 + this.height = 80 + } +} +class DownArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const downY = y + 1 / 2 * height + const downY2 = y + 1 / 5 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - 1 / 2 * ArrowWidth, downY2], + [x - 1 / 2 * width, downY2], + [x, downY], + [x + 1 / 2 * width, downY2], + [x + 1 / 2 * ArrowWidth, downY2], + [x + 1 / 2 * ArrowWidth, upY], + [x - 1 / 2 * ArrowWidth, upY] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'down-arrow', + view: DownArrowView, + model: DownArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/HorizontalArrowNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/HorizontalArrowNode.js new file mode 100644 index 00000000..0a8bf809 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/HorizontalArrowNode.js @@ -0,0 +1,56 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 姘村钩鍙岀澶 + +class HorizontalArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 40 + } +} + +class HorizontalArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const leftX2 = x - 1 / 5 * width + const rightX = x + 1 / 2 * width + const rightX2 = x + 1 / 5 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + // 鍙崇澶 + [rightX2, y - 1 / 2 * ArrowHeight], + [rightX2, y - 1 / 2 * height], + [rightX, y], + [rightX2, y + 1 / 2 * height], + [rightX2, y + 1 / 2 * ArrowHeight], + // 宸︾澶 + [leftX2, y + 1 / 2 * ArrowHeight], + [leftX2, y + 1 / 2 * height], + [leftX, y], + [leftX2, y - 1 / 2 * height], + [leftX2, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'horizontal-arrow', + view: HorizontalArrowView, + model: HorizontalArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/LeftArrow.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/LeftArrow.js new file mode 100644 index 00000000..0405e10f --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/LeftArrow.js @@ -0,0 +1,48 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 宸︾澶 +class LeftArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 50 + } +} +class LeftArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const leftX2 = x - 1 / 5 * width + const rightX = x + 1 / 2 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [leftX2, y - 1 / 2 * ArrowHeight], + [leftX2, y - 1 / 2 * height], + [leftX, y], + [leftX2, y + 1 / 2 * height], + [leftX2, y + 1 / 2 * ArrowHeight], + [rightX, y + 1 / 2 * ArrowHeight], + [rightX, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'left-arrow', + view: LeftArrowView, + model: LeftArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/RightArrow.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/RightArrow.js new file mode 100644 index 00000000..f963d0e3 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/RightArrow.js @@ -0,0 +1,50 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 鍙崇澶 + +class RightArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 50 + } +} + +class RightArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const rightX = x + 1 / 2 * width + const rightX2 = x + 1 / 5 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [rightX2, y - 1 / 2 * ArrowHeight], + [rightX2, y - 1 / 2 * height], + [rightX, y], + [rightX2, y + 1 / 2 * height], + [rightX2, y + 1 / 2 * ArrowHeight], + [leftX, y + 1 / 2 * ArrowHeight], + [leftX, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'right-arrow', + view: RightArrowView, + model: RightArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/UpArrowNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/UpArrowNode.js new file mode 100644 index 00000000..ae9b5386 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/UpArrowNode.js @@ -0,0 +1,49 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 涓婄澶 +class UpArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 50 + this.height = 80 + } +} + +class UpArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const upY2 = y - 1 / 5 * height + const downY = y + 1 / 2 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - 1 / 2 * ArrowWidth, upY2], + [x - 1 / 2 * width, upY2], + [x, upY], + [x + 1 / 2 * width, upY2], + [x + 1 / 2 * ArrowWidth, upY2], + [x + 1 / 2 * ArrowWidth, downY], + [x - 1 / 2 * ArrowWidth, downY] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'up-arrow', + view: UpArrowView, + model: UpArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/arrow/VerticalArrowNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/VerticalArrowNode.js new file mode 100644 index 00000000..0a0fa261 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/arrow/VerticalArrowNode.js @@ -0,0 +1,56 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 绔栫洿绠ご + +class VerticalArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 40 + this.height = 80 + } +} + +class VerticalArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const upY2 = y - 1 / 5 * height + const downY = y + 1 / 2 * height + const downY2 = y + 1 / 5 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + // 涓婄澶 + [x - 1 / 2 * ArrowWidth, upY2], + [x - 1 / 2 * width, upY2], + [x, upY], + [x + 1 / 2 * width, upY2], + [x + 1 / 2 * ArrowWidth, upY2], + // 涓嬬澶 + [x + 1 / 2 * ArrowWidth, downY2], + [x + 1 / 2 * width, downY2], + [x, downY], + [x - 1 / 2 * width, downY2], + [x - 1 / 2 * ArrowWidth, downY2] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'vertical-arrow', + view: VerticalArrowView, + model: VerticalArrowModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/BaseNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/BaseNode.js new file mode 100644 index 00000000..6c297ce8 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/BaseNode.js @@ -0,0 +1,16 @@ +import { BaseNode, BaseNodeModel } from '@logicflow/core' + +class BaseNewNode extends BaseNode { +} + +class BaseNewModel extends BaseNodeModel { + setAttributes() { + this.fill = 'red' + } +} + +export default { + type: 'BaseNode', + view: BaseNewNode, + model: BaseNewModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/CircleNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/CircleNode.js new file mode 100644 index 00000000..cc37250e --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/CircleNode.js @@ -0,0 +1,33 @@ +import { EllipseResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍦嗗舰 +class CircleNewModel extends EllipseResize.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 35 + this.ry = 35 + } + + setToBottom() { + this.zIndex = 0 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +export default { + type: 'pro-circle', + view: EllipseResize.view, + model: CircleNewModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/DiamondNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/DiamondNode.js new file mode 100644 index 00000000..38dc3152 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/DiamondNode.js @@ -0,0 +1,35 @@ +import { DiamondResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鑿卞舰 +/** + * model鎺у埗鍒濆鍖栫殑鍊 + */ +class DiamondModel extends DiamondResize.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 35 + this.ry = 35 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } + + setToBottom() { + this.zIndex = 0 + } +} + +export default { + type: 'pro-diamond', + view: DiamondResize.view, + model: DiamondModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/EllipseNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/EllipseNode.js new file mode 100644 index 00000000..c2976389 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/EllipseNode.js @@ -0,0 +1,19 @@ +import CircleNode from './CircleNode' + +// 妞渾 +class EllipseNewModel extends CircleNode.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 60 + this.ry = 30 + } + getNodeStyle() { + const style = super.getNodeStyle() + return { ...style } + } +} +export default { + type: 'pro-ellipse', + view: CircleNode.view, + model: EllipseNewModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectNode.js new file mode 100644 index 00000000..ee242e26 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectNode.js @@ -0,0 +1,27 @@ +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鐭╁舰 +class RectNewModel extends RectResize.model { + setToBottom() { + this.zIndex = 0 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +export default { + type: 'pro-rect', + view: RectResize.view, + model: RectNewModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectRadiusNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectRadiusNode.js new file mode 100644 index 00000000..9a336d63 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/RectRadiusNode.js @@ -0,0 +1,14 @@ +import RectNode from './RectNode' + +// 甯﹀渾瑙掔殑鐭╁舰 +class RectRadiusModel extends RectNode.model { + setAttributes() { + super.setAttributes() + this.radius = 20 + } +} +export default { + type: 'rect-radius', + view: RectNode.view, + model: RectRadiusModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/basic/TextNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/basic/TextNode.js new file mode 100644 index 00000000..b3a09117 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/basic/TextNode.js @@ -0,0 +1,37 @@ +import { TextNodeModel, TextNode } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鏂囨湰鑺傜偣 +class TextNewNode extends TextNode { +} +class TextNewModel extends TextNodeModel { + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + if (properties.backgroundColor) { + style.backgroundStyle = { + fill: properties.backgroundColor + } + } + return getTextStyleFunction(style, properties) + } + + setAttributes() { + super.setAttributes() + if (!this.text.value) { + this.text.value = 'text' + } + } +} + +export default { + type: 'pro-text', + view: TextNewNode, + model: TextNewModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/edge/Bezier.js b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Bezier.js new file mode 100644 index 00000000..ecfc48eb --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Bezier.js @@ -0,0 +1,26 @@ +import { BezierEdge, BezierEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 璐濆灏旀洸绾 +class Model extends BezierEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-bezier', + view: BezierEdge, + model: Model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/edge/Line.js b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Line.js new file mode 100644 index 00000000..c5ef06e0 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Line.js @@ -0,0 +1,26 @@ +import { LineEdge, LineEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鐩寸嚎 +class Model extends LineEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-line', + view: LineEdge, + model: Model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/edge/Polyline.js b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Polyline.js new file mode 100644 index 00000000..86d53c29 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/edge/Polyline.js @@ -0,0 +1,26 @@ +import { PolylineEdge, PolylineEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鎶樼嚎 +class Model extends PolylineEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-polyline', + view: PolylineEdge, + model: Model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/getShapeStyleUtil.js b/wcs/qd/src/views/acs/stage/editor/components/node/getShapeStyleUtil.js new file mode 100644 index 00000000..9df81757 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/getShapeStyleUtil.js @@ -0,0 +1,61 @@ +export const getShapeStyleFuction = (style, properties) => { + if (properties.backgroundColor) { + style.fill = properties.backgroundColor + } + if (properties.gradientColor && style.fill !== properties.gradientColor) { + style.fillGradient = properties.gradientColor + } + if (properties.borderColor) { + style.stroke = properties.borderColor + } + if (properties.borderWidth) { + style.strokeWidth = properties.borderWidth + } + if (properties.borderStyle) { + if (properties.borderStyle === 'solid') { + style.strokeDashArray = '0' + // nodeResize閲岀殑bug瀵艰嚧鐨,array灏忓啓浜 + style.strokeDasharray = '0' + } + if (properties.borderStyle === 'dashed') { + style.strokeDashArray = '3 3' + style.strokeDasharray = '3 3' + } + if (properties.borderStyle === 'dotted') { + style.strokeDashArray = '1 1' + style.strokeDasharray = '1 1' + } + if (properties.borderStyle === 'hidden') { + style.stroke = style.fill + } + } + return style +} + +export const getTextStyleFunction = (style = {}, properties) => { + if (properties.fontColor) { + style.color = properties.fontColor + } + if (properties.fontSize) { + style.fontSize = properties.fontSize + } + if (properties.fontFamily) { + style.fontFamily = properties.fontFamily + } + if (properties.lineHeight) { + style.lineHeight = properties.lineHeight + } + if (properties.textAlign) { + style.textAlign = properties.textAlign + } + if (properties.fontWeight) { + style.fontWeight = properties.fontWeight + } + if (properties.textDecoration) { + style.textDecoration = properties.textDecoration + } + if (properties.fontStyle) { + style.fontStyle = properties.fontStyle + } + return style +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/icon/IconNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/icon/IconNode.js new file mode 100644 index 00000000..5a6efd3d --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/icon/IconNode.js @@ -0,0 +1,44 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 宸︿笂瑙掑甫ICON鐨勮妭鐐 +class IconNode extends RectNode.view { + getImageHref() { + return + } + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const href = this.getImageHref() + const iconAttrs = { + x: x - 1 / 2 * width + 5, + y: y - 1 / 2 * height + 5, // icon鍦ㄥ乏涓婅 + width: 25, + height: 18, + href, + // 鏍规嵁瀹介珮缂╂斁 + preserveAspectRatio: 'none meet' + } + const rectAttrs = { + ...style, + strokeWidth: 1, + rx: 5, + ry: 5, + x: x - 1 / 2 * width, + y: y - 1 / 2 * height, + width, + height + } + return h('g', {}, [ + h('rect', { ...rectAttrs }), + h('image', { ...iconAttrs }) + ] + ) + } +} + +export default { + type: 'image-node', + view: IconNode, + model: RectNode.model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/icon/Message.js b/wcs/qd/src/views/acs/stage/editor/components/node/icon/Message.js new file mode 100644 index 00000000..a4f00e78 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/icon/Message.js @@ -0,0 +1,14 @@ +import IconNode from './IconNode' + +// 宸︿笂瑙扞CON涓烘秷鎭殑鑺傜偣 +class MessageNode extends IconNode.view { + getImageHref() { + return 'https://dpubstatic.udache.com/static/dpubimg/1TZgBoaq8G/message.png' + } +} + +export default { + type: 'icon-message', + view: MessageNode, + model: IconNode.model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/image/Cloud.js b/wcs/qd/src/views/acs/stage/editor/components/node/image/Cloud.js new file mode 100644 index 00000000..027ab027 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/image/Cloud.js @@ -0,0 +1,14 @@ +import ImageNode from './ImageNode' + +// 浜戝舰鐘剁殑鍥剧墖鑺傜偣 +class CloudNode extends ImageNode.view { + getImageHref() { + return 'https://dpubstatic.udache.com/static/dpubimg/0oqFX1nvbD/cloud.png' + } +} + +export default { + type: 'image-cloud', + view: CloudNode, + model: ImageNode.model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/image/ImageNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/image/ImageNode.js new file mode 100644 index 00000000..2ba9f9be --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/image/ImageNode.js @@ -0,0 +1,40 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 鍥剧墖-鍩虹鑺傜偣 +class ImageModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 60 + } +} + +class ImageNode extends RectNode.view { + getImageHref() { + return + } + getResizeShape() { + const { x, y, width, height } = this.props.model + const href = this.getImageHref() + const attrs = { + x: x - 1 / 2 * width, + y: y - 1 / 2 * height, + width, + height, + href, + // 鏍规嵁瀹介珮缂╂斁 + preserveAspectRatio: 'none meet' + } + return h('g', {}, [ + h('image', { ...attrs }) + ] + ) + } +} + +export default { + type: 'image-node', + view: ImageNode, + model: ImageModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/image/Setting.js b/wcs/qd/src/views/acs/stage/editor/components/node/image/Setting.js new file mode 100644 index 00000000..c1a8a492 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/image/Setting.js @@ -0,0 +1,21 @@ +import ImageNode from './ImageNode' + +// 鍥剧墖-璁剧疆鑺傜偣 +class SettingModel extends ImageNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 60 + this.height = 60 + } +} +class SettingNode extends ImageNode.view { + getImageHref() { + return 'https://dpubstatic.udache.com/static/dpubimg/UzI4AFUcfO/setting.png' + } +} + +export default { + type: 'image-setting', + view: SettingNode, + model: SettingModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/image/Star.js b/wcs/qd/src/views/acs/stage/editor/components/node/image/Star.js new file mode 100644 index 00000000..b87da97b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/image/Star.js @@ -0,0 +1,14 @@ +import ImageNode from './ImageNode' + +// 鍥剧墖-鐢ㄦ埛鑺傜偣 +class UserNode extends ImageNode.view { + getImageHref() { + return 'https://dpubstatic.udache.com/static/dpubimg/-6Fd2uIoJ-/user.png' + } +} + +export default { + type: 'image-user', + view: UserNode, + model: ImageNode.model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/image/User.js b/wcs/qd/src/views/acs/stage/editor/components/node/image/User.js new file mode 100644 index 00000000..b87da97b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/image/User.js @@ -0,0 +1,14 @@ +import ImageNode from './ImageNode' + +// 鍥剧墖-鐢ㄦ埛鑺傜偣 +class UserNode extends ImageNode.view { + getImageHref() { + return 'https://dpubstatic.udache.com/static/dpubimg/-6Fd2uIoJ-/user.png' + } +} + +export default { + type: 'image-user', + view: UserNode, + model: ImageNode.model +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/index.js b/wcs/qd/src/views/acs/stage/editor/components/node/index.js new file mode 100644 index 00000000..9ce798d1 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/index.js @@ -0,0 +1,82 @@ +// 鍩虹鍥惧舰 +import CircleNode from './basic/CircleNode' +import RectNode from './basic/RectNode' +import RectRadiusNode from './basic/RectRadiusNode' +import EllipseNode from './basic/EllipseNode' +import TextNode from './basic/TextNode' +import DiamondNode from './basic/DiamondNode' +// path缁樺埗鐨勪釜鎬у寲鍥惧舰 +import CylindeNode from './path/CylindeNode' +import TriangleNode from './path/TriangleNode' +import ParallelogramNode from './path/ParallelogramNode' +import ActorNode from './path/ActorNode' +import StarNode from './path/Star' +import PentagonNode from './path/PentagonNode' +import HexagonNode from './path/HexagonNode' +import SeptagonNode from './path/SeptagonNode' +import HeptagonNode from './path/HeptagonNode' +import TrapezoidNode from './path/TrapezoidNode' +import CrossNode from './path/CrossNode' +import MinusNode from './path/MinusNode' +import TimesNode from './path/TimesNode' +import DivideNode from './path/DivideNode' +// 澶氳竟褰㈢粯鍒剁殑绠ご +import LeftArrow from './arrow/LeftArrow' +import RightArrow from './arrow/RightArrow' +import HorizontalArrow from './arrow/HorizontalArrowNode' +import UpArrow from './arrow/UpArrowNode' +import DownArrow from './arrow/DownArrowNode' +import VerticalArrow from './arrow/VerticalArrowNode' +// image缁樺埗鍥剧墖鑺傜偣 +import ImageSetting from './image/Setting' +import ImageUser from './image/User' +import ImageCloud from './image/Cloud' +// image缁樺埗宸︿笂瑙抜con鑺傜偣 +import IconMessage from './icon/Message' +// 娉ㄥ唽杈 +import Ployline from './edge/Polyline' +import Line from './edge/Line' +import Bezier from './edge/Bezier' + +export const registerCustomElement = (lf) => { + // 娉ㄥ唽鍩虹鍥惧舰 + lf.register(CircleNode) + lf.register(RectNode) + lf.register(RectRadiusNode) + lf.register(EllipseNode) + lf.register(DiamondNode) + lf.register(TextNode) + // 娉ㄥ唽path缁樺埗鐨勪釜鎬у寲鍥惧舰 + lf.register(CylindeNode) + lf.register(TriangleNode) + lf.register(ParallelogramNode) + lf.register(ActorNode) + lf.register(StarNode) + lf.register(PentagonNode) + lf.register(HexagonNode) + lf.register(SeptagonNode) + lf.register(HeptagonNode) + lf.register(TrapezoidNode) + lf.register(CrossNode) + lf.register(MinusNode) + lf.register(TimesNode) + lf.register(DivideNode) + // 娉ㄥ唽澶氳竟褰㈢粯鍒剁殑绠ご + lf.register(LeftArrow) + lf.register(RightArrow) + lf.register(HorizontalArrow) + lf.register(UpArrow) + lf.register(DownArrow) + lf.register(VerticalArrow) + // 娉ㄥ唽image缁樺埗鍥剧墖鑺傜偣 + lf.register(ImageSetting) + lf.register(ImageUser) + lf.register(ImageCloud) + // 娉ㄥ唽image缁樺埗宸︿笂瑙抜con鑺傜偣 + lf.register(IconMessage) + // 娉ㄥ唽杈 + lf.register(Ployline) + lf.register(Line) + lf.register(Bezier) +} + diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/ActorNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/ActorNode.js new file mode 100644 index 00000000..718e5117 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/ActorNode.js @@ -0,0 +1,95 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' +// 浜虹墿 +class ActorModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 40 + this.height = 80 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class ActorView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + // 浜虹墿澶撮儴鍦嗗舰 + const ellipseAttrs = { + ...style, + cx: x, + cy: y - 3 / 8 * height, + rx: 1 / 4 * width, + ry: 1 / 8 * height, + width, + height + } + // 浜虹墿鑲╄唨妯嚎 + const pathAAttrs = { + ...style, + d: `M ${x - 1 / 2 * width} ${y - 1 / 8 * height} L ${x + 1 / 2 * width} ${y - 1 / 8 * height}` + } + // 浜虹墿韬綋韬共绔栫嚎 + const pathBAttrs = { + ...style, + d: `M ${x} ${y - 1 / 4 * height} L ${x} ${y + 1 / 5 * height}` + } + // 浜虹墿宸﹁吙鏂滅嚎 + const pathCAttrs = { + ...style, + d: `M ${x} ${y + 1 / 5 * height} L ${x - 1 / 2 * width} ${y + 1 / 2 * height}` + } + // 浜虹墿鍙宠吙鏂滅嚎 + const pathDAttrs = { + ...style, + d: `M ${x} ${y + 1 / 5 * height} L ${x + 1 / 2 * width} ${y + 1 / 2 * height}` + } + // 浜虹墿閫忔槑鑳屾櫙鏉 + const bgAttrs = { + x: x - 1 / 5 * width, + y: y - 1 / 2 * height, + width: 2 / 5 * width, + height, + style: 'fill: transparent' + } + return h('g', {}, [ + h('ellipse', { + ...ellipseAttrs + }), + h('path', { + ...pathAAttrs + }), + h('path', { + ...pathBAttrs + }), + h('path', { + ...pathCAttrs + }), + h('path', { + ...pathDAttrs + }), + h('rect', { + ...bgAttrs + }) + ] + ) + } +} + +export default { + type: 'actor', + view: ActorView, + model: ActorModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/CrossNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/CrossNode.js new file mode 100644 index 00000000..a9b4bbc7 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/CrossNode.js @@ -0,0 +1,65 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍔犲彿 +class CrossModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class CrossView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 6 * height], + [x - 1 / 6 * width, y - 1 / 6 * height], + [x - 1 / 6 * width, y - 1 / 2 * height], + [x + 1 / 6 * width, y - 1 / 2 * height], + [x + 1 / 6 * width, y - 1 / 6 * height], + [x + 1 / 2 * width, y - 1 / 6 * height], + [x + 1 / 2 * width, y + 1 / 6 * height], + [x + 1 / 6 * width, y + 1 / 6 * height], + [x + 1 / 6 * width, y + 1 / 2 * height], + [x - 1 / 6 * width, y + 1 / 2 * height], + [x - 1 / 6 * width, y + 1 / 6 * height], + [x - 1 / 2 * width, y + 1 / 6 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'cross', + view: CrossView, + model: CrossModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/CylindeNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/CylindeNode.js new file mode 100644 index 00000000..a719c7e3 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/CylindeNode.js @@ -0,0 +1,92 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍦嗘煴浣 +class CylindeModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 60 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class CylindeView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + // 鍦嗘煴浣撻《閮ㄦき鍦 + const ellipseAAttrs = { + ...style, + cx: x, + cy: y - 1 / 3 * height, + rx: 1 / 2 * width, + ry: 1 / 6 * height, + width, + height + } + // 鍦嗘煴浣撳乏鐩寸嚎 + const pathAAttrs = { + ...style, + d: `M ${x - 1 / 2 * width} ${y - 1 / 3 * height} L ${x - 1 / 2 * width} ${y + 1 / 3 * height}` + } + // 鍦嗘煴浣撳彸鐩寸嚎 + const pathBAttrs = { + ...style, + d: `M ${x + 1 / 2 * width} ${y - 1 / 3 * height} L ${x + 1 / 2 * width} ${y + 1 / 3 * height}` + } + // 鍦嗘煴浣撲笅妞渾 + const ellipseBAttrs = { + ...style, + cx: x, + cy: y + 1 / 3 * height, + rx: 1 / 2 * width, + ry: 1 / 6 * height, + width, + height + } + // 鍦嗘煴浣撲腑闂村~鍏呴儴鍒 + const rectAttrs = { + ...style, + x: x - 1 / 2 * width, + y: y - 1 / 3 * height, + width, + height: 2 / 3 * height, + stroke: 'transparent' + } + return h('g', {}, [ + h('ellipse', { + ...ellipseBAttrs + }), + h('rect', { + ...rectAttrs + }), + h('path', { + ...pathAAttrs + }), + h('path', { + ...pathBAttrs + }), + h('ellipse', { + ...ellipseAAttrs + }) + ]) + } +} + +export default { + type: 'cylinde', + model: CylindeModel, + view: CylindeView +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/DivideNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/DivideNode.js new file mode 100644 index 00000000..1fa2d989 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/DivideNode.js @@ -0,0 +1,83 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 闄ゅ彿 +class DivideModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class DivideView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y + 1 / 8 * height], + [x - 1 / 2 * width, y + 1 / 8 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + + const attrs = { + ...style, + x, + y, + width, + height + } + + // 闄ゅ彿涓棿妯嚎 + const lineAttrs = { + ...attrs, + points: points.join(' ') + } + + // 闄ゅ彿涓婂渾鐐 + const upEllipseAttrs = { + ...attrs, + cy: y - 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + // 闄ゅ彿涓嬪渾鐐 + const downEllipseAttrs = { + ...attrs, + cy: y + 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + return h('g', {}, [ + h('polygon', { ...lineAttrs }), + h('ellipse', { ...upEllipseAttrs }), + h('ellipse', { ...downEllipseAttrs }) + ]) + } +} + +export default { + type: 'divide', + view: DivideView, + model: DivideModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/HeptagonNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/HeptagonNode.js new file mode 100644 index 00000000..b28d42b1 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/HeptagonNode.js @@ -0,0 +1,61 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 浜旇竟褰 +class HeptagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class HeptagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.205 * width, y - 0.5 * height], + [x + 0.205 * width, y - 0.5 * height], + [x + 0.5 * width, y - 0.205 * height], + [x + 0.5 * width, y + 0.205 * height], + [x + 0.205 * width, y + 0.5 * height], + [x - 0.205 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.205 * height], + [x - 0.5 * width, y - 0.205 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'heptagon', + view: HeptagonView, + model: HeptagonModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/HexagonNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/HexagonNode.js new file mode 100644 index 00000000..a0e281fb --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/HexagonNode.js @@ -0,0 +1,59 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍏竟褰 +class HexagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class HexagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.28 * width, y - 0.5 * height], + [x + 0.28 * width, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.28 * width, y + 0.5 * height], + [x - 0.28 * width, y + 0.5 * height], + [x - 0.5 * width, y] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'hexagon', + view: HexagonView, + model: HexagonModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/MinusNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/MinusNode.js new file mode 100644 index 00000000..5f29f1e2 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/MinusNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍑忓彿 +class MinusModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 20 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class MinusView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 2 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'minus', + view: MinusView, + model: MinusModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/ParallelogramNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/ParallelogramNode.js new file mode 100644 index 00000000..96b07f88 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/ParallelogramNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 骞宠鍥涜竟褰 +class ParallelogramModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 100 + this.height = 60 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class ParallelogramView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - width / 2, y + height / 2], + [x - width / 5, y - height / 2], + [x + width / 2, y - height / 2], + [x + width / 5, y + height / 2] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'parallelogram', + view: ParallelogramView, + model: ParallelogramModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/PentagonNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/PentagonNode.js new file mode 100644 index 00000000..0bf20aad --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/PentagonNode.js @@ -0,0 +1,58 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 鍏竟褰 +class PentagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class PentagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.5 * width, y], + [x, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.3 * width, y + 0.5 * height], + [x - 0.3 * width, y + 0.5 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'pentagon', + view: PentagonView, + model: PentagonModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/SeptagonNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/SeptagonNode.js new file mode 100644 index 00000000..9ea030a4 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/SeptagonNode.js @@ -0,0 +1,60 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 涓冭竟褰 +class SeptagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class SeptagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x, y - 0.5 * height], + [x + 0.395 * width, y - 0.3 * height], + [x + 0.5 * width, y + 0.145 * height], + [x + 0.225 * width, y + 0.5 * height], + [x - 0.225 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.145 * height], + [x - 0.395 * width, y - 0.3 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'septagon', + view: SeptagonView, + model: SeptagonModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/Star.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/Star.js new file mode 100644 index 00000000..28eaeded --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/Star.js @@ -0,0 +1,40 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 浜旇鏄 +class StarModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } +} + +class StarView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const svgAttr = { + x: x - 1 / 2 * width, + y: y - 1 / 2 * height, + width, + height + } + const pathAAttrs = { + ...style, + d: 'm0.36922,13.46587l12.98695,0l4.01307,-13.36885l4.01307,13.36885l12.98694,0l-10.50664,8.26231l4.01327,13.36885l-10.50665,-8.26253l-10.50664,8.26253l4.01327,-13.36885l-10.50665,-8.26231l0,0z' + } + + return h('svg', { ...svgAttr, viewBox: '0 0 37 37' }, [ + h('path', { + ...pathAAttrs + }) + ]) + } +} + +export default { + type: 'star', + view: StarView, + model: StarModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/TimesNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/TimesNode.js new file mode 100644 index 00000000..6d67a2fc --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/TimesNode.js @@ -0,0 +1,65 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 涔樺彿 +class TimesModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TimesView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 3 * height], + [x - 1 / 3 * width, y - 1 / 2 * height], + [x, y - 1 / 6 * height], + [x + 1 / 3 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 3 * height], + [x + 1 / 6 * width, y], + [x + 1 / 2 * width, y + 1 / 3 * height], + [x + 1 / 3 * width, y + 1 / 2 * height], + [x, y + 1 / 6 * height], + [x - 1 / 3 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 3 * height], + [x - 1 / 6 * width, y] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'times', + view: TimesView, + model: TimesModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/TrapezoidNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/TrapezoidNode.js new file mode 100644 index 00000000..3ffe197b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/TrapezoidNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 浜旇竟褰 +class TrapezoidModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TrapezoidView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.31 * width, y - 0.5 * height], + [x + 0.31 * width, y - 0.5 * height], + [x + 0.5 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.5 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'trapezoid', + view: TrapezoidView, + model: TrapezoidModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/components/node/path/TriangleNode.js b/wcs/qd/src/views/acs/stage/editor/components/node/path/TriangleNode.js new file mode 100644 index 00000000..67ff9e36 --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/components/node/path/TriangleNode.js @@ -0,0 +1,47 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 涓夎褰 +class TriangleModel extends RectResize.model { + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TriangleView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - width / 2, y + height / 2], + [x - width / 2, y - height / 2], + [x + width / 2, y] + ] + } + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'triangle', + view: TriangleView, + model: TriangleModel +} diff --git a/wcs/qd/src/views/acs/stage/editor/constant/index.js b/wcs/qd/src/views/acs/stage/editor/constant/index.js new file mode 100644 index 00000000..710a725b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/constant/index.js @@ -0,0 +1,69 @@ +export const shortStyles = [ + { + backgroundColor: 'rgb(255, 255, 255)', + borderWidth: '1px', + borderColor: 'rgb(42, 42, 42)' + }, + { + backgroundColor: 'rgb(245, 245, 245)', + borderWidth: '1px', + borderColor: 'rgb(102, 102, 102)' + }, + { + backgroundColor: 'rgb(218, 232, 252)', + borderWidth: '1px', + borderColor: 'rgb(108, 142, 191)' + }, + { + backgroundColor: 'rgb(213, 232, 212)', + borderWidth: '1px', + borderColor: 'rgb(130, 179, 102)' + }, + { + backgroundColor: 'rgb(255, 230, 204)', + borderWidth: '1px', + borderColor: 'rgb(215, 155, 0)' + }, + { + backgroundColor: 'rgb(255, 242, 204)', + borderWidth: '1px', + borderColor: 'rgb(214, 182, 86)' + }, + { + backgroundColor: 'rgb(248, 206, 204)', + borderWidth: '1px', + borderColor: 'rgb(184, 84, 80)' + }, + { + backgroundColor: 'rgb(220, 210, 230)', + borderWidth: '1px', + borderColor: 'rgb(150, 115, 166)' + } +] + +export const borderStyles = [ + { + value: 'solid' + }, + { + value: 'dashed' + }, + { + value: 'dotted' + } +] + +export const fontFamilies = [ + { + value: 'Arial' + }, + { + value: 'Verdana' + }, + { + value: 'Georgia' + }, + { + value: 'Times New Roman' + } +] diff --git a/wcs/qd/src/views/acs/stage/editor/index2.vue b/wcs/qd/src/views/acs/stage/editor/index2.vue new file mode 100644 index 00000000..36004f5b --- /dev/null +++ b/wcs/qd/src/views/acs/stage/editor/index2.vue @@ -0,0 +1,101 @@ + + + + + +