Commit f812aa63 by 朱哲铨

bug 修复

parent 6fca9a19

50 KB | W: | H:

134 KB | W: | H:

build/icons/1024x1024.png
build/icons/1024x1024.png
build/icons/1024x1024.png
build/icons/1024x1024.png
  • 2-up
  • Swipe
  • Onion skin

3.09 KB | W: | H:

3.99 KB | W: | H:

build/icons/128x128.png
build/icons/128x128.png
build/icons/128x128.png
build/icons/128x128.png
  • 2-up
  • Swipe
  • Onion skin

299 Bytes | W: | H:

396 Bytes | W: | H:

build/icons/16x16.png
build/icons/16x16.png
build/icons/16x16.png
build/icons/16x16.png
  • 2-up
  • Swipe
  • Onion skin

461 Bytes | W: | H:

658 Bytes | W: | H:

build/icons/24x24.png
build/icons/24x24.png
build/icons/24x24.png
build/icons/24x24.png
  • 2-up
  • Swipe
  • Onion skin

7.21 KB | W: | H:

14.9 KB | W: | H:

build/icons/256x256.png
build/icons/256x256.png
build/icons/256x256.png
build/icons/256x256.png
  • 2-up
  • Swipe
  • Onion skin

632 Bytes | W: | H:

791 Bytes | W: | H:

build/icons/32x32.png
build/icons/32x32.png
build/icons/32x32.png
build/icons/32x32.png
  • 2-up
  • Swipe
  • Onion skin

1.02 KB | W: | H:

1.27 KB | W: | H:

build/icons/48x48.png
build/icons/48x48.png
build/icons/48x48.png
build/icons/48x48.png
  • 2-up
  • Swipe
  • Onion skin

17.3 KB | W: | H:

44 KB | W: | H:

build/icons/512x512.png
build/icons/512x512.png
build/icons/512x512.png
build/icons/512x512.png
  • 2-up
  • Swipe
  • Onion skin

1.42 KB | W: | H:

1.69 KB | W: | H:

build/icons/64x64.png
build/icons/64x64.png
build/icons/64x64.png
build/icons/64x64.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
No preview for this file type
{
"name": "Jomall_Graphics_Lab",
"productName": "Jomall Graphics Lab",
"name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant",
"description": "",
"version": "0.1.0",
"private": true,
......
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bDivide>false</bDivide>
<bTransColor>false</bTransColor>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<bUniPrint>false</bUniPrint>
<byResolution>1</byResolution>
<byInk>1</byInk>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>1</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file

11.6 KB | W: | H:

3.98 KB | W: | H:

src/assets/logo.jpg
src/assets/logo.jpg
src/assets/logo.jpg
src/assets/logo.jpg
  • 2-up
  • Swipe
  • Onion skin
import {downloadImage, toSend, writeProfileXml} from "@/backend/webserver/utils";
import { downloadImage, toSend, writeProfileXml } from "@/backend/webserver/utils";
const compressing = require('compressing');
const compressing = require("compressing");
var uuid = require("uuid");
const path = require('path');
const fs = require('fs');
const os = require('os');
const path = require("path");
const fs = require("fs");
const os = require("os");
import axios from "axios";
var multiparty = require("multiparty");
let fn = new Object();
fn.getPodProductionInfo = async (req, res) => {
const token = req.headers["jwt-token"]
const company = req.headers["company"]
const productionNo = req.body.productionNo
try {
let {data} = await axios.post(`https://${company}/api/podDesignCenter/getPodImageByProduction`, {productionNo}, {headers: {'jwt-token': token}})
if (data.code === 200 && data.data && data.data.length > 0) {
downloadImage(data.data, company, data => {
res.json({code: 200, data})
}, (err) => {
res.json({code: 500, msg: '素材图下载失败'})
})
} else {
res.json({code: 200, msg: '未找到素材图', data: []})
const token = req.headers["jwt-token"];
const company = req.headers["company"];
const productionNo = req.body.productionNo;
try {
let { data } = await axios.post(`https://${company}/api/podDesignCenter/getPodImageByProduction`, { productionNo }, { headers: { "jwt-token": token } });
console.log(data);
if (data.code === 200 && data.data && data.data.length > 0) {
let f = data.data.find(el => !el.productionFile);
data.data.forEach((el ) => {
if (!el.productionFile.includes("http")) {
el.productionFile = el.productionFile.replace("/data/upload/erp", "");
el.productionFile = `https://${company}/upload/erp/${el.productionFile}`;
}
} catch (err) {
console.log(err)
res.json({code: 500, msg: '接口调用失败'})
});
if (f) {
return res.json({ code: 500, msg: "存在地址错误的素材图" });
}
downloadImage(data.data, company, data => {
res.json({ code: 200, data });
}, (err) => {
res.json({ code: 500, msg: "素材图下载失败" });
});
} else {
res.json({ code: 200, msg: "未找到素材图", data: [] });
}
} catch (err) {
console.log(err);
res.json({ code: 500, msg: "接口调用失败" });
}
}
};
fn.findByPodProductionNo = async (req, res) => {
const token = req.headers["jwt-token"]
const company = req.headers["company"]
const q = req.body
try {
let {data} = await axios.get(`https://${company}/api/pod/podProductionInfo/findByPodProductionNo`, {
params: q,
headers: {'jwt-token': token}
})
res.json(data)
} catch (err) {
res.json({code: 500, msg: err})
}
const token = req.headers["jwt-token"];
const company = req.headers["company"];
const q = req.body;
try {
let { data } = await axios.get(`https://${company}/api/pod/podProductionInfo/findByPodProductionNo`, {
params: q,
headers: { "jwt-token": token }
});
res.json(data);
} catch (err) {
res.json({ code: 500, msg: err });
}
}
};
fn.getCompanyList = async (req, res) => {
try {
let {data} = await axios.get('https://platform.jomalls.com/api/tools/getCompanyList')
res.send(data)
} catch (err) {
console.log(err)
res.json({code: 500, msg: err})
}
}
try {
let { data } = await axios.get("https://platform.jomalls.com/api/tools/getCompanyList");
res.send(data);
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
}
};
fn.commitApply = async (req, res) => {
const company = req.headers["company"]
const q = req.body
try {
let {data} = await axios.post(`https://${company}/api/sysDeviceInfo/commitApply`, q)
res.send(data)
} catch (err) {
console.log(err)
res.json({code: 500, msg: err})
}
}
const company = req.headers["company"];
const q = req.body;
try {
let { data } = await axios.post(`https://${company}/api/sysDeviceInfo/commitApply`, q);
res.send(data);
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
}
};
fn.completeDelivery = async (req, res) => {
const token = req.headers["jwt-token"]
const company = req.headers["company"]
const q = req.body
try {
let {data} = await axios.post(`https://${company}/api/pod/podProductionInfo/completeDelivery`, q, {
headers: {'jwt-token': token}
})
res.json(data)
} catch (err) {
res.json({code: 500, msg: err})
}
const token = req.headers["jwt-token"];
const company = req.headers["company"];
const q = req.body;
try {
let { data } = await axios.post(`https://${company}/api/pod/podProductionInfo/completeDelivery`, q, {
headers: { "jwt-token": token }
});
res.json(data);
} catch (err) {
res.json({ code: 500, msg: err });
}
}
};
fn.downloadByDesignId = async (req, res) => {
let q = req.body
try {
let dir = path.join(os.homedir(), '/Desktop/' + q.productionNo+'.zip')
const zipStream = new compressing.zip.Stream();
for(let k in q.imgList){
const p = path.join(process.cwd(),'./print/Input/'+q.imgList[k].fileName)
zipStream.addEntry(p);
}
const destStream = fs.createWriteStream(dir);
zipStream.pipe(destStream)
.on('finish', () => {
console.log('success');
res.json({code: 200, msg: q.productionNo+'.zip' + '已下载到桌面'})
})
.on('error', () => {
res.json({code: 500, msg: '文件下载失败'})
});
// let ws=fs.createWriteStream(dir );
// console.log(downloadByDesignId)
//
// ws.write(downloadByDesignId.data);
// ws.on('drain',function () {
// console.log("内存干了");
// });
// ws.on('error',function (err) {
// res.json({code: 500, msg: '文件下载失败'})
// });
// ws.on('close',function (err) {
//
// });
// ws.end()
} catch (err) {
console.log(err)
res.json({code: 500, msg: err})
let q = req.body;
try {
let dir = path.join(os.homedir(), "/Desktop/" + q.productionNo + ".zip");
const zipStream = new compressing.zip.Stream();
for (let k in q.imgList) {
const p = path.join(process.cwd(), "./print/Input/" + q.imgList[k].fileName);
zipStream.addEntry(p);
}
}
const destStream = fs.createWriteStream(dir);
zipStream.pipe(destStream)
.on("finish", () => {
console.log("success");
res.json({ code: 200, msg: q.productionNo + ".zip" + "已下载到桌面" });
})
.on("error", () => {
res.json({ code: 500, msg: "文件下载失败" });
});
// let ws=fs.createWriteStream(dir );
// console.log(downloadByDesignId)
//
// ws.write(downloadByDesignId.data);
// ws.on('drain',function () {
// console.log("内存干了");
// });
// ws.on('error',function (err) {
// res.json({code: 500, msg: '文件下载失败'})
// });
// ws.on('close',function (err) {
//
// });
// ws.end()
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
}
};
fn.uploadImage = async (req, res) => {
try {
const p = path.join(process.cwd(), './print/Input/')
let fileName = uuid.v4() + ".png";
console.log(fileName)
const form = new multiparty.Form({uploadDir: p});
form.parse(req, function (err, fields, files) {
console.log(fields, files, err)
if (err) {
res.send({code: 500, err})
} else {
fs.renameSync(files.file[0].path, path.join(p, fileName))
res.json({code: 200, data: {fileName, url: path.join(process.cwd(), './print/Input/' + fileName)}})
}
});
} catch (err) {
console.log(err)
res.json({code: 500, msg: err})
}
try {
const p = path.join(process.cwd(), "./print/Input/");
let fileName = uuid.v4() + ".png";
console.log(fileName);
const form = new multiparty.Form({ uploadDir: p });
form.parse(req, function(err, fields, files) {
console.log(fields, files, err);
if (err) {
res.send({ code: 500, err });
} else {
fs.renameSync(files.file[0].path, path.join(p, fileName));
res.json({ code: 200, data: { fileName, url: path.join(process.cwd(), "./print/Input/" + fileName) } });
}
});
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
}
}
};
fn.getPngImg = async (req, res) => {
try {
const filePath = path.join(process.cwd(), `./print/Input/${req.body.fileName}`);
console.log(filePath)
// 给客户端返回一个文件流 type类型
res.set('content-type', {"png": "image/png", "jpg": "image/jpeg"});//设置返回类型
let stream = fs.createReadStream(filePath);
let responseData = [];//存储文件流
if (stream) {//判断状态
stream.on('data', function (chunk) {
responseData.push(chunk);
});
stream.on('end', function () {
const finalData = Buffer.concat(responseData);
res.write(finalData);
res.end();
});
}
} catch (err) {
res.send({code: 500, msg: err})
try {
const filePath = path.join(process.cwd(), `./print/Input/${req.body.fileName}`);
console.log(filePath);
// 给客户端返回一个文件流 type类型
res.set("content-type", { "png": "image/png", "jpg": "image/jpeg" });//设置返回类型
let stream = fs.createReadStream(filePath);
let responseData = [];//存储文件流
if (stream) {//判断状态
stream.on("data", function(chunk) {
responseData.push(chunk);
});
stream.on("end", function() {
const finalData = Buffer.concat(responseData);
res.write(finalData);
res.end();
});
}
} catch (err) {
res.send({ code: 500, msg: err });
}
}
};
fn.login = async (req, res) => {
const {loginName, company, password, deviceId} = req.body
try {
let {data} = await axios.post(`https://${company}/api/sysLogin/login`, {loginName, password, deviceId})
res.send(data)
} catch (err) {
console.log(err)
res.json({code: 500, msg: err})
}
}
const { loginName, company, password, deviceId } = req.body;
try {
let { data } = await axios.post(`https://${company}/api/sysLogin/login`, { loginName, password, deviceId });
res.send(data);
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
}
};
fn.toPrint = (req, res) => {
let body = req.body;
writeProfileXml(body) // 写入xml文件
// GTXproCMD.exe print -X "Profile\\CO12.xml" -I "Input\\sample.png" -A "Output\\pO12.arxp" -S 03000400 -L 02540254
toSend(body).then(r => {
res.send({code: 200, msg: '操作成功'})
}).catch(err => {
res.send({code: 500, msg: err})
})
let body = req.body;
writeProfileXml(body); // 写入xml文件
// GTXproCMD.exe print -X "Profile\\CO12.xml" -I "Input\\sample.png" -A "Output\\pO12.arxp" -S 03000400 -L 02540254
toSend(body).then(r => {
res.send({ code: 200, msg: "操作成功" });
}).catch(err => {
res.send({ code: 500, msg: err });
});
};
export {fn as default};
export { fn as default };
import {exec, execSync} from "child_process";
import { exec, execSync } from "child_process";
var fs = require("fs");
var path = require("path");
var request = require("request");
var uuid = require("uuid");
const compressing = require("compressing");
function zip(from, to, callback, errorback) {
let dirName = path.join(to, uuid.v4());
console.log(dirName);
if (!fs.existsSync(dirName)) {
fs.mkdirSync(dirName);
}
let arr = [];
compressing.zip
.uncompress(from, dirName, { zipFileNameEncoding: "gbk" })
.then(() => {
console.log("success");
let data = fs.readdirSync(dirName);
data.forEach(el => {
let file_path = path.join(dirName, el);
console.log(file_path, to);
fs.renameSync(file_path, path.join(to, el));
arr.push({
fileName: el,
productionFile: path.join(to, el)
});
});
fs.unlinkSync(from); // 删除压缩包
fs.rmdirSync(dirName); // 删除目录文件
console.log(arr);
callback && callback(arr);
})
.catch(err => {
console.log(err);
errorback && errorback("压缩包解压失败");
});
}
// 下载素材
export const downloadImage = (list, company, callback, errorBack = null) => {
try {
let dirPath = path.join(process.cwd(), "./print/Input/");
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
for (let i = 0; i < list.length; i++) {
if (!list[i].productionFile) return
if (!list[i].productionFile.includes('http')) return;
let fileName = uuid.v4() + ".png";
let p = path.join(process.cwd(), './print/Input/' + fileName)
let stream = fs.createWriteStream(p);
list[i].fileName = fileName
request(list[i].productionFile).pipe(stream).on("close", function (err) {
console.log("文件[" + fileName + "]下载完毕");
if (i === list.length - 1) {
callback && callback(list)
}
});
}
} catch (err) {
console.log(err)
errorBack && errorBack(err)
try {
let dirPath = path.join(process.cwd(), "./print/Input/");
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
for (let i = 0; i < list.length; i++) {
if (list[i].productionFile && list[i].productionFile.includes("http")) {
let fileName = "";
let type = 2;
let flag =[
".zip",
".gzip",
".tar",
".taz",
".rar",
".7z",
".gz",
".bz2"
].filter(el=>list[i].productionFile.toLowerCase().includes(el)).length>0
if (
flag
) {
fileName = list[i].productionFile.split("/")[
list[i].productionFile.split("/").length - 1
];
type = 1;
} else {
fileName = uuid.v4() + ".png";
type = 2;
}
let p = path.join(process.cwd(), "./print/Input/" + fileName);
let stream = fs.createWriteStream(p);
list[i].fileName = fileName;
list[i].type = type;
console.log(list[i].productionFile);
request(list[i].productionFile)
.pipe(stream)
.on("close", function(err) {
console.log(6666666666,list[i]);
if (type === 1) {
}
// 传递素材给前端
export const sendImg = (filename = 'sample.png') => {
let filePath = path.join(process.cwd(), './print/Input/' + filename)
if (!fs.existsSync(filePath)) {
return false
zip(
p,
dirPath,
data => {
list[i].list = data;
},
errorBack
);
} else {
if (i === list.length - 1) {
callback && callback(list);
}
}
});
}
}
let data = fs.readFileSync(filePath);
data = Buffer.from(data).toString('base64');
return 'data:' + 'png' + ';base64,' + data;
}
export const toSend = (body) => {
return new Promise((resolve, reject) => {
exec(
body.cmd,
{cwd: path.join(process.cwd(), 'print'), shell: true},
(err, stdout, stderr) => {
console.log(stdout, 1)
console.log(stderr, 2)
console.log(err, 4)
if (!err) {
exec(
body.print_cmd,
{cwd: path.join(process.cwd(), 'print'), shell: true},
(err2, stdout2, stderr2) => {
console.log(err2)
if (!err2) {
// 成功后删除 素材图,xml,output文件
// fs.unlinkSync(path.join(process.cwd(), 'print/Input/' + body.fileName))
// fs.unlinkSync(path.join(process.cwd(), 'print/Profile/' + body.fileName.replace('.png', '') + '.xml'))
// fs.unlinkSync(path.join(process.cwd(), 'print/Output/' + body.fileName.replace('.png', '') + '.arxp'))
resolve('操作成功')
} else {
reject('打印机参数错误')
}
})
} catch (err) {
console.log(err);
errorBack && errorBack(err);
}
};
} else {
reject('生成arxp文件失败')
}
})
})
}
export const writeProfileXml = (b) => {
try {
let p = path.join(process.cwd(), `./print/Profile/${b.byInk}.xml`);
let file = fs.readFileSync(p, {encoding: "utf8"});
file = file.replace(/<uiCopies>(.*)<\/uiCopies>/i, `<uiCopies>${b.printNum}</uiCopies>`)
file = file.replace(/<byPlatenSize>(.*)<\/byPlatenSize>/i, `<byPlatenSize>${b.byPlatenSize}</byPlatenSize>`)
file = file.replace(/<bEcoMode>(.*)<\/bEcoMode>/i, `<bEcoMode>${b.bEcoMode}</bEcoMode>`)
file = file.replace(/<bMaterialBlack>(.*)<\/bMaterialBlack>/i, `<bMaterialBlack>${b.bMaterialBlack}</bMaterialBlack>`)
file = file.replace(/<byHighlight>(.*)<\/byHighlight>/i, `<byHighlight>${b.byHighlight}</byHighlight>`)
file = file.replace(/<byMask>(.*)<\/byMask>/i, `<byMask>${b.byMask}</byMask>`)
file = file.replace(/<bTransColor>(.*)<\/bTransColor>/i, `<bTransColor>${b.bTransColor}</bTransColor>`)
file = file.replace(/<bPause>(.*)<\/bPause>/i, `<bPause>${b.bPause}</bPause>`)
file = file.replace(/<bDivide>(.*)<\/bDivide>/i, `<bDivide>${b.bDivide}</bDivide>`)
file = file.replace(/<byChoke>(.*)<\/byChoke>/i, `<byChoke>${b.byChoke}</byChoke>`)
file = file.replace(/<byInk>(.*)<\/byInk>/i, `<byInk>${b.byInk}</byInk>`)
file = file.replace(/<bFastMode>(.*)<\/bFastMode>/i, `<bFastMode>${b.bFastMode}</bFastMode>`)
file = file.replace(/<byResolution>(.*)<\/byResolution>/i, `<byResolution>${1}</byResolution>`)
file = file.replace(/<byInkVolume>(.*)<\/byInkVolume>/i, `<byInkVolume>${b.byInkVolume}</byInkVolume>`)
file = file.replace(/<byDoublePrint>(.*)<\/byDoublePrint>/i, `<byDoublePrint>${b.byDoublePrint}</byDoublePrint>`)
file = file.replace(/<bMultiple>(.*)<\/bMultiple>/i, `<bMultiple>${b.bMultiple}</bMultiple>`)
file = file.replace(/<bySaturation>(.*)<\/bySaturation>/i, `<bySaturation>${b.bySaturation}</bySaturation>`)
file = file.replace(/<byBrightness>(.*)<\/byBrightness>/i, `<byBrightness>${b.byBrightness}</byBrightness>`)
file = file.replace(/<byContrast>(.*)<\/byContrast>/i, `<byContrast>${b.byContrast}</byContrast>`)
file = file.replace(/<iCyanBalance>(.*)<\/iCyanBalance>/i, `<iCyanBalance>${b.iCyanBalance}</iCyanBalance>`)
file = file.replace(/<iMagentaBalance>(.*)<\/iMagentaBalance>/i, `<iMagentaBalance>${b.iMagentaBalance}</iMagentaBalance>`)
file = file.replace(/<iYellowBalance>(.*)<\/iYellowBalance>/i, `<iYellowBalance>${b.iYellowBalance}</iYellowBalance>`)
file = file.replace(/<iBlackBalance>(.*)<\/iBlackBalance>/i, `<iBlackBalance>${b.iBlackBalance}</iBlackBalance>`)
file = file.replace(/<bUniPrint>(.*)<\/bUniPrint>/i, `<bUniPrint>${b.bUniPrint}</bUniPrint>`)
fs.writeFileSync(path.join(process.cwd(), `./print/Profile/${b.fileName.replace('.png', '')}.xml`), file)
// 传递素材给前端
export const sendImg = (filename = "sample.png") => {
let filePath = path.join(process.cwd(), "./print/Input/" + filename);
if (!fs.existsSync(filePath)) {
return false;
}
let data = fs.readFileSync(filePath);
data = Buffer.from(data).toString("base64");
return "data:" + "png" + ";base64," + data;
};
} catch (err) {
console.log(err)
export const toSend = body => {
return new Promise((resolve, reject) => {
exec(
body.cmd,
{ cwd: path.join(process.cwd(), "print"), shell: true },
(err, stdout, stderr) => {
console.log(stdout, 1);
console.log(stderr, 2);
console.log(err, 4);
if (!err) {
exec(
body.print_cmd,
{ cwd: path.join(process.cwd(), "print"), shell: true },
(err2, stdout2, stderr2) => {
console.log(err2);
if (!err2) {
// 成功后删除 素材图,xml,output文件
// fs.unlinkSync(path.join(process.cwd(), 'print/Input/' + body.fileName))
// fs.unlinkSync(path.join(process.cwd(), 'print/Profile/' + body.fileName.replace('.png', '') + '.xml'))
// fs.unlinkSync(path.join(process.cwd(), 'print/Output/' + body.fileName.replace('.png', '') + '.arxp'))
resolve("操作成功");
} else {
reject("打印机参数错误");
}
}
);
} else {
reject("生成arxp文件失败");
}
}
);
});
};
}
}
export const writeProfileXml = b => {
try {
let p = path.join(process.cwd(), `./print/Profile/${b.byInk}.xml`);
let file = fs.readFileSync(p, { encoding: "utf8" });
file = file.replace(
/<uiCopies>(.*)<\/uiCopies>/i,
`<uiCopies>${b.printNum}</uiCopies>`
);
file = file.replace(
/<byPlatenSize>(.*)<\/byPlatenSize>/i,
`<byPlatenSize>${b.byPlatenSize}</byPlatenSize>`
);
file = file.replace(
/<bEcoMode>(.*)<\/bEcoMode>/i,
`<bEcoMode>${b.bEcoMode}</bEcoMode>`
);
file = file.replace(
/<bMaterialBlack>(.*)<\/bMaterialBlack>/i,
`<bMaterialBlack>${b.bMaterialBlack}</bMaterialBlack>`
);
file = file.replace(
/<byHighlight>(.*)<\/byHighlight>/i,
`<byHighlight>${b.byHighlight}</byHighlight>`
);
file = file.replace(
/<byMask>(.*)<\/byMask>/i,
`<byMask>${b.byMask}</byMask>`
);
file = file.replace(
/<bTransColor>(.*)<\/bTransColor>/i,
`<bTransColor>${b.bTransColor}</bTransColor>`
);
file = file.replace(
/<bPause>(.*)<\/bPause>/i,
`<bPause>${b.bPause}</bPause>`
);
file = file.replace(
/<bDivide>(.*)<\/bDivide>/i,
`<bDivide>${b.bDivide}</bDivide>`
);
file = file.replace(
/<byChoke>(.*)<\/byChoke>/i,
`<byChoke>${b.byChoke}</byChoke>`
);
file = file.replace(/<byInk>(.*)<\/byInk>/i, `<byInk>${b.byInk}</byInk>`);
file = file.replace(
/<bFastMode>(.*)<\/bFastMode>/i,
`<bFastMode>${b.bFastMode}</bFastMode>`
);
file = file.replace(
/<byResolution>(.*)<\/byResolution>/i,
`<byResolution>${1}</byResolution>`
);
file = file.replace(
/<byInkVolume>(.*)<\/byInkVolume>/i,
`<byInkVolume>${b.byInkVolume}</byInkVolume>`
);
file = file.replace(
/<byDoublePrint>(.*)<\/byDoublePrint>/i,
`<byDoublePrint>${b.byDoublePrint}</byDoublePrint>`
);
file = file.replace(
/<bMultiple>(.*)<\/bMultiple>/i,
`<bMultiple>${b.bMultiple}</bMultiple>`
);
file = file.replace(
/<bySaturation>(.*)<\/bySaturation>/i,
`<bySaturation>${b.bySaturation}</bySaturation>`
);
file = file.replace(
/<byBrightness>(.*)<\/byBrightness>/i,
`<byBrightness>${b.byBrightness}</byBrightness>`
);
file = file.replace(
/<byContrast>(.*)<\/byContrast>/i,
`<byContrast>${b.byContrast}</byContrast>`
);
file = file.replace(
/<iCyanBalance>(.*)<\/iCyanBalance>/i,
`<iCyanBalance>${b.iCyanBalance}</iCyanBalance>`
);
file = file.replace(
/<iMagentaBalance>(.*)<\/iMagentaBalance>/i,
`<iMagentaBalance>${b.iMagentaBalance}</iMagentaBalance>`
);
file = file.replace(
/<iYellowBalance>(.*)<\/iYellowBalance>/i,
`<iYellowBalance>${b.iYellowBalance}</iYellowBalance>`
);
file = file.replace(
/<iBlackBalance>(.*)<\/iBlackBalance>/i,
`<iBlackBalance>${b.iBlackBalance}</iBlackBalance>`
);
file = file.replace(
/<bUniPrint>(.*)<\/bUniPrint>/i,
`<bUniPrint>${b.bUniPrint}</bUniPrint>`
);
fs.writeFileSync(
path.join(
process.cwd(),
`./print/Profile/${b.fileName.replace(".png", "")}.xml`
),
file
);
} catch (err) {
console.log(err);
}
};
......@@ -4,60 +4,65 @@ import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
{
path: '/',
name: 'login',
meta: {
title: '登录'
},
component: (resolve) => require(['../views/login/index.vue'], resolve)
{
path: "/",
name: "login",
meta: {
title: "登录"
},
{
path: '/design',
name: 'design',
meta: {
title: '设计页面'
},
component: (resolve) => require(['../views/design/index.vue'], resolve)
component: resolve => require(["../views/login/index.vue"], resolve)
},
{
path: "/design",
name: "design",
meta: {
title: "设计页面"
},
{
path: '/design-copy',
name: 'design',
meta: {
title: '设计页面'
},
component: (resolve) => require(['../views/design/copy.vue'], resolve)
}, {
path: '/design-detail',
name: 'design',
meta: {
title: '设计详情页面'
},
component: (resolve) => require(['../views/design/detail/index.vue'], resolve)
}, {
path: '*',
redirect: '/'
component: resolve => require(["../views/design/index.vue"], resolve)
},
{
path: "/design-copy",
name: "design",
meta: {
title: "设计页面"
},
component: resolve => require(["../views/design/copy.vue"], resolve)
},
{
path: "/design-detail",
name: "design",
meta: {
title: "设计详情页面"
},
component: resolve => require(["../views/design/detail/index.vue"], resolve)
},
{
path: "*",
redirect: "/"
}
];
const router = new VueRouter({
mode: "hash",
base: process.env.BASE_URL,
routes
mode: "hash",
base: process.env.BASE_URL,
routes
});
router.beforeEach((to, from, next) => {
let user = Vue.prototype.$dataStore.get('user')
if (to.name === 'login') {
if (user) {
console.log(1)
return next({path:'/design'})
} else {
return next( )
}
let user = Vue.prototype.$dataStore.get("user");
if (to.name === "login") {
if (user) {
console.log(1);
return next({ path: "/design" });
} else {
return next()
return next();
}
} else {
if (user) {
return next();
} else {
return next("/");
}
})
}
});
export default router;
......@@ -4,52 +4,53 @@ import Vuex from "vuex";
Vue.use(Vuex);
const defaultSetting = {
gridShow: 1,
language: 'cn',
gridValue: 1,
autoPrint: false,
gridSpacing: "10mm"
}
gridShow: 1,
language: "cn",
gridValue: 1,
autoPrint: false,
gridSpacing: "10mm"
};
export default new Vuex.Store({
state: {
actionList:[],
imgList:[],
actionIndex:-1,
systemSetting: {
gridShow: 1,
gridValue: 1,
language: 'cn',
autoPrint: false,
gridSpacing: "10mm"
}
state: {
actionList: [],
imgList: [],
actionIndex: -1,
systemSetting: {
gridShow: 1,
gridValue: 1,
unit: "mm",
language: "cn",
autoPrint: false,
gridSpacing: 10
}
},
mutations: {
setDefaultSetting(state) {
state.systemSetting = JSON.parse(JSON.stringify(defaultSetting));
},
mutations: {
setDefaultSetting(state) {
state.systemSetting = JSON.parse(JSON.stringify(defaultSetting))
},
updateSystemSetting(state, f) {
state.systemSetting[f.field] = f.value
},
changeActionList(state, value) {
state.actionList = value
},
changeActionIndex(state, value) {
state.actionIndex = value
},
changeImgList(state, value) {
state.imgList = value
}
updateSystemSetting(state, f) {
state.systemSetting[f.field] = f.value;
},
getters: {
systemSetting(state) {
return state.systemSetting;
},
getActionList(state) {
return state.actionList;
},
getActionIndex:(state)=> state.actionIndex,
imgList:(state)=> state.imgList
changeActionList(state, value) {
state.actionList = value;
},
actions: {},
modules: {}
changeActionIndex(state, value) {
state.actionIndex = value;
},
changeImgList(state, value) {
state.imgList = value;
}
},
getters: {
systemSetting(state) {
return state.systemSetting;
},
getActionList(state) {
return state.actionList;
},
getActionIndex: (state) => state.actionIndex,
imgList: (state) => state.imgList
},
actions: {},
modules: {}
});
import axios from 'axios'
import Vue from 'vue'
import {Loading} from 'element-ui'
import axios from "axios";
import Vue from "vue";
import { Loading } from "element-ui";
import router from "../router/index";
// create an axios instance
const service = axios.create({
baseURL: 'http://localhost:3000', // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 50000000 // request timeout
})
let loading
baseURL: "http://localhost:3000", // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 50000000 // request timeout
});
let loading;
function startLoading() {
loading = Loading.service({
lock: true,
text: '拼命加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0,0,0,.7)'
})
loading = Loading.service({
lock: true,
text: "拼命加载中...",
spinner: "el-icon-loading",
background: "rgba(0,0,0,.7)"
});
}
function endLoading() {
loading.close()
loading.close();
}
// Add a request interceptor
service.interceptors.request.use(
config => {
const user = Vue.prototype.$dataStore.get('user')
const company = Vue.prototype.$dataStore.get('company')
if (user) {
config.headers['jwt-token'] = user.token
config.headers['company'] = company.domain
}
startLoading()
return config
},
error => {
endLoading()
// do something with request error
return Promise.reject(error)
config => {
const user = Vue.prototype.$dataStore.get("user");
const company = Vue.prototype.$dataStore.get("company");
if (user) {
config.headers["jwt-token"] = user.token;
config.headers["company"] = company.domain;
}
)
startLoading();
return config;
},
error => {
endLoading();
// do something with request error
return Promise.reject(error);
}
);
// Add a response interceptor
service.interceptors.response.use(
/**
* If you want to get http information such as headers or status
* Please return response => response
*/
/**
* Determine the request status by custom code
* Here is just an example
* You can also judge the status by HTTP Status Code
*/
response => {
// do something with response data
const res = response.data
endLoading()
if (res.code) {
if (res.code !== 200) {
if (res.code === 411) {
/**
* If you want to get http information such as headers or status
* Please return response => response
*/
return Promise.resolve(res)
}
if (res.code === 403) {
router.replace('/')
Vue.prototype.$message.error({showClose: true, message: res.msg || res.message || 'Error'})
Vue.prototype.$dataStore.delete('user')
return Promise.reject(new Error(res.msg || res.message || 'Error'))
}
/**
* Determine the request status by custom code
* Here is just an example
* You can also judge the status by HTTP Status Code
*/
async response => {
// do something with response data
const res = response.data;
endLoading();
if (res.code) {
if (res.code !== 200) {
if (res.code === 411) {
return Promise.resolve(res);
}
if (res.code === 403) {
Vue.prototype.$dataStore.delete("user");
Vue.prototype.$message.error({
showClose: true,
message: res.msg || res.message || "Error"
});
setTimeout(() => {
location.reload();
}, 500);
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// TODO: to re-login
}
Vue.prototype.$message.error({showClose: true, message: res.msg || res.message || 'Error'})
// reject
return Promise.reject(new Error(res.msg || res.message || 'Error'))
} else {
return Promise.reject(new Error(res.msg || res.message || "Error"));
}
return Promise.resolve(res)
}
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// TODO: to re-login
}
return Promise.resolve(res)
},
error => {
endLoading()
// do something with response error
return Promise.reject(error)
Vue.prototype.$message.error({
showClose: true,
message: res.msg || res.message || "Error"
});
// reject
return Promise.reject(new Error(res.msg || res.message || "Error"));
} else {
return Promise.resolve(res);
}
}
)
return Promise.resolve(res);
},
error => {
endLoading();
// do something with response error
return Promise.reject(error);
}
);
export default service
export default service;
export const grid = [
// {
// label: '7×8',
// value: 4,
// col: 7,
// row: 8
// },
// {
// label: '10×12',
// col: 10,
// value: 3,
// row: 12
// },
// {
// label: '14×16',
// col: 14,
// value: 2,
// row: 16
// },
{
label: "16×18",
value: 1,
row: 16,
col: 18,
h: 542,
w: 482
}
// {
// label: '16×21',
// value: 0,
// col: 16,
// row: 21
// }
];
\ No newline at end of file
export default {
byInk:`
byInk: `
<b>油墨选择</b>
<p>选择所使用油墨的组合方式:</p>
<p>选择所使用油墨的组合方式:</p>
......@@ -7,30 +7,30 @@ export default {
<p>仅彩色油墨:在白底或淡色底上打印彩色图像。</p>
<p>仅黑色油墨:只使用黑色油墨,打印黑白图像。</p>
`,
bEcoMode:`
bEcoMode: `
<b>模式</b>
<p>自动调整底材的白色油墨量,抑制整体的油墨消耗量。</p>
<p>但是,根据颜色,完成品的亮度有时会略微降低。</p>
`,
bMaterialBlack:
bMaterialBlack:
`
<b>利用底材的黑色</b>
<p>在黑色底材上打印时,利用底材的黑色打印时,设定为ON。</p>
<p>自动将黑色(RGB=0)作为透明色处理。</p>
<p>已在详细设置菜单中将其它颜色指定为透明色时,设定为OFF。</p>
`,
bMultiple:
bMultiple:
`
<b>彩色的复合路径打印</b>
<p>彩色的复合路径打印是针对含有彩色的图像通过增加压板的进给次数(LF)来喷出更精细的油墨液滴。尽管打印时间变长,但可以更加细致地再现色彩。</p>
`,
byHighlight:
byHighlight:
`
<b>高光</b>
<p>选择RGB=254的白度(浓度)。值越大,白度越增加。</p>
<p>打印HighlightCheckPattern.arxp选择适当的值。</p>
`,
byMask:
byMask:
`
<b>遮光</b>
<p>调节底材的白色油墨量。</p>
......@@ -40,62 +40,62 @@ export default {
<p>4:用于红色、紫色、绿色等鲜艳的底色。</p>
<p>5:在暗色区以外的所有区域中以最大白色油墨量打印。</p>
`,
bFastMode:
bFastMode:
`
<b>白色高速打印</b>
<p>在白色油墨使用模式下高速打印。油墨量和浓度不变。</p>
<p>横纹明显时设定为OFF。</p>
`,
bDivide:
bDivide:
`
<b>白色分次打印</b>
<p>分两层,每层用一半的油墨量进行白色打印。
总油墨量不变。</p>
`,
bPause:
bPause:
`
<b>白色/彩色个别打印</b>
<p>打印白色层后,暂停(等待时间)后打印彩色层。打印极小的图像时请选择。</p>
`,
bTransColor:
bTransColor:
`
<b>透明色</b>
<p>指定打印时不使用油墨而是作为透明色处理的颜色。</p>
<p>根据颜色的再现性,建议取消选中[利用底材的黑色]。</p>
`,
byChoke:
byChoke:
`
<b>白色油墨的削减范围</b>
<p>通过减少白色油墨的打印范围,防止白色油墨从彩色油墨下露出。</p>
<p>通常为1-3,数字越大,白色油墨的削减量增力口。</p>
<p>如果原图像的周围能看到白色的线或点,很可能是“抗锯齿“导致,请确认原图像。</p>
`,
byMinWhite:
byMinWhite:
`
<b>最小白色油墨量</b>
<p>设置值越大,使用“彩色+白色油墨"打印时的暗色区域底材的白色油墨量越增加。</p>
<p>如果选择“特殊”,则设置值可以选择大于“3”的值。</p>
<p>请注意,设置值越大,越容易渗透。</p>
`,
bySaturation:
bySaturation:
`
<b>饱和度</b>
<p>增加颜色的鲜艳度。请用于稍暗或色调不足的图像、CMYK颜色模式的图像、扫描仪的图像旁。</p>
`,
byBrightness:
byBrightness:
`
<b>亮度</b>
<p>值越大,颜色变得越亮。</p>
`,
byContrast:
byContrast:
`
<b>对比度</b>
<p>使亮的颜色更亮、暗的颜色更暗,从而给呆板的图像增加颜色强弱。</p>
`,
iCyanBalance :
iCyanBalance:
`
<b>青色</b>
<p>调整青色油墨量。</p>
......@@ -103,7 +103,7 @@ export default {
<p>如果减少值,整体会偏红。</p>
`,
iMagentaBalance :
iMagentaBalance:
`
<b>红色</b>
<p>调整青色油墨量。</p>
......@@ -111,7 +111,7 @@ export default {
<p>如果减少值,整体会偏绿。</p>
`,
iYellowBalance :
iYellowBalance:
`
<b>黄色</b>
<p>调整黄色油墨量。</p>
......@@ -119,7 +119,7 @@ export default {
<p>如果减少值,整体会偏蓝。</p>
`,
iBlackBalance :
iBlackBalance:
`
<b>黑色</b>
<p>调整黑色油墨量。</p>
......@@ -128,19 +128,19 @@ export default {
`,
printTime :
printTime:
`
<b>打印时间</b>
<p>“x1”以按照高光5打印的时间作为标准。</p>
<p>提高高光增加了白色油墨量时打印时间变长。</p>
`,
whiteInk :
whiteInk:
`
<b>白色油墨量</b>
<p>高光5的油墨量为“400%",以此作为标准。</p>
<p>实际油墨消耗量取决于打印图像内的色彩。请将其当作油墨消耗量的标准。</p>
`,
byInkVolume :
byInkVolume:
`
<b>油墨量</b>
<p>减少彩色油墨量以防止油墨渗透。</p>
......@@ -150,11 +150,20 @@ export default {
<p>6-4 用于薄平纹织物和棉/聚酯纤维/聚氨酯混纺。</p>
<p>3-1用于聚酯纤维针织物和没有吸水性合成纤维。</p>
`,
bUniPrint :
bUniPrint:
`
<b>单向打印</b>
<p>将打印方向固定为一个方向。</p>
<p>优先执行来自打印机操作面板的指定,仅在打印机的设置是[自动]时有效。</p>
`,
byDoublePrint:
`
<b>2次打印</b>
<p>设置为0时,打印1次。</p>
<p>设置为1~3时,分2次打印。</p>
<p>分2次打印时,无需增加油墨消耗量也可期待提高黑度。</p>
<p>设置值越大,从第1次打印开始到第2次打印开始的间隔越长,可以更加期待提高黑度效果。</p>
`
}
\ No newline at end of file
};
\ No newline at end of file
<script>
import bus from '@/bus'
import bus from "@/bus";
import PrintDialog from "./printDialog.vue";
import {ipcRenderer} from "electron";
import { ipcRenderer } from "electron";
import { grid } from "../data";
export default {
components: {PrintDialog},
components: { PrintDialog },
props: {
user: {
default: {
avatar: ''
avatar: ""
},
type: Object
},
......@@ -24,96 +24,73 @@ export default {
actionIndex: -1,
isAutoFinish: false,
showPrintDialog: false,
productionNo: '',
setting: {},
productionNo: "",
setting: {
gridShow: 1,
gridValue: 0,
unit: "mm",
language: "cn",
autoPrint: false,
gridSpacing: 10
},
imgList: [],
detail: null,
selectBgColor: '#ececec',
selectBgColor: "#ececec",
predefineColors: [
'#ff4500',
'#ff8c00',
'#ffd700',
'#90ee90',
'#00ced1',
'#1e90ff',
'#c71585',
'rgba(255, 69, 0, 0.68)',
'rgb(255, 120, 0)',
'hsv(51, 100, 98)',
'hsva(120, 40, 94, 0.5)',
'hsl(181, 100%, 37%)',
'hsla(209, 100%, 56%, 0.73)',
'#c7158577'
"#ff4500",
"#ff8c00",
"#ffd700",
"#90ee90",
"#00ced1",
"#1e90ff",
"#c71585",
"rgba(255, 69, 0, 0.68)",
"rgb(255, 120, 0)",
"hsv(51, 100, 98)",
"hsva(120, 40, 94, 0.5)",
"hsl(181, 100%, 37%)",
"hsla(209, 100%, 56%, 0.73)",
"#c7158577"
],
grid: [
// {
// label: '7×8',
// value: 4,
// col: 7,
// row: 8
// },
// {
// label: '10×12',
// col: 10,
// value: 3,
// row: 12
// },
// {
// label: '14×16',
// col: 14,
// value: 2,
// row: 16
// },
{
label: '16×18',
value: 1,
col: 543,
row: 482
},
// {
// label: '16×21',
// value: 0,
// col: 16,
// row: 21
// }
]
}
grid
};
},
computed: {
avatar() {
if (this.user && this.user.avatar) {
console.log(this.user, 9)
let host = this.company.domain
if (host.includes('console')) {
host = host.replace('.jomalls.com', '.joshine.cn')
console.log(this.user, 9);
let host = this.company.domain;
if (host.includes("console")) {
host = host.replace(".jomalls.com", ".joshine.cn");
}
let avatar = this.user.avatar.includes('http') ? this.user.avatar : `https://${host}/erpimg/${this.user.avatar}`
console.log(avatar)
return avatar
let avatar = this.user.avatar.includes("http") ? this.user.avatar : `https://${host}/erpimg/${this.user.avatar}`;
console.log(avatar);
return avatar;
}
return ''
return "";
},
actionList() {
return this.$store.getters.getActionList
return this.$store.getters.getActionList;
}
},
mounted() {
this.$nextTick(() => {
this.$refs.searchRef.focus()
})
this.$refs.searchRef.focus();
});
},
created() {
if(this.$dataStore.get('setting')){
this.setting = this.$dataStore.get('setting')
if (this.$dataStore.get("setting")) {
this.setting = this.$dataStore.get("setting");
} else {
this.$dataStore.set("setting", this.setting);
}
},
watch: {
setting: {
handler() {
this.$dataStore.set('setting', this.setting)
this.$dataStore.set("setting", this.setting);
bus.$emit("busEmit", { type: "updateSystemSetting" });
},
deep: true
}
......@@ -121,152 +98,197 @@ export default {
methods: {
dropdownCommand(v) {
switch (v) {
case 'logout':
this.$confirm('是否退出登录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
case "logout":
this.$confirm("是否退出登录?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$dataStore.delete('user')
this.$router.push('/')
this.$dataStore.delete("user");
this.$router.push("/");
}).catch(() => {
});
break
case 'company':
this.$confirm('是否切换系统?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
break;
case "company":
this.$confirm("是否切换系统?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$dataStore.delete('company')
this.$dataStore.delete('user')
this.$router.push('/')
this.$dataStore.delete("company");
this.$dataStore.delete("user");
this.$router.push("/");
}).catch(() => {
});
break;
case "clear":
// this.$confirm("是否清除缓存?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// }).then(() => {
// for (let k in this.$dataStore.store) {
// this.$dataStore.delete(k);
// }
// location.reload();
// }).catch(() => {
//
// });
break;
}
},
async setData(data) {
if (!data) return this.$message.warning('请扫描生产单号')
await this.$api.post('/completeDelivery', {id: data.id}).then(() => {
})
this.$message.success('成功生产完成')
if (!data) return this.$message.warning("请扫描生产单号");
await this.$api.post("/completeDelivery", { id: data.id }).then(() => {
});
this.$message.success("成功生产完成");
},
async sureData() {
if (!this.detail || Object.keys(this.detail).length <= 1) {
return this.$message.warning('请扫描生产单号')
return this.$message.warning("请扫描生产单号");
}
this.$confirm(
`确定生产完成?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
`确定生产完成?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(async () => {
await this.setData(this.detail)
})
await this.setData(this.detail);
});
},
async downloadImage() {
if (!this.detail || Object.keys(this.detail).length === 0) return this.$message.warning('请扫描生产单号')
if (!this.detail || Object.keys(this.detail).length === 0) return this.$message.warning("请扫描生产单号");
let params = {
productionNo: this.detail.podProductionNo,
imgList: this.imgList
}
};
let res = await this.$api.post('/downloadByDesignId', params)
this.$message.success(res.msg)
let res = await this.$api.post("/downloadByDesignId", params);
this.$message.success(res.msg);
},
async getDataInfo() {
if (this.detail && Object.keys(this.detail).length > 0 && this.isAutoFinish) {
await this.setData(this.detail)
await this.setData(this.detail);
}
if (this.productionNo === '') return this.$message.warning('请录入生产单号')
if (this.productionNo === "") return this.$message.warning("请录入生产单号");
try {
const findByPodProductionNo = await this.$api.post('/findByPodProductionNo', {
const findByPodProductionNo = await this.$api.post("/findByPodProductionNo", {
podProductionNo: this.productionNo,
status: 'IN_PRODUCTION'
})
this.detail = findByPodProductionNo.data
ipcRenderer.send('win-subScreen', findByPodProductionNo.data)
status: "IN_PRODUCTION"
});
this.detail = findByPodProductionNo.data;
ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
} catch (err) {
this.productionNo = ''
this.$refs.searchRef.focus()
this.productionNo = "";
this.$refs.searchRef.focus();
}
try {
let res = await this.$api.post('/getPodProductionInfo', {productionNo: this.productionNo})
if (res.data.length === 0) return this.$message.warning('未找到素材图!')
for (let i = 0; i < res.data.length; i++) {
this.$api.post('/getPngImg', {fileName: res.data[i].fileName}, {
headers: {
'responseType': 'blob'
}
}).then(r => {
res.data[i].file = new File([r], res.data[i].fileName, {type: 'image/png'})
if (i === res.data.length - 1) {
this.imgList = res.data
bus.$emit('busEmit', {type: 'sendFile', value: res.data})
}
})
}
this.productionNo = ''
this.$refs.searchRef.focus()
let res = await this.$api.post("/getPodProductionInfo", { productionNo: this.productionNo });
if (res.data.length === 0) return this.$message.warning("未找到素材图!");
let arr = [];
res.data.forEach(el => {
arr.push(el);
if (el.list) {
el.list.forEach(it => {
arr.push({
...it,
...{
designId:el.designId
}
});
});
}
});
console.log(arr,'arr');
res.data = arr.filter(el=>el.type!==1);
// for (let i = 0; i < res.data.length; i++) {
// this.$api.post("/getPngImg", { fileName: res.data[i].fileName }, {
// headers: {
// "responseType": "blob"
// }
// }).then(r => {
//
// res.data[i].file = new File([r], res.data[i].fileName, { type: "image/png" });
// if (i === res.data.length - 1) {
// this.imgList = res.data;
//
// }
// });
// }
bus.$emit("busEmit", { type: "sendFile", value: res.data });
this.productionNo = "";
this.$refs.searchRef.focus();
} catch (err) {
bus.$emit('busEmit', {type: 'sendFile', value: []})
this.productionNo = ''
this.$refs.searchRef.focus()
bus.$emit("busEmit", { type: "sendFile", value: [] });
this.productionNo = "";
this.$refs.searchRef.focus();
}
},
changeActionIndex(t) {
let index = this.actionIndex
if (t === '+') {
let index = this.actionIndex;
if (t === "+") {
if (index === this.$store.state.actionList.length - 1) return;
this.actionIndex = this.actionIndex + 1
this.actionIndex = this.actionIndex + 1;
} else {
if (index === 0) return
this.actionIndex = this.actionIndex - 1
if (index === 0) return;
this.actionIndex = this.actionIndex - 1;
}
console.log(this.actionIndex, 88)
bus.$emit('busEmit', {type: 'index', value: this.actionIndex})
this.$store.commit('changeActionIndex', this.actionIndex)
console.log(this.actionIndex, 88);
bus.$emit("busEmit", { type: "index", value: this.actionIndex });
this.$store.commit("changeActionIndex", this.actionIndex);
},
setDefaultSetting() {
this.$store.commit('setDefaultSetting')
this.setting = JSON.parse(JSON.stringify(this.$store.getters.systemSetting))
this.$message.success('重置应用程序设置成功')
this.$store.commit("setDefaultSetting");
this.setting = {
gridShow: 1,
gridValue: 0,
unit: "mm",
language: "cn",
autoPrint: false,
gridSpacing: 10
};
this.$message.success("重置应用程序设置成功");
},
settingChange(field, value) {
this.$store.commit('updateSystemSetting', {field, value});
if (value === "inch") {
this.setting.gridSpacing = 1;
} else if (value === "mm") {
this.setting.gridSpacing = 20;
}
this.$store.commit("updateSystemSetting", { field, value });
},
setBg() {
bus.$emit('busEmit', {type: 'bg', value: this.selectBgColor})
bus.$emit("busEmit", { type: "bg", value: this.selectBgColor });
},
async uploadImage(f) {
let formData = new FormData()
formData.append('file', f)
let {data} = await this.$api.post('/uploadImage', formData, {
let formData = new FormData();
formData.append("file", f);
let { data } = await this.$api.post("/uploadImage", formData, {
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
})
bus.$emit('busEmit', {type: 'uploadImage', value: data})
return false
});
bus.$emit("busEmit", { type: "uploadImage", value: data });
return false;
},
command(i) {
this.selectGridIndex = i
this.$store.commit('updateSystemSetting', {field: 'gridValue', value: this.grid[i]})
bus.$emit('busEmit', {type: 'grid', value: this.grid[i]})
},
this.selectGridIndex = i;
this.setting.gridValue = i;
this.$store.commit("updateSystemSetting", { field: "gridValue", value: this.grid[i] });
bus.$emit("busEmit", { type: "grid", value: this.grid[i] });
}
}
}
};
</script>
<style scoped>
.page-header {
......@@ -327,33 +349,41 @@ export default {
<!-- </el-tooltip>-->
<el-tooltip content="背景色">
<el-color-picker
style="margin-right: 3px"
v-model="selectBgColor"
@change="setBg"
color-format="hex"
:predefine="predefineColors">
style="margin-right: 3px"
v-model="selectBgColor"
@change="setBg"
color-format="hex"
:predefine="predefineColors">
</el-color-picker>
</el-tooltip>
<el-popover
width="320"
:offset="-120"
trigger="click"
placement="bottom"
width="320"
:offset="-120"
trigger="click"
placement="bottom"
>
<div class="setting-form">
<el-form :model="setting" label-position="left" size="small">
<el-form :model="setting" label-position="left" label-width="80px" size="small">
<el-form-item prop="setting" label="网格显示">
<el-select @change="(e)=>settingChange('gridShow',e)" clearable v-model="setting.gridShow">
<el-option :value="1" label="未缩放的网格"></el-option>
<el-option :value="0" label="无"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gridSpacing" label="单位">
<el-select @change="(e)=>settingChange('unit',e)" clearable v-model="setting.unit">
<el-option value="mm" label="mm"></el-option>
<el-option value="inch" label="inch"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gridSpacing" label="网格间隔">
<el-select @change="(e)=>settingChange('gridSpacing',e)" clearable v-model="setting.gridSpacing">
<el-option value="20mm" label="20mm"></el-option>
<el-option value="10mm" label="10mm"></el-option>
<el-option v-if="setting.unit==='mm'" :value="20" :label="`20 ${setting.unit}`"></el-option>
<el-option v-if="setting.unit==='mm'" :value="10" :label="`10 ${setting.unit}`"></el-option>
<el-option v-if="setting.unit==='inch'" :value="1" :label="`1 ${setting.unit}`"></el-option>
<el-option v-if="setting.unit==='inch'" :value="0.5" :label="`0.5 ${setting.unit}`"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="language" label="语言设置">
......@@ -406,6 +436,7 @@ export default {
<el-dropdown @command="dropdownCommand">
<b style="cursor:pointer;">{{ user.employeeName }}</b>
<el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item command="clear">清除缓存</el-dropdown-item>-->
<el-dropdown-item command="company">切换系统</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
......
<script>
import fieldDescription from "./fieldDescription";
import {ipcRenderer} from "electron"
import axios from 'axios'
import html2canvas from 'html2canvas'
import { ipcRenderer } from "electron";
import axios from "axios";
import html2canvas from "html2canvas";
export default {
data() {
......@@ -13,36 +13,36 @@ export default {
printerList: [],
printSettingList: [],
printSettingVal: 0,
description: '',
printSettingSelectLabel: 'default',
printer: '',
settingName: '',
description: "",
printSettingSelectLabel: "default",
printer: "",
settingName: "",
printInkList: [
{
label: '仅彩色油墨',
label: "仅彩色油墨"
},
{
label: '仅白色油墨'
label: "仅白色油墨"
},
{
label: '彩色 + 白色油墨'
label: "彩色 + 白色油墨"
},
{
label: '仅黑色油墨'
},
label: "仅黑色油墨"
}
],
detailShow: false,
showPopover: false,
printSetting: {
printer: '',
xy: '',
printer: "",
xy: "",
byInk: 2,
byInkVolume: 1,
byDoublePrint: 3,
bEcoMode: false,
bMaterialBlack: false,
byHighlight: 1,
byHighlight: 5,
printNum: 1,
bFastMode: false,
bUniPrint: false,
......@@ -60,9 +60,9 @@ export default {
iBlackBalance: 0,
iYellowBalance: 0,
byMinWhite: 1,
bMultiple: false,
bMultiple: false
}
}
};
},
props: {
visible: {
......@@ -74,263 +74,274 @@ export default {
type: Number
},
imgList: {
default: [],
default: () => [],
type: Array
}
},
mounted() {
this.$dataStore.set('default-print-setting', this.printSetting)
let select = this.$dataStore.get('print-setting-select')
if (select) {
this.printSettingSelectLabel = select
let index = this.printSettingList.findIndex(el => el.label === select)
if (index >= 0) {
this.printSettingVal = index
this.printSetting = JSON.parse(JSON.stringify(this.printSettingList[index].value))
this.$dataStore.set("default-print-setting", this.printSetting);
this.getPrintSettingList(()=>{
let select = this.$dataStore.get("print-setting-select");
console.log(this.$dataStore, "select");
if (select) {
this.printSettingSelectLabel = select;
let index = this.printSettingList.findIndex(el => el.label === select);
if (index >= 0) {
this.printSettingVal = index;
this.printSetting = JSON.parse(
JSON.stringify(this.printSettingList[index].value)
);
} else {
this.printSettingVal = 0;
this.printSetting = JSON.parse(
JSON.stringify(this.printSettingList[0].value)
);
}
} else {
this.printSettingVal = 0
this.printSetting = JSON.parse(JSON.stringify(this.printSettingList[0].value))
this.printSettingVal = 0;
this.printSetting = JSON.parse(
JSON.stringify(this.printSettingList[0].value)
);
}
} else {
this.printSettingVal = 0
this.printSetting = JSON.parse(JSON.stringify(this.printSettingList[0].value))
}
});
},
computed: {
inkNum() {
return 200 + (Number(this.printSetting.byHighlight) * 50) - 50
return 200 + (Number(this.printSetting.byHighlight) * 50) - 50;
},
defaultTime() {
if ([6, 7].includes(Number(this.printSetting.byHighlight))) {
return '1.25'
return "1.25";
} else if (this.printSetting.byHighlight < 6) {
return '1.00'
return "1.00";
} else {
return '1.5'
return "1.5";
}
}
},
watch: {
visible() {
this.dialogShow = this.visible
this.dialogShow = this.visible;
}
},
created() {
this.getPrinter()
this.getPrintSettingList()
this.getPrinter();
},
methods: {
delSetting() {
this.$confirm(
`确定删除该预设?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
`确定删除该预设?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
).then(() => {
this.$dataStore.delete(this.printSettingList[this.printSettingVal].label + '-print-setting')
this.getPrintSettingList()
this.printSettingVal = 0
})
this.$dataStore.delete(this.printSettingList[this.printSettingVal].label + "-print-setting");
this.getPrintSettingList();
this.printSettingVal = 0;
});
},
getPrintSettingList() {
let arr = []
getPrintSettingList(callback) {
let arr = [];
for (let k in this.$dataStore.store) {
if (k.includes('-print-setting')) {
if (k.includes("-print-setting")) {
arr.push({
label: k.replace('-print-setting', ''),
label: k.replace("-print-setting", ""),
value: this.$dataStore.get(k)
})
});
}
}
this.printSettingList = arr
this.printSettingList = arr;
callback && callback();
},
printSettingChange(v) {
let label = this.printSettingList[v].label
this.$dataStore.set('print-setting-select', label)
this.printSetting = JSON.parse(JSON.stringify(this.printSettingList[v].value))
let label = this.printSettingList[v].label;
this.$dataStore.set("print-setting-select", label);
this.printSetting = JSON.parse(JSON.stringify(this.printSettingList[v].value));
},
saveSetting() {
if (this.settingName.trim() === '') {
return this.$message.warning('预设名称不能为空')
if (this.settingName.trim() === "") {
return this.$message.warning("预设名称不能为空");
}
if (this.printSettingList.find(el => el.label === this.settingName)) {
return this.$message.warning('预设名称不能重复')
return this.$message.warning("预设名称不能重复");
}
this.$dataStore.set(`${this.settingName}-print-setting`, this.printSetting)
this.showPopover = false
this.printSettingVal = this.printSettingList.length
this.getPrintSettingList()
this.$dataStore.set(`${this.settingName}-print-setting`, this.printSetting);
this.showPopover = false;
this.printSettingVal = this.printSettingList.length;
this.getPrintSettingList();
},
openPopover() {
this.showPopover = true
this.settingName = ''
this.showPopover = true;
this.settingName = "";
},
singleStr(str) {
if (Number(str) >= 0) {
str = str.toString().replace('.', '')
str = str.toString().replace(".", "");
if (str.length >= 4) {
str = str.slice(0, 5)
str = str.slice(0, 5);
} else if (str.length === 3) {
str = '0' + str
str = "0" + str;
} else if (str.length === 2) {
str = '00' + str
str = "00" + str;
} else if (str.length === 1) {
str = '000' + str
str = "000" + str;
}
} else {
str = str.toString().replace('.', '').replace('-', '')
str = str.toString().replace(".", "").replace("-", "");
if (str.length >= 4) {
str = str.slice(0, 5)
str = str.slice(0, 5);
} else if (str.length === 3) {
str = '0' + str
str = "0" + str;
} else if (str.length === 2) {
str = '00' + str
str = "00" + str;
} else if (str.length === 1) {
str = '000' + str
str = "000" + str;
}
str = '-' + str
str = "-" + str;
}
// 不足四位前面用0补齐
console.log(str)
return str
console.log(str);
return str;
},
dataURLtoBlob(dataurl) {
var arr = dataurl.split(',')
var arr = dataurl.split(",");
//注意base64的最后面中括号和引号是不转译的
var _arr = arr[1].substring(0, arr[1].length - 2)
var _arr = arr[1].substring(0, arr[1].length - 2);
var mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(_arr),
n = bstr.length,
u8arr = new Uint8Array(n)
bstr = atob(_arr),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {
type: mime
})
});
},
moreImageCmd(arr) {
var canvas1 = document.createElement("canvas");
let _canvas = document.getElementsByClassName('sucaitu')[0];//目标块
var bodyW = parseInt(window.getComputedStyle(_canvas).width)
var bodyH = parseInt(window.getComputedStyle(_canvas).height)
let _canvas = document.getElementsByClassName("sucaitu")[0];//目标块
var bodyW = parseInt(window.getComputedStyle(_canvas).width);
var bodyH = parseInt(window.getComputedStyle(_canvas).height);
canvas1.width = bodyW;
canvas1.height = bodyH;
canvas1.style.width = bodyW + "px";
canvas1.style.height = bodyH + "px";
canvas1.style.background = 'transparent';
canvas1.style.background = "transparent";
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
var context = canvas1.getContext("2d");
// context.scale(2, 2);
let that = this
let that = this;
html2canvas(_canvas, {
canvas: canvas1,
backgroundColor: null,
useCORS: true,
allowTaint: true
}).then(async function (canvas) {
}).then(async function(canvas) {
let dataURL = canvas.toDataURL('image/png')
let pageBlob = that.dataURLtoBlob(dataURL)
let params = new FormData()
let fileOfBlob = new File([pageBlob], new Date().getTime() + '.jpg')
params.append('file', fileOfBlob)
let dataURL = canvas.toDataURL("image/png");
let pageBlob = that.dataURLtoBlob(dataURL);
let params = new FormData();
let fileOfBlob = new File([pageBlob], new Date().getTime() + ".jpg");
params.append("file", fileOfBlob);
let {data} = await that.$api.post('/uploadImage', params, {
let { data } = await that.$api.post("/uploadImage", params, {
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
})
let w_mm = Number((canvas1.width * 0.84183).toFixed(1))
let h_mm = Number((canvas1.height * 0.84183).toFixed(1))
let size = `${that.singleStr(Number(w_mm).toFixed(1))}${that.singleStr(Number(h_mm).toFixed(1))}`
await that.sendCmd(data.fileName, size, '00000000', 0)
});
let w_mm = Number((canvas1.width * 0.84183).toFixed(1));
let h_mm = Number((canvas1.height * 0.84183).toFixed(1));
let size = `${that.singleStr(Number(w_mm).toFixed(1))}${that.singleStr(Number(h_mm).toFixed(1))}`;
await that.sendCmd(data.fileName, size, "00000000", 0);
//canvas转换成url,然后利用a标签的download属性,直接下载,绕过上传服务器再下载
// document.querySelector(".down").setAttribute('href', canvas.toDataURL());
});
},
async getPrintCmd() {
if (this.imgList.length === 0) return this.$message.warning('素材不能为空')
console.log(this.imgList[0])
if (this.imgList.length === 0) return this.$message.warning("素材不能为空");
console.log(this.imgList[0]);
if (this.imgList.length > 1) {
let dom = document.getElementsByClassName('drr')
let dom = document.getElementsByClassName("drr");
for (let i = 0; i < dom.length; i++) {
dom[i].classList.remove("active")
dom[i].classList.add("inactive")
dom[i].classList.remove("active");
dom[i].classList.add("inactive");
}
setTimeout(() => {
this.moreImageCmd(this.imgList)
}, 500)
this.moreImageCmd(this.imgList);
}, 500);
return
return;
}
let {x, y, r, w, h} = this.imgList[0]
y = (Number(y) - Number(h) / 2)
x = (Number(x) - Number(w) / 2)
let x_mm = Number((x * 0.84183).toFixed(1))
let w_mm = Number((w * 0.84183).toFixed(1))
let h_mm = Number((h * 0.84183).toFixed(1))
let y_mm = Number((y * 0.84183).toFixed(1))
console.log(x_mm, y_mm)
r = Number(r).toFixed(0)
const imgFileName = this.imgList[0].fileName
let position = '' // 位置
let size = '' // 图像大小
let { x, y, r, w, h } = this.imgList[0];
y = (Number(y) - Number(h) / 2);
x = (Number(x) - Number(w) / 2);
let x_mm = Number((x * 0.84183).toFixed(1));
let w_mm = Number((w * 0.84183).toFixed(1));
let h_mm = Number((h * 0.84183).toFixed(1));
let y_mm = Number((y * 0.84183).toFixed(1));
console.log(x_mm, y_mm);
r = Number(r).toFixed(0);
const imgFileName = this.imgList[0].fileName;
let position = ""; // 位置
let size = ""; // 图像大小
if (Number(x_mm) < 0 || Number(y_mm) < 0) {
position = `"${this.singleStr(Number(x_mm).toFixed(1))},${this.singleStr(Number(y_mm).toFixed(1))}"`
position = `"${this.singleStr(Number(x_mm).toFixed(1))},${this.singleStr(Number(y_mm).toFixed(1))}"`;
} else {
position = `${this.singleStr(x_mm.toFixed(1))}${this.singleStr(y_mm.toFixed(1))}`
position = `${this.singleStr(x_mm.toFixed(1))}${this.singleStr(y_mm.toFixed(1))}`;
}
size = `${this.singleStr(Number(w_mm).toFixed(1))}${this.singleStr(Number(h_mm).toFixed(1))}`
size = `${this.singleStr(Number(w_mm).toFixed(1))}${this.singleStr(Number(h_mm).toFixed(1))}`;
const bigNum = '0031131' // 图像放大倍数 -R
const bigNum = "0031131"; // 图像放大倍数 -R
await this.sendCmd(imgFileName, size, position, r)
await this.sendCmd(imgFileName, size, position, r);
},
async sendCmd(imgFileName, size, position, r) {
const whitePrint = [1, 2].includes(this.printSetting.byInk) ? 1 : 0 // 白色打印
let cmd = `GTXproCMD.exe print -X "${`Profile\\${imgFileName.replace('.png', '')}.xml`}" -I "${'Input\\' + imgFileName}" -A "Output\\${imgFileName.replace('.png', '')}.arxp" -S ${size} -L ${position} -D ${r} -W ${whitePrint}`
let print_cmd = `GTXproCMD.exe send -A "Output\\${imgFileName.replace('.png', '')}.arxp" -P "${this.printer}`
const whitePrint = [1, 2].includes(this.printSetting.byInk) ? 1 : 0; // 白色打印
let cmd = `GTXproCMD.exe print -X "${`Profile\\${imgFileName.replace(".png", "")}.xml`}" -I "${"Input\\" + imgFileName}" -A "Output\\${imgFileName.replace(".png", "")}.arxp" -S ${size} -L ${position} -D ${r} -W ${whitePrint}`;
let print_cmd = `GTXproCMD.exe send -A "Output\\${imgFileName.replace(".png", "")}.arxp" -P "${this.printer}`;
let data = {
...this.printSetting,
...{
byPlatenSize: this.byPlatenSize,
cmd,
fileName: imgFileName,
print_cmd,
print_cmd
}
}
let res = await this.$api.post('/toPrint', data)
this.$message.success(res.msg)
};
let res = await this.$api.post("/toPrint", data);
this.$message.success(res.msg);
},
async getPrinter() {
ipcRenderer.send('allPrint')
ipcRenderer.once('printName', (event, data) => {
console.log(data, 996) // data就是返回的打印机数据列表
this.printerList = data
ipcRenderer.send("allPrint");
ipcRenderer.once("printName", (event, data) => {
console.log(data, 996); // data就是返回的打印机数据列表
this.printerList = data;
if (this.printerList.length > 0) {
this.printer = this.printerList[0].name
this.printer = this.printerList[0].name;
}
})
});
},
setDetailShow() {
this.detailShow = !this.detailShow
this.detailShow = !this.detailShow;
}
}
}
};
</script>
<template>
......@@ -351,10 +362,10 @@ export default {
</el-select>
<div style="margin-left: 15px;display: flex" class="save-btn">
<el-popover
placement="bottom"
width="200"
v-model="showPopover"
trigger="manual">
placement="bottom"
width="200"
v-model="showPopover"
trigger="manual">
<el-button style="margin-right: 10px" @click="openPopover" slot="reference" type="primary">保存预设
</el-button>
<div class="save-setting">
......@@ -403,7 +414,7 @@ export default {
</template>
<div v-if="printSetting.byInk===2">
<el-form-item
label="利用底材的黑色">
label="利用底材的黑色">
<el-switch v-model="printSetting.bMaterialBlack"></el-switch>
</el-form-item>
</div>
......@@ -416,7 +427,7 @@ export default {
<div v-if="printSetting.byInk!==1"
>
<el-form-item
label="彩色的复合路径打印">
label="彩色的复合路径打印">
<el-switch v-model="printSetting.bMultiple"></el-switch>
</el-form-item>
</div>
......@@ -489,7 +500,7 @@ export default {
</template>
<div v-if="[2].includes(printSetting.byInk)">
<el-form-item
label="白色高速打印">
label="白色高速打印">
<el-switch v-model="printSetting.bFastMode"></el-switch>
</el-form-item>
</div>
......@@ -500,7 +511,7 @@ export default {
</template>
<div>
<el-form-item
label="白色分次打印">
label="白色分次打印">
<el-switch v-model="printSetting.bDivide"></el-switch>
</el-form-item>
</div>
......@@ -512,7 +523,7 @@ export default {
<div v-if="[2].includes(printSetting.byInk)"
>
<el-form-item
label="白色/彩色个别打印">
label="白色/彩色个别打印">
<el-switch v-model="printSetting.bPause"></el-switch>
</el-form-item>
</div>
......@@ -534,7 +545,7 @@ export default {
<div v-if="[2].includes(printSetting.byInk)"
>
<el-form-item
label="白色油墨的削减范围">
label="白色油墨的削减范围">
<div class="flex-row">
<el-slider :step="1" :min="0" :max="10" v-model="printSetting.byChoke"></el-slider>
<span>{{ printSetting.byChoke }}</span>
......@@ -549,7 +560,7 @@ export default {
<div v-if="[2].includes(printSetting.byInk)"
>
<el-form-item
label="最小白色油墨量">
label="最小白色油墨量">
<div class="flex-column">
<el-select v-model="printSetting.minWhiteInkType">
<el-option label="通常" :value="0"></el-option>
......@@ -615,7 +626,7 @@ export default {
<div v-if="[1].includes(printSetting.byInk)"
>
<el-form-item
label="单向打印">
label="单向打印">
<el-switch v-model="printSetting.bUniPrint"></el-switch>
</el-form-item>
</div>
......@@ -685,7 +696,7 @@ export default {
</template>
<div>
<el-form-item
label="单向打印">
label="单向打印">
<el-switch v-model="printSetting.bUniPrint"></el-switch>
</el-form-item>
</div>
......@@ -693,7 +704,7 @@ export default {
</div>
<el-button size="small" @click="setDetailShow">{{
detailShow ? '关闭详细设置' : '打开详细设置'
detailShow ? "关闭详细设置" : "打开详细设置"
}}...
</el-button>
</div>
......
<script>
import VueDragResizeRotate from "@minogin/vue-drag-resize-rotate";
import ImgSetting from './imgSetting.vue'
import bus from '@/bus'
import { grid } from "../data";
import ImgSetting from "./imgSetting.vue";
import bus from "@/bus";
import PrintDialog from "@/views/design/head/printDialog.vue";
import {debounce} from 'lodash'
import { debounce } from "lodash";
const img = require('../../../assets/bg_tshirt_shadow.png')
const img = require("../../../assets/bg_tshirt_shadow.png");
export default {
components: {
PrintDialog,
VueDragResizeRotate,
ImgSetting,
ImgSetting
},
destroyed() {
document.removeEventListener('keyup', this.keyup)
document.removeEventListener('dragover', this.dragover)
document.removeEventListener('drop', this.drop)
document.removeEventListener("keyup", this.keyup);
document.removeEventListener("dragover", this.dragover);
document.removeEventListener("drop", this.drop);
},
computed: {
sysSetting() {
if(this.$dataStore.get('setting')){
return this.$dataStore.get('setting')
}else{
return this.$store.getters.systemSetting
}
computed: {
gridWH() {
if (!this.systemSetting || !this.grid || !this.grid[this.systemSetting.gridValue]) return { w: 0, h: 0 };
return {
w: this.grid[this.systemSetting.gridValue].w,
h: this.grid[this.systemSetting.gridValue].h
};
},
gridSpacing() {
return this.sysSetting.gridSpacing.slice(0, 2) + 'px'
if (!this.systemSetting) return { w: 0, h: 0 };
if (this.systemSetting.unit === "mm") {
return { w: this.systemSetting.gridSpacing + "px", h: this.systemSetting.gridSpacing + "px" };
} else if (this.systemSetting.unit === "inch") {
console.log(this.systemSetting.gridValue);
let w = this.grid[this.systemSetting.gridValue].w;
let row = this.grid[this.systemSetting.gridValue].row;
let col = this.grid[this.systemSetting.gridValue].col;
let h = this.grid[this.systemSetting.gridValue].h;
return {
w: this.systemSetting.gridSpacing * ((w - row + 1) / row) + "px",
h: this.systemSetting.gridSpacing * ((h) / col) + "px"
};
}
},
computedGridSize() {
const getter = this.sysSetting
const num = getter.gridSpacing.slice(0, 2)
return 10 + 'px'
const getter = this.systemSetting;
const num = getter.gridSpacing.slice(0, 2);
return 10 + "px";
},
returnItem() {
if (this.selectIndex < 0) {
this.showImgSetting = false
return null
this.showImgSetting = false;
return null;
}
let item = this.imgList[this.selectIndex]
let item = this.imgList[this.selectIndex];
if (item) {
item = JSON.parse(JSON.stringify(item))
item.x = Number(item.x) - Number(item.w)
item.y = Number(item.y) + (Number(item.h) / 2)
return JSON.parse(JSON.stringify(this.imgList[this.selectIndex]))
item = JSON.parse(JSON.stringify(item));
item.x = Number(item.x) - Number(item.w);
item.y = Number(item.y) + (Number(item.h) / 2);
return JSON.parse(JSON.stringify(this.imgList[this.selectIndex]));
}
this.showImgSetting = false
return null
this.showImgSetting = false;
return null;
}
},
......@@ -58,9 +72,11 @@ export default {
return {
actionList: [],
parentWidth: 0,
systemSetting: {},
imgHeight: 0,
selectImgList: [],
bus: 0,
grid,
showImgSetting: false,
parentHeight: 0,
width: 0,
......@@ -75,26 +91,25 @@ export default {
row: 8,
img,
col: 7
}
};
},
watch: {
imgList: {
handler() {
if (this.imgList.length > 0) {
this.$nextTick(() => {
let dom = document.getElementsByClassName('drr')
let dom = document.getElementsByClassName("drr");
this.imgList.forEach((el, i) => {
let dom_i = document.getElementsByClassName('drr')[i]
dom_i.style.zIndex = dom_i.style.zIndex === '' || !dom_i.style.zIndex ? 0 : dom_i.style.zIndex
dom[i].addEventListener('click', (e) => {
this.selectIndex = i
this.selectItem(i)
})
})
})
let dom_i = document.getElementsByClassName("drr")[i];
dom_i.style.zIndex = dom_i.style.zIndex === "" || !dom_i.style.zIndex ? 0 : dom_i.style.zIndex;
dom[i].addEventListener("click", (e) => {
this.selectIndex = i;
this.selectItem(i);
});
});
});
}
this.$store.commit('changeImgList', this.imgList)
this.$store.commit("changeImgList", this.imgList);
},
deep: true,
immediate: true
......@@ -102,85 +117,85 @@ export default {
selectIndex() {
if (this.selectIndex >= 0) {
if (!this.showImgSetting) {
this.showImgSetting = true
this.showImgSetting = true;
}
} else {
this.showImgSetting = false
this.showImgSetting = false;
}
}
},
methods: {
async drop(e) {
let that = this
let that = this;
e.stopPropagation();
//阻止浏览器默认打开文件的操作
e.preventDefault();
console.log(e)
console.log(e);
const files = e.dataTransfer.files;
if (files.length === 0) return
if (files.length === 0) return;
for (let i = 0; i < files.length; i++) {
if (files[i].type !== 'image/png') {
return that.$message.warning('只能上传png格式文件')
if (files[i].type !== "image/png") {
return that.$message.warning("只能上传png格式文件");
}
let formData = new FormData()
formData.append('file', files[i])
let {data} = await that.$api.post('/uploadImage', formData, {
let formData = new FormData();
formData.append("file", files[i]);
let { data } = await that.$api.post("/uploadImage", formData, {
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
})
that.selectImgIndex = 0
});
that.selectImgIndex = 0;
that.addFile(data, file => {
that.imgHistoryList.push(JSON.parse(JSON.stringify(that.imgList)))
})
that.imgHistoryList.push(JSON.parse(JSON.stringify(that.imgList)));
});
}
},
dragover(e) {
e.stopPropagation();
//阻止浏览器默认打开文件的操作
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
e.dataTransfer.dropEffect = "copy";
},
keyup(e) {
console.log(e)
console.log(e);
if (e.keyCode == 90 && e.ctrlKey) {
let i = this.imgHistoryList.length - (2 + this.imgHistoryIndex)
let i = this.imgHistoryList.length - (2 + this.imgHistoryIndex);
if (this.imgHistoryList[i]) {
this.imgList = JSON.parse(JSON.stringify(this.imgHistoryList[i]))
this.imgHistoryIndex = this.imgHistoryIndex + 1
this.imgList = JSON.parse(JSON.stringify(this.imgHistoryList[i]));
this.imgHistoryIndex = this.imgHistoryIndex + 1;
}
}
if (this.selectIndex >= 0) {
if (e.keyCode === 38) {
//上
this.$set(this.imgList[this.selectIndex], 'y', Number(this.imgList[this.selectIndex].y) - 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.$set(this.imgList[this.selectIndex], "y", Number(this.imgList[this.selectIndex].y) - 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
if (e.keyCode === 40) {
//下
this.$set(this.imgList[this.selectIndex], 'y', Number(this.imgList[this.selectIndex].y) + 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.$set(this.imgList[this.selectIndex], "y", Number(this.imgList[this.selectIndex].y) + 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
if (e.keyCode === 37) {
//左
this.$set(this.imgList[this.selectIndex], 'x', Number(this.imgList[this.selectIndex].x) - 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.$set(this.imgList[this.selectIndex], "x", Number(this.imgList[this.selectIndex].x) - 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
if (e.keyCode === 39) {
//右
this.$set(this.imgList[this.selectIndex], 'x', Number(this.imgList[this.selectIndex].x) + 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.$set(this.imgList[this.selectIndex], "x", Number(this.imgList[this.selectIndex].x) + 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
}
if (e.keyCode === 8) {
if (this.selectIndex >= 0) {
this.imgList.splice(this.selectIndex, 1)
this.imgList.splice(this.selectIndex, 1);
if (this.imgList.length > 0) {
this.selectIndex = 0
this.selectIndex = 0;
} else {
this.selectIndex = -1
this.selectIndex = -1;
}
}
......@@ -188,23 +203,23 @@ export default {
},
debounce,
indexChange(v) {
console.log(v)
console.log(v);
if (this.imgList.length === 0) return;
let index = !this.imgList[this.selectIndex] ? 0 : this.selectIndex
let index = !this.imgList[this.selectIndex] ? 0 : this.selectIndex;
let item = this.$store.state.actionList[v]
let item = this.$store.state.actionList[v];
if (!item) return;
if (item.t === 'drag') {
this.$set(this.imgList[index], 'x', item.x)
this.$set(this.imgList[index], 'y', item.y)
} else if (item.t === 'resize') {
this.$set(this.imgList[index], 'x', item.x)
this.$set(this.imgList[index], 'y', item.y)
this.$set(this.imgList[index], 'w', item.w)
this.$set(this.imgList[index], 'h', item.h)
if (item.t === "drag") {
this.$set(this.imgList[index], "x", item.x);
this.$set(this.imgList[index], "y", item.y);
} else if (item.t === "resize") {
this.$set(this.imgList[index], "x", item.x);
this.$set(this.imgList[index], "y", item.y);
this.$set(this.imgList[index], "w", item.w);
this.$set(this.imgList[index], "h", item.h);
}
console.log()
console.log();
},
getOneMmsPx() {
// 创建一个1mm宽的元素插入到页面,然后坐等出结果
......@@ -222,67 +237,67 @@ export default {
// this.selectImgIndexList.push(i)
// this.selectImgIndexList = Array.from(new Set(this.selectImgIndexList))
this.getBackFile([it], file => {
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
})
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
});
},
ev(type) {
if (this.selectIndex < 0) return
if (this.selectIndex < 0) return;
// if (this.selectIndex === -1) this.selectIndex = 0
if (!this.imgList[this.selectIndex]) return
if (!this.imgList[this.selectIndex]) return;
let w = document.getElementById('line').clientWidth / 2
let h = document.getElementById('line').clientHeight / 2
let dom = document.getElementsByClassName('drr')[this.selectIndex]
let z_index = dom.style.zIndex === '' || !dom.style.zIndex ? 0 : dom.style.zIndex
let w = document.getElementById("line").clientWidth / 2;
let h = document.getElementById("line").clientHeight / 2;
let dom = document.getElementsByClassName("drr")[this.selectIndex];
let z_index = dom.style.zIndex === "" || !dom.style.zIndex ? 0 : dom.style.zIndex;
switch (type) {
case 'center':
this.$set(this.imgList[this.selectIndex], 'x', Number(w))
this.$set(this.imgList[this.selectIndex], 'y', Number(h))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
case "center":
this.$set(this.imgList[this.selectIndex], "x", Number(w));
this.$set(this.imgList[this.selectIndex], "y", Number(h));
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
case 'x_center':
this.$set(this.imgList[this.selectIndex], 'x', Number(w))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
case "x_center":
this.$set(this.imgList[this.selectIndex], "x", Number(w));
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
case 'y_center':
this.$set(this.imgList[this.selectIndex], 'y', Number(h))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
case "y_center":
this.$set(this.imgList[this.selectIndex], "y", Number(h));
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
case 'add_index':
case "add_index":
dom.style.zIndex = Number(z_index) + 1
console.log(dom.style.zIndex)
this.$set(this.imgList[this.selectIndex], 'zIndex', this.imgList[this.selectIndex].zIndex + 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
dom.style.zIndex = Number(z_index) + 1;
console.log(dom.style.zIndex);
this.$set(this.imgList[this.selectIndex], "zIndex", this.imgList[this.selectIndex].zIndex + 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
case 'reduce_index':
dom.style.zIndex = Number(z_index) - 1
console.log(dom.style.zIndex)
this.$set(this.imgList[this.selectIndex], 'zIndex', this.imgList[this.selectIndex].zIndex - 1)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
case "reduce_index":
dom.style.zIndex = Number(z_index) - 1;
console.log(dom.style.zIndex);
this.$set(this.imgList[this.selectIndex], "zIndex", this.imgList[this.selectIndex].zIndex - 1);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
default:
break
break;
}
},
formChange(form) {
// if (this.selectIndex === -1) this.selectIndex = 0
if (!this.imgList[this.selectIndex]) return
let f = JSON.parse(JSON.stringify(form))
let x_mm = f.x
let w_mm = f.w
let h_mm = f.h
let y_mm = f.y
this.$set(this.imgList[this.selectIndex], 'x', x_mm)
this.$set(this.imgList[this.selectIndex], 'y', y_mm)
this.$set(this.imgList[this.selectIndex], 'w', w_mm)
this.$set(this.imgList[this.selectIndex], 'h', h_mm)
this.$set(this.imgList[this.selectIndex], 'r', f.r)
this.$set(this.imgList[this.selectIndex], 'zIndex', f.zIndex)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
if (!this.imgList[this.selectIndex]) return;
let f = JSON.parse(JSON.stringify(form));
let x_mm = f.x;
let w_mm = f.w;
let h_mm = f.h;
let y_mm = f.y;
this.$set(this.imgList[this.selectIndex], "x", x_mm);
this.$set(this.imgList[this.selectIndex], "y", y_mm);
this.$set(this.imgList[this.selectIndex], "w", w_mm);
this.$set(this.imgList[this.selectIndex], "h", h_mm);
this.$set(this.imgList[this.selectIndex], "r", f.r);
this.$set(this.imgList[this.selectIndex], "zIndex", f.zIndex);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
},
close() {
this.showImgSetting = false
this.showImgSetting = false;
},
onDragDebounce(left, top, item, index) {
......@@ -290,8 +305,8 @@ export default {
dragStop(data, item) {
this.$set(item, 'y', data.y)
this.$set(item, 'x', data.x)
this.$set(item, "y", data.y);
this.$set(item, "x", data.x);
// console.log(left, top)
// if (!this.imgList[this.selectIndex]) return
// this.$set(this.imgList[this.selectIndex], 'x', left)
......@@ -302,17 +317,17 @@ export default {
// x: left,
// y: top
// })
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
// this.$store.commit('changeActionList', this.actionList)
},
resizeStop(data, item) {
// if (this.selectIndex === -1) this.selectIndex = 0
console.log('drag', this.selectIndex)
if (this.selectIndex < 0) return
this.$set(item, 'y', data.y)
this.$set(item, 'w', data.w)
this.$set(item, 'h', data.h)
this.$set(item, 'x', data.x)
console.log("drag", this.selectIndex);
if (this.selectIndex < 0) return;
this.$set(item, "y", data.y);
this.$set(item, "w", data.w);
this.$set(item, "h", data.h);
this.$set(item, "x", data.x);
// console.log(this.selectIndex,'resize',x, y, w, h)
// this.actionList.unshift({
......@@ -323,49 +338,49 @@ export default {
// h
// })
// this.$store.commit('changeActionList', this.actionList)
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
},
resizing(index) {
},
rotating(data, item) {
console.log(data)
this.$set(item, 'r', data.angle.toFixed(2))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
console.log(data);
this.$set(item, "r", data.angle.toFixed(2));
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
},
outsideClick(e) {
if (!(e.target.className.includes('drr') || e.target.className.includes('sucaitu-img'))) {
this.selectIndex = -1
this.close()
if (!(e.target.className.includes("drr") || e.target.className.includes("sucaitu-img"))) {
this.selectIndex = -1;
this.close();
}
},
selectItem(index) {
let dom = document.getElementsByClassName('drr')
let dom = document.getElementsByClassName("drr");
for (let i = 0; i < dom.length; i++) {
if (index !== i) {
dom[i].classList.remove("active")
dom[i].classList.add("inactive")
dom[i].classList.remove("active");
dom[i].classList.add("inactive");
}
}
this.selectIndex = index
this.selectIndex = index;
},
deSelect(index) {
console.log(index, 222222222)
this.close()
this.selectIndex = -1
console.log(index, 222222222);
this.close();
this.selectIndex = -1;
},
delImg(index) {
console.log(index, 'index')
this.imgList.splice(index, 1)
console.log(index, "index");
this.imgList.splice(index, 1);
if (this.imgList.length > 0) {
this.selectIndex = 0
this.showImgSetting = true
this.selectIndex = 0;
this.showImgSetting = true;
} else {
this.selectIndex = -1
this.selectIndex = -1;
}
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
},
fileToBase64(file) {
return new Promise((resolve, reject) => {
......@@ -374,7 +389,7 @@ export default {
// 读取 File 对象
reader.readAsDataURL(file);
// 加载完成后
reader.onload = function () {
reader.onload = function() {
// 将读取的数据转换为 base64 编码的字符串
const base64String = reader.result;
// 解析为 Promise 对象,并返回 base64 编码的字符串
......@@ -382,84 +397,92 @@ export default {
};
// 加载失败时
reader.onerror = function () {
reader.onerror = function() {
reject(new Error("Failed to load file"));
};
});
},
getBackFile(files, callback) {
console.log(files)
let that = this
console.log(files);
let that = this;
let bw = document.getElementById("line").clientWidth;
let bh = document.getElementById("line").clientHeight;
for (let i = 0; i < files.length; i++) {
files[i].url = files[i].productionFile
files[i].url = files[i].productionFile;
that.$nextTick(() => {
that.getImageSize(files[i].url).then(data => {
let w = document.getElementById('line').clientWidth / 2
let rate = data.height / data.width
let w = document.getElementById("line").clientWidth / 2;
let rate = data.height / data.width;
that.imgList.push({
url: files[i].url,
fileName: files[i].fileName,
rate,
w: 100,
w: bw * (2 / 3),
zIndex: that.imgList.length,
x: w,
y: (100 * rate) / 2,
h: 100 * rate,
r: 0,
y: (bw * (2 / 3) * rate) / 2,
h: bw * (2 / 3) * rate,
r: 0
});
that.selectIndex = that.imgList.length - 1
that.showImgSetting = true
that.selectIndex = that.imgList.length - 1;
that.showImgSetting = true;
if (i === files.length - 1) {
callback && callback()
callback && callback();
}
})
})
});
});
}
},
addFile(file, callback) {
let that = this
let that = this;
let bw = document.getElementById("line").clientWidth;
let bh = document.getElementById("line").clientHeight;
console.log(bw, bh);
that.$nextTick(() => {
that.getImageSize(file.url).then(data => {
let w = document.getElementById('line').clientWidth / 2
let rate = data.height / data.width
let w = document.getElementById("line").clientWidth / 2;
let rate = data.height / data.width;
that.imgList.push({
url: file.url,
w: 100,
w: bw * (2 / 3),
rate,
fileName: file.fileName,
zIndex: that.imgList.length,
x: w,
y: (100 * rate) / 2,
h: 100 * rate,
r: 0,
y: (bw * (2 / 3) * rate) / 2,
h: bw * (2 / 3) * rate,
r: 0
});
console.log(that.imgList)
that.selectIndex = that.imgList.length - 1
that.showImgSetting = true
callback && callback(file)
})
})
console.log(that.imgList);
that.selectIndex = that.imgList.length - 1;
that.showImgSetting = true;
callback && callback(file);
});
});
},
listenUpload() {
let that = this
that.parentWidth = document.getElementById('img').clientWidth
that.parentHeight = document.getElementById('img').clientHeight
let dp = document.getElementsByClassName('container')[0]
dp.addEventListener('dragover', this.dragover);
let that = this;
document.getElementById("img").onmousedown = function(e) {
e.preventDefault();
};
that.parentWidth = document.getElementById("img").clientWidth;
that.parentHeight = document.getElementById("img").clientHeight;
let dp = document.getElementsByClassName("container")[0];
dp.addEventListener("dragover", this.dragover);
dp.addEventListener("drop", this.drop);
},
getImageSize(url) {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
let image = new Image();
image.onload = function () {
image.onload = function() {
resolve({
width: image.width,
height: image.height
});
};
image.onerror = function () {
reject(new Error('error'));
image.onerror = function() {
reject(new Error("error"));
};
image.src = url;
});
......@@ -473,16 +496,16 @@ export default {
*/
changeImageColor(color = "#00ff7f", callback) {
let threshold = 114; //默认颜色阀值 为 114 ->和默认图相关
let img = new Image()
img.src = require('../../../assets/bg_tshirt_shadow.png');
let img = new Image();
img.src = require("../../../assets/bg_tshirt_shadow.png");
let newR = parseInt("0x" + color.substr(1, 2));
let newG = parseInt("0x" + color.substr(3, 2));
let newB = parseInt("0x" + color.substr(5, 2));
//图片加载后进行处理
img.onload = function () {
img.onload = function() {
let width = img.width, height = img.height, canvas = document.createElement("canvas"),
ctx = canvas.getContext("2d");
ctx = canvas.getContext("2d");
canvas.width = width;
canvas.height = height;
// 将源图片复制到画布上
......@@ -493,9 +516,9 @@ export default {
let i = 0;
while (i < data.length) {
let r = data[i++],
g = data[i++],
b = data[i++],
a = data[i++];
g = data[i++],
b = data[i++],
a = data[i++];
//计算透明度
let alp = (255 - r) / (255 - threshold);
//判断是否透明
......@@ -521,56 +544,61 @@ export default {
}
},
mounted() {
this.imgHeight = window.screen.height + 'px'
bus.$on('busEmit', (v) => {
let {type, value} = v
this.imgHeight = window.screen.height + "px";
this.systemSetting = this.$dataStore.get("setting");
bus.$on("busEmit", (v) => {
let { type, value } = v;
switch (type) {
case 'grid':
this.row = value.row
this.col = value.col
case "grid":
this.row = value.row;
this.col = value.col;
break;
case 'index':
this.indexChange(value)
case "index":
this.indexChange(value);
break;
case 'bg':
case "bg":
this.changeImageColor(value, (res) => {
this.img = res
})
this.img = res;
});
break;
case 'uploadImage':
case "updateSystemSetting":
console.log(this.$dataStore);
this.systemSetting = this.$dataStore.get("setting");
break;
case "uploadImage":
this.addFile(value, file => {
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
// this.selectImgList.push(file)
// this.selectImgIndex = this.selectImgList.length - 1
})
});
break;
case 'sendFile':
this.imgList = []
this.selectIndex = -1
case "sendFile":
this.imgList = [];
this.selectIndex = -1;
if (value.length > 0) {
console.log(value)
this.selectImgList = value
this.selectImgIndex = 0
console.log(value);
this.selectImgList = value;
this.selectImgIndex = 0;
this.getBackFile([value[0]], file => {
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)))
})
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
});
// this.addFile([value[0].file])
}
break;
default:
break;
}
})
});
document.addEventListener("keyup", this.keyup);
this.$nextTick(() => {
this.listenUpload();
});
document.addEventListener('keyup', this.keyup)
this.listenUpload()
document.getElementById('img').onmousedown = function (e) {
e.preventDefault()
}
}
}
};
</script>
<template>
......@@ -581,33 +609,33 @@ export default {
<div @click="selectImg(it,i)" v-for="(it,i) in selectImgList"
:key="i"
class="img-item">
<el-image style="width: 100px;height: auto;" :src="it.productionFile"
></el-image>
<img style="width: 100px;height: auto;" :src="it.productionFile" />
<span>{{ it.designId }}</span>
</div>
</div>
<div :style="{height:imgHeight}" id="img">
<div id="line" v-if="sysSetting.gridShow">
<div class="sucaitu" style="width:482px;height:542px">
<div id="line">
<div class="sucaitu"
:style="{width:gridWH.w+'px',height:gridWH.h+'px'}">
<vue-drag-resize-rotate
:w="item.w"
class-name="my-drag-resize-rotate"
:prevent-deactivation="false"
:h="item.h"
:x="item.x"
:z="item.zIndex"
:aspectRatio="true"
:isActive="index===selectIndex"
:y="item.y"
v-for="(item,index) in imgList"
:key="index"
:draggable="true"
:resizable="true"
:rotatable="true"
@dragstop="(a)=>dragStop(a,item)"
@resizestop="(a)=>resizeStop(a,item)"
@rotatestop="(a)=>rotating(a,item)"
:angle="item.r"
:w="item.w"
class-name="my-drag-resize-rotate"
:prevent-deactivation="false"
:h="item.h"
:x="item.x"
:z="item.zIndex"
:aspectRatio="true"
:isActive="index===selectIndex"
:y="item.y"
v-for="(item,index) in imgList"
:key="index"
:draggable="true"
:resizable="true"
:rotatable="true"
@dragstop="(a)=>dragStop(a,item)"
@resizestop="(a)=>resizeStop(a,item)"
@rotatestop="(a)=>rotating(a,item)"
:angle="item.r"
>
<div ref="sucaitu-img"
:class="{'active': index === selectIndex}"
......@@ -620,28 +648,22 @@ export default {
</vue-drag-resize-rotate>
</div>
<div v-if="$store.getters.systemSetting.gridShow" style="width:482px;height:542px" class="grid">
<div :style="{height:gridSpacing,lineHeight:gridSpacing}" class="grid-row" v-for="it in 100" :key="it">
<div :style="{width:gridSpacing,height:gridSpacing}"
<div v-if="systemSetting.gridShow===1"
:style="{width:gridWH.w+'px',height:gridWH.h+'px'}"
class="grid">
<div :style="{height:gridSpacing.h,lineHeight:gridSpacing.h}" class="grid-row" v-for="it in 100"
:key="it">
<div :style="{width:gridSpacing.w,height:gridSpacing.h}"
class="grid-col" v-for="it in 100" :key="it">
</div>
</div>
</div>
<!-- <table v-if="$store.getters.systemSetting.gridShow" border="none">-->
<!-- <tr :style="{height:computedGridSize}" style="width: 482px;overflow: hidden;"-->
<!-- v-for="it in Number((543/Number($store.getters.systemSetting.gridSpacing.slice(0,2))).toFixed(0))">-->
<!-- <td v-for="it in Number((482/Number($store.getters.systemSetting.gridSpacing.slice(0,2))).toFixed(0))"-->
<!-- :style="{width:computedGridSize ,height:computedGridSize}">-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
</div>
<img class="template-img" draggable="false" :src="img" alt="">
</div>
<print-dialog :imgList="imgList" :byPlatenSize="$store.getters.systemSetting.gridValue"/>
<print-dialog :imgList="imgList" :byPlatenSize="systemSetting.gridValue" />
</div>
</div>
<img-setting @ev="ev" @change="formChange" :item="returnItem" @close="close"
......@@ -684,6 +706,7 @@ export default {
white-space: nowrap;
}
.grid-row:nth-of-type(1) .grid-col {
border-top: none !important;
}
......@@ -694,12 +717,15 @@ export default {
.grid-row .grid-col:nth-of-type(1) {
border-left: none !important;
}
.grid .grid-row .grid-col {
display: inline-block;
border: 1px solid gray;
border-right: none;
border-bottom: none;
}
......
......@@ -4,144 +4,155 @@ export default {
data() {
return {
rules: {
company: [{validator: this.validatePass, required: true, trigger: 'blur'}],
loginName: [{message: '请输入用户名', required: true, trigger: 'blur'}],
password: [{message: '请输入密码', required: true, trigger: 'blur'}],
company: [{ validator: this.validatePass, required: true, trigger: "blur" }],
loginName: [{ message: "请输入用户名", required: true, trigger: "blur" }],
password: [{ message: "请输入密码", required: true, trigger: "blur" }]
},
companyList: [],
userList: [],
company: null,
authorityVisible: false,
remember: true,
authorityForm: {},
form: {
loginName: '',
user: '',
company: '',
password: ''
loginName: "",
user: "",
company: "",
password: ""
}
}
};
},
created() {
console.log(this.$dataStore, 'this.$dataStore')
this.company = this.$dataStore.get('company')
this.userList = this.$dataStore.get('userList') || []
// this.len = Object.keys(this.$dataStore.store).length
console.log(this.$dataStore, "this.$dataStore");
// this.$dataStore.set('deviceIdceshi03','b27a0777451f789521f4240e99f65913')
this.company = this.$dataStore.get("company");
this.userList = this.$dataStore.get("userList") || [];
if (this.company) {
this.form.company = this.company.domain
this.form.company = this.company.domain;
}
// if (user) {
// return this.$router.push('/design')
// }
this.getCompanyList()
this.getCompanyList();
},
mounted() {
document.addEventListener('keyup', this.keyUp)
document.addEventListener("keyup", this.keyUp);
},
beforeDestroy() {
document.removeEventListener('keyup', this.keyUp)
document.removeEventListener("keyup", this.keyUp);
},
methods: {
keyUp(e) {
console.log(e)
console.log(e);
if (e.keyCode === 13) {
this.login()
this.login();
}
},
submitAuthority() {
this.$refs.authorityForm.validate((v) => {
if (v) {
this.$api.post('/commitApply', {
this.$api.post("/commitApply", {
...this.authorityForm,
...this.form
}, {
headers: {
'company': this.form.company + '.jomalls.com'
"company": this.form.company + ".jomalls.com"
}
}).then((res) => {
if (res.code === 200) {
this.authorityVisible = false
this.$message.success('申请提交成功')
this.$dataStore.set('deviceId' + this.form.loginName, res.data.id)
this.authorityVisible = false;
this.$message.success("申请提交成功");
this.$dataStore.set("deviceId" + this.form.loginName, res.data.id);
}
})
});
}
})
});
},
validatePass(rule, value, callback) {
if (!value || value === '') {
return callback(new Error('请输入客户(例如demo)'));
if (!value || value === "") {
return callback(new Error("请输入客户(例如demo)"));
}
let item = this.companyList.find(item => item.domain.replace('.jomalls.com', '') === value)
let item = this.companyList.find(item => item.domain.replace(".jomalls.com", "") === value);
if (item) {
return callback()
return callback();
} else {
return callback(new Error('未查找到该客户'))
return callback(new Error("未查找到该客户"));
}
},
async login() {
// if (this.form.auth) {
// this.$dataStore.set(this.form.auth.split(",")[0], this.form.auth.split(",")[1]);
// console.log("存储成功");
// console.log(this.$dataStore.store);
//
// }
this.$refs.formRef.validate(async valid => {
if (valid) {
let f = JSON.parse(JSON.stringify(this.form))
if (f.company.split('.').length === 1) {
f.company = f.company + '.jomalls.com'
let f = JSON.parse(JSON.stringify(this.form));
if (f.company.split(".").length === 1) {
f.company = f.company + ".jomalls.com";
}
if (!f.deviceId) {
f.deviceId = this.$dataStore.get('deviceId' + this.form.loginName)
f.deviceId = this.$dataStore.get("deviceId" + this.form.loginName);
}
if (!f.deviceId) delete f.deviceId
let {data, code, message} = await this.$api.post('/login', f)
if (!f.deviceId) delete f.deviceId;
let { data, code, message } = await this.$api.post("/login", f);
if (code === 411) {
this.authorityVisible = true
this.authorityForm = {}
return this.$message.error(message)
this.authorityVisible = true;
this.authorityForm = {};
return this.$message.error(message);
}
data = {
...data.sysUser,
...{
token: data.token
}
}
delete data.sysMenus
delete data.sysUser
let item = this.companyList.find(item => item.domain === f.company)
console.log(item, 111222)
this.$dataStore.set('user', data)
this.$dataStore.set('company', item)
};
delete data.sysMenus;
delete data.sysUser;
let item = this.companyList.find(item => item.domain === f.company);
console.log(item, 111222);
this.$dataStore.set("user", data);
this.$dataStore.set("company", item);
if (this.remember) {
let userList = this.$dataStore.get('userList')
let userList = this.$dataStore.get("userList");
if (userList && !userList.find(el => el.loginName === f.loginName && el.company === f.company)) {
userList.push(f)
userList.push(f);
} else {
userList = [f]
userList = [f];
}
this.$dataStore.set('userList', userList)
this.$dataStore.set("userList", userList);
}
await this.$router.push('/design')
await this.$router.push("/design");
}
})
});
},
userChange(v) {
if (v === '') {
this.form.deviceId = ''
return
if (v === "") {
this.form.deviceId = "";
return;
}
console.log(this.userList, v)
this.form.company = this.userList[v].company.split('.')[0]
this.form.loginName = this.userList[v].loginName
this.form.password = this.userList[v].password
this.form.deviceId = this.userList[v].deviceId
console.log(this.userList, v);
this.form.company = this.userList[v].company.split(".")[0];
this.form.loginName = this.userList[v].loginName;
this.form.password = this.userList[v].password;
this.form.deviceId = this.userList[v].deviceId;
},
async getCompanyList() {
let {data} = await this.$api.get('/getCompanyList')
this.companyList = data.records
let { data } = await this.$api.get("/getCompanyList");
this.companyList = data.records;
}
}
}
};
</script>
<template>
......@@ -177,6 +188,10 @@ export default {
<el-input placeholder="密码" show-password prefix-icon="el-icon-lock" type="password" v-model="form.password"
clearable></el-input>
</el-form-item>
<!-- <el-form-item v-if="len===0" prop="授权信息">-->
<!-- <el-input placeholder="授权信息" prefix-icon="el-icon-lock" v-model="form.auth"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<div class="check">
<el-checkbox v-model="remember">记住账号</el-checkbox>
</div>
......@@ -188,16 +203,16 @@ export default {
</el-form>
</div>
<el-dialog
:close-on-click-modal="false"
title="权限申请"
:visible.sync="authorityVisible"
top="15%"
width="400px">
:close-on-click-modal="false"
title="权限申请"
:visible.sync="authorityVisible"
top="15%"
width="400px">
<el-form
:model="authorityForm"
size="mini"
ref="authorityForm"
label-width="80px">
:model="authorityForm"
size="mini"
ref="authorityForm"
label-width="80px">
<el-form-item label="设备名称" prop="deviceName" required>
<el-input v-model="authorityForm.deviceName"></el-input>
</el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment