bim-tools
v2.0.1
Published
Using npm: ``` npm install bim-tools --save
Downloads
3
Readme
bim-tools
Install
Using npm:
npm install bim-tools --save
const bimTools = require("bim-tools");
import 'bim-tools/dist/bimTools.css'
bimTools.init(config)
Using html:
<script src="./bimTools.umd.min.js"></script>
<link rel="stylesheet" href="./bimTools.css">
<div id="bim"></div>
<script>
console.log(bimTools)
bimTools.init(config)
</script>
config
{
el: "bim",
dataList: [
{
children: [
{
title: "批注",
icon: `<svg
t="1612319024678"
class="icon"
viewBox="0 0 1026 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1315"
width="64"
height="64"
>
<path
d="M581.02670127 601.71530892c-7.3100779-2.71605889-14.57359506-5.29243478-21.79055145-7.66704594-4.57849877-1.50547259-42.74300485-21.99231547-15.44273433-69.43798255l-0.23280526 1e-8c47.07317812-48.48552917 83.03379657-126.53729748 83.03379657-203.36295997 0-118.12527576-78.54841933-180.03589541-169.8235141-180.03589541C365.41819663 141.21142578 287.28882633 203.12204544 287.28882633 321.24732119c0 77.136069 35.80541448 155.51376481 83.14243907 203.87513051 18.43815925 48.40792717-14.62015655 66.20975241-21.46462467 68.92581128C177.88597954 661.99629324 141.21142578 753.86116055 141.21142578 753.86116055l0 128.92742961 290.2147585-1e-8 49.47883049-180.53254571L581.02670127 601.71530892 581.02670127 601.71530892zM763.96489935 631.4522723l-27.92108428-27.98316529 0.15520327-0.17072352-37.38848906-37.34192756L528.73868965 734.50730198c-2.32805038 1.87796085-4.314653 4.26809224-5.21483278 7.35663939l-39.51477469 140.92464878 144.15287894-36.31758575c2.88678242-0.85361829 5.12171054-2.6384569 6.95311063-4.79578377l170.47536839-168.9698958-41.45481655-41.42377604L763.96489935 631.4522723 763.96489935 631.4522723zM530.11999948 839.45581204c0 0 16.97924744-67.57554198 19.60218408-79.61932265 36.10030075 15.4892951 60.45170783 60.43618758 60.45170784 60.43618759L530.11999948 839.45581204zM714.25326362 548.97720777l106.79543039 106.76438987 24.42900835-22.90801551-106.81095064-106.77991015L714.25326362 548.97720777zM873.55398991 547.44069467l-51.18606708-51.15502657c-14.12350553-14.12350553-36.90735829-14.26318853-50.87566055-0.27936602l-15.69105914 15.84626311 102.31005315 102.35661464 15.72210036-15.89282387C887.80165819 584.37909346 887.67749543 561.57972045 873.55398991 547.44069467L873.55398991 547.44069467zM873.55398991 547.44069467"
p-id="1316"
></path>
</svg>`,
event: () => {
console.log(111);
},
children: [
{
title: "批注",
icon: `<svg
t="1612319024678"
class="icon"
viewBox="0 0 1026 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1315"
width="64"
height="64"
>
<path
d="M581.02670127 601.71530892c-7.3100779-2.71605889-14.57359506-5.29243478-21.79055145-7.66704594-4.57849877-1.50547259-42.74300485-21.99231547-15.44273433-69.43798255l-0.23280526 1e-8c47.07317812-48.48552917 83.03379657-126.53729748 83.03379657-203.36295997 0-118.12527576-78.54841933-180.03589541-169.8235141-180.03589541C365.41819663 141.21142578 287.28882633 203.12204544 287.28882633 321.24732119c0 77.136069 35.80541448 155.51376481 83.14243907 203.87513051 18.43815925 48.40792717-14.62015655 66.20975241-21.46462467 68.92581128C177.88597954 661.99629324 141.21142578 753.86116055 141.21142578 753.86116055l0 128.92742961 290.2147585-1e-8 49.47883049-180.53254571L581.02670127 601.71530892 581.02670127 601.71530892zM763.96489935 631.4522723l-27.92108428-27.98316529 0.15520327-0.17072352-37.38848906-37.34192756L528.73868965 734.50730198c-2.32805038 1.87796085-4.314653 4.26809224-5.21483278 7.35663939l-39.51477469 140.92464878 144.15287894-36.31758575c2.88678242-0.85361829 5.12171054-2.6384569 6.95311063-4.79578377l170.47536839-168.9698958-41.45481655-41.42377604L763.96489935 631.4522723 763.96489935 631.4522723zM530.11999948 839.45581204c0 0 16.97924744-67.57554198 19.60218408-79.61932265 36.10030075 15.4892951 60.45170783 60.43618758 60.45170784 60.43618759L530.11999948 839.45581204zM714.25326362 548.97720777l106.79543039 106.76438987 24.42900835-22.90801551-106.81095064-106.77991015L714.25326362 548.97720777zM873.55398991 547.44069467l-51.18606708-51.15502657c-14.12350553-14.12350553-36.90735829-14.26318853-50.87566055-0.27936602l-15.69105914 15.84626311 102.31005315 102.35661464 15.72210036-15.89282387C887.80165819 584.37909346 887.67749543 561.57972045 873.55398991 547.44069467L873.55398991 547.44069467zM873.55398991 547.44069467"
p-id="1316"
></path>
</svg>`,
event: () => {
console.log(111);
}
},
{
title: "二级",
icon: `<svg t="1612337489141" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4840" width="64" height="64"><path d="M481.78500516 300.85507477l276.60487911 2.60474112v70.53266245l171.07566175-98.79410166-171.07566175-98.79410164v86.19831902H505.5253583l-43.4433576-2.60474111-177.79217129 189.79258529 28.85680782 28.89401936 168.63836793-177.82938283z m276.60487911 451.92254672l-235.76626263-2.62334645-245.03169808-245.0875133H94.51584863v40.83861648h163.35446595l245.03169726 245.0875133 255.46926709 2.6419518v70.53266246l171.07566175-98.81270701-171.07566175-98.79410083v86.21692355z" fill="#1F3645" p-id="4841"></path></svg>`,
event: () => {
console.log(111);
}
}
]
},
{
title: "设置",
icon: `<svg
t="1612319087634"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="4441"
width="64"
height="64"
>
<path
d="M455.46773274 565.4683431c4.94384766 11.74163818-1.23596192 40.16876221-20.39337158 51.91040039 0 0-130.39398193 63.65203857-135.33782959 213.82141113H144.0053304V230.52266438c0-17.3034668 24.10125732-29.04510498 24.10125733-29.04510498h252.13623047c9.88769531 0 24.10125732 11.74163818 24.10125732 29.04510499v86.51733398s-33.98895263 22.86529541-33.98895264 115.56243897c-4.3258667 92.69714356 40.16876221 127.30407715 45.11260987 132.86590576zM233.61256917 264.51161702c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.51702881c16.68548584 0 29.66308594-14.21356201 29.66308594-31.51702881 0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.51702881z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.51702881c16.68548584 0 29.66308594-14.21356201 29.66308593-31.51702881 0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.51702881zM233.61256917 390.57973226c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308594-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.5170288z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308593-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.5170288zM233.61256917 516.64784749c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.5170288 29.66308594-14.21356201 29.66308594-31.5170288c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.51702881z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.5170288 29.66308594-14.21356201 29.66308593-31.5170288c0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.51702881zM233.61256917 642.71596273c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308594-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.5170288z"
p-id="4442"
></path>
<path
d="M742.82887776 642.71596273V548.1648763c0-17.3034668 13.59558106-31.51702881 29.66308594-31.51702881s29.66308594 14.21356201 29.66308594 31.51702881v94.55108643H891.76228841c16.68548584 0 29.66308594 14.21356201 29.66308594 31.5170288s-13.59558106 31.51702881-29.66308594 31.51702881h-89.60723877v94.55108643c0 17.3034668-13.59558106 31.51702881-29.66308594 31.5170288s-29.66308594-14.21356201-29.66308594-31.5170288V705.75002034H653.221639c-16.68548584 0-29.66308594-14.21356201-29.66308595-31.51702881s13.59558106-31.51702881 29.66308594-31.5170288h89.60723877z m12.9776001-188.4841919v-9.26971435c0-71.06781006-55.61828614-129.15802002-124.21417236-129.15802002-68.59588623 0-124.83215333 57.47222901-124.83215332 129.15802002 0 56.85424805 35.84289551 105.0567627 85.28137207 122.36022948v61.79809571C508.61409505 646.42384846 444.34407552 717.49165853 433.83839925 805.86293538h-0.61798095v0.61798096c0 14.21356201-11.12365723 25.9552002-24.71923829 25.95520019s-24.71923828-11.12365723-24.71923828-25.95520019v-2.47192383c0-3.08990479 0.61798096-5.56182862 1.23596191-8.03375244C397.37752278 706.3680013 453.61378987 629.73836263 533.33333333 594.51344807c-47.58453369-33.37097168-76.01165771-88.98925781-76.01165771-148.93341063 0-99.49493408 77.86560059-180.45043945 174.27062988-180.45043947s174.27062989 80.95550537 174.27062988 180.45043947v9.26971435l-50.05645752-0.61798096z"
p-id="4443"
></path>
</svg>`,
event: () => {
console.log("设置");
}
}
]
},
{
children: [
{
title: "批注",
icon: `<svg
t="1612319024678"
class="icon"
viewBox="0 0 1026 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1315"
width="64"
height="64"
>
<path
d="M581.02670127 601.71530892c-7.3100779-2.71605889-14.57359506-5.29243478-21.79055145-7.66704594-4.57849877-1.50547259-42.74300485-21.99231547-15.44273433-69.43798255l-0.23280526 1e-8c47.07317812-48.48552917 83.03379657-126.53729748 83.03379657-203.36295997 0-118.12527576-78.54841933-180.03589541-169.8235141-180.03589541C365.41819663 141.21142578 287.28882633 203.12204544 287.28882633 321.24732119c0 77.136069 35.80541448 155.51376481 83.14243907 203.87513051 18.43815925 48.40792717-14.62015655 66.20975241-21.46462467 68.92581128C177.88597954 661.99629324 141.21142578 753.86116055 141.21142578 753.86116055l0 128.92742961 290.2147585-1e-8 49.47883049-180.53254571L581.02670127 601.71530892 581.02670127 601.71530892zM763.96489935 631.4522723l-27.92108428-27.98316529 0.15520327-0.17072352-37.38848906-37.34192756L528.73868965 734.50730198c-2.32805038 1.87796085-4.314653 4.26809224-5.21483278 7.35663939l-39.51477469 140.92464878 144.15287894-36.31758575c2.88678242-0.85361829 5.12171054-2.6384569 6.95311063-4.79578377l170.47536839-168.9698958-41.45481655-41.42377604L763.96489935 631.4522723 763.96489935 631.4522723zM530.11999948 839.45581204c0 0 16.97924744-67.57554198 19.60218408-79.61932265 36.10030075 15.4892951 60.45170783 60.43618758 60.45170784 60.43618759L530.11999948 839.45581204zM714.25326362 548.97720777l106.79543039 106.76438987 24.42900835-22.90801551-106.81095064-106.77991015L714.25326362 548.97720777zM873.55398991 547.44069467l-51.18606708-51.15502657c-14.12350553-14.12350553-36.90735829-14.26318853-50.87566055-0.27936602l-15.69105914 15.84626311 102.31005315 102.35661464 15.72210036-15.89282387C887.80165819 584.37909346 887.67749543 561.57972045 873.55398991 547.44069467L873.55398991 547.44069467zM873.55398991 547.44069467"
p-id="1316"
></path>
</svg>`,
event: () => {
console.log(111);
},
children: [
{
title: "批注",
icon: `<svg
t="1612319024678"
class="icon"
viewBox="0 0 1026 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1315"
width="64"
height="64"
>
<path
d="M581.02670127 601.71530892c-7.3100779-2.71605889-14.57359506-5.29243478-21.79055145-7.66704594-4.57849877-1.50547259-42.74300485-21.99231547-15.44273433-69.43798255l-0.23280526 1e-8c47.07317812-48.48552917 83.03379657-126.53729748 83.03379657-203.36295997 0-118.12527576-78.54841933-180.03589541-169.8235141-180.03589541C365.41819663 141.21142578 287.28882633 203.12204544 287.28882633 321.24732119c0 77.136069 35.80541448 155.51376481 83.14243907 203.87513051 18.43815925 48.40792717-14.62015655 66.20975241-21.46462467 68.92581128C177.88597954 661.99629324 141.21142578 753.86116055 141.21142578 753.86116055l0 128.92742961 290.2147585-1e-8 49.47883049-180.53254571L581.02670127 601.71530892 581.02670127 601.71530892zM763.96489935 631.4522723l-27.92108428-27.98316529 0.15520327-0.17072352-37.38848906-37.34192756L528.73868965 734.50730198c-2.32805038 1.87796085-4.314653 4.26809224-5.21483278 7.35663939l-39.51477469 140.92464878 144.15287894-36.31758575c2.88678242-0.85361829 5.12171054-2.6384569 6.95311063-4.79578377l170.47536839-168.9698958-41.45481655-41.42377604L763.96489935 631.4522723 763.96489935 631.4522723zM530.11999948 839.45581204c0 0 16.97924744-67.57554198 19.60218408-79.61932265 36.10030075 15.4892951 60.45170783 60.43618758 60.45170784 60.43618759L530.11999948 839.45581204zM714.25326362 548.97720777l106.79543039 106.76438987 24.42900835-22.90801551-106.81095064-106.77991015L714.25326362 548.97720777zM873.55398991 547.44069467l-51.18606708-51.15502657c-14.12350553-14.12350553-36.90735829-14.26318853-50.87566055-0.27936602l-15.69105914 15.84626311 102.31005315 102.35661464 15.72210036-15.89282387C887.80165819 584.37909346 887.67749543 561.57972045 873.55398991 547.44069467L873.55398991 547.44069467zM873.55398991 547.44069467"
p-id="1316"
></path>
</svg>`,
event: () => {
console.log(111);
}
},
{
title: "二级",
icon: `<svg t="1612337489141" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4840" width="64" height="64"><path d="M481.78500516 300.85507477l276.60487911 2.60474112v70.53266245l171.07566175-98.79410166-171.07566175-98.79410164v86.19831902H505.5253583l-43.4433576-2.60474111-177.79217129 189.79258529 28.85680782 28.89401936 168.63836793-177.82938283z m276.60487911 451.92254672l-235.76626263-2.62334645-245.03169808-245.0875133H94.51584863v40.83861648h163.35446595l245.03169726 245.0875133 255.46926709 2.6419518v70.53266246l171.07566175-98.81270701-171.07566175-98.79410083v86.21692355z" fill="#1F3645" p-id="4841"></path></svg>`,
event: () => {
console.log(111);
}
}
]
},
{
title: "设置",
icon: `<svg
t="1612319087634"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="4441"
width="64"
height="64"
>
<path
d="M455.46773274 565.4683431c4.94384766 11.74163818-1.23596192 40.16876221-20.39337158 51.91040039 0 0-130.39398193 63.65203857-135.33782959 213.82141113H144.0053304V230.52266438c0-17.3034668 24.10125732-29.04510498 24.10125733-29.04510498h252.13623047c9.88769531 0 24.10125732 11.74163818 24.10125732 29.04510499v86.51733398s-33.98895263 22.86529541-33.98895264 115.56243897c-4.3258667 92.69714356 40.16876221 127.30407715 45.11260987 132.86590576zM233.61256917 264.51161702c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.51702881c16.68548584 0 29.66308594-14.21356201 29.66308594-31.51702881 0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.51702881z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.51702881c16.68548584 0 29.66308594-14.21356201 29.66308593-31.51702881 0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.51702881zM233.61256917 390.57973226c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308594-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.5170288z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308593-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.5170288zM233.61256917 516.64784749c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.5170288 29.66308594-14.21356201 29.66308594-31.5170288c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.51702881z m119.88830567 0c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.51702881s13.59558106 31.51702881 29.66308594 31.5170288 29.66308594-14.21356201 29.66308593-31.5170288c0.61798096-17.3034668-12.9776001-31.51702881-29.66308593-31.51702881zM233.61256917 642.71596273c-16.68548584 0-29.66308594 14.21356201-29.66308594 31.5170288s13.59558106 31.51702881 29.66308594 31.51702881 29.66308594-14.21356201 29.66308594-31.51702881c0.61798096-17.3034668-12.9776001-31.51702881-29.66308594-31.5170288z"
p-id="4442"
></path>
<path
d="M742.82887776 642.71596273V548.1648763c0-17.3034668 13.59558106-31.51702881 29.66308594-31.51702881s29.66308594 14.21356201 29.66308594 31.51702881v94.55108643H891.76228841c16.68548584 0 29.66308594 14.21356201 29.66308594 31.5170288s-13.59558106 31.51702881-29.66308594 31.51702881h-89.60723877v94.55108643c0 17.3034668-13.59558106 31.51702881-29.66308594 31.5170288s-29.66308594-14.21356201-29.66308594-31.5170288V705.75002034H653.221639c-16.68548584 0-29.66308594-14.21356201-29.66308595-31.51702881s13.59558106-31.51702881 29.66308594-31.5170288h89.60723877z m12.9776001-188.4841919v-9.26971435c0-71.06781006-55.61828614-129.15802002-124.21417236-129.15802002-68.59588623 0-124.83215333 57.47222901-124.83215332 129.15802002 0 56.85424805 35.84289551 105.0567627 85.28137207 122.36022948v61.79809571C508.61409505 646.42384846 444.34407552 717.49165853 433.83839925 805.86293538h-0.61798095v0.61798096c0 14.21356201-11.12365723 25.9552002-24.71923829 25.95520019s-24.71923828-11.12365723-24.71923828-25.95520019v-2.47192383c0-3.08990479 0.61798096-5.56182862 1.23596191-8.03375244C397.37752278 706.3680013 453.61378987 629.73836263 533.33333333 594.51344807c-47.58453369-33.37097168-76.01165771-88.98925781-76.01165771-148.93341063 0-99.49493408 77.86560059-180.45043945 174.27062988-180.45043947s174.27062989 80.95550537 174.27062988 180.45043947v9.26971435l-50.05645752-0.61798096z"
p-id="4443"
></path>
</svg>`,
event: () => {
console.log("设置");
}
},
{
title: "模型浏览器",
icon: `<svg t="1612338190090" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5106" width="64" height="64"><path d="M871.55255647 547.95525603h-26.96644106v-80.89932548c0-34.15749305-28.76420483-62.92169709-62.92169787-62.92169788H538.96644183v-71.9105113H691.77627863c19.77539063 0 35.95525603-16.17986541 35.95525524-35.95525524V188.40269879c0-19.77539063-16.17986541-35.95525603-35.95525524-35.95525526H332.22372137c-19.77539063 0-35.95525603 16.17986541-35.95525524 35.95525526v107.86576734c0 19.77539063 16.17986541 35.95525603 35.95525524 35.95525524h152.8098368v71.91051131H242.33558246c-34.15749305 0-62.92169709 28.76420483-62.92169787 62.92169786V547.95525603H152.44744353c-19.77539063 0-35.95525603 16.17986541-35.95525603 35.95525526v251.68678992c0 19.77539063 16.17986541 35.95525603 35.95525603 35.95525526h107.86576655c19.77539063 0 35.95525603-16.17986541 35.95525605-35.95525526V583.91051129c0-19.77539063-16.17986541-35.95525603-35.95525605-35.95525526H233.34676825v-80.89932548c0-5.3932882 3.59552522-8.9888142 8.98881421-8.98881421h242.69797571v89.88813969H458.06711634c-19.77539063 0-35.95525603 16.17986541-35.95525527 35.95525526v251.68678992c0 19.77539063 16.17986541 35.95525603 35.95525527 35.95525526h107.86576733c19.77539063 0 35.95525603-16.17986541 35.95525525-35.95525526V583.91051129c0-19.77539063-16.17986541-35.95525603-35.95525525-35.95525526h-26.96644184v-89.8881397H781.66441754c5.3932882 0 8.9888142 3.59552522 8.98881421 8.98881421V547.95525603H763.68678991c-19.77539063 0-35.95525603 16.17986541-35.95525604 35.95525526v251.68678992c0 19.77539063 16.17986541 35.95525603 35.95525605 35.95525526h107.86576655c19.77539063 0 35.95525603-16.17986541 35.95525603-35.95525526V583.91051129c0-19.77539063-16.17986541-35.95525603-35.95525603-35.95525526zM242.33558246 601.88813892v215.73153466H170.42507116V601.88813892h71.9105113z m305.61967357 0v215.73153466h-71.91051206V601.88813892h71.91051206zM350.20134978 278.29083772V206.38032643h323.59730044v71.91051129H350.20134978z m503.37357905 539.32883585h-71.91051129V601.88813892h71.91051129v215.73153466z" p-id="5107"></path></svg>`,
event: () => {
console.log("模型浏览器");
}
}
]
}
]
}