도형 선 종류를 변경할 수 있으며, 겹선 종류를 사용할 수 있습니다.
<template>
<div class="sample-tutorial">
<gc-spread-sheets class="sample-spreadsheets" @workbookInitialized="initSpread">
</gc-spread-sheets>
<div class="options-container">
<div class="option-row">
Select a shape then change the line format to see the effect:
</div>
<hr />
<div class="option-row">
<label>Change Shapes line, use different compound type</label>
<select id="changeCompoundType" :value="compoundType" @change="updateCompoundType($event)">
<option value="0" selected>Simple</option>
<option value="1">Double</option>
<option value="2">Thick Thin</option>
<option value="3">Thin Thick</option>
<option value="4">Triple</option>
</select>
<br />
</div>
</div>
</template>
<script>
import Vue from "vue";
import "@mescius/spread-sheets-vue";
import "@mescius/spread-sheets-shapes";
import GC from "@mescius/spread-sheets";
import '@mescius/spread-sheets-resources-ko';
GC.Spread.Common.CultureManager.culture("ko-kr");
let App = Vue.extend({
name: "app",
data: function () {
return {
spread: null,
compoundType: '0'
};
},
methods: {
initSpread(spread) {
var self = this;
self.spread = spread;
let sheet = spread.getActiveSheet();
var rectangle = sheet.shapes.add('rectangle', GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 50, 200, 100);
var shapeStyle1 = rectangle.style();
shapeStyle1.fill.color = '#FFE4B3';
shapeStyle1.line.color = "black";
shapeStyle1.line.width = 10;
shapeStyle1.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.simple;
rectangle.style(shapeStyle1);
var rightArrow = sheet.shapes.add('rightArrow', GC.Spread.Sheets.Shapes.AutoShapeType.rightArrow, 400, 50, 200, 100);
var shapeStyle2 = rightArrow.style();
shapeStyle2.fill.color = '#FFE4B3';
shapeStyle2.line.color = "black";
shapeStyle2.line.width = 10;
shapeStyle2.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.double;
rightArrow.style(shapeStyle2);
var hexagon = sheet.shapes.add('hexagon', GC.Spread.Sheets.Shapes.AutoShapeType.hexagon, 100, 200, 200, 100);
var shapeStyle3 = hexagon.style();
shapeStyle3.fill.color = '#FFE4B3';
shapeStyle3.line.color = "black";
shapeStyle3.line.width = 10;
shapeStyle3.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.thickThin;
hexagon.style(shapeStyle3);
var mathMultiply = sheet.shapes.add('mathMultiply', GC.Spread.Sheets.Shapes.AutoShapeType.mathMultiply, 400, 200, 200, 100);
var shapeStyle4 = mathMultiply.style();
shapeStyle4.fill.color = '#FFE4B3';
shapeStyle4.line.color = "black";
shapeStyle4.line.width = 10;
shapeStyle4.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.thinThick;
mathMultiply.style(shapeStyle4);
var cross = sheet.shapes.add('cross', GC.Spread.Sheets.Shapes.AutoShapeType.cross, 100, 350, 200, 100);
var shapeStyle5 = cross.style();
shapeStyle5.fill.color = '#FFE4B3';
shapeStyle5.line.color = "black";
shapeStyle5.line.width = 10;
shapeStyle5.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.triple;
cross.style(shapeStyle5);
sheet.bind(GC.Spread.Sheets.Events.ShapeSelectionChanged, function () {
sheet.shapes.all().forEach(function (sp) {
if (sp.isSelected() && sp instanceof GC.Spread.Sheets.Shapes.Shape) {
self.compoundType = sp.style().line.compoundType;
}
});
});
},
setCompoundType(spread, value) {
let activeSheet = spread.getActiveSheet();
let shapes = activeSheet.shapes.all();
for (let i = 0; i < shapes.length; i++) {
let shape = shapes[i];
if (shape.isSelected()) {
var shapeStyle = shape.style();
shapeStyle.line.compoundType = value;
shape.style(shapeStyle);
}
}
},
updateCompoundType(e) {
switch (e.target.value) {
case '0':
this.setCompoundType(this.spread, GC.Spread.Sheets.Shapes.CompoundType.simple);
return;
case '1':
this.setCompoundType(this.spread, GC.Spread.Sheets.Shapes.CompoundType.double);
return;
case '2':
this.setCompoundType(this.spread, GC.Spread.Sheets.Shapes.CompoundType.thickThin);
return;
case '3':
this.setCompoundType(this.spread, GC.Spread.Sheets.Shapes.CompoundType.thinThick);
return;
case '4':
this.setCompoundType(this.spread, GC.Spread.Sheets.Shapes.CompoundType.triple);
return;
default:
return;
}
}
},
});
new Vue({
render: h => h(App)
}).$mount("#app");
</script>
<style scoped>
.sample-tutorial {
position: relative;
height: 100%;
overflow: hidden;
}
.sample-spreadsheets {
width: calc(100% - 280px);
height: 100%;
overflow: hidden;
float: left;
}
.options-container {
float: right;
width: 280px;
padding: 12px;
height: 100%;
box-sizing: border-box;
background: #fbfbfb;
overflow: auto;
}
.options-container {
float: right;
width: 280px;
padding: 12px;
height: 100%;
box-sizing: border-box;
background: #fbfbfb;
overflow: auto;
}
.option-row {
font-size: 14px;
padding: 5px;
margin-top: 5px;
}
.sample-options {
z-index: 1000;
}
label {
display: block;
margin-bottom: 6px;
}
p {
padding: 2px 10px;
background-color: #F4F8EB;
}
input {
padding: 4px 6px;
width: 160px;
}
input[type="button"] {
margin-top: 6px;
display: block;
}
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
<!doctype html>
<html style="height:100%;font-size:14px;">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="$DEMOROOT$/ko/vue/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css">
<!-- SystemJS -->
<script src="$DEMOROOT$/ko/vue/node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('./src/app.vue');
System.import('$DEMOROOT$/ko/lib/vue/license.js');
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>
(function (global) {
System.config({
transpiler: 'plugin-babel',
babelOptions: {
es2015: true
},
meta: {
'*.css': { loader: 'css' },
'*.vue': { loader: 'vue-loader' }
},
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
'@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js',
'@mescius/spread-sheets-vue': 'npm:@mescius/spread-sheets-vue/index.js',
'@mescius/spread-sheets-shapes': 'npm:@mescius/spread-sheets-shapes/index.js',
'@mescius/spread-sheets-resources-ko': 'npm:@mescius/spread-sheets-resources-ko/index.js',
'@grapecity/jsob-test-dependency-package/react-components': 'npm:@grapecity/jsob-test-dependency-package/react-components/index.js',
'jszip': 'npm:jszip/dist/jszip.js',
'css': 'npm:systemjs-plugin-css/css.js',
'vue': 'npm:vue/dist/vue.min.js',
'vue-loader': 'npm:systemjs-vue-browser/index.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'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
src: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
"node_modules": {
defaultExtension: 'js'
}
}
});
})(this);