EAN8

EAN-8은 EAN/UPC 기호 바코드이며, 길이가 더 긴 국제 상품 번호(EAN-13) 코드에서 파생되었습니다. EAN-8 코드는 전 세계에서 통용되며, 회사에서 자사 스토어에서만 판매되는 자사 제품을 식별하기 위해 사용할 수도 있습니다.

설명
app.vue
index.html

수식에서 BC_EAN8 함수를 사용하여 EAN-8 바코드를 만들 수 있습니다: =BC_EAN8(value, color, backgroudColor, showLabel, labelPosition, fontFamily, fontStyle, fontWeight, fontTextDecoration, fontTextAlign, fontSize, quietZonLeft, quietZoneRight, quietZoneTop, quietZoneBottom).

이 함수에는 다음과 같은 매개 변수가 있습니다:

value: 이 유형은 길이가 7-8자 사이인 숫자여야 합니다.

showLabel: 이 값은 바코드에 레이블이 있는 경우 레이블 텍스트를 표시할지 여부를 나타냅니다.

labelPosition: 이 값은 레이블이 표시되는 경우의 레이블 위치를 나타냅니다.

수식에서 BC_EAN8 함수를 사용하여 EAN-8 바코드를 만들 수 있습니다: =BC_EAN8(value, color, backgroudColor, showLabel, labelPosition, fontFamily, fontStyle, fontWeight, fontTextDecoration, fontTextAlign, fontSize, quietZonLeft, quietZoneRight, quietZoneTop, quietZoneBottom). 이 함수에는 다음과 같은 매개 변수가 있습니다: value: 이 유형은 길이가 7-8자 사이인 숫자여야 합니다. showLabel: 이 값은 바코드에 레이블이 있는 경우 레이블 텍스트를 표시할지 여부를 나타냅니다. labelPosition: 이 값은 레이블이 표시되는 경우의 레이블 위치를 나타냅니다.
<template> <div class="sample-tutorial"> <gc-spread-sheets class="sample-spreadsheets" @workbook-initialized="initSpread"> <gc-worksheet :auto-generate-columns="autoGenerateColumns" /> </gc-spread-sheets> </div> </template> <script setup> import { ref } from 'vue'; import '@mescius/spread-sheets-vue'; import GC from '@mescius/spread-sheets'; import '@mescius/spread-sheets-barcode'; import '@mescius/spread-sheets-resources-ko'; GC.Spread.Common.CultureManager.culture("ko-kr"); const autoGenerateColumns = ref(true); const spread = ref(null); const initSpread = (spreadInstance) => { spread.value = spreadInstance; spreadInstance.suspendPaint(); const sheet = spreadInstance.getSheet(0); sheet.name("customSheet"); let pos = [1, 2, 6]; let dataArray = [ ["Value length is 7", 4137962], ["Value length is 8", 81424863], ["Value length is 8", 81424865] ]; sheet.setArray(1, 1, dataArray); sheet.setArray(3, 1, dataArray); for (let i = 0; i < pos.length; i++) { sheet.addSpan(1, pos[i], 2, 1); } sheet.addSpan(1, 3, 1, 3); sheet.setValue(1, 1, "Name"); sheet.setValue(1, 2, "Number"); sheet.setValue(1, 3, "EAN-8"); sheet.setValue(1, 6, "Explain"); sheet.setValue(2, 3, "Default"); sheet.setValue(2, 4, "Change showLabel"); sheet.setValue(2, 5, "Change labelPosition"); sheet.setColumnWidth(0, 20); for (let row = 3; row < 6; row++) { sheet.setRowHeight(row, 100); } for (let col = 1; col < 7; col++) { sheet.setColumnWidth(col, 200); } sheet .getRange(1, 1, 2, 6) .foreColor("#000") .backColor("#FFF3CE") .setBorder( new GC.Spread.Sheets.LineBorder( "orange", GC.Spread.Sheets.LineStyle.thin ), { all: true } ); sheet .getRange(1, 1, 5, 6) .vAlign(GC.Spread.Sheets.VerticalAlign.center) .hAlign(GC.Spread.Sheets.HorizontalAlign.center) .setBorder( new GC.Spread.Sheets.LineBorder( "orange", GC.Spread.Sheets.LineStyle.medium ), { outline: true } ); sheet .getCell(5, 6) .foreColor("red") .wordWrap(true); for (let row = 3; row < 6; row++) { sheet.setFormula(row, 3, "=BC_EAN8(C" + (row + 1) + ")"); sheet.setFormula(row, 4, "=BC_EAN8(C" + (row + 1) + ",,,0)"); sheet.setFormula(row, 5, "=BC_EAN8(C" + (row + 1) + ',,,,"top")'); } sheet.setValue( 5, 6, "No EAN-8 generated, because the last digit is check-sum digit and it is invalid" ); spreadInstance.resumePaint(); }; </script> <style scoped> #app { height: 100%; } .sample-tutorial { position: relative; height: 100%; overflow: hidden; } .sample-spreadsheets { width: 100%; height: 100%; overflow: hidden; float: left; } .options-container legend { text-align: center; } .option-row { font-size: 14px; padding: 5px; } input { display: block; width: 100%; margin: 8px 0; box-sizing: border-box; } label, input { padding: 4px 6px; } body { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } #app { height: 100%; } #drawUnderline { display: inline-block; width: 30px; } #drawUnderlineLabel { display: inline-block; } #allowAutoCreateHyperlink { display: inline-block; width: 30px; } #setHyperlinkButton { font-weight: bold; background-color: #ecf3ff; width: 200px; height: 35px; border-radius: 4px; border-color: #0b93d5; border-width: thin; } #settingsDiv { margin-top: "10px" } #settingString { padding: "2px 10px } #allowAutoCreateHyperlinkDiv { margin-top: "10px" } </style>
<!DOCTYPE html> <html style="height:100%;font-size:14px;"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>SpreadJS VUE</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/ko/vue3/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <script src="$DEMOROOT$/ko/vue3/node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script src="compiler.js" type="module"></script> <script> var System = SystemJS; System.import("./src/app.js"); System.import('$DEMOROOT$/ko/lib/vue3/license.js'); </script> </head> <body> <div id="app"></div> </body> </html>
(function (global) { SystemJS.config({ transpiler: 'plugin-babel', babelOptions: { es2015: true }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, packageConfigPaths: [ './node_modules/*/package.json', "./node_modules/@mescius/*/package.json", "./node_modules/@babel/*/package.json", "./node_modules/@vue/*/package.json" ], map: { 'vue': "npm:vue/dist/vue.esm-browser.js", 'tiny-emitter': 'npm:tiny-emitter/index.js', 'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js', "systemjs-babel-build": "npm:systemjs-plugin-babel/systemjs-babel-browser.js", '@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js', '@mescius/spread-sheets-resources-ko': 'npm:@mescius/spread-sheets-resources-ko/index.js', '@mescius/spread-sheets-vue': 'npm:@mescius/spread-sheets-vue/index.js', '@mescius/spread-sheets-barcode': 'npm:@mescius/spread-sheets-barcode/index.js', }, meta: { '*.css': { loader: 'systemjs-plugin-css' }, '*.vue': { loader: "../plugin-vue/index.js" } } }); })(this);