How to use defValue method in ng-mocks

Best JavaScript code snippet using ng-mocks

editor.js

Source:editor.js Github

copy

Full Screen

1import Vue from 'vue';2export default {3 namespaced: true,4 state: {5 settings: [],6 changesElemSettings: [],7 currentElemSettings: [],8 defaultElemSettings: [],9 fontFamily: [],10 counter: 0,11 isDisabledNext: true,12 isDisabledBack: true,13 isDisabledClear: true,14 isOpenSearchIframe: false,15 iFrameURL: '//romanhristofor.github.io/Shop-with-Angularjs/',16 },17 getters: {18 getIFrameURL(state) {19 return state.iFrameURL;20 },21 settings(state) {22 return state.settings;23 },24 getFonts(state) {25 return state.fontFamily;26 },27 getElemSettingsLength(state) {28 return state.changesElemSettings.length;29 },30 getCounter(state) {31 return state.counter;32 },33 getIsDisabledBtn(state) {34 return {35 next: state.isDisabledNext,36 back: state.isDisabledBack,37 }38 },39 getIsDisabledClear(state) {40 return state.isDisabledClear;41 },42 getElemSettings(state) {43 return state.currentElemSettings;44 },45 getCurrentElemSettings: state => (id) => {46 return state.currentElemSettings.find(item => item.id === id);47 },48 getOpenSearchStatus(state) {49 return state.isOpenSearchIframe;50 },51 getData(state) {52 let data = {};53 _.each(state.currentElemSettings, item => {54 data[item.name] = item.newValue;55 });56 return data;57 },58 },59 mutations: {60 setCurrentElemSettings(state, payload) {61 if (!state.currentElemSettings.find(item => item.id === payload.id)) {62 state.currentElemSettings.push(payload);63 }64 else {65 let i = _.findIndex(state.currentElemSettings, (o) => {66 return o.id === payload.id;67 });68 state.currentElemSettings.splice(i, 1, payload);69 }70 },71 setElemSettings(state, payload) {72 if (state.changesElemSettings.length === 0) {73 state.defaultElemSettings = _.cloneDeep(state.currentElemSettings);74 }75 // if (payload.newValue && payload.oldValue) {76 state.changesElemSettings.push(payload);77 state.counter = state.changesElemSettings.length;78 // }79 },80 setSaveElemSettings(state, payload) {// get for next or back81 let currentEl = {};82 if (payload === 'back') {83 currentEl = state.changesElemSettings[state.counter];84 let newValue = currentEl.newValue;85 currentEl.newValue = currentEl.oldValue;86 currentEl.oldValue = newValue;87 }88 if (payload === 'next') {89 currentEl = state.changesElemSettings[state.counter];90 let oldValue = currentEl.oldValue;91 currentEl.oldValue = currentEl.newValue;92 currentEl.newValue = oldValue;93 }94 let i = _.findIndex(state.currentElemSettings, function(o) {95 return o.id === currentEl.id;96 });97 state.currentElemSettings.splice(i, 1, currentEl);98 },99 setCurrentElem(state, payload) {100 if (payload === 'back') {101 state.counter -= 1;102 }103 if (payload === 'next') {104 state.counter += 1;105 }106 },107 isDisabledBtn(state) {108 state.isDisabledNext = state.counter >= state.changesElemSettings.length;109 state.isDisabledBack = state.counter === 0;110 state.isDisabledClear = state.changesElemSettings.length === 0;111 },112 clearChangesElemSettings(state, payload) {113 state.changesElemSettings = [];114 state.changesElemSettings.length = 0;115 state.counter = 0;116 if (payload.history === 'clear') {117 state.currentElemSettings = state.defaultElemSettings;118 }119 },120 clearCurrentElemSettings(state) {121 state.currentElemSettings = [];122 state.currentElemSettings.length = 0;123 },124 loadSettings(state, data) {125 state.fontFamily = data[0].fonts;126 state.settings = data;127 },128 isReplaceElement(state) {129 if (state.counter < state.changesElemSettings.length) {130 state.changesElemSettings.splice(state.counter, state.changesElemSettings.length - state.counter);131 }132 },133 setOpenCloseSearch(state) {134 state.isOpenSearchIframe = !state.isOpenSearchIframe;135 },136 },137 actions: {138 clearChangesElemSettings(store, payload) {139 store.commit('clearChangesElemSettings', payload);140 store.commit('isDisabledBtn');141 },142 isDisabledBtn(store) {143 store.commit('isDisabledBtn');144 },145 setSaveElemSettings(store, newElement) {146 store.commit('setSaveElemSettings', newElement);147 },148 setElemSettings(store, newSettings) {149 store.commit('isReplaceElement');150 store.commit('setElemSettings', newSettings);151 store.commit('isDisabledBtn');152 store.commit('setCurrentElemSettings', newSettings);153 },154 replaceElement(store) {155 store.commit('replaceElement');156 },157 setCurrentElemSettings(store, newElement) {158 store.commit('setCurrentElemSettings', newElement);159 },160 setCurrentElem(store, count) {161 store.commit('setCurrentElem', count);162 },163 clearCurrentElemSettings(store) {164 store.commit('clearCurrentElemSettings');165 },166 loadSettings(store) {167 store.commit('loadSettings', loadSettings());168 },169 setOpenCloseSearch(store) {170 store.commit('setOpenCloseSearch');171 },172 pushCurrentElemSettings(store) {173 Vue.http.post('api/editor', {174 data: store.getters.getData,175 type: 'dispatcher',176 })177 .then(({data}) => {178 if (data.errors === false && data.data) {179 // call method editor/clear changes180 }181 },182 (reason) => {183 console.log('error', reason);184 },185 );186 },187 },188};189// GET settings for Design Editor190function loadSettings() {191 return [192 {193 id: 0,194 name: 'FontFamily',195 fonts: [196 { name: 'Rubik', font: 'Rubik' },197 { name: 'Inconsolata', font: 'Inconsolata&Regular' },198 { name: 'Roboto', font: 'Roboto' },199 { name: 'Montserrat', font: 'Montserrat' },200 { name: 'Pacifico', font: 'Pacifico' },201 // {"name":"Helvetica","font":"Helvetica"},202 // {"name":"Didact Gothic","font":"Didact Gothic&Regular"},203 // {"name":"Roboto Regular","font":"Roboto&Regular"},204 // {"name":"Roboto Light","font":"Roboto&Light"},205 // {"name":"Roboto Bold","font":"Roboto&Bold"},206 // {"name":"Playfair Display Regular","font":"Playfair Display&Regular"},207 // {"name":"Playfair Display Bold","font":"Playfair Display&Bold"},208 // {"name":"Raleway Regular","font":"Raleway&Regular"},209 // {"name":"Raleway Light","font":"Raleway&Light"},210 // {"name":"Raleway Bold","font":"Raleway&Bold"},211 //212 // {"name":"Open Sans Regular","font":"Open Sans&Regular"},213 // {"name":"Open Sans Light","font":"Open Sans&light"},214 // {"name":"Open Sans Bold","font":"Open Sans&bold"},215 // {"name":"Open Sans Condensed","font":"Open+Sans+Condensed:300&subset=latin,cyrillic"},216 // {"name":"Fira Sans Regular","font":"Fira Sans&Regular"},217 // {"name":"Fira Sans Light","font":"Fira Sans&Light"},218 // {"name":"Fira Sans Bold","font":"Fira Sans&Bold"},219 // {"name":"Fira Sans Condensed Regular","font":"Fira Sans Condensed&Regular"},220 // {"name":"Fira Sans Condensed Light","font":"Fira Sans Condensed&Light"},221 // {"name":"Fira Sans Condensed Bold","font":"Fira Sans Condensed&Bold"},222 //223 // {"name":"Lato Light","font":"Lato&Light"},224 // {"name":"Lato Bold","font":"Lato&Bold"},225 // {"name":"Lato Regular","font":"Lato&Regular"},226 ],227 },228 {229 id: 10,230 page: 'menu',231 url: '/menu',232 elements: [233 {234 id: 0, name: "bg-color-menu_page", type: "colorPicker",235 label: "Фон меню", defValue: "rgba(217, 221, 245, 1)", opacity: true,236 selector: [237 `header .md-menu__main .md-menu__li-l1.active>a,238 .mod--vertical-menu .md-menu--mobile .md-menu__main .active > a,239 .mod--vertical-menu .md-menu--mobile .md-menu__wrap-l2 .active > a`,240 '.md-menu__href-l1',241 ],242 css: [ 'background-color: %val% !important', 'box-shadow:0 0 10px %val%' ]243 },244 {245 id: 1, name: "font-site-menu_page", type: "fontSelect",246 label: "Шрифт меню", defValue: "Roboto", search: 'search',247 selector: ["body"],248 css: ["font-family: %val%"]249 },250 {251 id: 2, name: "size-point-menu_page", type: "slider",252 label: 'Размер пункта меню', defValue: 10, min: 6, max: 20,253 selector: [],254 css: []255 },256 {257 id: 3, name: "format-menu_page", type: "fontSelect",258 label: "Формат меню", defValue: "center",259 array: [260 { name: 'center' },261 { name: 'left' },262 { name: 'right' },263 ],264 selector: [".md-menu"],265 css: ["text-align"]266 },267 {268 id: 4, name: "font-letter-spacing-menu_page", type: "slider",269 label: 'Межбуквенный интервал', defValue: 3, min: 0, max: 7,270 selector: [".md-menu__href-l1"],271 css: ["letter-spacing"]272 },273 {274 id: 5, name: "font-color-menu_page", type: "colorPicker",275 label: "Цвет пункта меню", defValue: "rgba(0,0,0,0.87)", opacity: true,276 selector: [".application.theme--light"],277 css: ["color"]278 },279 {280 id: 6, name: "link-color-hover-menu_page", type: "colorPicker",281 label: "Цвет активного пункта меню", defValue: "#5468f6",282 selector: [".application.theme--light a"], opacity: true,283 css: ["color"]284 },285 {286 id: 7, name: "arrow-up-color-menu_page", type: "colorPicker",287 label: "Фон подменю", defValue: "#e73617", opacity: true,288 selector: ["body"],289 css: ["color"]290 },291 {292 id: 8, name: "width-catalog-submenu-menu_page", type: "slider",293 label: 'Размер пункта подменю', defValue: 3, min: 0, max: 7,294 selector: [295 `header .md-menu__main .md-menu__li-l1.active>a,296 .mod--vertical-menu .md-menu--mobile .md-menu__main .active > a,297 .mod--vertical-menu .md-menu--mobile .md-menu__wrap-l2 .active > a`,298 ],299 css: [ "width" ]300 },301 {302 id: 10, name: "arrow-up-color-hover-menu_page", type: "colorPicker",303 label: "Цвет пункта подменю", defValue: "#a7e707",304 selector: ["body"], opacity: true,305 css: ["color"]306 },307 {308 id: 11, name: "link-color-active-menu_page", type: "colorPicker", show: true,309 label: "Цвет активного пункта меню", defValue: "#e35e19",310 selector: ["body"], opacity: true,311 css: ["color"]312 },313 {314 id: 12, name: "bg-color-mobile-menu_page", type: "colorPicker", show: true,315 label: "Фон меню в мобильной версии", defValue: "#a1e3df",316 selector: ["body"], opacity: true,317 css: ["color"]318 },319 {320 id: 13, name: "arrow-up-color-hover-menu_page", type: "colorPicker",321 label: "Цвет пункта меню в мобильной версии", defValue: "#24e78f",322 selector: ["body"], opacity: true,323 css: ["color"]324 },325 {326 id: 14, name: "link-color-active-mobile-menu_page", type: "colorPicker",327 label: "Цвет активного пункта меню в мобильной версии", defValue: "#0e2287",328 selector: ["body"], opacity: true,329 css: ["color"]330 },331 {332 id: 15, name: "effect-menu-active-menu_page", type: "selectComposite",333 label: "Эффект при наведении на пункт", defValue: 'выделение цветом',334 selector: ["body"], css: ["color"],335 options: [336 {name: 'выделение цветом', slider: false, picker: false },337 {name: 'подчеркивание', slider: true, picker: false },338 {name: 'зачеркивание', slider: true, picker: false },339 {name: 'маркер', slider: true, picker: true }340 ],341 components: [342 {343 id: 17, name: "effect-link-weight-menu-menu_page", type: "slider",344 label: "Толщина линии", defValue: 2, min: 1, max: 5,345 selector: ["body"],346 css: ["color"]347 },348 {349 id: 18, name: "effect-link-color-menu-menu_page", type: "colorPicker",350 opacity: true, label: "Цвет линии", defValue: "#2a66e3",351 selector: ["body"],352 css: ["color"]353 },354 ],355 },356 {357 id: 19, name: "vertical-indents-menu_page", type: "slider",358 label: "Вертикальные отступы меню", defValue: 70, min: 69, max: 100,359 selector: ["body"],360 css: ["color"]361 },362 {363 id: 20, name: "font-letter-spacing-menu_page", type: "slider",364 label: "Расстояние между пунктами меню", defValue: 13, min: 1, max: 27,365 selector: ["body"],366 css: ["color"]367 },368 {369 id: 21, name: "link-color-active-mobile-menu_page", type: "colorPicker",370 label: "Цвет разделительной линии", defValue: "#871e0d",371 selector: ["body"], opacity: true,372 css: ["color"]373 },374 {375 id: 22, name: "align-menu-content-menu_page", type: "switch",376 label: 'Выровнять меню по ширине контента сайта', defValue: false,377 selector: ["body"],378 css: ["color"]379 },380 {381 id: 23, name: "location-submenu-menu_page", type: "fontSelect",382 label: "Расположение подменю", defValue: "Center",383 array: [384 { name: 'Center' },385 { name: 'Left' },386 { name: 'Right' },387 ],388 selector: ["body"],389 css: ["color"]390 },391 {392 id: 24, name: "menu-scroll-events-menu_page", type: "radio",393 label: "Поведение меню при прокрутке страницы", defValue: 'не показывать',394 array: [395 { label: 'не показывать', v: 'не показывать' },396 { label: 'закрепить вверху', v: 'fix_to_top' },397 { label: 'подгрузить сверху', v: 'load_top' }398 ],399 selector: ["body"],400 css: ["color"]401 },402 {403 id: 25, name: "align-menu-content-menu_page", type: "switch",404 label: "Эффект плавного появления меню сверху", defValue: false,405 selector: ["body"],406 css: ["color"]407 },408 {409 id: 26, name: "location-submenu-menu_page", type: "input",410 label: "Разделитель между пунктами меню", defValue: "*", maxLength: 3,411 selector: ["body"],412 css: ["color"]413 },414 {415 id: 27, name: "align-menu-content-menu_page", type: "switch",416 label: "Расположить меню под слайдером", defValue: false, // (only DEV)417 selector: ["body"],418 css: ["color"]419 },420 {421 id: 28, name: "view-icon-basket-menu_page", type: "radio", picture: true,422 label: "Вид иконки \"Корзина\"", defValue: 'account',423 array: [424 { src: 'account_circle', v: 'account' },425 { src: 'star', v: 'star' },426 { src: 'cake', v: 'cake' },427 { src: 'check_circle', v: 'check' },428 ],429 selector: ["body"],430 css: ["color"]431 },432 {433 id: 29, name: "menu-scroll-events-menu_page", type: "radio",434 label: "Отображение иконки \"Корзина\" ", defValue: 'shop',435 array: [436 { label: 'только на страницах магазина', v: 'shop' },437 { label: 'на всех страницах сайта', v: 'all_pages' },438 ],439 selector: ["body"],440 css: ["color"]441 },442 {443 id: 30, name: "design-menu-menu_page", type: "radio", picture: true,444 label: "Вид меню", defValue: 'cake', // (есть 14 видов меню)445 array: [446 { src: 'account_circle', v: 'account' },447 { src: 'star', v: 'star' },448 { src: 'cake', v: 'cake' },449 { src: 'check_circle', v: 'check' },450 ],451 selector: ["body"],452 css: ["color"]453 },454 ],455 },456 {457 id: 20,458 page: 'general',459 url: '/',460 elements: [461 {462 id: 0, name: "width-site", type: "slider", units: true,463 label: "Ширина сайта",464 switchId: 1, switchName: "switch-width-site", switchValue: '%',465 dim: { 0: '%', 1: 'Px' },466 range: {467 0: { v: 90, min: 1, max: 100, step: 10 },468 1: { v: 900, min: 600, max: 2500, step: 50 }469 },470 selector: ["body"],471 css: ["color"]472 },473 {474 id: 2, name: "bg-color-site", type: "colorPicker",475 label: "Фон сайта", defValue: "rgba(224,224,224,1)",476 selector: ["body"],477 css: ["color"]478 },479 {480 id: 2, name: "font-site", type: "fontSelect",481 label: "Шрифт сайта", defValue: "Rubik", search: 'search',482 selector: ["body"],483 css: ["color"]484 },485 {486 id: 3, name: "color-font-text", type: "colorPicker",487 label: "Цвет текста", defValue: "rgba(0,0,0,0.87)", opacity: true,488 selector: ["body"],489 css: ["color"]490 },491 {492 id: 4, name: "color-links-hover", type: "colorPicker",493 label: "Цвет ссылок при наведении", defValue: "rgba(211,123,123,1)", opacity: true,494 selector: ["body"],495 css: ["color"]496 },497 {498 id: 5, name: "color-arrow-top", type: "colorPicker",499 label: "Цвет стрелки \"вверх\"", defValue: "rgba(211,123,123,1)", opacity: true,500 selector: ["body"],501 css: ["color"]502 },503 {504 id: 6, name: "color-arrow-top-hover", type: "colorPicker",505 label: "Цвет стрелки \"вверх\" при наведении", defValue: "rgba(211,123,123,1)", opacity: true,506 selector: ["body"],507 css: ["color"]508 },509 {510 id: 7, name: "color-elem-slider", type: "colorPicker",511 label: "Элементы навигации слайдера", defValue: "rgba(211,123,123,1)", opacity: true,512 selector: ["body"],513 css: ["color"]514 },515 {516 id: 8, name: "color-elem-slider-hover", type: "colorPicker",517 label: "Элементы навигации слайдера при наведении", defValue: "rgba(211,123,123,1)", opacity: true,518 selector: ["body"],519 css: ["color"]520 },521 ],522 },523 {524 id: 30,525 page: 'search',526 url: '/search',527 elements: [528 {529 id: 0, name: "bg-color-search", type: "colorPicker",530 label: "Фон страницы поиска", defValue: "rgba(224,224,224,1)",531 selector: ["body"],532 css: ["color"]533 },534 {535 id: 1, name: "color-search-close", type: "colorPicker",536 label: "Элементы страницы поиска", defValue: "rgba(211,123,123,1)", opacity: true,537 selector: ["body"],538 css: ["color"]539 },540 ],541 },542 {543 id: 40,544 page: 'blog_categories',545 url: '/categories',546 elements: [547 {548 id: 0, name: "font-categories", type: "fontSelect",549 label: "Шрифт категории", defValue: "Rubik", search: 'search',550 selector: ["body"],551 css: ["color"]552 },553 {554 id: 1, name: "size-font-categories", type: "slider",555 label: "Размер шрифта категории", defValue: 2, min: 1, max: 5,556 selector: ["body"],557 css: ["color"]558 },559 {560 id: 2, name: "color-categories", type: "colorPicker",561 label: "Цвет категории", defValue: "rgba(211,123,123,1)", opacity: true,562 selector: ["body"],563 css: ["color"]564 },565 {566 id: 3, name: "color-active-categories", type: "colorPicker",567 label: "Цвет активной категории", defValue: "rgba(211,123,123,1)", opacity: true,568 selector: ["body"],569 css: ["color"]570 },571 {572 id: 4, name: "position-categories", type: "fontSelect",573 label: "Расположение категории", defValue: "Center",574 array: [575 { name: 'Center' },576 { name: 'Left' },577 { name: 'Right' },578 ],579 selector: ["body"],580 css: ["color"]581 },582 ],583 },584 {585 id: 50,586 page: 'blog_page',587 url: '/page',588 elements: [589 {590 id: 0, name: "width-blog-page", type: "slider", units: true,591 label: "Ширина блога",592 switchId: 1, switchName: "switch-blog-page", switchValue: '%',593 dim: { 0: '%', 1: 'Px' },594 range: {595 0: { v: 20, min: 1, max: 100, step: 30 },596 1: { v: 4, min: 1, max: 5, step: 1 }597 },598 selector: ["body"],599 css: ["color"]600 },601 {602 id: 2, name: "bg-blog-page", type: "selectComposite",603 label: "Фон записи", defValue: 'использовать фон сайта',604 selector: [], css: [], options: [605 {name: 'использовать фон сайта', picker: false},606 {name: 'цвет фона', picker: true},607 ],608 components: [609 {610 id: 3, name: "sub_bg-blog-page", type: "colorPicker",611 label: "", defValue: "#e35e19", opacity: true,612 selector: [],613 css: []614 },615 ],616 },617 {618 id: 4, name: "bg-side-panel", type: "selectComposite",619 label: "Фон боковой панели", defValue: 'цвет фона',620 selector: ["body"], css: ["color"], options: [621 {name: 'использовать фон сайта', picker: false},622 {name: 'цвет фона', picker: true},623 ],624 components: [625 {626 id: 5, name: "sub_bg-side-panel", type: "colorPicker",627 label: "", defValue: "#193EE3", opacity: true,628 selector: ["body"],629 css: ["color"]630 },631 ],632 },633 {634 id: 6, name: "color-preview-blog-page", type: "colorPicker",635 label: "Фон превью", defValue: "rgba(211,123,123,1)", opacity: true,636 selector: ["body"],637 css: ["color"]638 },639 {640 id: 7, name: "size-preview-blog-page", type: "slider",641 label: "Расстояние между превью", defValue: 2, min: 1, max: 10,642 selector: ["body"], css: ["color"]643 },644 {645 id: 8, name: "location-description-blog-page", type: "fontSelect",646 label: "Расположение описания", defValue: "Center",647 selector: ["body"], css: ["color"],648 array: [649 { name: 'Center' },650 { name: 'Left' },651 { name: 'Right' },652 ]653 },654 {655 id: 9, name: "width-border-post-blog-page", type: "slider",656 label: "Толщина границы записи", defValue: 2, min: 1, max: 5,657 selector: ["body"],658 css: ["color"]659 },660 {661 id: 10, name: "color-border-post-blog-page", type: "colorPicker",662 label: "Цвет границы записи", defValue: "rgba(211,123,123,1)", opacity: true,663 selector: ["body"],664 css: ["color"]665 },666 {667 id: 11, name: "color-line-under-post", type: "colorPicker",668 label: "Цвет линии под записью", defValue: "rgba(211,123,123,1)", opacity: true,669 selector: ["body"],670 css: ["color"]671 },672 {673 id: 12, name: "color-icons-blog-page", type: "colorPicker",674 label: "Цвет иконок", defValue: "rgba(123,177,211,1)", opacity: true,675 selector: ["body"],676 css: ["color"]677 },678 {679 id: 13, name: "color-decor_elem-blog-page", type: "colorPicker",680 label: "Цвет декоративных элементов", defValue: "rgba(222, 236, 245, 1)", opacity: true,681 selector: ["body"],682 css: ["color"]683 },684 {685 id: 14, name: "color-decor_line-blog-page", type: "colorPicker",686 label: "Цвет декоративных линий", defValue: "rgba(239, 230, 189, 1)", opacity: true,687 selector: ["body"],688 css: ["color"]689 },690 {691 id: 15, name: "color-navigation-blog-page", type: "colorPicker",692 label: "Цвет навигации", defValue: "rgba(123,177,211,1)", opacity: true,693 selector: ["body"],694 css: ["color"]695 },696 {697 id: 16, name: "bg-button-blog-page", type: "colorPicker",698 label: "Цвет фона кнопки \"Читать далее\"", defValue: "#D70CF2", opacity: true,699 selector: ["body"],700 css: ["color"]701 },702 {703 id: 17, name: "font-header-blog-page", type: "fontSelect",704 label: "Шрифт заголовка", defValue: "Rubik", search: 'search',705 selector: ["body"],706 css: ["color"]707 },708 {709 id: 18, name: "size-header-blog-page", type: "slider",710 label: "Размер шрифта заголовка", defValue: 2, min: 1, max: 5,711 selector: ["body"],712 css: ["color"]713 },714 {715 id: 19, name: "bg-header-blog-page", type: "colorPicker",716 label: "Цвет заголовка", defValue: "#000", opacity: true,717 selector: ["body"],718 css: ["color"]719 },720 {721 id: 20, name: "font-text-blog-page", type: "fontSelect",722 label: "Шрифт текста", defValue: "Rubik", search: 'search',723 selector: ["body"],724 css: ["color"]725 },726 {727 id: 21, name: "size-font-text-blog-page", type: "slider",728 label: "Размер шрифта текста", defValue: 2, min: 1, max: 5,729 selector: ["body"],730 css: ["color"]731 },732 {733 id: 22, name: "bg-text-blog-page", type: "colorPicker",734 label: "Цвет текста", defValue: "#959899", opacity: true,735 selector: ["body"],736 css: ["color"]737 },738 {739 id: 23, name: "font-description-blog-page", type: "fontSelect",740 label: "Шрифт описания", defValue: "Rubik", search: 'search',741 selector: ["body"],742 css: ["color"]743 },744 {745 id: 24, name: "size-font-descript-blog-page", type: "slider",746 label: "Размер шрифта описания", defValue: 2, min: 1, max: 5,747 selector: ["body"],748 css: ["color"]749 },750 {751 id: 25, name: "bg-descript-blog-page", type: "colorPicker",752 label: "Цвет описания", defValue: "#dadee3", opacity: true,753 selector: ["body"],754 css: ["color"]755 },756 {757 id: 26, name: "font-date-blog-page", type: "fontSelect",758 label: "Шрифт даты", defValue: "Rubik", search: 'search',759 selector: ["body"],760 css: ["color"]761 },762 {763 id: 27, name: "size-font-date-blog-page", type: "slider",764 label: "Размер шрифта даты", defValue: 2, min: 1, max: 5,765 selector: ["body"],766 css: ["color"]767 },768 {769 id: 28, name: "bg-date-blog-page", type: "colorPicker",770 label: "Цвет даты", defValue: "#589939", opacity: true,771 selector: ["body"],772 css: ["color"]773 },774 {775 id: 29, name: "font-tags-blog-page", type: "fontSelect",776 label: "Шрифт тегов", defValue: "Rubik", search: 'search',777 selector: ["body"],778 css: ["color"]779 },780 {781 id: 30, name: "size-font-tags-blog-page", type: "slider",782 label: "Размер шрифта тегов", defValue: 2, min: 1, max: 5,783 selector: ["body"],784 css: ["color"]785 },786 {787 id: 31, name: "bg-tags-blog-page", type: "colorPicker",788 label: "Цвет тегов", defValue: "#997920", opacity: true,789 selector: ["body"],790 css: ["color"]791 },792 {793 id: 32, name: "font-links-blog-page", type: "fontSelect",794 label: "Шрифт ссылки \"Читать далее\"", defValue: "Rubik", search: 'search',795 selector: ["body"],796 css: ["color"]797 },798 {799 id: 33, name: "size-font-links-blog-page", type: "slider",800 label: "Размер шрифта ссылки \"Читать далее\"", defValue: 2, min: 1, max: 5,801 selector: ["body"],802 css: ["color"]803 },804 {805 id: 34, name: "color-link-read-blog-page", type: "colorPicker",806 label: "Цвет ссылки \"Читать далее\"", defValue: "#99341d", opacity: true,807 selector: ["body"],808 css: ["color"]809 },810 {811 id: 35, name: "size-font-text-blog-page", type: "slider",812 label: "Размер шрифта текста \"Читать далее\"", defValue: 2, min: 1, max: 5,813 selector: ["body"],814 css: ["color"]815 },816 {817 id: 36, name: "color-text-read-blog-page", type: "colorPicker",818 label: "Цвет текста \"Читать далее\"", defValue: "#079993", opacity: true,819 selector: ["body"],820 css: ["color"]821 },822 ],823 },824 {825 id: 60,826 page: 'blog_post',827 url: '/post',828 elements: [829 {830 id: 0, name: "width-blog-post", type: "slider", units: true,831 label: 'Ширина страницы записи',832 switchId: 1, switchName: "switch-width-blog-post", switchValue: '%',833 dim: { 0: '%', 1: 'Px' },834 range: {835 0: { v: 90, min: 1, max: 100, step: 10 },836 1: { v: 900, min: 600, max: 2500, step: 50 }837 },838 selector: ["body"],839 css: ["color"]840 },841 {842 id: 2, name: "effect-menu-active", type: "selectComposite",843 label: "Фон записи", defValue: 'использовать фон сайта',844 selector: [], css: [], options: [845 {name: 'использовать фон сайта', picker: false},846 {name: 'цвет фона', picker: true},847 ],848 components: [849 {850 id: 3, name: "sub_bg-blog-post", type: "colorPicker",851 label: "", defValue: "#b2e354",852 selector: ["body"], css: ["color"]853 },854 ],855 },856 {857 id: 4, name: "weight-border-blog-post", type: "slider",858 label: "Толщина границы записи", defValue: 2, min: 1, max: 10,859 selector: [],860 css: []861 },862 {863 id: 5, name: "color-border-blog-post", type: "colorPicker",864 label: "Цвет границы записи", defValue: "#e35e19", opacity: true,865 selector: [],866 css: []867 },868 {869 id: 6, name: "color-line-under-blog-post", type: "colorPicker",870 label: "Цвет линии под записью", defValue: "#43a1e3", opacity: true,871 selector: [],872 css: []873 },874 {875 id: 7, name: "color-elem-under-blog-post", type: "colorPicker",876 label: "Цвет элементов под записью", defValue: "#e393aa", opacity: true,877 selector: [],878 css: []879 },880 {881 id: 8, name: "color-decor-elem-blog-post", type: "colorPicker",882 label: "Цвет декоративных элементов", defValue: "#997920", opacity: true,883 selector: [],884 css: []885 },886 {887 id: 9, name: "color-navigation-blog-post", type: "colorPicker",888 label: "Цвет навигации", defValue: "#bfbab1", opacity: true,889 selector: [],890 css: []891 },892 {893 id: 10, name: "font-header-blog-post", type: "fontSelect",894 label: "Шрифт заголовка", defValue: "Rubik", search: 'search',895 selector: [],896 css: []897 },898 {899 id: 11, name: "size-font-blog-post", type: "slider",900 label: "Размер шрифта заголовка", defValue: 2, min: 1, max: 10,901 selector: [],902 css: []903 },904 {905 id: 12, name: "color-heading-blog-post", type: "colorPicker",906 label: "Цвет заголовка", defValue: "#2d2927", opacity: true,907 selector: [],908 css: []909 },910 {911 id: 13, name: "font-text-blog-post", type: "fontSelect",912 label: "Шрифт текста", defValue: "Rubik", search: 'search',913 selector: [],914 css: []915 },916 {917 id: 14, name: "size-font-text-blog-post", type: "slider",918 label: "Размер шрифта текста", defValue: 2, min: 1, max: 10,919 selector: [],920 css: []921 },922 {923 id: 15, name: "color-heading-blog-post", type: "colorPicker",924 label: "Цвет текста", defValue: "#000000", opacity: true,925 selector: [],926 css: []927 },928 {929 id: 16, name: "font-date-blog-post", type: "fontSelect",930 label: "Шрифт даты", defValue: "Rubik", search: 'search',931 selector: [],932 css: []933 },934 {935 id: 17, name: "size-font-date-blog-post", type: "slider",936 label: "Размер шрифта даты", defValue: 2, min: 1, max: 10,937 selector: [],938 css: []939 },940 {941 id: 18, name: "color-heading-blog-post", type: "colorPicker",942 label: "Цвет даты", defValue: "#cb692d", opacity: true,943 selector: [],944 css: []945 },946 ],947 },948 {949 id: 70,950 page: 'blog_slider',951 url: '/slider',952 elements: [953 {954 id: 0, name: "height-blog-slider", type: "slider",955 label: "Высота слайдера", defValue: 2, min: 1, max: 5,956 selector: ["body"],957 css: ["color"]958 },959 {960 id: 1, name: "width-blog-slider", type: "slider",961 label: "Ширина слайдера", defValue: 1500, min: 600, max: 2590,962 selector: [],963 css: []964 },965 {966 id: 2, name: "indent-preview-blog-slider", type: "slider",967 label: "Отступ между превью", defValue: 30, min: 1, max: 100,968 selector: [],969 css: []970 },971 {972 id: 3, name: "bg-blog-slider", type: "colorPicker",973 label: "Цвет фона", defValue: "#c9dfe2", opacity: true,974 selector: [],975 css: []976 },977 {978 id: 4, name: "show-button-blog-slider", type: "switchComposite",979 label: "Отображать кнопки для пролистывания", defValue: false, tag: "enable-buttons",980 selector: [], css: [],981 components: [982 {983 id: 5, name: "color-button-blog-slider", type: "colorPicker",984 label: "Цвет кнопок", defValue: "#2d88e3", opacity: true,985 selector: [],986 css: []987 },988 {989 id: 6, name: "color-button-hover-blog-slider", type: "colorPicker",990 label: "Цвет кнопок при наведении", defValue: "#bfbab1", opacity: true,991 selector: [],992 css: []993 },994 ],995 },996 {997 id: 7, name: "show-arrow-blog-slider", type: "switchComposite",998 label: "Отображать стрелки для пролистывания", defValue: false, tag: "enable-arrows",999 selector: [], css: [],1000 components: [1001 {1002 id: 8, name: "color-arrow-blog-slider", type: "colorPicker",1003 label: "Цвет стрелок", defValue: "#19e3cb", opacity: true,1004 selector: [],1005 css: []1006 },1007 {1008 id: 9, name: "color-arrow-hover-blog-slider", type: "colorPicker",1009 label: "Цвет стрелок при наведении", defValue: "#3089bf", opacity: true,1010 selector: [],1011 css: []1012 },1013 ],1014 },1015 {1016 id: 10, name: "color-scroll-blog-slider", type: "colorPicker",1017 label: "Цвет прокрутки", defValue: "#adc3c6", opacity: true,1018 selector: [],1019 css: []1020 },1021 {1022 id: 11, name: "bg-under-text-blog-slider", type: "colorPicker",1023 label: "Фон под текстом", defValue: "#da3b76",1024 selector: [],1025 css: []1026 },1027 {1028 id: 12, name: "font-heading-blog-slider", type: "fontSelect",1029 label: "Шрифт заголовка", defValue: "Rubik", search: 'search',1030 selector: [],1031 css: []1032 },1033 {1034 id: 13, name: "size-heading-blog-slider", type: "slider",1035 label: "Размер заголовка", defValue: 2, min: 1, max: 5,1036 selector: [],1037 css: []1038 },1039 {1040 id: 14, name: "color-heading-blog-slider", type: "colorPicker",1041 label: "Цвет заголовка", defValue: "#4d5556", opacity: true,1042 selector: [],1043 css: []1044 },1045 {1046 id: 15, name: "font-description-blog-slider", type: "fontSelect",1047 label: "Шрифт описания", defValue: "Rubik", search: 'search',1048 selector: [],1049 css: []1050 },1051 {1052 id: 16, name: "size-description-blog-slider", type: "slider",1053 label: "Размер описания", defValue: 2, min: 1, max: 5,1054 selector: [],1055 css: []1056 },1057 {1058 id: 17, name: "color-description-blog-slider", type: "colorPicker",1059 label: "Цвет описания", defValue: "#43a1e3", opacity: true,1060 selector: [],1061 css: []1062 },1063 {1064 id: 18, name: "color-links-hover-blog-slider", type: "colorPicker",1065 label: "Цвет ссылки при наведении", defValue: "#b2e354", opacity: true,1066 selector: [],1067 css: []1068 },1069 {1070 id: 19, name: "position-text-blog-slider", type: "fontSelect",1071 label: "Расположение текста", defValue: "Center",1072 selector: [], css: [],1073 array: [1074 { name: 'Center' },1075 { name: 'Left' },1076 { name: 'Right' },1077 ]1078 },1079 {1080 id: 20, name: "show-arrow-blog-slider", type: "switchComposite",1081 label: "Включить слайдшоу", defValue: false, tag: "enable-slide-show",1082 selector: [], css: [],1083 components: [1084 {1085 id: 21, name: "interval-blog-slider", type: "slider",1086 label: "Интервал", defValue: 2, min: 1, max: 5,1087 selector: [], css: [],1088 },1089 ],1090 },1091 ],1092 },1093 {1094 id: 80,1095 page: 'shop_categories',1096 url: '/categories',1097 elements: [1098 {1099 id: 0, name: "shop-font-categories", type: "fontSelect",1100 label: "Шрифт категории", defValue: "Rubik", search: 'search',1101 selector: ["body"],1102 css: ["color"]1103 },1104 {1105 id: 1, name: "shop-size-categories", type: "slider",1106 label: "Размер категории", defValue: 2, min: 1, max: 5,1107 selector: [], css: []1108 },1109 {1110 id: 2, name: "format-categories", type: "fontSelect",1111 label: "Формат категории", defValue: "Center",1112 array: [1113 { name: 'Center' },1114 { name: 'Left' },1115 { name: 'Right' },1116 ],1117 selector: [], css: []1118 },1119 {1120 id: 3, name: "letter-spacing-categories", type: "slider",1121 label: "Межбуквенный интервал категорий", defValue: 3, min: 1, max: 5,1122 selector: [], css: []1123 },1124 {1125 id: 4, name: "line-spacing-categories", type: "slider",1126 label: "Межстрочный интервал категорий", defValue: 2, min: 1, max: 5,1127 selector: [], css: []1128 },1129 {1130 id: 5, name: "color-categories", type: "colorPicker",1131 label: "Цвет категории", defValue: "rgba(211,123,123,1)", opacity: true,1132 selector: [], css: []1133 },1134 {1135 id: 6, name: "color-active-categories", type: "colorPicker",1136 label: "Цвет активной категории", defValue: "rgba(211,123,123,1)", opacity: true,1137 selector: [], css: []1138 },1139 {1140 id: 7, name: "color-active-hover-categories", type: "colorPicker",1141 label: "Цвет активной категории при наведении", defValue: "rgba(211,123,123,1)", opacity: true,1142 selector: [], css: []1143 },1144 {1145 id: 8, name: "bg-subcategories", type: "colorPicker",1146 label: "Фон для подкатегорий", defValue: "#43a1e3", opacity: true,1147 selector: [], css: []1148 },1149 {1150 id: 9, name: "size-subcategories", type: "slider",1151 label: "Размер подкатегории", defValue: 2, min: 1, max: 5,1152 selector: [], css: []1153 },1154 {1155 id: 10, name: "format-name-subcategories", type: "fontSelect",1156 label: "Формат названия подкатегорий", defValue: "Left",1157 array: [1158 { name: 'Center' },1159 { name: 'Left' },1160 { name: 'Right' },1161 ],1162 selector: [], css: []1163 },1164 {1165 id: 11, name: "letter-spacing-subcategories", type: "slider",1166 label: "Межбуквенный интервал подкатегорий", defValue: 2, min: 1, max: 5,1167 selector: [], css: []1168 },1169 {1170 id: 12, name: "line-spacing-subcategories", type: "slider",1171 label: "Межстрочный интервал подкатегорий", defValue: 1, min: 1, max: 5,1172 selector: [], css: []1173 },1174 {1175 id: 13, name: "color-subcategories", type: "colorPicker",1176 label: "Цвет подкатегории", defValue: "rgba(211,123,123,1)", opacity: true,1177 selector: [], css: []1178 },1179 {1180 id: 14, name: "color-active-subcategories", type: "colorPicker",1181 label: "Цвет активной подкатегории", defValue: "rgba(211,123,123,1)", opacity: true,1182 selector: [], css: []1183 },1184 {1185 id: 15, name: "color-active-hover-subcategories", type: "colorPicker",1186 label: "Цвет подкатегории при наведении", defValue: "#b2e354", opacity: true,1187 selector: [], css: []1188 },1189 ],1190 },1191 {1192 id: 90,1193 page: 'shop_catalog',1194 url: '/catalog',1195 elements: [1196 {1197 id: 0, name: "size-shop_catalog", type: "slider", units: true,1198 label: "Ширина каталога",1199 switchId: 1, switchName: "switch-size-shop_catalog", switchValue: '%',1200 dim: { 0: '%', 1: 'Px' },1201 range: {1202 0: { v: 20, min: 1, max: 100, step: 10 },1203 1: { v: 2, min: 1, max: 5, step: 0 }1204 },1205 selector: ["body"],1206 css: ["color"]1207 },1208 {1209 id: 2, name: "size-font-shop_catalog", type: "slider",1210 label: "Размер шрифта", defValue: 2, min: 1, max: 5,1211 selector: [], css: []1212 },1213 {1214 id: 3, name: "color-text-shop_catalog", type: "colorPicker",1215 label: "Цвет текста", defValue: "rgba(211,123,123,1)", opacity: true,1216 selector: [], css: []1217 },1218 {1219 id: 4, name: "bg-preview-hover-shop_catalog", type: "colorPicker",1220 label: "Фон при наведении на превью", defValue: "rgba(211,123,123,1)", opacity: true,1221 selector: [], css: []1222 },1223 {1224 id: 5, name: "name-product-shop_catalog", type: "colorPicker",1225 label: "Название товара", defValue: "#b2e354", opacity: true,1226 selector: [], css: []1227 },1228 {1229 id: 6, name: "text-up-preview-shop_catalog", type: "colorPicker",1230 label: "Текст над превью", defValue: "rgba(211,123,123,1)", opacity: true,1231 selector: [], css: []1232 },1233 {1234 id: 7, name: "price-shop_catalog", type: "colorPicker",1235 label: "Цена", defValue: "rgba(211,123,123,1)", opacity: true,1236 selector: [], css: []1237 },1238 {1239 id: 8, name: "discount-price-shop_catalog", type: "colorPicker",1240 label: "Цена по скидке", defValue: "rgba(211,123,123,1)", opacity: true,1241 selector: [], css: []1242 },1243 {1244 id: 9, name: "bg-icon-shop_catalog", type: "colorPicker",1245 label: "Фон иконки \"В корзину\"", defValue: "rgba(211,123,123,1)", opacity: true,1246 selector: [], css: []1247 },1248 {1249 id: 10, name: "bg-icon-hover-shop_catalog", type: "colorPicker",1250 label: "Фон иконки \"В корзину\" при наведении", defValue: "rgba(211,123,123,1)", opacity: true,1251 selector: [], css: []1252 },1253 {1254 id: 11, name: "basket-icon-shop_catalog", type: "colorPicker",1255 label: "Иконка \"В корзину\"", defValue: "rgba(211,123,123,1)", opacity: true,1256 selector: [], css: []1257 },1258 {1259 id: 12, name: "basket-icon-hover-shop_catalog", type: "colorPicker",1260 label: "Иконка \"В корзину\" при наведении", defValue: "rgba(211,123,123,1)", opacity: true,1261 selector: [], css: []1262 },1263 ],1264 },1265 {1266 id: 100,1267 page: 'shop_product',1268 url: '/product',1269 elements: [1270 {1271 id: 0, name: "size-shop_product", type: "slider", units: true,1272 label: "Ширина страницы товара", defValue: 12,1273 switchId: 1, switchName: "switch-size-shop_catalog", switchValue: '%',1274 dim: { 0: '%', 1: 'Px' },1275 range: {1276 0: { v: 20, min: 1, max: 100, step: 10 },1277 1: { v: 2, min: 1, max: 5, step: 0 }1278 },1279 selector: ["body"],1280 css: ["color"]1281 },1282 {1283 id: 2, name: "font-select-shop_product", type: "fontSelect",1284 label: "Шрифт страницы", defValue: "Helvetica", search: 'search',1285 selector: [], css: []1286 },1287 {1288 id: 3, name: "size-font-breadcrumbs-shop_product", type: "slider",1289 label: "Размер шрифта \"хлебных крошек\"", defValue: 2, min: 1, max: 5,1290 selector: [], css: []1291 },1292 {1293 id: 4, name: "color-breadcrumbs-shop_product", type: "colorPicker",1294 label: "Цвет \"хлебных крошек\"", defValue: "rgba(211,123,123,1)", opacity: true,1295 selector: [], css: []1296 },1297 {1298 id: 5, name: "color-breadcrumbs-hover-shop_product", type: "colorPicker",1299 label: "Цвет \"хлебных крошек\" при наведении", defValue: "rgba(211,123,123,1)", opacity: true,1300 selector: [], css: []1301 },1302 {1303 id: 6, name: "size-font-name-shop_product", type: "slider",1304 label: "Размер шрифта названия", defValue: 2, min: 1, max: 5,1305 selector: [], css: []1306 },1307 {1308 id: 7, name: "color-name-shop_product", type: "colorPicker",1309 label: "Цвет названия товара", defValue: "#43a1e3", opacity: true,1310 selector: [], css: []1311 },1312 {1313 id: 8, name: "size-font-price-shop_product", type: "slider",1314 label: "Размер шрифта цены", defValue: 2, min: 1, max: 5,1315 selector: [], css: []1316 },1317 {1318 id: 9, name: "color-price-shop_product", type: "colorPicker",1319 label: "Цвет цены", defValue: "#e3875b", opacity: true,1320 selector: [], css: []1321 },1322 {1323 id: 10, name: "size-font-price-discount-shop_product", type: "slider",1324 label: "Размер шрифта цены со скидкой", defValue: 2, min: 1, max: 5,1325 selector: [], css: []1326 },1327 {1328 id: 11, name: "color-price-discount-shop_product", type: "colorPicker",1329 label: "Цвет цены со скидкой", defValue: "#e31524", opacity: true,1330 selector: [], css: []1331 },1332 {1333 id: 12, name: "size-font-price-discount-shop_product", type: "slider",1334 label: "Размер шрифта сообщения о количестве товаров", defValue: 2, min: 1, max: 5,1335 selector: [], css: []1336 },1337 // {1338 // id: 13, name: "color-price-discount-shop_product", type: "colorPicker",1339 // label: "Цвет цены со скидкой", defValue: "#2be3d3",1340 // selector: [], css: []1341 // },1342 {1343 id: 14, name: "color-msg-count_price-shop_product", type: "colorPicker",1344 label: "Цвет сообщения о количестве товаров", defValue: "#e31524",1345 opacity: true, selector: [], css: []1346 },1347 {1348 id: 15, name: "size-font-description-shop_product", type: "slider",1349 label: "Размер шрифта описания", defValue: 2, min: 1, max: 5,1350 selector: [], css: []1351 },1352 {1353 id: 16, name: "color-description-shop_product", type: "colorPicker",1354 label: "Цвет описания", defValue: "#808e90", opacity: true,1355 selector: [], css: []1356 },1357 {1358 id: 17, name: "color-icon-add-cart-shop_product", type: "colorPicker",1359 label: "Цвет кнопки \"Добавить в корзину\"", defValue: "#abbdc0", opacity: true,1360 selector: [], css: []1361 },1362 {1363 id: 18, name: "color-icon-add-cart-shop_product", type: "colorPicker",1364 label: "Цвет текста \"Добавить в корзину\"", defValue: "#197BC1", opacity: true,1365 selector: [], css: []1366 },1367 {1368 id: 19, name: "bg-button-photo-big-size-shop_product", type: "colorPicker",1369 label: "Цвет фона под фото в большом размере", defValue: "#14907c", opacity: true,1370 selector: [], css: []1371 },1372 ],1373 },1374 {1375 id: 110,1376 page: 'shop_order_page',1377 // url: '/order/page',1378 elements: [1379 {1380 id: 0, name: "font-page-shop_order", type: "fontSelect",1381 label: "Шрифт страницы", defValue: "Rubik", search: 'search',1382 selector: ["body"],1383 css: ["color"]1384 },1385 {1386 id: 1, name: "size-font-heading-shop_order", type: "slider",1387 label: "Размер шрифта заголовка", defValue: 2, min: 1, max: 5,1388 selector: [], css: []1389 },1390 {1391 id: 2, name: "color-heading-shop_order", type: "colorPicker",1392 label: "Цвет заголовков на странице", defValue: "rgba(211,123,123,1)", opacity: true,1393 selector: [], css: []1394 },1395 {1396 id: 3, name: "size-font-name-column-shop_order", type: "slider",1397 label: "Размер шрифта названия колонок в таблице", defValue: 2, min: 1, max: 5,1398 selector: [], css: []1399 },1400 {1401 id: 4, name: "color-name-column-shop_order", type: "colorPicker",1402 label: "Цвет названия колонок в таблице", defValue: "rgba(211,123,123,1)", opacity: true,1403 selector: [], css: []1404 },1405 {1406 id: 5, name: "size-font-product-description-shop_order", type: "slider",1407 label: "Размер шрифта описания товаров", defValue: 2, min: 1, max: 5,1408 selector: [], css: []1409 },1410 {1411 id: 6, name: "color-product-description-shop_order", type: "colorPicker",1412 label: "Цвет описания товаров", defValue: "rgba(211,123,123,1)", opacity: true,1413 selector: [], css: []1414 },1415 {1416 id: 7, name: "size-font-product-params-shop_order", type: "slider",1417 label: "Размер шрифта параметров товаров", defValue: 2, min: 1, max: 5,1418 selector: [], css: []1419 },1420 {1421 id: 8, name: "color-product-params-shop_order", type: "colorPicker",1422 label: "Цвет параметров товаров", defValue: "rgba(211,123,123,1)", opacity: true,1423 selector: [], css: []1424 },1425 {1426 id: 9, name: "size-font-total-price-shop_order", type: "slider",1427 label: "Размер шрифта итоговой суммы", defValue: 2, min: 1, max: 5,1428 selector: [], css: []1429 },1430 {1431 id: 10, name: "color-total-price-shop_order", type: "colorPicker",1432 label: "Цвет итоговой суммы", defValue: "rgba(211,123,123,1)", opacity: true,1433 selector: [], css: []1434 },1435 {1436 id: 11, name: "size-font-bottom-text-block-shop_order", type: "slider",1437 label: "Размер шрифта текстового блока внизу", defValue: 2, min: 1, max: 5,1438 selector: [], css: []1439 },1440 {1441 id: 12, name: "color-bottom-text-block-shop_order", type: "colorPicker",1442 label: "Цвет текстового блока внизу", defValue: "rgba(211,123,123,1)", opacity: true,1443 selector: [], css: []1444 },1445 {1446 id: 13, name: "size-font-delivery-methods-shop_order", type: "slider",1447 label: "Размер шрифта способов доставки", defValue: 2, min: 1, max: 5,1448 selector: [], css: []1449 },1450 {1451 id: 14, name: "color-delivery-method-shop_order", type: "colorPicker",1452 label: "Цвет способов доставки", defValue: "rgba(211,123,123,1)", opacity: true,1453 selector: [], css: []1454 },1455 {1456 id: 15, name: "size-font-payment-methods-shop_order", type: "slider",1457 label: "Размер шрифта способов оплаты", defValue: 2, min: 1, max: 5,1458 selector: [], css: []1459 },1460 {1461 id: 16, name: "color-payment-methods-shop_order", type: "colorPicker",1462 label: "Цвет способов оплаты", defValue: "rgba(211,123,123,1)", opacity: true,1463 selector: [], css: []1464 },1465 {1466 id: 17, name: "size-font-link-promo-code-shop_order", type: "slider",1467 label: "Размер шрифта текста ссылки на промо-код", defValue: 2, min: 1, max: 5,1468 selector: [], css: []1469 },1470 {1471 id: 18, name: "color-split-lanes-shop_order", type: "colorPicker",1472 label: "Цвет разделительных полос", defValue: "rgba(211,123,123,1)", opacity: true,1473 selector: [], css: []1474 },1475 ],1476 },1477 {1478 id: 111,1479 page: 'shop_order_form',1480 elements: [1481 //Вид полей1482 {1483 id: 19, name: "type-fields-shop_order", type: "radio", sample: true,1484 label: "Вид полей", defValue: 'square',1485 selector: [], css: [],1486 array: [1487 { className: 'sample-square', v: 'square' },1488 { className: 'sample-circle', v: 'circle' },1489 { className: 'sample-ellipse', v: 'ellipse' },1490 { className: 'sample-inline', v: 'inline' },1491 ]1492 },1493 {1494 id: 20, name: "color-bg-fields-shop_order", type: "colorPicker",1495 label: "Цвет фона полей", defValue: "rgba(86, 73, 73, 1)", opacity: true,1496 selector: [], css: []1497 },1498 {1499 id: 21, name: "border-fields-shop_order", type: "selectComposite",1500 label: "Обводка полей", defValue: 'цвет полей',1501 selector: [], css: [],1502 options: [1503 {name: 'цвет полей', picker: true, slider: false},1504 {name: 'толщина линии', picker: false, slider: true},1505 ],1506 components: [1507 {1508 id: 22, name: "border-fields-color-shop_order", type: "colorPicker",1509 label: "", defValue: "#ae93e3", opacity: true,1510 selector: [], css: []1511 },1512 {1513 id: 23, name: "border-fields-weight-shop_order", type: "slider",1514 label: "", defValue: 2, min: 1, max: 3,1515 selector: [], css: []1516 },1517 ],1518 },1519 {1520 id: 24, name: "font-text-field-shop_order", type: "fontSelect",1521 label: "Шрифт текста поля", defValue: "Rubik", search: 'search',1522 selector: [], css: []1523 },1524 {1525 id: 25, name: "size-text-field-shop_order", type: "slider",1526 label: "Размер текста поля", defValue: 2, min: 1, max: 5,1527 selector: [], css: []1528 },1529 {1530 id: 26, name: "format-text-shop_order", type: "fontSelect",1531 label: "Формат текста", defValue: "regular",1532 selector: [], css: [],1533 array: [1534 { name: 'regular' },1535 { name: 'bold' },1536 { name: 'italic' },1537 ]1538 },1539 {1540 id: 27, name: "letter-spacing-shop_order", type: "slider",1541 label: "Межбуквенный интервал", defValue: 2, min: 1, max: 5,1542 selector: [], css: []1543 },1544 {1545 id: 28, name: "color-field-text-shop_order", type: "colorPicker",1546 label: "Цвет текста поля", defValue: "#313b40", opacity: true,1547 selector: [], css: []1548 },1549 {1550 id: 29, name: "color-field-text-input-shop_order", type: "colorPicker",1551 label: "Цвет текста поля при вводе", defValue: "#000", opacity: true,1552 selector: [], css: []1553 },1554 {1555 id: 30, name: "color-field-text-input-shop_order", type: "colorPicker",1556 label: "Цвет текста без поля", defValue: "#264027", opacity: true,1557 selector: [], css: []1558 },1559 {1560 id: 31, name: "menu-scroll-events-shop_order", type: "radio",1561 label: "Эффект при вводе данных", defValue: 'hidden-field-name',1562 selector: [], css: [],1563 array: [1564 { label: 'скрывать название поля', v: 'hidden-field-name' },1565 { label: 'уменьшать название поля', v: 'lower-field-name' },1566 ]1567 },1568 {1569 id: 32, name: "distance-between-fields-shop_order", type: "slider",1570 label: "Расстояние между полями", defValue: 2, min: 1, max: 5,1571 selector: [], css: []1572 },1573 {1574 id: 33, name: "distance-from-form-to-button-shop_order", type: "slider",1575 label: "Расстояние от формы до кнопки", defValue: 2, min: 1, max: 5,1576 selector: [], css: []1577 },1578 //Вид кнопки1579 {1580 id: 34, name: "view-button-shop_order", type: "radio", sample: true,1581 label: "Вид кнопки", defValue: 'circle',1582 selector: [], css: [],1583 array: [1584 { className: 'sample-square', v: 'square' },1585 { className: 'sample-circle', v: 'circle' },1586 { className: 'sample-ellipse', v: 'ellipse' },1587 ]1588 },1589 {1590 id: 35, name: "color-button-shop_order", type: "colorPicker",1591 label: "Цвет кнопки", defValue: "#63c0c0", opacity: true,1592 selector: [], css: []1593 },1594 {1595 id: 36, name: "color-button-hover-shop_order", type: "colorPicker",1596 label: "Цвет кнопки при наведении", defValue: "#4c6ec0", opacity: true,1597 selector: [], css: []1598 },1599 {1600 id: 37, name: "border-button-shop_order", type: "selectComposite",1601 label: "Обводка кнопки", defValue: 'цвет обводки кнопки',1602 selector: [], css: [],1603 options: [1604 {name: 'цвет обводки кнопки', picker: true, slider: false},1605 {name: 'толщина обводки кнопки', picker: false, slider: true},1606 ],1607 components: [1608 {1609 id: 38, name: "color-border-button-shop_order", type: "colorPicker",1610 label: "", defValue: "#b2e354", opacity: true,1611 selector: [], css: []1612 },1613 {1614 id: 39, name: "weight-border-button-shop_order", type: "slider",1615 label: "", defValue: 2, min: 1, max: 3,1616 selector: [], css: []1617 },1618 ],1619 },1620 {1621 id: 40, name: "border-button-hover-shop_order", type: "selectComposite",1622 label: "Обводка кнопки при наведении", defValue: 'толщина обводки кнопки',1623 selector: [], css: [],1624 options: [1625 {name: 'цвет обводки кнопки', picker: true, slider: false},1626 {name: 'толщина обводки кнопки', picker: false, slider: true},1627 ],1628 components: [1629 {1630 id: 41, name: "color-border-button-hover-shop_order", type: "colorPicker",1631 label: "", defValue: "#e37a79", opacity: true,1632 selector: [], css: []1633 },1634 {1635 id: 42, name: "weight-border-button-hover-shop_order", type: "slider",1636 label: "", defValue: 2, min: 1, max: 5,1637 selector: [], css: []1638 },1639 ],1640 },1641 {1642 id: 43, name: "font-text-button-shop_order", type: "fontSelect",1643 label: "Шрифт текста", defValue: "Rubik", search: 'search',1644 selector: [], css: []1645 },1646 {1647 id: 44, name: "size-text-button-field-shop_order", type: "slider",1648 label: "Размер текста поля", defValue: 2, min: 1, max: 5,1649 selector: [], css: []1650 },1651 {1652 id: 45, name: "format-text-button-shop_order", type: "fontSelect",1653 label: "Формат текста", defValue: "regular",1654 selector: [], css: [],1655 array: [1656 { name: 'regular' },1657 { name: 'bold' },1658 { name: 'italic' },1659 ]1660 },1661 {1662 id: 46, name: "letter-spacing-button-shop_order", type: "slider",1663 label: "Межбуквенный интервал", defValue: 2, min: 1, max: 5,1664 selector: [], css: []1665 },1666 {1667 id: 47, name: "color-text-button-shop_order", type: "colorPicker",1668 label: "Цвет текста", defValue: "#313b40", opacity: true,1669 selector: [], css: []1670 },1671 {1672 id: 48, name: "color-text-hover-button-shop_order", type: "colorPicker",1673 label: "Цвет текста при наведении", defValue: "#000", opacity: true,1674 selector: [], css: []1675 },1676 {1677 id: 49, name: "size-lateral-indents-in-button-shop_order", type: "slider",1678 label: "Размер боковых отступов внутри кнопки", defValue: 2, min: 1, max: 5,1679 selector: [], css: []1680 },1681 {1682 id: 50, name: "format-text-button-shop_order", type: "fontSelect",1683 label: "Выравнивание", defValue: "left",1684 selector: [], css: [],1685 array: [1686 { name: 'left' },1687 { name: 'center' },1688 { name: 'right' },1689 ]1690 },1691 {1692 id: 51, name: "stretch-button-full-form-shop_order", type: "switch",1693 label: "Растянуть кнопку на всю ширину формы", defValue: false,1694 selector: [], css: []1695 },1696 ],1697 },1698 {1699 id: 120,1700 page: 'shop_pre_order_page',1701 // url: '/pre-order',1702 elements: [1703 {1704 id: 0, name: "size-heading-ordering-shop_pre_order", type: "slider",1705 label: "Размер заголовка \"Оформление заказа\"", defValue: 500, min: 300, max: 1000,1706 selector: [], css: []1707 },1708 {1709 id: 1, name: "color-heading-ordering-shop_pre_order", type: "colorPicker",1710 label: "Цвет заголовка \"Оформление заказа\"", defValue: "rgba(86, 73, 73, 1)", opacity: true,1711 selector: [], css: []1712 },1713 {1714 id: 2, name: "size-text-upper-form-shop_pre_order", type: "slider",1715 label: "Размер текста над формой", defValue: 500, min: 300, max: 1000,1716 selector: [], css: []1717 },1718 {1719 id: 3, name: "color-text-upper-form-shop_pre_order", type: "colorPicker",1720 label: "Цвет текста над формой", defValue: "rgba(86, 73, 73, 1)", opacity: true,1721 selector: [], css: []1722 },1723 ],1724 },1725 {1726 id: 121,1727 page: 'shop_pre_order_form',1728 elements: [1729 //Вид полей1730 {1731 id: 19, name: "type-fields-shop_pre_order", type: "radio", sample: true,1732 label: "Вид полей", defValue: 'circle',1733 selector: [], css: [],1734 array: [1735 { className: 'sample-square', v: 'square' },1736 { className: 'sample-circle', v: 'circle' },1737 { className: 'sample-ellipse', v: 'ellipse' },1738 { className: 'sample-inline', v: 'inline' },1739 ]1740 },1741 {1742 id: 20, name: "color-bg-fields-shop_pre_order", type: "colorPicker",1743 label: "Цвет фона полей", defValue: "rgba(86, 73, 73, 1)", opacity: true,1744 selector: [], css: []1745 },1746 {1747 id: 21, name: "border-fields-shop_pre_order", type: "selectComposite",1748 label: "Обводка полей", defValue: 'цвет полей',1749 selector: [], css: [],1750 options: [1751 {name: 'цвет полей', picker: true, slider: false},1752 {name: 'толщина линии', picker: false, slider: true},1753 ],1754 components: [1755 {1756 id: 22, name: "border-fields-color-shop_pre_order", type: "colorPicker",1757 label: "", defValue: "#ae93e3", opacity: true,1758 selector: [], css: []1759 },1760 {1761 id: 23, name: "border-fields-weight-shop_pre_order", type: "slider",1762 label: "", defValue: 2, min: 1, max: 3,1763 selector: [], css: []1764 },1765 ],1766 },1767 {1768 id: 24, name: "font-text-field-shop_pre_order", type: "fontSelect",1769 label: "Шрифт текста поля", defValue: "Rubik", search: 'search',1770 selector: [], css: []1771 },1772 {1773 id: 25, name: "size-text-field-shop_pre_order", type: "slider",1774 label: "Размер текста поля", defValue: 2, min: 1, max: 5,1775 selector: [], css: []1776 },1777 {1778 id: 26, name: "format-text-shop_pre_order", type: "fontSelect",1779 label: "Формат текста", defValue: "regular",1780 selector: [], css: [],1781 array: [1782 { name: 'regular' },1783 { name: 'bold' },1784 { name: 'italic' },1785 ]1786 },1787 {1788 id: 27, name: "letter-spacing-shop_pre_order", type: "slider",1789 label: "Межбуквенный интервал", defValue: 2, min: 1, max: 5,1790 selector: [], css: []1791 },1792 {1793 id: 28, name: "color-field-text-shop_pre_order", type: "colorPicker",1794 label: "Цвет текста поля", defValue: "#313b40", opacity: true,1795 selector: [], css: []1796 },1797 {1798 id: 29, name: "color-field-text-input-shop_pre_order", type: "colorPicker",1799 label: "Цвет текста поля при вводе", defValue: "#000", opacity: true,1800 selector: [], css: []1801 },1802 {1803 id: 30, name: "color-field-text-input-shop_pre_order", type: "colorPicker",1804 label: "Цвет текста без поля", defValue: "#264027", opacity: true,1805 selector: [], css: []1806 },1807 {1808 id: 31, name: "menu-scroll-events-shop_pre_order", type: "radio",1809 label: "Эффект при вводе данных", defValue: 'hidden-field-name',1810 selector: [], css: [],1811 array: [1812 { label: 'скрывать название поля', v: 'hidden-field-name' },1813 { label: 'уменьшать название поля', v: 'lower-field-name' },1814 ]1815 },1816 {1817 id: 32, name: "distance-between-fields-shop_pre_order", type: "slider",1818 label: "Расстояние между полями", defValue: 2, min: 1, max: 5,1819 selector: [], css: []1820 },1821 {1822 id: 33, name: "distance-from-form-to-button-shop_pre_order", type: "slider",1823 label: "Расстояние от формы до кнопки", defValue: 2, min: 1, max: 5,1824 selector: [], css: []1825 },1826 //Вид кнопки1827 {1828 id: 34, name: "view-button-shop_pre_order", type: "radio", sample: true,1829 label: "Вид кнопки", defValue: 'square',1830 selector: [], css: [],1831 array: [1832 { className: 'sample-square', v: 'square' },1833 { className: 'sample-circle', v: 'circle' },1834 { className: 'sample-ellipse', v: 'ellipse' },1835 ]1836 },1837 {1838 id: 35, name: "color-button-shop_pre_order", type: "colorPicker",1839 label: "Цвет кнопки", defValue: "#63c0c0", opacity: true,1840 selector: [], css: []1841 },1842 {1843 id: 36, name: "color-button-hover-shop_pre_order", type: "colorPicker",1844 label: "Цвет кнопки при наведении", defValue: "#4c6ec0", opacity: true,1845 selector: [], css: []1846 },1847 {1848 id: 37, name: "border-button-shop_pre_order", type: "selectComposite",1849 label: "Обводка кнопки", defValue: 'цвет обводки кнопки',1850 selector: [], css: [],1851 options: [1852 {name: 'цвет обводки кнопки', picker: true, slider: false},1853 {name: 'толщина обводки кнопки', picker: false, slider: true},1854 ],1855 components: [1856 {1857 id: 38, name: "color-border-button-shop_pre_order", type: "colorPicker",1858 label: "", defValue: "#b2e354", opacity: true, selector: [], css: []1859 },1860 {1861 id: 39, name: "weight-border-button-shop_pre_order", type: "slider",1862 label: "", defValue: 2, min: 1, max: 3,1863 selector: [], css: []1864 },1865 ],1866 },1867 {1868 id: 40, name: "border-button-hover-shop_pre_order", type: "selectComposite",1869 label: "Обводка кнопки при наведении", defValue: 'толщина обводки кнопки',1870 selector: [], css: [],1871 options: [1872 {name: 'цвет обводки кнопки', picker: true, slider: false},1873 {name: 'толщина обводки кнопки', picker: false, slider: true},1874 ],1875 components: [1876 {1877 id: 41, name: "color-border-button-hover-shop_pre_order", type: "colorPicker",1878 label: "", defValue: "#e37a79", opacity: true, selector: [], css: []1879 },1880 {1881 id: 42, name: "weight-border-button-hover-shop_pre_order", type: "slider",1882 label: "", defValue: 2, min: 1, max: 5,1883 selector: [], css: []1884 },1885 ],1886 },1887 {1888 id: 43, name: "font-text-button-shop_pre_order", type: "fontSelect",1889 label: "Шрифт текста", defValue: "Rubik", search: 'search',1890 selector: [], css: []1891 },1892 {1893 id: 44, name: "size-text-button-field-shop_pre_order", type: "slider",1894 label: "Размер текста поля", defValue: 2, min: 1, max: 5,1895 selector: [], css: []1896 },1897 {1898 id: 45, name: "format-text-button-shop_pre_order", type: "fontSelect",1899 label: "Формат текста", defValue: "regular",1900 selector: [], css: [],1901 array: [1902 { name: 'regular' },1903 { name: 'bold' },1904 { name: 'italic' },1905 ]1906 },1907 {1908 id: 46, name: "letter-spacing-button-shop_pre_order", type: "slider",1909 label: "Межбуквенный интервал", defValue: 2, min: 1, max: 5,1910 selector: [], css: []1911 },1912 {1913 id: 47, name: "color-text-button-shop_pre_order", type: "colorPicker",1914 label: "Цвет текста", defValue: "#313b40", opacity: true,1915 selector: [], css: []1916 },1917 {1918 id: 48, name: "color-text-hover-button-shop_pre_order", type: "colorPicker",1919 label: "Цвет текста при наведении", defValue: "#000", opacity: true,1920 selector: [], css: []1921 },1922 {1923 id: 49, name: "size-lateral-indents-in-button-shop_pre_order", type: "slider",1924 label: "Размер боковых отступов внутри кнопки", defValue: 2, min: 1, max: 5,1925 selector: [], css: []1926 },1927 {1928 id: 50, name: "format-text-button-shop_pre_order", type: "fontSelect",1929 label: "Выравнивание", defValue: "left", selector: [], css: [],1930 array: [1931 { name: 'left' },1932 { name: 'center' },1933 { name: 'right' },1934 ]1935 },1936 {1937 id: 51, name: "stretch-button-full-form-shop_pre_order", type: "switch",1938 label: "Растянуть кнопку на всю ширину формы", defValue: false,1939 selector: [], css: []1940 },1941 ],1942 }1943 ];...

Full Screen

Full Screen

select_tree.js

Source:select_tree.js Github

copy

Full Screen

1var SelectTree = function() {23};456/**7 * 加载安委会机构8 * code:定义选择后的ID值9 * defValue 默认值10 */11SelectTree.loadIsMemberSelect = function loadIsMemberSelect(code,param,defValue){12 SelectTree.loadBaseSelect(BASE_URL+"/system/sysorg/isMemberTree",code,param,defValue);13}141516/**17 * 加载组织机构18 * code:定义选择后的ID值19 * defValue 默认值20 */21SelectTree.loadOrgSelect = function loadOrgSelect(code,param,defValue){22 SelectTree.loadBaseSelect(BASE_URL+"/system/sysorg/orgtree",code,param,defValue);23}2425/**26 * 根据组织机构ID加载它下面的组织机构27 * code:定义选择后的ID值28 * defValue 默认值29 */30SelectTree.loadOrgByOrgidSelect = function loadOrgSelect(code,param,defValue,fn){31 SelectTree.loadBaseSelect(BASE_URL+"/system/sysorg/orgtreeByOrgid",code,param,defValue,fn);32}3334/**35 * 加载企业详细信息树36 * 37 */38SelectTree.loadBaseInfoSelect = function loadBaseInfoSelect(code,param,defValue,fn){39 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entsafeinfomenu/safemenutree",code,param,defValue,fn);40}4142/**43 * 加载排除项树44 * 45 */46SelectTree.loadHdiCheckitemSelect = function loadHdiCheckitemSelect(code,param,defValue,fn){47 SelectTree.loadBaseSelect(BASE_URL+"/hiddendanger/hdicheckitem/checkitementtree",code,param,defValue,fn);48}4950/**51 * 任务文书下拉树52 * 53 */54SelectTree.loadDocmenuTree = function loadDocmenuTree(code,param,defValue,fn){55 SelectTree.loadBaseSelect(BASE_URL+"/law/lawmydoc/docmenutree",code,param,defValue,fn);56}5758/**59 * 加载文书信息树60 * 61 */62SelectTree.loadLawDocInfoSelect = function loadLawDocInfoSelect(code,param,defValue,fn){63 SelectTree.loadBaseSelect(BASE_URL+"/law/lawdocinfo/lawmenutree",code,param,defValue,fn);64}6566/**67 * 加载部门68 * code:定义选择后的ID值69 * defValue 默认值70 */71SelectTree.loadDepartSelect = function loadDepartSelect(code,param,defValue) {72 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdepart/departtree",code,param,defValue);73};747576/**77 * 查询权限树(权限管理)78 * code:定义选择后的ID值79 * defValue 默认值80 */ 81SelectTree.loadDistrictSelect = function loadDistrictSelect(code,param,defValue) {82 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdistrict/districttree",code,param,defValue);83};848586/**87 * 加载行政区域(所有节点)88 * code:定义选择后的ID值89 * defValue 默认值90 */ 91SelectTree.loadDistrictAllSelect = function loadDistrictAllSelect(code,param,defValue) {92 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdistrict/districtalltree",code,param,defValue);93};9495/**96 * 加载行政区域(查询当前用户所在机构下的所属行政区域)97 * code:定义选择后的ID值98 * defValue 默认值99 */ 100SelectTree.loadSelfDistrictSelect = function loadSelfDistrictSelect(code,param,defValue) {101 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdistrict/districtTreeById",code,param,defValue);102};103104/**105 * 加载系统权限106 * code:定义选择后的ID值107 * defValue 默认值108 */ 109SelectTree.loadPrivIdSelect = function loadPrivIdSelect(code,param,defValue) {110 SelectTree.loadBaseSelect(BASE_URL+"/system/syspriv/privtree",code,param,defValue);111};112113/**114 * 加载国民经济行业分类(所属行业)115 * code:定义选择后的ID值116 * defValue 默认值117 */ 118SelectTree.loadEconindustrySelect = function loadEconindustrySelect(code,param,defValue) {119 SelectTree.loadBaseSelect(BASE_URL+"/system/syseconindustry/econindustrytree",code,param,defValue);120};121122/**123 * 加载经济类型 124 * code:定义选择后的ID值125 * defValue 默认值126 */ 127SelectTree.loadEconomictypeSelect = function loadEconomictypeSelect(code,param,defValue) {128 SelectTree.loadBaseSelect(BASE_URL+"/system/syseconomictype/economictypetree",code,param,defValue);129};130131132/**133 * 加载监管分类134 * code:定义选择后的ID值135 * defValue 默认值136 */ 137SelectTree.loadManagerTypeSelect = function loadManagerTypeSelect(code,param,defValue) {138 SelectTree.loadBaseSelect(BASE_URL+"/system/sysmanagertype/managertypetree",code,param,defValue);139};140141/**142 * 加载行业主管分类-隐藏叶子节点143 * code:定义选择后的ID值144 * defValue 默认值145 */ 146SelectTree.loadDirectorTypeSelect = function loadDirectorTypeSelect(code,param,defValue) {147 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdirectortype/directortypetree",code,param,defValue);148};149150/**151 * 加载行业主管分类-全部152 * code:定义选择后的ID值153 * defValue 默认值154 */ 155SelectTree.loadDirectorTypeAllSelect = function loadDirectorTypeAllSelect(code,param,defValue,fn) {156 SelectTree.loadBaseSelect(BASE_URL+"/system/sysdirectortype/directorTypeAllTree",code,param,defValue,fn);157};158159/**160 * 加载特种作业岗位树161 * code:定义选择后的ID值162 * defValue 默认值163 */ 164SelectTree.loadSpecialPositionSelect = function loadSpecialPositionSelect(code,param,defValue,fn) {165 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entoperator/specialpositiontree",code,param,defValue,fn);166};167168/**169 * 加载特种设备作业岗位树170 * code:定义选择后的ID值171 * defValue 默认值172 */ 173SelectTree.loadSpecialEquipPositionSelect = function loadSpecialEquipPositionSelect(code,param,defValue,fn) {174 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entequipoperator/specialequippositiontree",code,param,defValue,fn);175};176177/**178 * 加载危险设备类型树179 * code:定义选择后的ID值180 * defValue 默认值181 */ 182SelectTree.loadDangerEquipTypeSelect = function loadDangerEquipTypeSelect(code,param,defValue,fn) {183 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entdangerequip/dangerequiptypetree",code,param,defValue,fn);184};185186/**187 * 加载安全生产投入领域类型树188 * code:定义选择后的ID值189 * defValue 默认值190 */ 191SelectTree.loadInvestFieldSelect = function loadInvestFieldSelect(code,param,defValue,fn) {192 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entsafeinvestinfo/investfieldtree",code,param,defValue,fn);193};194195/**196 * 加载安全生产许可证照类型树197 * code:定义选择后的ID值198 * defValue 默认值199 */ 200SelectTree.loadPermitTypeSelect = function loadPermitTypeSelect(code,param,defValue,fn) {201 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entpermitphoto/permittypetree",code,param,defValue,fn);202};203204/**205 * 加载职业危害因素树206 * code:定义选择后的ID值207 * defValue 默认值208 */ 209SelectTree.loadHarmFactorSelect = function loadHarmFactorSelect(code,param,defValue,fn) {210 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entproharmctrl/harmfactortree",code,param,defValue,fn);211};212213/**214 * 加载危化品企业类型树(所有节点)215 * code:定义选择后的ID值216 * defValue 默认值217 */ 218SelectTree.loadChemicalEntTypeAllSelect = function loadChemicalEntTypeAllSelect(code,param,defValue) {219 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/entchemicaltype/chemicaltypeAllTree",code,param,defValue);220};221222223/**224 * 加载危险化工工艺目录225 * code:定义选择后的ID值226 * defValue 默认值227 */228SelectTree.loadDancatalogSelect = function loadDancatalogSelect(code,param,defValue) {229 SelectTree.loadBaseSelect(BASE_URL+"/enterprise/sysdancheprocatalog/dancatalogtree",code,param,defValue);230};231232/**233 * 加载危化品目录234 * code:定义选择后的ID值235 * defValue 默认值236 */237SelectTree.loadChecatalogSelect = function loadChecatalogSelect(code,param,defValue) {238 SelectTree.loadBaseSelect(BASE_URL+"/knowledge/knochemicalcatal/checatalogtree",code,param,defValue);239};240241/**242 * 加载排查项243 * code:定义选择后的ID值244 * defValue 默认值245 */246SelectTree.loadCheckitemSelect = function loadCheckitemSelect(code,param,defValue) {247 SelectTree.loadBaseSelect(BASE_URL+"/hiddendanger/hdicheckitem/checkitemtree",code,param,defValue);248};249250/**251 * 加载巡查人员252 * code:定义选择后的ID值253 * defValue 默认值254 */255SelectTree.loadPatrollerSelect = function loadPatrollerSelect(code,param,defValue) {256 SelectTree.loadBaseSelect(BASE_URL+"/hiddendanger/hdipatroller/patrolleTree",code,param,defValue);257};258259/**260 * 加载 重大危险源 监测监控 主机型号261 * code:定义选择后的ID值262 * defValue 默认值263 */264SelectTree.loadMacVideoBrandTypeSelect = function loadMacVideoBrandTypeSelect(code,param,defValue) {265 SelectTree.loadBaseSelect(BASE_URL+"/monitor/macvideobrandtype/loadMacVideoBrandTypeTree",code,param,defValue);266};267268/**269 * 加载 重大危险源 监测监控 监测主机型号270 * code:定义选择后的ID值271 * defValue 默认值272 */273SelectTree.loadMacProbeBrandTypeSelect = function loadMacProbeBrandTypeSelect(code,param,defValue) {274 SelectTree.loadBaseSelect(BASE_URL+"/monitor/macprobebrandtype/loadMacProbeBrandTypeTree",code,param,defValue);275};276277/**278 * 加载执法部门279 * code:定义选择后的ID值280 * defValue 默认值281 */ 282SelectTree.loadLawDeptSelect = function loadLawDeptSelect(code,param,defValue) {283 SelectTree.loadBaseSelect(BASE_URL+"/law/lawdept/lawdepttree",code,param,defValue);284};285286/**287 * 加载应急机构288 * code:定义选择后的ID值289 * defValue 默认值290 */ 291SelectTree.loadEmsResOrgSelect = function loadEmsResOrgSelect(code,param,defValue) {292 SelectTree.loadBaseSelect(BASE_URL+"/ems/emsresorg/emsresorgtree",code,param,defValue);293};294295/**296 * 预案模板元素(所有节点)297 * code:定义选择后的ID值298 * defValue 默认值299 */300SelectTree.loadPlanElementAllSelect = function loadPlanElementAllSelect(code,param,defValue){301 SelectTree.loadBaseSelect(BASE_URL+"/ems/emsplaelement/planelementtree",code,param,defValue);302};303304/**305 * 加载事故类型树(所有节点)306 * code:定义选择后的ID值307 * defValue 默认值308 */ 309SelectTree.loadEventTypeAllTreeSelect = function loadEventTypeAllTreeSelect(code,param,defValue) {310 SelectTree.loadBaseSelect(BASE_URL+"/ems/emsplaproacc/loadEventTypeAllTree",code,param,defValue);311};312313/**314 * 加载弹出树315 * loadurl:弹出树请求地址316 * code:定义选择后的ID值317 * defValue 默认值318 */319SelectTree.loadBaseSelect = function loadBaseSelect(loadurl,code,jsonParam,defValue,fn) {320 // 生成树的DIV321 $('#'+code).attr("readOnly","true");322 323 if(defValue!=null&&defValue!=""&&defValue!=undefined){324 $('#'+code).val(defValue);325 }326 327 //获取是否多选328 var isMuti=$('#'+code).attr("selectmulti");329 if(isMuti=='true'||isMuti==true){330 isMuti=true;331 }else{332 isMuti=false;333 }334 335 //获取父节点是否可点336 var rootclick =$('#'+code).attr('rootclick');337 if(rootclick=='true'||rootclick==true){338 rootclick=true;339 }else{340 rootclick=false;341 }342 343 //弹出框宽度344 var selectwidth =$('#'+code).attr('selectwidth');345 if(!selectwidth){346 selectwidth=174;347 }348 //弹出框高度349 var selectheight =$('#'+code).attr('selectheight');350 if(!selectheight){351 selectheight=200;352 }353 354 //获取附加属性355 var alias=$('#'+code).attr('alias');356 357 var hide_div='hide_div_tree'+code;358 var hide_tree='hide_tree_id'+code;359 360 var treeDIV = $('<div id='+hide_div+' class="dropdown-menu" style="display:none; position: absolute;z-index: 9000;"><ul id='+hide_tree+' class="ztree" style="margin-top:0; width:'+selectwidth+';height:'+selectheight+';overflow:auto"></ul></div>"');361 $(document.body).append(treeDIV);362363 var resultcode=code+"_select";364 var resultname=$('#'+code).attr("selectname");365 if(resultname==""||resultname==undefined){366 alert(code+"未定义selectname");367 return;368 }369370 var hideIdDIV = $('<input id="'371 + resultcode372 + '" name="'373 + resultname374 + '" type="text" readonly value="" style="width:120px; display: none"/>');375 $("#" + code).after(hideIdDIV);376 $("#" + code)377 .bind(378 "click",379 function() {380 var nameObj = $("#" + code);381 var nameObjOffset = $("#" + code).offset();382 $("#"+hide_div).css(383 {384 left : nameObjOffset.left + "px",385 top : nameObjOffset.top386 + nameObj.outerHeight() + "px"387 }).slideDown("fast");388 $("body")389 .bind(390 "mousedown",391 function(event) {392 if (!(event.target.id == "menuBtn"393 || event.target.id == hide_div || $(394 event.target).parents(395 "#"+hide_div).length > 0)) {396 $("#"+hide_div).fadeOut(397 "fast");398 $("body")399 .unbind(400 "mousedown",401 function(event) {402 SelectTree403 .onBodyDown(event,code);404 });405 }406 });407 });408 409 var setting = {410 check : {411 enable : isMuti412 },413 view : {414 dblClickExpand : false415 },416 data : {417 simpleData : {418 enable : true419 }420 },421 callback : {422 beforeClick : function(treeId, treeNode) {423 if(rootclick){424 return true;425 }else{426 if(treeNode && treeNode.isParent){427 return false;428 }else{429 return true;430 }431 }432 },433 onCheck : function() {434 var zTree = $.fn.zTree.getZTreeObj(hide_tree), nodes = zTree435 .getCheckedNodes(true), v = "";436 var eventId = "";437 nodes.sort(function compare(a, b) {438 return a.id - b.id;439 });440 for ( var i = 0, l = nodes.length; i < l; i++) {441 if (!nodes[i].isParent) {442 v += nodes[i][alias] + ",";443 eventId += nodes[i].id + ",";444 }445446 }447 if (v.length > 0)448 v = v.substring(0, v.length - 1);449 if (eventId.length > 0)450 eventId = eventId.substring(0, eventId.length - 1);451 $("#" + code).val(v);452 $('#'+code).attr("selectvalue",eventId);453 $('#' + resultcode).val(eventId);454455 },456 onClick : function(event, treeId, treeNode, clickFlag) {457 $("#" + code).val();458 $("#" + resultcode).val();459 if(alias){460 $("#" + code).val(treeNode[alias]);461 }else{462 $("#" + code).val(treeNode.name);463 }464 $("#" + resultcode).val(treeNode.id);465 $('#'+code).attr("selectvalue",treeNode.id);466 if(fn != undefined){467 fn(treeNode);468 }469 $('#'+code).focus();470 SelectTree.hideMenu(event,code);471 }472 }473 };474 475 $.ajax( {476 type : "post",477 url : loadurl,478 dataType : 'json',479 data:jsonParam,480 global : false,481 async : false,482 success : function(json) {483 var tree = $.fn.zTree.init($("#"+hide_tree), setting, json);484 tree.expandAll(true);485 var selnames="";486 var selIds = $('#' + code).attr('selectvalue');487 $("#" + resultcode).val(selIds);488 489 if(selIds==""||selIds==null||selIds=='null'){490 selnames=defValue;491 }else{492 if(isMuti){493 if (selIds != null && selIds != "" && tree.setting.check.enable) {494 var ids = selIds.split(",");495 if (ids.length > 0) {496 for ( var i = 0; i < ids.length; i++) {497 var id = ids[i];498 var node = tree.getNodeByParam("id", id, null);499 tree.checkNode(node, true, false);500 if(attr){501 selnames+=','+node[alias];502 }else{503 selnames+=','+node.name;504 }505 }506 }507 508 }509 }else{510 var node = tree.getNodeByParam("id", selIds, null);511 if(node != null){512 if(alias){513 selnames+=','+node[alias];514 }else{515 selnames+=','+node.name;516 }517 }else{518 selnames=",";519 }520 }521 selnames=selnames.substring(1);522 }523 $('#'+code).val(selnames);524 //返回函数525 if(fn != undefined){526 fn(selIds);527 }528 },529 error : function() {530531 }532 });533};534535//树节点对象536function Node(id, pId, name, open, icon,datatype,url, tablename, doccode) {537 this.id = id;538 this.pId = pId;539 this.name = name;540 this.open = open;541 this.icon = icon;542 this.datatype=datatype;543 this.url = url; 544 this.tablename = tablename;545 this.doccode = doccode;546}547548SelectTree.hideMenu = function hideMenu(event,code) {549 $("#hide_div_tree"+code).fadeOut("fast");550 $("body").unbind("mousedown", SelectTree.onBodyDown(event,code));551};552SelectTree.onBodyDown = function onBodyDown(event,code) {553 if (!(event.target.id == "menuBtn" || event.target.id == "hide_div_tree"+code || $(554 event.target).parents("#hide_div_tree"+code).length > 0)) {555 SelectTree.hideMenu(event,code);556 } ...

Full Screen

Full Screen

get-column-detials.js

Source:get-column-detials.js Github

copy

Full Screen

1const realTypeOf = require('realtypeof');2const getColumnDetails = defValue => {3 switch (realTypeOf(defValue)) {4 case 'string':5 return {6 $column: defValue,7 };8 case 'array':9 return {10 $column: defValue,11 $type: 'array',12 };13 case 'object':14 if ('$column' in defValue) {15 defValue.$type = defValue.$type ? defValue.$type.toLowerCase() : undefined;16 return defValue;17 }18 return {19 $column: defValue,20 $type: 'object',21 };22 default:23 throw Error(`The definition object has a non-standard value: ${defValue}`);24 }25};...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { defValue } from 'ng-mocks';2import { MockBuilder, MockRender } from 'ng-mocks';3import ngMocks from 'ng-mocks';4import { MockInstance } from 'ng-mocks';5import { MockRender } from 'ng-mocks';6import { MockReset } from 'ng-mocks';7import { MockService } from 'ng-mocks';8import { MockRender } from 'ng-mocks';9import { MockRender } from 'ng-mocks';10import { MockRender } from 'ng-mocks';11import { MockRender } from 'ng-mocks';12import { MockRender } from 'ng-mocks';13import { MockRender } from 'ng-mocks';14import { MockRender } from 'ng-mocks';15import { MockRender } from 'ng-mocks';16import { MockRender } from 'ng-mocks';17import { MockRender } from 'ng-mocks';18import { MockRender } from 'ng-mocks';19import { MockRender } from 'ng-mocks';20import { MockRender } from 'ng-mocks';21import { MockRender } from 'ng-mocks';22import { MockRender } from 'ng-mocks';23import { MockRender } from 'ng-mocks';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { defValue } from 'ng-mocks';2import { MyService } from './myservice';3describe('test', () => {4 it('test', () => {5 defValue(MyService, 'myMethod', 'Hello');6 const myService = new MyService();7 expect(myService.myMethod()).toEqual('Hello');8 });9});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { defValue } from 'ng-mocks';2describe('ng-mocks', () => {3 it('should be able to use defValue', () => {4 const mock = defValue({ a: 1 });5 expect(mock.a).toEqual(1);6 });7});8✓ ng-mocks: it should be able to use defValue (3ms)9import { defValue } from 'ng-mocks';10describe('ng-mocks', () => {11 it('should be able to use defValue', () => {12 const mock = defValue({ a: 1 });13 expect(mock.a).toEqual(1);14 });15});16✓ ng-mocks: it should be able to use defValue (3ms)

Full Screen

Using AI Code Generation

copy

Full Screen

1import { defValue } from 'ng-mocks';2describe('MyComponent', () => {3 it('should be ok', () => {4 const fixture = MockRender(MyComponent);5 const component = defValue(fixture.debugElement.componentInstance);6 expect(component).toBeDefined();7 });8});9@Component({10})11export class MyComponent {12 public myMethod(): void {13 console.log('Hello world');14 }15}16describe('MyComponent', () => {17 it('should be ok', () => {18 const component = new MyComponent();19 expect(component).toBeDefined();20 });21});22describe('MyComponent', () => {23 it('should be ok', () => {24 const component = MockInstance(MyComponent);25 expect(component).toBeDefined();26 });27});28describe('MyComponent', () => {29 it('should be ok', () => {30 const component = MockProvider(MyComponent);31 expect(component).toBeDefined();32 });33});34describe('MyComponent', () => {35 it('should be ok', () => {36 const component = MockService(MyComponent);37 expect(component).toBeDefined();38 });39});40describe('MyComponent', () => {41 it('should be ok', () => {42 const component = MockType(MyComponent);43 expect(component).toBeDefined();44 });45});46describe('MyComponent', () => {47 it('should be ok', () => {48 const component = MockDirective(MyComponent);49 expect(component).toBeDefined();50 });51});52describe('MyComponent', () => {53 it('should be ok', () => {54 const component = MockPipe(MyComponent);55 expect(component).toBeDefined();56 });57});58describe('MyComponent', () => {59 it('should be ok', () => {60 const component = MockRender(MyComponent);61 expect(component).toBeDefined();62 });63});64describe('MyComponent', () => {65 it('should be ok', () => {66 const component = MockRender(MyComponent, { detectChanges: false });67 expect(component

Full Screen

Using AI Code Generation

copy

Full Screen

1var mock = ngMocks.defaultMock($http, 'get', 'test');2expect(mock).toBeDefined();3expect(mock).not.toBeNull();4var mock = jasmine.createSpyObj('$http', ['get']);5expect(mock).toBeDefined();6expect(mock).not.toBeNull();7var mock = sinon.mock($http);8expect(mock).toBeDefined();9expect(mock).not.toBeNull();

Full Screen

Using AI Code Generation

copy

Full Screen

1import { defValue } from 'ng-mocks';2const mockService = {3 get: () => {4 return 'Mocked Data';5 }6};7defValue(mockService, MockService);8import 'ng-mocks';9import { M

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful